Project Fix
Purpose
Diagnose and fix bugs through scoped context, evidence, reproduction, implementation, verification, and bug knowledge sync.
This skill owns the bug stage of Project Develop Copilot. It does not own top-level routing, final completion claims, or broad review.
When to Use
Use when the user reports or wants to fix:
- bug, error, exception, failed test, regression, incident, runtime symptom, unexpected behavior, or log evidence
- suspected bug in a scoped module or service
- bug work that may need systematic debugging, TDD, or verification bridges
When Not to Use
- Do not use for feature requests without a bug symptom; use
project-develop.
- Do not use for lightweight explanation of a log unless the user does not want lifecycle state.
- Do not use for final sync after a fix is complete; use
project-finish.
- Do not use for merge-readiness review; use
project-review.
Owned Gates
- Context Recovery Gate
- Lifecycle Anchor Gate
- Work Definition Gate
- Scope Lock Gate
- External Bridge Gate
- Verification Gate before fix completion claims
Initialization Gate
Run after resolving the project root and before any lifecycle or source work in this child.
wiki_required: true
on_missing_wiki: route project-init
direct_invocation_missing_wiki: dispatch-project-init
- When directly invoked and no parent router is active, treat the bootstrap handoff as an internal routing message, not a terminal user-facing response.
- Unless an explicit no-write constraint or root-confidence check requires confirmation, continue through
project-init in the same turn, consume its return handoff, and resume only at a supported next gate.
pending_primary_stage: project-fix
- Preserve the user's original request as
pending_intent.
- If
<project_root>/.llm-wiki/ is absent, stop and return a Context Handoff to project-init; resume only after the router receives initialization readiness and a supported next gate.
- Do not create a partial
.llm-wiki/, Bug Brief, working-context, test, or code change inside this child as a substitute for initialization.
On the missing-wiki branch, emit this minimal handoff:
bootstrap_handoff:
project_root: <resolved project root>
pending_intent: <preserved user request>
pending_primary_stage: project-fix
requested_stage_or_bridge: project-init
bootstrap_mode: automatic-minimal
current_gate: Initialization Gate
Required First Check
- Resolve project root.
- Run the Initialization Gate before resolving child references or creating lifecycle state.
- Resolve optional shared references from
../references/ or local references/. If bug-brief.md, flow-record.md, or scoped-working-context.md is missing, continue in degraded mode using the minimum rules in this skill; report the missing deep references and keep bug evidence, scope, and Flow Record updates conservative.
- Create or resume Bug Brief.
- Capture or ingest external bug source.
- Identify active, read-only, candidate, and excluded scopes.
- If the bug involves external calls, upstream/downstream services, Feign, MQTT, HTTP, RPC, shared DB, or shared config, check Project Graph pins/edges/candidates and perform the cross-project boundary check before relying on external contract behavior.
- Run Work Definition Gate before broad diagnosis or edits.
Core Process
Read as needed:
../references/north-star.md
../references/lifecycle-gates.md
../references/bug-brief.md
../references/project-graph.md
../references/cross-project-refs.md
../references/base-graph.md
../references/flow-record.md
../references/session-digest.md
../references/scoped-working-context.md
../references/tool-bridge.md
../references/superpowers-bridge.md
../references/templates.md
Reference availability policy:
- Shared references are deep references, not startup requirements.
- Do not stop solely because
../references/ is missing.
- In degraded mode, require a minimal Bug Brief before edits: symptom, expected behavior, evidence, reproduction status, likely scope, fix plan, verification plan, and
bug_id or flow_id.
- Do not mark diagnosis, fix, or verification complete unless evidence exists.
Anti-Corruption Debugging Rule
Historical bug notes, dead-end records, session digests, and wiki findings are useful clues, but stale or provisional notes cannot close root-cause analysis. Treat freshness-expired, stale-source-anchor, coarse-stale-source-anchor, missing-verified-commit, unreachable-verified-commit, unverifiable-anchor, dirty_at_capture, and needs_commit_resolution as clue-only signals.
Confirm the suspected cause against current logs, source code, tests, configuration, or runtime evidence before using it as the reason for a fix. If current evidence contradicts the wiki, prefer current evidence and mark the wiki item for re-verification.
Workflow:
- Resolve project root and Bug Brief.
- Capture source, symptom, expected behavior, evidence, and likely scope.
- Search
.llm-wiki/session-digests/ entries for related recall context such as symptoms, failed attempts, suspected root causes, reproduction notes, and verification history. Use them as bug evidence only when selected digest items were explicitly promoted or reconfirmed.
- Mark stale or conflict digest items before relying on them.
- Create or update the Bug Brief Flow Record with source evidence.
- Run Context Recovery Gate.
- If the bug crosses service/project boundaries, check Project Graph evidence in order:
.llm-wiki/cross-refs/index.md pin -> .llm-wiki/project-graph/edges.md -> .llm-wiki/project-graph/candidates.md.
- If a pin matches, follow
edge_id; do not treat pin fields as contract facts.
- If only a candidate matches, it is a clue only; perform source verification before using it for a fix decision.
- If no edge or candidate exists, suggest manual registration via
project-maintain graph-register only after the fix evidence is clear enough.
- If a registry mapping is missing, ask for the local path. With Base Graph available, write Base Graph
.llm-wiki/registry.local.json after confirmation; without Base, write only current project .llm-wiki/registry.local.json.
- Before reading remote wiki or source, output a cross-project boundary check with
scope: read-only.
- If the fix decision depends on the remote contract, use
verification_required: source.
- Use an external edge for fix decisions only when it is
source-verified, not stale, and directly relevant to the bug. If it is stale, wiki-checked, draft, blocked, or candidate-only, re-verify source or treat it as risk.
- Do not base edits on
wiki-checked, draft, stale, blocked, or candidate-only evidence.
- Record remote evidence in the Bug Brief
## External Findings section with project_id, edge_id, evidence, verification status, conclusion, impact, and suggested handoff.
- Do not write external project files or Base tracked files from a business-project bug session.
- Reproduce the issue or state why reproduction is not currently possible.
- Bridge to systematic-debugging only after evidence and scoped context are captured.
- Diagnose likely cause before changing code and update the Flow Record
design step when diagnosis evidence exists.
- Use test-driven-development for regression coverage when feasible.
- Record or confirm the fix plan and update the Flow Record
plan step before edits.
- Run Scope Lock Gate before edits.
- If the fix needs candidate or excluded scope, run scope escalation before editing.
- Fix only active scopes unless escalation is justified.
- Verify the fix or record limitation.
- Update Bug Brief, Flow Record, and working-context after verification.
- Return diagnosis, verification, Flow Record updates, external findings, residual risk, and next gate.
Mode / Entry Selection
| Mode |
Use when |
evidence-intake |
symptom or log exists but scope/reproduction is unclear |
reproduction |
issue needs a command, test, or manual steps |
diagnosis |
evidence exists and likely cause must be found |
fix |
scope is locked and user asked to fix |
verification |
fix exists and result must be checked |
Inputs
- Bug Brief or bug id
- log, error, failed test, incident report, or user description
- project root
- active and candidate scopes
- Session Digests when they contain related recall context; use as bug evidence only after explicit promotion or current confirmation
- recent changes or git diff when relevant
Outputs
Final report:
Diagnosis:
Fix:
Files changed:
Scope escalation:
External findings:
Regression coverage:
Verification:
Bug Brief updates:
Flow Record updates:
Artifacts:
Residual risk:
Next action:
Context Handoff
Before systematic-debugging, TDD, or other external bridges, provide:
## Context Handoff
- lifecycle_session:
- user_intent:
- active_sources:
- active_scope:
- read_only_scope:
- candidate_scope:
- excluded_scope:
- current_gate:
- requested_stage_or_bridge:
- constraints:
Return Handoff
After debugging, fixing, or verification, return:
## Return Handoff
- stage_or_bridge_used: project-fix
- result_summary:
- changed_assumptions:
- recommended_scope_changes:
- artifacts:
- verification_notes:
- external_findings:
- lifecycle_updates_needed:
- next_gate:
Boundaries
- Do not patch randomly before diagnosis.
- Do not expand write scope without evidence or user confirmation.
- Do not let systematic-debugging own project scope.
- Do not claim fixed without verification or explicit limitation.
- Do not copy sensitive raw logs into
.llm-wiki.
- Do not edit remote project wiki, source, config, or registry during cross-project evidence gathering. Generate a context handoff if remote project changes are needed.
Common Mistakes
- Jumping straight into external debugging without Bug Brief.
- Editing candidate scope before escalation.
- Treating reproduction-blocked as reproduced.
- Forgetting residual risk when verification cannot run.
- Updating dashboard as fixed before verification evidence exists.
- Making fix decisions from
wiki-checked external evidence when the remote contract needs source verification.
1---2name: project-fix3description: Use when diagnosing or fixing a project bug, error, failed test, regression, incident, log symptom, or unexpected behavior with scoped project context and LLM Wiki bug summaries.4---56# Project Fix78## Purpose910Diagnose and fix bugs through scoped context, evidence, reproduction, implementation, verification, and bug knowledge sync.1112This skill owns the bug stage of Project Develop Copilot. It does not own top-level routing, final completion claims, or broad review.1314## When to Use1516Use when the user reports or wants to fix:1718- bug, error, exception, failed test, regression, incident, runtime symptom, unexpected behavior, or log evidence19- suspected bug in a scoped module or service20- bug work that may need systematic debugging, TDD, or verification bridges2122## When Not to Use2324- Do not use for feature requests without a bug symptom; use `project-develop`.25- Do not use for lightweight explanation of a log unless the user does not want lifecycle state.26- Do not use for final sync after a fix is complete; use `project-finish`.27- Do not use for merge-readiness review; use `project-review`.2829## Owned Gates3031- Context Recovery Gate32- Lifecycle Anchor Gate33- Work Definition Gate34- Scope Lock Gate35- External Bridge Gate36- Verification Gate before fix completion claims3738## Initialization Gate3940Run after resolving the project root and before any lifecycle or source work in this child.4142- `wiki_required: true`43- `on_missing_wiki: route project-init`44- `direct_invocation_missing_wiki: dispatch-project-init`45- When directly invoked and no parent router is active, treat the bootstrap handoff as an internal routing message, not a terminal user-facing response.46- Unless an explicit no-write constraint or root-confidence check requires confirmation, continue through `project-init` in the same turn, consume its return handoff, and resume only at a supported next gate.47- `pending_primary_stage: project-fix`48- Preserve the user's original request as `pending_intent`.49- If `<project_root>/.llm-wiki/` is absent, stop and return a Context Handoff to `project-init`; resume only after the router receives initialization readiness and a supported next gate.50- Do not create a partial `.llm-wiki/`, Bug Brief, working-context, test, or code change inside this child as a substitute for initialization.5152On the missing-wiki branch, emit this minimal handoff:5354```text55bootstrap_handoff:56 project_root: <resolved project root>57 pending_intent: <preserved user request>58 pending_primary_stage: project-fix59 requested_stage_or_bridge: project-init60 bootstrap_mode: automatic-minimal61 current_gate: Initialization Gate62```6364## Required First Check65661. Resolve project root.672. Run the Initialization Gate before resolving child references or creating lifecycle state.683. Resolve optional shared references from `../references/` or local `references/`. If `bug-brief.md`, `flow-record.md`, or `scoped-working-context.md` is missing, continue in degraded mode using the minimum rules in this skill; report the missing deep references and keep bug evidence, scope, and Flow Record updates conservative.694. Create or resume Bug Brief.705. Capture or ingest external bug source.716. Identify active, read-only, candidate, and excluded scopes.727. If the bug involves external calls, upstream/downstream services, Feign, MQTT, HTTP, RPC, shared DB, or shared config, check Project Graph pins/edges/candidates and perform the cross-project boundary check before relying on external contract behavior.738. Run Work Definition Gate before broad diagnosis or edits.7475## Core Process7677Read as needed:7879- `../references/north-star.md`80- `../references/lifecycle-gates.md`81- `../references/bug-brief.md`82- `../references/project-graph.md`83- `../references/cross-project-refs.md`84- `../references/base-graph.md`85- `../references/flow-record.md`86- `../references/session-digest.md`87- `../references/scoped-working-context.md`88- `../references/tool-bridge.md`89- `../references/superpowers-bridge.md`90- `../references/templates.md`9192Reference availability policy:9394- Shared references are deep references, not startup requirements.95- Do not stop solely because `../references/` is missing.96- In degraded mode, require a minimal Bug Brief before edits: symptom, expected behavior, evidence, reproduction status, likely scope, fix plan, verification plan, and `bug_id` or `flow_id`.97- Do not mark diagnosis, fix, or verification complete unless evidence exists.9899## Anti-Corruption Debugging Rule100101Historical bug notes, dead-end records, session digests, and wiki findings are useful clues, but stale or provisional notes cannot close root-cause analysis. Treat `freshness-expired`, `stale-source-anchor`, `coarse-stale-source-anchor`, `missing-verified-commit`, `unreachable-verified-commit`, `unverifiable-anchor`, `dirty_at_capture`, and `needs_commit_resolution` as clue-only signals.102103Confirm the suspected cause against current logs, source code, tests, configuration, or runtime evidence before using it as the reason for a fix. If current evidence contradicts the wiki, prefer current evidence and mark the wiki item for re-verification.104105Workflow:1061071. Resolve project root and Bug Brief.1082. Capture source, symptom, expected behavior, evidence, and likely scope.1093. Search `.llm-wiki/session-digests/` entries for related recall context such as symptoms, failed attempts, suspected root causes, reproduction notes, and verification history. Use them as bug evidence only when selected digest items were explicitly promoted or reconfirmed.1104. Mark stale or conflict digest items before relying on them.1115. Create or update the Bug Brief Flow Record with source evidence.1126. Run Context Recovery Gate.1137. If the bug crosses service/project boundaries, check Project Graph evidence in order: `.llm-wiki/cross-refs/index.md` pin -> `.llm-wiki/project-graph/edges.md` -> `.llm-wiki/project-graph/candidates.md`.114 - If a pin matches, follow `edge_id`; do not treat pin fields as contract facts.115 - If only a candidate matches, it is a clue only; perform source verification before using it for a fix decision.116 - If no edge or candidate exists, suggest manual registration via `project-maintain graph-register` only after the fix evidence is clear enough.117 - If a registry mapping is missing, ask for the local path. With Base Graph available, write Base Graph `.llm-wiki/registry.local.json` after confirmation; without Base, write only current project `.llm-wiki/registry.local.json`.118 - Before reading remote wiki or source, output a cross-project boundary check with `scope: read-only`.119 - If the fix decision depends on the remote contract, use `verification_required: source`.120 - Use an external edge for fix decisions only when it is `source-verified`, not stale, and directly relevant to the bug. If it is stale, `wiki-checked`, `draft`, `blocked`, or candidate-only, re-verify source or treat it as risk.121 - Do not base edits on `wiki-checked`, `draft`, stale, blocked, or candidate-only evidence.122 - Record remote evidence in the Bug Brief `## External Findings` section with `project_id`, `edge_id`, evidence, verification status, conclusion, impact, and suggested handoff.123 - Do not write external project files or Base tracked files from a business-project bug session.1248. Reproduce the issue or state why reproduction is not currently possible.1259. Bridge to systematic-debugging only after evidence and scoped context are captured.12610. Diagnose likely cause before changing code and update the Flow Record `design` step when diagnosis evidence exists.12711. Use test-driven-development for regression coverage when feasible.12812. Record or confirm the fix plan and update the Flow Record `plan` step before edits.12913. Run Scope Lock Gate before edits.13014. If the fix needs candidate or excluded scope, run scope escalation before editing.13115. Fix only active scopes unless escalation is justified.13216. Verify the fix or record limitation.13317. Update Bug Brief, Flow Record, and working-context after verification.13418. Return diagnosis, verification, Flow Record updates, external findings, residual risk, and next gate.135136## Mode / Entry Selection137138| Mode | Use when |139|---|---|140| `evidence-intake` | symptom or log exists but scope/reproduction is unclear |141| `reproduction` | issue needs a command, test, or manual steps |142| `diagnosis` | evidence exists and likely cause must be found |143| `fix` | scope is locked and user asked to fix |144| `verification` | fix exists and result must be checked |145146## Inputs147148- Bug Brief or bug id149- log, error, failed test, incident report, or user description150- project root151- active and candidate scopes152- Session Digests when they contain related recall context; use as bug evidence only after explicit promotion or current confirmation153- recent changes or git diff when relevant154155## Outputs156157Final report:158159```text160Diagnosis:161Fix:162Files changed:163Scope escalation:164External findings:165Regression coverage:166Verification:167Bug Brief updates:168Flow Record updates:169Artifacts:170Residual risk:171Next action:172```173174## Context Handoff175176Before systematic-debugging, TDD, or other external bridges, provide:177178```markdown179## Context Handoff180181- lifecycle_session:182- user_intent:183- active_sources:184- active_scope:185- read_only_scope:186- candidate_scope:187- excluded_scope:188- current_gate:189- requested_stage_or_bridge:190- constraints:191```192193## Return Handoff194195After debugging, fixing, or verification, return:196197```markdown198## Return Handoff199200- stage_or_bridge_used: project-fix201- result_summary:202- changed_assumptions:203- recommended_scope_changes:204- artifacts:205- verification_notes:206- external_findings:207- lifecycle_updates_needed:208- next_gate:209```210211## Boundaries212213- Do not patch randomly before diagnosis.214- Do not expand write scope without evidence or user confirmation.215- Do not let systematic-debugging own project scope.216- Do not claim fixed without verification or explicit limitation.217- Do not copy sensitive raw logs into `.llm-wiki`.218- Do not edit remote project wiki, source, config, or registry during cross-project evidence gathering. Generate a context handoff if remote project changes are needed.219220## Common Mistakes221222- Jumping straight into external debugging without Bug Brief.223- Editing candidate scope before escalation.224- Treating reproduction-blocked as reproduced.225- Forgetting residual risk when verification cannot run.226- Updating dashboard as fixed before verification evidence exists.227- Making fix decisions from `wiki-checked` external evidence when the remote contract needs source verification.