Skip to content

Use Garry Tan's exact Claude Code setup: 23 opinionated tools that serve as CEO, Designer, Eng Manager, Release Manager, Doc Engineer, and QA

TypeScript
3.4 KB
Raw Blame
## Step 8: Plan Completion Audit

Complete this section in order:
1. Dispatch the audit, validate its result and resolve its Gate Logic.
2. Collect the plan's executable checks in Step 8.1; do not run them yet.
3. Run Step 8.2 Scope Drift.
4. Run Prior Learnings, including its setting question when offered, then proceed to Step 9 for review and QA.

**Dispatch this step as a subagent** using Agent, `subagent_type: "general-purpose"`
and `run_in_background: false`. Use Step 7's shared foreground-dispatch rule.
The child reads the plan and every referenced
code file; the parent validates its report and applies the gates below.

**Before dispatch, the parent binds the plan:**

{{PLAN_COMPLETION_GATE_SHIP:discovery}}

**Subagent prompt:** Substitute `<base>` and supply the bound plan's absolute path
or complete text, including user-approved scope changes. When discovery printed the
not-run line, skip dispatch. The child does not inherit the parent's conversation.

````text
You are running a ship-workflow plan completion audit. The base branch is `<base>`. Use `git diff origin/<base>` and inspect untracked files from `git status` to see the full proposed change. Do not commit or push. Report only: classify every item, but do not execute Gate Logic, ask the user, or advance the workflow. The parent applies those gates to your report.

{{PLAN_COMPLETION_AUDIT_SHIP}}

After your analysis, output a single JSON object with exactly these seven fields on the LAST LINE of your response (no other text after it):
{"total_items":N,"done":N,"changed":N,"partial":N,"not_done":N,"unverifiable":N,"summary":"<markdown checklist for PR body>"}
Counts map one-to-one to the classifications above and sum to total_items. No plan or no actionable items means all counts are zero with the skip reason in summary. Do not classify work as deferred; only the parent can record a user-approved deferral.
````

**Parent processing:**

1. Check the task's terminal status. Without successful completion and valid LAST-line
   JSON, use the audit-failure fallback below. Require exactly the seven declared
   fields: nonnegative integer counts whose classification sum equals `total_items`,
   and a string `summary`. Missing,
   extra or invalid fields fail. Valid no-plan/no-actionable reports retain zero counts
   and their summary.
2. Store counts for Step 20 and `summary` for Step 19's `## Plan Completion`.
3. Run the parent-computed Acceptance edits check below on the bound plan; it adds
   `ACCEPTANCE_EDITED` beside the child's classes and never changes the child's
   seven fields.
4. Apply Gate Logic below before continuing. Carry approved deferrals, with item text
   and plan path, to Step 14; keep them separate from dropped scope. The gate supplies
   the required PR notes and per-item manual verification evidence.

{{PLAN_COMPLETION_GATE_SHIP:acceptance}}

**Audit-failure fallback:** On failure, invalid JSON or no final output after ~10
minutes, stop any live child and confirm it stopped before an inline audit with the same
extraction/classification logic; never race a late result. If that also fails,
AskUserQuestion: A) Skip audit and ship, recording the reason in the PR body and
Step 20 metrics; B) Stop and fix the audit (recommended/default). Never fail open
silently: a skipped audit would let unverified plan items ship as done.

---

{{PLAN_COMPLETION_GATE_SHIP}}

{{PLAN_VERIFICATION_EXEC}}

{{SCOPE_DRIFT}}

{{LEARNINGS_SEARCH:query=release ship version changelog merge pr}}

---