Skip to content
Development
Command

/implement-fix

Minimal pipeline for test-fixing tasks

From plugin
autonomous-dev
3226 skills16 agents26 commands1 MCP
Install
$ npx -y skills add akaszubski/autonomous-dev --agent claude-code

How 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.md
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

Read more
Ships withautonomous-dev

A harness that wraps Claude Code with enforcement, specialist agents, and alignment gates to deliver consistent, production-grade software engineering outcomes.

Get the whole plugin, auto-invoked
Stats
32
Stars
0
Views
5
Forks
Active
Maintenance
Python
Language
2h ago
Last commit
9mo ago
Created

Repo: akaszubski/autonomous-dev