| name | execute-automated-fix |
| description | Fixes one issue from the iteration issues list by reproducing, diagnosing, and resolving it. Invoked by: bun nvst fix issue. |
| user-invocable | false |
Automated Fix
Attempt to resolve the provided issue safely and deterministically by following a structured debugging workflow.
Reasoning Protocol
Use Chain of Draft (CoD) for all internal reasoning. Before diagnosing, planning, or implementing any fix, think step by step in short drafts — each step ≤ ~5 words.
- Scope: Internal reasoning only — diagnosis, root-cause analysis, fix planning, verification steps.
- Step length: Each draft step must be ≤ ~5 words (e.g. "reproduce: missing null check", "root cause: state not reset", "fix: add guard clause", "verify: re-run failing test").
- Purpose: Reduce token use and latency while maintaining accuracy in root-cause identification and fix planning.
- Guarantee: Fix implementation, checklist output, and any user-facing communication remain complete and unabbreviated.
Inputs
| Source | Used for |
|---|
issue (context variable) | The issue to fix, including id, title, description, and reproduction steps |
project_context (context variable) | Project conventions, tech stack, code standards, testing strategy, and architecture |
iteration (context variable) | Current iteration number for file naming and context |
The Job
Follow this debugging workflow in order:
- Understand the issue — read the description and any reproduction steps carefully.
- Reproduce the issue — confirm it is observable before making any changes.
- Form hypotheses — identify possible root causes based on the observed behaviour.
- Identify affected code — locate the files and functions involved.
- Add instrumentation if needed — add temporary logging or assertions to narrow down the cause.
- Collect logs — run the code and capture output if instrumentation was added.
- Confirm or discard hypotheses — use evidence to settle on the root cause.
- Fix the issue — apply the minimal change that resolves the root cause.
- Verify the fix — attempt to reproduce the original issue and confirm it no longer occurs.
- Remove instrumentation — clean up any temporary logging or assertions added in step 5.
Rules
- Minimal scope. Keep changes scoped to the provided issue — do not refactor unrelated code.
- Add or update tests. Write or update tests to cover the fix when appropriate.
- Do not commit. The calling command handles git commits.
- Stop on uncertainty. If no hypothesis can be confirmed after reasonable effort, stop and report failure rather than guessing.
- Follow conventions exactly. Use the naming, formatting, error handling, and module organisation patterns from the project context.
Output
The output is the set of file changes (modified or new files) in the working tree. There is no document to produce — the corrected code and any updated tests are the deliverable.
Checklist
Before finishing: