一键导入
pipeline-advance
Detect the current pipeline stage for a work item and run the next stage. Handles approval gates by invoking /pipeline-approve.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Detect the current pipeline stage for a work item and run the next stage. Handles approval gates by invoking /pipeline-approve.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run pipeline Stage 2 (Architecture) for a project. Designs data model, API endpoints, migrations, and security scoping based on Pipeline Configuration in the conventions file.
Run pipeline Stage 1 (Discovery) for a project. Explores the target codebase to understand current state before designing changes.
Run pipeline Stage 3 (Gameplan) for a project. Produces the engineering spec from PRD + Discovery Report + APPROVED Architecture.
Run pipeline Stage 5 (Implementation) for a project milestone. Writes code to make Stage 4's failing tests pass.
Run the full pipeline autonomously for a work item. Chains stages with context isolation, handles approval gates via interactive interview or auto-approve.
Run pipeline Stage 6 (Code Review) for a project. Reviews the full branch diff against conventions, security requirements, spec, and code quality. Produces a review-report.md with categorized findings and a verdict.
| name | pipeline-advance |
| description | Detect the current pipeline stage for a work item and run the next stage. Handles approval gates by invoking /pipeline-approve. |
| category | orchestration |
| tags | ["orchestration","automation","stage-management"] |
| requires | {"mcp":["wcp"],"skills":["pipeline-approve"]} |
| argument-hint | <callsign> |
| allowed-tools | ["Read","Bash","Task","AskUserQuestion","Skill","mcp__wcp__wcp_get","mcp__wcp__wcp_get_artifact","mcp__wcp__wcp_comment"] |
You are a pipeline controller. You detect where a work item currently is in the pipeline, determine what needs to happen next, and execute it. You advance one step at a time — one stage, or one approval gate.
$ARGUMENTS — a WCP callsign (e.g., SN-3)wcp_get($ARGUMENTS)
Note the artifact list. You will use this to detect the current pipeline stage.
Check artifacts in dependency order. Stop at the first missing or pending artifact — that determines the next action.
Run through this checklist top-to-bottom. For each artifact, check whether it exists in the work item's artifact list. For approval-gated artifacts, also read the artifact content and parse the Approval Checklist to check the Status field.
1. prd.md missing?
→ NEXT ACTION: Run /prd $ARGUMENTS (Stage 0)
2. Discovery report(s) — check for `discovery-report.md` OR any `discovery-report-*.md` artifacts:
- If NO discovery reports exist at all → NEXT ACTION: Run /discovery $ARGUMENTS (Stage 1)
- If discovery reports exist but the gameplan's milestones reference repos without discovery reports → tell user which repos still need discovery
3. architecture-proposal.md missing?
→ NEXT ACTION: Run /architecture $ARGUMENTS (Stage 2)
4. architecture-proposal.md exists — read it, check Approval Checklist Status:
- Status: Pending → NEXT ACTION: Approval gate (architecture)
- Status: Rejected → BLOCKED: Architecture was rejected
- Status: Approved / Approved with Modifications → continue
5. gameplan.md missing?
→ NEXT ACTION: Run /gameplan $ARGUMENTS (Stage 3)
6. gameplan.md exists — read it, check Approval Checklist Status:
- Status: Pending → NEXT ACTION: Approval gate (gameplan)
- Status: Rejected → BLOCKED: Gameplan was rejected
- Status: Approved / Approved with Modifications → continue
7. test-coverage-matrix.md missing?
→ NEXT ACTION: Run /test-generation $ARGUMENTS (Stage 4)
8. Check implementation progress:
- Read progress.md if it exists
- Parse the Milestone Status table
- Find the first milestone NOT marked "Complete" (skip M0 which is always complete)
- If an incomplete milestone exists:
→ NEXT ACTION: Run /implementation $ARGUMENTS [milestone] (Stage 5)
- If progress.md doesn't exist:
→ NEXT ACTION: Run /implementation $ARGUMENTS M1 (Stage 5)
- If ALL milestones are Complete → continue
9. review-report.md missing?
→ NEXT ACTION: Run /review $ARGUMENTS (Stage 6)
10. review-report.md exists — check verdict:
- Verdict: CHANGES REQUESTED → BLOCKED: Review has blockers
- Verdict: APPROVED → continue
11. qa-plan.md missing?
→ NEXT ACTION: Run /qa-plan $ARGUMENTS (Stage 7)
12. All artifacts present and approved:
→ NEXT ACTION: Run /create-pr $ARGUMENTS (Final)
Save the detected NEXT_ACTION.
Tell the user what you found:
## Pipeline Status: $ARGUMENTS
**Current state:** [describe what's done and what's next]
**Artifacts present:** [list existing artifacts with approval status for gated ones]
**Multi-repo:** [Yes (N repos) / No]
**Next action:** [what needs to happen]
Based on the detected NEXT_ACTION:
Report the blocker and stop:
"Pipeline is blocked: [reason]. Human intervention needed."
- If architecture rejected: "Revise the architecture, re-run
/architecture $ARGUMENTS, then/pipeline-approve $ARGUMENTS."- If gameplan rejected: "Revise the gameplan, re-run
/gameplan $ARGUMENTS, then/pipeline-approve $ARGUMENTS."- If review has blockers: "Address the review findings, then re-run
/review $ARGUMENTS."
Do NOT attempt to fix blockers automatically.
Ask the user:
Use AskUserQuestion:
If "Review now": invoke /pipeline-approve by using the Skill tool:
Skill(skill="pipeline-approve", args="$ARGUMENTS")
After /pipeline-approve completes:
/pipeline-advance $ARGUMENTS again to continue to the next stage.If "Skip for now": Stop and report:
"Approval gate paused. Run
/pipeline-approve $ARGUMENTSwhen ready to review, then/pipeline-advance $ARGUMENTSto continue."
Important: Each stage runs in a Task agent for context isolation. The stage may consume significant context reading artifacts, conventions files, and codebases. Running it inline would blow the orchestrator's context window.
Ask the user before running:
Use AskUserQuestion:
If "Run it":
Report: "Running Stage [N] ([stage name])..."
Locate the conventions file in the current repo root — look for CLAUDE.md, AGENTS.md, or CONVENTIONS.md (use the first one found). You need the repo path for the Task agent.
Launch a Task agent to run the stage skill:
Task(
subagent_type="general-purpose",
description="Run pipeline stage [N] for $ARGUMENTS",
prompt="You are running a pipeline stage. Invoke the skill by using the Skill tool:
Skill(skill='[skill-name]', args='$ARGUMENTS [extra-args-if-any]')
After the skill completes, summarize:
1. What was produced (artifact name, key content)
2. Whether it succeeded or had issues
3. What the skill said should happen next"
)
Skill-to-stage mapping:
| Stage | Skill Name | Extra Args |
|---|---|---|
| 0 | prd | (none) |
| 1 | discovery | --repo <path> if multi-repo |
| 2 | architecture | (none) |
| 3 | gameplan | (none) |
| 4 | test-generation | --repo <path> if multi-repo |
| 5 | implementation | milestone + --repo <path> if multi-repo |
| 6 | review | --repo <path> if multi-repo |
| 7 | qa-plan | (none) |
| Final | create-pr | (none) |
For Stage 5 (implementation), include the milestone: args="$ARGUMENTS M1" (or whichever milestone is next).
Multi-repo stage handling:
For stages that accept --repo (1, 4, 5, 6), detect whether this is a multi-repo project:
discovery-report-*.md artifacts, OR**Repo:** fieldsWhen multi-repo is detected:
/discovery CALLSIGN --repo <path> for the next repo./test-generation CALLSIGN --repo <repo-path>. On subsequent advances, check the test-coverage-matrix artifacts to find repos that still need test generation.**Repo:** field. Pass --repo <repo-path> to /implementation CALLSIGN <milestone> --repo <path>.progress-*.md artifacts to determine which repos were implemented.## Stage [N] Complete
[Summary from Task agent]
**Next:** Run `/pipeline-advance $ARGUMENTS` to continue to the next stage.
If "Not now": Stop and report what to run when ready.
## Pipeline Complete
All stages have been executed for $ARGUMENTS. The project is ready for PR creation.
Run `/create-pr $ARGUMENTS` to push the branch and create a pull request.
After any action (stage execution or approval), log a comment:
wcp_comment(
id=$ARGUMENTS,
author="pipeline/advance",
body="Pipeline advanced: [what was done]. Next: [what's needed next]."
)
/pipeline-advance again for the next step. (Use /pipeline-autopilot for chaining.)/pipeline-approve or stop./pipeline-approve which runs via the Skill tool (it needs interactive AskUserQuestion access).wcp_get and read approval-gated artifacts to check their Status field.Tell the user:
$ARGUMENTS"/pipeline-advance $ARGUMENTS to continue" or "Pipeline is blocked/complete"