/implement-fix
Minimal pipeline for test-fixing tasks
$ npx -y skills add akaszubski/autonomous-dev --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/implement-fix
Context preview
What this command does when you run it.
Minimal pipeline for test-fixing tasks
Command definition
implement-fix.mdname: implement-fix
description: Minimal pipeline for test-fixing tasks
version: 1.0.0
user-invocable: false
user_facing: false
allowed-tools: [Agent, Read, Write, Edit, Bash, Grep, Glob, WebSearch, WebFetch]
FIX MODE
> The key words "MUST", "MUST NOT", "SHOULD", and "MAY" in this document are to be interpreted as described in [RFC 2119](https://www.rfc-editor.org/rfc/rfc2119).
Minimal pipeline (5 steps, 4 agents minimum) for test-fixing tasks. Invoked via `/implement --fix "description"`. Skips research and planning since the problem is already known (failing tests).
Coordinator Role — HARD GATE
The coordinator is a **dispatcher**, not a substitute for specialist agents. These constraints apply globally — before any step definitions — and MUST NOT be violated regardless of circumstances.
Agent Management
The coordinator dispatches work to specialists; it MUST NOT do the work itself.
**FORBIDDEN — You MUST NOT do any of the following**:
- ❌ You MUST NOT write, edit, or modify any project files directly — ALL file modifications MUST go through specialist agents (implementer, doc-master)
- ❌ You MUST NOT do an agent's work when the agent crashes — RETRY once, then BLOCK with a clear error message; never substitute coordinator judgment for agent execution
- ❌ You MUST NOT skip any STEP in the pipeline
- ❌ You MUST NOT summarize agent output instead of passing full results to the next agent — verbatim output is required
Pipeline Integrity
Step ordering and post-completion behavior are strictly constrained.
**FORBIDDEN — You MUST NOT do any of the following**:
- ❌ You MUST NOT parallelize agents from different pipeline phases (e.g., running F3 and F4 concurrently)
- ❌ You MUST NOT clean up pipeline state before STEP F5 launches
- ❌ You MUST NOT perform any file edits after agents complete — the coordinator's only permitted post-agent actions are: outputting the final summary, git operations (add, commit, push), and launching STEP F5
- ❌ You MUST NOT skip STEP F4.7 when the changeset matches the activation trigger (SQL, ORM models, execution/order/trade/payment paths) — even if the unit tests pass green. The 4-fix chain #1285 → #1288 happened with all-green unit tests. (#1210)
Output Fidelity
The coordinator MUST transmit agent outputs intact.
**FORBIDDEN — You MUST NOT do any of the following**:
- ❌ You MUST NOT paraphrase or condense agent output when passing to the next stage
- ❌ You MUST NOT pass fewer than 50% of the implementer output words to the reviewer — if context is a constraint, include the implementer's file change list and test results in full before trimming any prose sections
Fix Mode Progress Protocol
Output structured progress at each step. Same format conventions as the full pipeline protocol.
**Step Banner**: `STEP FN/5 — Step Name` with agent info where applicable. **Timing**: Capture `FIX_START=$(date +%s)` at pipeline start. Capture per-step timing. **Gate Results**: `GATE: name — PASS/BLOCKED` **Final Summary** (after STEP F6 persists the CIA report, before STEP F6.5 cleanup):
========================================
FIX COMPLETE
========================================
Step Description Agent(s) Time Status
---- ------------------ --------------------------------- ------ ------
F1 Alignment — 2s PASS
F1.5 Pre-staged check — 1s PASS
F2 Test context — 5s done
F3 Implementation implementer (Opus) 2:30 done
F3 Test gate — 8s PASS
F4 Review + docs reviewer, doc-master 45s done
F5 CI analysis continuous-improvement-analyst 30s done
F6 Persist CIA report — (coordinator Write, #1209) 1s done
========================================
Total: 4:02 | Tests: N passed, M failed | Files changed: N | CIA: .claude/local/cia-DATE-issue-NNNN-fix.md
========================================
Implementation
Steps F1-F2: Alignment and Test Context
STEP F1: Validate PROJECT.md Alignment
**Progress**: Output step banner (STEP F1/5 — Alignment). Capture FIX_START. Output gate result.
Read `.claude/PROJECT.md`. If missing: BLOCK ("Run `/setup` or `/align --retrofit`"). Verify the fix is within project scope. If misaligned: BLOCK with reason.
This is the same alignment gate as the full pipeline STEP 1.
Prompt Baseline Reset (Defensive — Issue #1088 F3)
Before initializing pipeline state, clear any stale `prompt_baselines.json` from a prior session. /fix mode by design dispatches shorter, focused prompts; stale baselines from prior runs frequently exceed the 20% shrinkage threshold against fresh fix-mode prompts and produce false-positive integrity blocks.
import sys, os
for _p in ('.claude/lib', 'plugins/autonomous-dev/lib', os.path.expanduser('~/.claude/lib')):
if os.path.isdir(_p):
sys.path.insert(0, _p)
break
from prompt_integrity import clear_prompt_baselines
clear_prompt_baselines()
print('Prompt baselines cleared for fix mode')Note: This step becomes unnecessary once #1082 Phase 1a (per-issue baseline split) lands. Until then, /fix mode SHOULD clear baselines defensively at pipeline start.
Pipeline State Initialization
After alignment validation passes, initialize the pipeline state file so that hook enforcement (prompt integrity, pipeline ordering) is active during fix mode:
python3 -c "
import json, os, time
state = {'mode': 'fix', 'explicitly_invoked': True, 'start_time': int(time.time())}
with open(os.environ.get('PIPELINE_STATE_FILE', '/tmp/implement_pipeline_state.json'), 'w') as f:
json.dump(state, f)
print('Pipeline state initialized for fix mode')
"This ensures prompt integrity enforcement (Layer 5) can detect an active pipeline an
Read more
name: implement-fix description: Minimal pipeline for test-fixing tasks version: 1.0.0 user-invocable: false user_facing: false allowed-tools: [Agent, Read, Write, Edit, Bash, Grep, Glob, WebSearch, WebFetch]
FIX MODE
> The key words "MUST", "MUST NOT", "SHOULD", and "MAY" in this document are to be interpreted as described in [RFC 2119](https://www.rfc-editor.org/rfc/rfc2119).
Minimal pipeline (5 steps, 4 agents minimum) for test-fixing tasks. Invoked via `/implement --fix "description"`. Skips research and planning since the problem is already known (failing tests).
Coordinator Role — HARD GATE
The coordinator is a **dispatcher**, not a substitute for specialist agents. These constraints apply globally — before any step definitions — and MUST NOT be violated regardless of circumstances.
Agent Management
The coordinator dispatches work to specialists; it MUST NOT do the work itself.
**FORBIDDEN — You MUST NOT do any of the following**:
- ❌ You MUST NOT write, edit, or modify any project files directly — ALL file modifications MUST go through specialist agents (implementer, doc-master)
- ❌ You MUST NOT do an agent's work when the agent crashes — RETRY once, then BLOCK with a clear error message; never substitute coordinator judgment for agent execution
- ❌ You MUST NOT skip any STEP in the pipeline
- ❌ You MUST NOT summarize agent output instead of passing full results to the next agent — verbatim output is required
Pipeline Integrity
Step ordering and post-completion behavior are strictly constrained.
**FORBIDDEN — You MUST NOT do any of the following**:
- ❌ You MUST NOT parallelize agents from different pipeline phases (e.g., running F3 and F4 concurrently)
- ❌ You MUST NOT clean up pipeline state before STEP F5 launches
- ❌ You MUST NOT perform any file edits after agents complete — the coordinator's only permitted post-agent actions are: outputting the final summary, git operations (add, commit, push), and launching STEP F5
- ❌ You MUST NOT skip STEP F4.7 when the changeset matches the activation trigger (SQL, ORM models, execution/order/trade/payment paths) — even if the unit tests pass green. The 4-fix chain #1285 → #1288 happened with all-green unit tests. (#1210)
Output Fidelity
The coordinator MUST transmit agent outputs intact.
**FORBIDDEN — You MUST NOT do any of the following**:
- ❌ You MUST NOT paraphrase or condense agent output when passing to the next stage
- ❌ You MUST NOT pass fewer than 50% of the implementer output words to the reviewer — if context is a constraint, include the implementer's file change list and test results in full before trimming any prose sections
Fix Mode Progress Protocol
Output structured progress at each step. Same format conventions as the full pipeline protocol.
**Step Banner**: `STEP FN/5 — Step Name` with agent info where applicable. **Timing**: Capture `FIX_START=$(date +%s)` at pipeline start. Capture per-step timing. **Gate Results**: `GATE: name — PASS/BLOCKED` **Final Summary** (after STEP F6 persists the CIA report, before STEP F6.5 cleanup):
======================================== FIX COMPLETE ======================================== Step Description Agent(s) Time Status ---- ------------------ --------------------------------- ------ ------ F1 Alignment — 2s PASS F1.5 Pre-staged check — 1s PASS F2 Test context — 5s done F3 Implementation implementer (Opus) 2:30 done F3 Test gate — 8s PASS F4 Review + docs reviewer, doc-master 45s done F5 CI analysis continuous-improvement-analyst 30s done F6 Persist CIA report — (coordinator Write, #1209) 1s done ======================================== Total: 4:02 | Tests: N passed, M failed | Files changed: N | CIA: .claude/local/cia-DATE-issue-NNNN-fix.md ========================================
Implementation
Steps F1-F2: Alignment and Test Context
STEP F1: Validate PROJECT.md Alignment
**Progress**: Output step banner (STEP F1/5 — Alignment). Capture FIX_START. Output gate result.
Read `.claude/PROJECT.md`. If missing: BLOCK ("Run `/setup` or `/align --retrofit`"). Verify the fix is within project scope. If misaligned: BLOCK with reason.
This is the same alignment gate as the full pipeline STEP 1.
Prompt Baseline Reset (Defensive — Issue #1088 F3)
Before initializing pipeline state, clear any stale `prompt_baselines.json` from a prior session. /fix mode by design dispatches shorter, focused prompts; stale baselines from prior runs frequently exceed the 20% shrinkage threshold against fresh fix-mode prompts and produce false-positive integrity blocks.
import sys, os
for _p in ('.claude/lib', 'plugins/autonomous-dev/lib', os.path.expanduser('~/.claude/lib')):
if os.path.isdir(_p):
sys.path.insert(0, _p)
break
from prompt_integrity import clear_prompt_baselines
clear_prompt_baselines()
print('Prompt baselines cleared for fix mode')Note: This step becomes unnecessary once #1082 Phase 1a (per-issue baseline split) lands. Until then, /fix mode SHOULD clear baselines defensively at pipeline start.
Pipeline State Initialization
After alignment validation passes, initialize the pipeline state file so that hook enforcement (prompt integrity, pipeline ordering) is active during fix mode:
python3 -c "
import json, os, time
state = {'mode': 'fix', 'explicitly_invoked': True, 'start_time': int(time.time())}
with open(os.environ.get('PIPELINE_STATE_FILE', '/tmp/implement_pipeline_state.json'), 'w') as f:
json.dump(state, f)
print('Pipeline state initialized for fix mode')
"This ensures prompt integrity enforcement (Layer 5) can detect an active pipeline an
A harness that wraps Claude Code with enforcement, specialist agents, and alignment gates to deliver consistent, production-grade software engineering outcomes.
Repo: akaszubski/autonomous-dev
Other commands on autonomous-dev.
- /advise
Critical thinking analysis - validates alignment, challenges assumptions, identifies risks
Open command - /align
Unified alignment command (--project, --docs, --retrofit, --content)
Open command - /audit
Comprehensive quality audit - code quality, documentation, coverage, security
Open command - /autoresearch
Autonomous experiment loop — hypothesize, modify, benchmark, commit or revert
Open command - /create-issue
Create GitHub issue with automated research (--quick for fast mode)
Open command - /drain-queue
Autonomous queue drainer — picks the top /triage cluster, applies safety gates, drains via /implement --issues, pushes, deploys.
Open command

