/claude-apd:apd-finishfrom claude-apd
Presents push/PR/keep/discard options after a successful APD pipeline commit, verifying tests and showing a pipeline report first.
Ships in claude-apd. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
NO PUSH WITHOUT USER DECISION FIRST
The pipeline produced a commit. Now the user decides what happens with it. Never auto-push, never assume.
Use when:
Skip when:
apd-debug, not finishdigraph finish {
VERIFY [label="1. Verify\ntests pass"];
OPTIONS [label="2. Present options"];
PUSH [label="Push to remote"];
PR [label="Push + Create PR"];
KEEP [label="Keep local"];
DISCARD [label="Discard (confirm)"];
VERIFY -> OPTIONS;
OPTIONS -> PUSH [label="1"];
OPTIONS -> PR [label="2"];
OPTIONS -> KEEP [label="3"];
OPTIONS -> DISCARD [label="4"];
}
git log --oneline -1
bash "$(git rev-parse --show-toplevel)/.claude/scripts/verify-all.sh"
If tests fail → fix before proceeding.
bash "$(git rev-parse --show-toplevel)/.claude/bin/apd" report
Show the formatted pipeline recap so the user sees what was done before deciding.
If the run ACCEPTED any adversarial or supervision finding, ask one question before moving on: does it generalize? A finding is an instance; the thing worth keeping is the class.
The fix already landed in code — that part is done.
If the same shape can appear in another module, another handler, another task, record it once so the next builder meets the class instead of the instance:
bash .claude/bin/apd pipeline lesson "<the rule, as a class>" "<what it cost>"
bash .claude/bin/apd pipeline show lessons # what the project already knows
Builders are told to read .apd/lessons.md before they start, so a recorded
class is education that arrives automatically on every future dispatch.
Write the RULE, not the patch: if it only makes sense for one file it belongs in a code comment. Do not record a lesson for every finding — a file past ~20 entries gets skimmed rather than read, and then it teaches nothing. One good class beats five restatements of the same run. Commit the file; it is team knowledge, not session state.
Pipeline complete. What would you like to do?
1. Push to remote (current branch)
2. Push and create a Pull Request
3. Keep local (I'll handle it)
4. Discard this work
# Resolve the push remote first — never assume "origin" (handles esir, upstream, etc.)
REMOTE=$(bash .claude/bin/apd git-remote) && APD_ORCHESTRATOR_COMMIT=1 git push -u "$REMOTE" <branch>
REMOTE=$(bash .claude/bin/apd git-remote) && APD_ORCHESTRATOR_COMMIT=1 git push -u "$REMOTE" <branch>
gh pr create --title "<feature>" --body "$(cat <<'EOF'
## Summary
<what changed>
## APD Pipeline
- Spec: approved
- Builder: <agents used>
- Reviewer: code-reviewer (opus/max) — verdict: PASS
- Verifier: all tests pass
- Pipeline duration: <time>
## Test Plan
- [ ] <verification steps>
EOF
)"
Report branch name and status. Done.
Require typed confirmation: "Type 'discard' to confirm."
git checkout main
git branch -D <branch>
| Thought | Reality |
|---|---|
| "User probably wants me to push" | Never assume. Ask. |
| "I'll push and create PR in one go" | User might want to review locally first. |
| "Skip verification, we just ran tests" | Verify again. Something might have changed. |
| "Force push to fix the branch" | Never force push. guard-git blocks it anyway. |
| "Push to origin" | The remote may not be origin (e.g. esir). Run apd git-remote — never assume. |
apd git-remote — never hardcode origin. If it exits
non-zero (ambiguous), ask the user or pin it with apd git-remote --set-remote <name>Example 1 — Clean pipeline, user picks Push.
Input: apd pipeline status shows commit done. verify-all.sh returns green. User has not yet decided.
Output:
Pipeline complete. What would you like to do?
1. Push to remote (current branch)
2. Push and create a Pull Request
3. Keep local (I'll handle it)
4. Discard this work
> 1
REMOTE=$(bash .claude/bin/apd git-remote) && APD_ORCHESTRATOR_COMMIT=1 git push -u "$REMOTE" feature/order-refund
→ https://github.com/org/repo/tree/feature/order-refund
Example 2 — Verifier red blocks the finish menu.
Input: Pipeline reports commit done, but rerunning verify-all.sh from clean shows two failing integration tests (OrderRefundSpec.refundFailsTwice, WebhookSpec.signatureMismatch).
Output: Do NOT present the four options. Hand off to apd-debug:
Verifier red after commit:
- test/integration/OrderRefundSpec.refundFailsTwice
- test/integration/WebhookSpec.signatureMismatch
Switching to apd-debug — Phase 1: trace data flow on the two failures.
Example 3 — User picks PR, body carries the pipeline summary.
Input: User picks option 2 after a clean pipeline (6 R-criteria, 11m 32s, adversarial 5/3/2).
Output: PR opened with this body:
## Summary
Add idempotent POST /orders/:id/refund with audit log.
## APD Pipeline
- Spec: approved
- Builder: backend-api (sonnet/xhigh)
- Reviewer: code-reviewer (opus/max) — verdict: PASS
- Adversarial: 5/3/2 (total/accepted/dismissed)
- Verifier: all tests pass
- Duration: 11m 32s
## Test Plan
- [ ] POST /refund twice with same Idempotency-Key → second is a no-op
- [ ] webhook fires exactly once on the first call
Return the PR URL to the user; do not auto-start a new pipeline.
You're done when:
discard literally before any branch was removedapd-debug (do NOT present finish options on red tests)What SKILL.md sets; muted values are Claude Code's defaults
highThree short reads, in order
Other plugins' skills for the same job
npx claudepluginhub zstevovich/claude-apd --plugin claude-apd11 skills in this plugin
/apd-auditUse when verifying that APD is correctly configured in the current project — qualitative deep audit of agents, hooks, CLAUDE.md, pipeline state, MCP wiring, and guardrails. Goes further than verify-apd. Triggers on "audit APD", "review setup", "is APD configured", "verify framework", "check APD", "APD health", "is everything wired", after any major framework upgrade or version bump./apd-brainstormUse BEFORE writing the APD spec-card.md whenever the task is vague, broad, ambiguous, or has multiple reasonable approaches. Asks ONE question at a time, presents 2-3 options when there are real choices, converges on a design the user explicitly approves. Triggers on "improve X", "what should we", "thinking about", "options", "not sure", "maybe", "vague", "broad", "redesign", any spec-card.md with unclear scope or fewer than 3 R-criteria. For the pipeline gate contract (plan format, rationale format, BLOCKs) load /apd-pipeline-guide — that one is mandatory on every task; this one is for unclear scope./apd-debugMANDATORY before re-dispatching the builder after any APD verifier failure or critical reviewer finding. Use on any bug, test failure, build failure, error, crash, regression, or unexpected behavior during the APD pipeline. Four-phase root-cause analysis — investigate, pattern-match, hypothesize + controlled test, fix with TDD. Triggers on "bug", "fail", "failing", "broken", "doesn't work", "error", "crash", "regression", "verifier blocked", "reviewer rejected"./apd-githubUse when the project has GitHub Projects configured (GITHUB_PROJECTS_URL in CLAUDE.md) and APD pipeline tasks need to sync with the board. Creates issues for specs, moves cards through columns (todo → in-progress → review → done), closes on commit. Triggers on "GitHub Projects", "issue", "board", "card", "sync", "kanban", "project board", any APD pipeline phase transition when a board URL is configured./apd-miroUse when the project has a Miro board configured (MIRO_BOARD_URL in CLAUDE.md) and the APD pipeline dashboard needs updating. Visualizes current pipeline status, completed tasks, recent metrics, and active spec cards. Triggers on "Miro", "dashboard", "board update", "visualize pipeline", "pipeline view", "metrics", any pipeline phase change when a Miro URL is configured./apd-pipeline-guideMANDATORY before EVERY pipeline task — load this skill BEFORE writing spec-card.md, on every new task, no exceptions. It is the APD operating manual, NOT a brainstorm — "the task is already clear" is not a reason to skip it. Carries the current gate contract - pipeline phase map, implementation-plan **Implements:** format, adversarial rationale file format, common BLOCKs + recovery, state read rules. The spec gate hard-BLOCKS without the .guide-marker this skill writes on exit. There is no skip flag.