/forge:pipelinefrom forge
Orchestrates an adversarial plan-implement-review pipeline using native Claude Code subagents. Routes between feature, audit, repo-health, repo-eval, and doc-health pipeline types based on intake documents.
Ships in forge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You coordinate the adversarial development pipeline turn by turn in this session. (The /forge:run workflow runs the same stages from a script; this skill is for when workflows are unavailable or the user wants to steer between stages.) Each role is a native Claude Code subagent (defined in the plugin's agents/ directory) and runs in its own fresh context window. Your job is to spawn each role by its subagent_type, read its signals, and route work accordingly. You never read role-prompt files or inject prompt text — the subagent definition supplies the system prompt; you supply only the task.
Read pipeline-protocol.md for the full signal protocol before starting.
$ARGUMENTS is the plan identifier in YYYY-MM-DD-slug format (e.g., 2026-03-12-user-auth). Plan files live at docs/plans/$ARGUMENTS/.
pipeline-protocol.md to load the signal protocoldocs/plans/$ARGUMENTS/:+-------------------------------------------------------------------+
| PIPELINE TYPE ROUTING |
+-------------------------------------------------------------------+
| |
| Check which intake docs exist at docs/plans/$ARGUMENTS/: |
| |
| brainstorm.md exists? → type: feature (default flow below) |
| Multiple audit docs? → type: audit (unified plan) |
| health-audit.md only? → type: repo-health |
| eval.md only? → type: repo-eval |
| doc-audit.md only? → type: doc-health |
| none found? → tell user to run an intake skill |
| |
+-------------------------------------------------------------------+
Each pipeline type uses a distinct intake filename — no frontmatter parsing needed for routing.
docs/plans/$ARGUMENTS/ to determine which existbrainstorm.md exists: it runs alone — continue with the feature flow stages below. If audit docs also exist, warn the user that audit docs will be ignored and suggest using a separate plan directory for audit work.health-audit.md, eval.md, doc-audit.md): Read flows/audit-flow.md and follow it. This creates ONE unified plan across all audit types. Stop reading this file and follow the flow file.health-audit.md → flows/repo-health-flow.md, eval.md → flows/repo-eval-flow.md, doc-audit.md → flows/doc-health-flow.md. Stop reading this file and follow the flow file.Before starting any stage, detect prior progress to determine the correct entry point:
Gates log each decision as one line under ## Gate Log in docs/plans/$ARGUMENTS/feedback.md, oldest first; a rework starts with a REWORK line.
PLAN_APPROVED line after its last REWORK line (or has no REWORK line), and no PLAN_REVIEW item is OPENPHASE_APPROVED — Phase N lines in the log, OPEN/resolved CODE_REVIEW entries, and implementation commits (see Stage 2 State Recovery)GO or NO-GO line in the log, unless a REWORK line follows itBased on findings:
GO logged → pipeline already completed, report the result to the user and stopNO-GO logged (no REWORK after it) → report it and follow the NO-GO Re-Entry Path belowPHASE_APPROVED for all phases → skip to Stage 3 (Final Review)PLAN_APPROVED → skip to Stage 2 at the correct phase (see State Recovery below)PLAN_REVIEW feedback → enter Stage 1 at revision step (1a with revision instructions)Report the detected state to the user before continuing.
Max iterations: 3. If not approved after 3 cycles, stop and surface the unresolved issues to the user.
One Planner agent and one Plan Reviewer agent for the entire planning stage. Spawn each once, then use SendMessage for subsequent iterations.
Agent addressing: Every spawn sets subagent_type to the role and passes an explicit name. Address the agent by that same bare name in every subsequent SendMessage(to=...) — names stay routable after an agent finishes, and the composite name@session-<hex> id is rejected. See pipeline-protocol.md → Agents Are Native Subagents.
subagent_type="forge:planner", name="planner", reusing that name for subsequent SendMessage calls. Pass only the task:<task>
Version: $ARGUMENTS
Brainstorm document: docs/plans/$ARGUMENTS/brainstorm.md
Read the brainstorm document, explore the codebase, and create the implementation plan files at docs/plans/$ARGUMENTS/.
Remember to create feedback.md with the empty template structure.
When complete, report with: PLAN_COMPLETE
</task>
SendMessage report — the Agent call returns at spawn and never carries it (see pipeline-protocol.md → Signals Arrive by Message, Not by Return Value)PLAN_COMPLETE is the report's final linesubagent_type="forge:plan-reviewer", name="plan-reviewer":<task>
Version: $ARGUMENTS
Plan location: docs/plans/$ARGUMENTS/
Review the implementation plan. Verify file existence with Glob. Check dependencies, actionability, and testing strategy.
If issues found: write feedback to docs/plans/$ARGUMENTS/feedback.md tagged PLAN_REVIEW, then end with: REVISION_REQUIRED
If plan is good: end with: PLAN_APPROVED
</task>
PLAN_APPROVED → proceed to Stage 2REVISION_REQUIRED → use SendMessage with to="planner":The Plan Reviewer has requested revisions. Read docs/plans/$ARGUMENTS/feedback.md for OPEN items tagged PLAN_REVIEW.
Address each item by revising the plan files. Move resolved feedback to the "Resolved Feedback" section with a resolution note.
When complete, report with: PLAN_COMPLETE
to="plan-reviewer":The Planner has revised the plan. Re-review the changes:
1. Check that OPEN PLAN_REVIEW items in feedback.md were resolved
2. Verify file existence with Glob
3. Re-check dependencies and actionability
If new issues found: write new feedback, end with: REVISION_REQUIRED
If all resolved: end with: PLAN_APPROVED
PLAN_APPROVED or max iterations (3) reachedSendMessage to continue the existing agents.After plan approval, report:
Plan approved after N iteration(s).
Phases identified: [list phases found]
Starting implementation...
Max iterations per phase: 3. If not approved after 3 cycles, stop and surface issues.
Identify all phases by using Glob for docs/plans/$ARGUMENTS/Phase-*.md (excluding Phase-0). Process them in sequential order.
Before processing phases, determine each phase's completion state. For each Phase-N:
docs/plans/$ARGUMENTS/feedback.md and check for:
PHASE_APPROVED — Phase N line in the Gate Log → phase is done, skip itBLOCKED — Phase N: ... → phase is blocked, enter at step 2a (Implementer), which re-checks the gate. Never enter a blocked phase at the Reviewer: nothing was built. (An UNBLOCKED — Phase N line after it means the gate was met and the phase was taken up again; apply the rules below)CODE_REVIEW items for Phase N → phase needs review fixes, enter at step 2a (Implementer) with revision instructionsCODE_REVIEW items for Phase N but no PHASE_APPROVED → phase needs re-review, enter at step 2b (Reviewer)git log --oneline for commits referencing Phase N (e.g., phase-N, Phase N, phase N)
A phase is only skip-eligible when the Gate Log has a PHASE_APPROVED — Phase N line for it. Implementation commits alone are not sufficient.
Report the recovered state to the user before continuing:
Resume state for $ARGUMENTS:
- Phase 1: [done | blocked on <gate> | needs review | needs review fixes | needs implementation | not started]
- Phase 2: [...]
Continuing from Phase N...
One Implementer agent and one Reviewer agent per phase. Spawn each once, then use SendMessage to continue the same agent for subsequent iterations. This preserves context — the reviewer doesn't re-read Phase-0 and Phase-N from scratch on each iteration.
subagent_type="forge:implementer", name="implementer-phase-N" (substitute the actual phase number), reusing that name for subsequent SendMessage calls:<task>
Version: $ARGUMENTS
Phase: N
Read these files in order:
1. docs/plans/$ARGUMENTS/README.md
2. docs/plans/$ARGUMENTS/Phase-0.md
3. docs/plans/$ARGUMENTS/Phase-N.md
4. docs/plans/$ARGUMENTS/feedback.md (check for OPEN CODE_REVIEW items)
Implement all tasks in Phase-N following TDD. Make atomic commits.
If a prerequisite Phase-N.md names, or a human gate in README.md that applies to Phase N, is not met: change nothing, append "BLOCKED — Phase N: <what is unmet>" under "## Gate Log" in feedback.md, and report BLOCKED naming that gate or prerequisite as the plan names it.
When complete, report with: IMPLEMENTATION_COMPLETE (or BLOCKED)
</task>
If the implementer reports BLOCKED, do not spawn the Reviewer. Confirm the BLOCKED — Phase N line is in the Gate Log (append it if the implementer did not), then stop the pipeline and report it with the On BLOCKED template below. A blocked phase was never built; reviewing it only repeats the block.
subagent_type="forge:reviewer", name="reviewer-phase-N" (substitute the actual phase number), reusing that name for subsequent SendMessage calls:<task>
Version: $ARGUMENTS
Phase: N
Review the Phase N implementation:
1. Read docs/plans/$ARGUMENTS/Phase-0.md first (architecture source of truth)
2. Read docs/plans/$ARGUMENTS/Phase-N.md (the spec)
3. Verify implementation matches spec using Read, Glob, Grep
4. Run tests and build with Bash
5. Check git commits, and state the commit you reviewed (`git rev-parse HEAD`) in your report
If issues found: write feedback to docs/plans/$ARGUMENTS/feedback.md tagged CODE_REVIEW, then end with: CHANGES_REQUESTED
If implementation is good: end with: PHASE_APPROVED
</task>
PHASE_APPROVED → report to user, move to next phaseCHANGES_REQUESTED → use SendMessage with to="implementer-phase-N":The Code Reviewer has requested changes. Read docs/plans/$ARGUMENTS/feedback.md for OPEN items tagged CODE_REVIEW.
Address each item. Move resolved feedback to "Resolved Feedback" with a resolution note. Continue following TDD. If the phase turns out to be blocked on a prerequisite or human gate, follow your Blocked Phases instructions instead.
When complete, report with: IMPLEMENTATION_COMPLETE (or BLOCKED)
BLOCKED → do not message the Reviewer; handle it as in 2a (confirm the Gate Log line, stop, On BLOCKED template).IMPLEMENTATION_COMPLETE, use SendMessage with to="reviewer-phase-N":The Implementer has addressed the feedback. Re-review the changes:
1. Check that OPEN CODE_REVIEW items in feedback.md were resolved
2. Run tests and build
3. Verify fixes are correct
4. State the commit you reviewed (`git rev-parse HEAD`)
If new issues found: write new feedback, end with: CHANGES_REQUESTED
If all resolved: end with: PHASE_APPROVED
CHANGES_REQUESTED on the same commit as its previous CHANGES_REQUESTED for this phase, the implementer committed nothing in between. Stop and report it with the On No Progress template; more rounds would repeat the same reviewPHASE_APPROVED or max iterations (3) reachedSendMessage to continue the existing agents.Phase N approved after M iteration(s).
Remaining phases: [list]
After all phases are approved:
subagent_type="forge:final-reviewer", name="final-reviewer". You will not need to message it again — unlike the other stages, the Final Reviewer runs once and is never resumed via SendMessage (a NO-GO surfaces to the user rather than re-entering a loop):<task>
Version: $ARGUMENTS
Plan location: docs/plans/$ARGUMENTS/
Conduct the final comprehensive review:
1. Run the full test suite
2. Verify spec compliance across all phases — read each Phase-N.md and verify every task has corresponding code
3. Check integration points between phases
4. Scan for security issues, dead code, and tech debt
5. Produce the Production Readiness Dashboard
If ready: end with: GO
If not ready: write feedback to docs/plans/$ARGUMENTS/feedback.md tagged FINAL_REVIEW, categorize issues as plan-level or implementation-level, then end with: NO-GO
</task>
GO → report success to userNO-GO → report issues to user with the final reviewer's assessment. Do not automatically re-enter the loop. Let the user decide next steps.Before reporting the final verdict, append an entry to .claude/skill-runs.json in the repo root. If the file does not exist, create it with an empty array first.
{
"skill": "pipeline",
"date": "YYYY-MM-DD",
"plan": "$ARGUMENTS",
"verdict": "GO | NO-GO | BLOCKED | NO_PROGRESS | MAX_ITERATIONS"
}
verdict: the final outcome of this pipeline runPipeline complete for $ARGUMENTS.
Final verdict: GO — Production Ready
Stages completed:
- Plan: approved in N iteration(s)
- Phase 1: approved in M iteration(s)
- Phase 2: approved in M iteration(s)
- ...
- Final review: GO
All code is committed and ready for deployment.
Pipeline stopped for $ARGUMENTS.
Final verdict: NO-GO
The final reviewer identified issues in docs/plans/$ARGUMENTS/feedback.md tagged FINAL_REVIEW.
[Summary of issues categorized as plan-level vs implementation-level]
Options:
A) Address the issues and re-run: /pipeline $ARGUMENTS
B) Review feedback manually: read docs/plans/$ARGUMENTS/feedback.md
C) Ship with caveats (if issues are minor)
NO-GO Re-Entry Path: When the user re-runs /pipeline $ARGUMENTS after a NO-GO, State Recovery (Stage 0) finds the NO-GO in the Gate Log. Rework adds phases; it never reopens an approved one:
REWORK under ## Gate Log before anything else, so an interrupted run resumes the rework instead of reporting the old NO-GO.FINAL_REVIEW items, fixes plan-level issues (architecture flaw, missing phase) in the existing phase files, and adds new Phase-N files, numbered after the last one, for implementation-level issues (bug, missing test, security). It moves each FINAL_REVIEW item to Resolved Feedback, naming the phase that addresses it.PLAN_APPROVED after the REWORK line approves it.Pipeline stopped for $ARGUMENTS.
Phase N is blocked on: [the gate or prerequisite, as the implementer named it]
Nothing was changed for Phase N. Phases before it are approved.
Once that is met, re-run: /pipeline $ARGUMENTS
Phase N restarts at its implementer, which re-checks it.
Pipeline stopped for $ARGUMENTS.
Phase N made no progress: the reviewer requested changes twice on commit [sha], and the implementer committed nothing in between.
Read the OPEN CODE_REVIEW items for Phase N in docs/plans/$ARGUMENTS/feedback.md, resolve what is stopping the implementer, then re-run: /pipeline $ARGUMENTS
Pipeline paused for $ARGUMENTS.
The [Planner ↔ Plan Reviewer | Implementer ↔ Reviewer] loop for [Phase N] did not converge after 3 iterations.
Unresolved feedback in docs/plans/$ARGUMENTS/feedback.md.
Options:
A) Review feedback and provide guidance, then re-run
B) Manually resolve and continue
SendMessage report before deciding the next step.subagent_type and canonical name from pipeline-protocol.md, then use SendMessage(to="<name>") for subsequent iterations. Never spawn a new agent for the same role within a phase. Never address by role description — use the exact name you spawned with.subagent_type (e.g. forge:planner) — the subagent definition supplies the system prompt; never read role files or inject <role_prompt> blocks<task> in each agent's prompt — the role's behavior comes from its subagent definitionWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub hatmanstack/claude-forge --plugin forge6 skills in this plugin
/auditRun any mix of repo-eval, repo-health and doc-health audits in parallel, producing one plan directory for a single /forge:run./brainstormExplore the codebase and turn a feature idea into a design spec (brainstorm.md) through clarifying questions; the entry point for /forge:run./doc-healthAudit documentation drift against the code across 6 phases and write doc-audit.md for /forge:run remediation./repo-evalScore the codebase on 12 pillars with a 3-evaluator hiring panel and write eval.md for /forge:run remediation./repo-healthAudit technical debt across 4 vectors and write health-audit.md for /forge:run remediation.Other plugins' skills for the same job