/gogodev:apply change-namefrom gogodev
Implement an approved OpenSpec change using Matt Pocock's implement or tdd workflow
Ships in gogodev. Installing the plugin adds it to Claude Code.
Implement the OpenSpec change: $ARGUMENTS
This command keeps OpenSpec's task bookkeeping honest while handing the actual engineering to Matt Pocock's implement or tdd skill.
Verify the implement and tdd skills (from the mattpocock-skills plugin) are available, the openspec CLI responds, and an OpenSpec root exists. If not, STOP and point the user at /gogodev:setup. (The ocr CLI, needed only if loop mode is chosen, is checked in Step 4-loop instead — no need to gate the whole command on it.)
If $ARGUMENTS names a change, use it. Otherwise infer from conversation context; if only one active change exists, auto-select it; if ambiguous, run openspec list --json and ask the user to pick (AskUserQuestion). Announce: "Using change: ".
openspec status --change "<name>" --json
openspec instructions apply --change "<name>" --json
Handle states:
blocked (missing artifacts) → report which artifacts are missing and suggest finishing the proposal first (/gogodev:propose or /opsx:continue).all_done → congratulate, suggest /opsx:archive <name>.contextFiles (proposal, specs, design, tasks — whatever the schema lists), then show progress ("N/M tasks complete") and continue.Check the change's design.md for an ## Execution mode section.
If present, use the recorded mode. Do not re-ask.
If absent, look at the design and tasks, then ask the user ONCE (AskUserQuestion): "tdd, implement, or loop for this change?"
tdd / implement — a single pass through the tasks (Step 4), ending with /code-review and one commit (Step 5).loop — a stricter, mostly-autonomous cycle (Step 4-loop): mandatory TDD per task, a lint+typecheck+test gate, a dual review (Standards+Spec and OpenCodeReview) once every task is implemented, and a single human-approval gate before the one commit for the whole change.tdd when the work is testable logic with clear seams; lean implement when it is mostly wiring, config, or UI plumbing; lean loop when the change has several tasks and should run with minimal check-ins along the way.Record the answer by appending to design.md:
## Execution mode
<implement|tdd|loop> — chosen <date>. <one-line reason>
This makes the choice survive interrupted sessions.
tdd / implement modes)Skip this step and Step 5 entirely if the mode is loop — go to "Step 4-loop" below instead; it replaces both.
Run the chosen skill — implement or tdd from the mattpocock-skills plugin — with the change's artifacts as the spec. The contextFiles from Step 2 ARE the spec/tickets that skill expects; follow its rules (for tdd: pre-agreed seams, red-green loop, vertical slices; for implement: typecheck regularly, use tdd at pre-agreed seams where possible).
Layer OpenSpec's bookkeeping on top:
tasks.md in order, one task at a time.- [ ] → - [x]). Never batch-tick; the file must always reflect reality.tdd / implement modes)When done (or paused), report: tasks completed this session, overall progress N/M, and — per Matt's implement skill — run /code-review on the work and commit to the current branch if the user hasn't said otherwise.
If all tasks are complete, suggest archiving to fold the change into the main specs. Archiving is stock OpenSpec; this plugin does not wrap it. Two equivalent routes — offer the one that works now:
/opsx:archive <name> — only if the /opsx:* commands are loaded in this session (they won't be if openspec init ran mid-session; they register at session start).openspec archive <name> via Bash — always works, same behavior including built-in validation. Offer to run it directly rather than telling the user to restart.loop execution modeThis replaces Step 4 and Step 5 completely — do not run those for loop mode. Requires the open-code-review-delegate skill and its ocr CLI (/gogodev:setup Check 5). If ocr isn't on PATH or the skill isn't available, STOP and point the user there. An OCR provider or model is not required.
loop mode's whole point is to run with minimal check-ins, so the autonomous work is delegated to a background subagent — this session only launches it and handles the one human-approval checkpoint at the end. Never run the per-task cycle or the review inline in this session; that would defeat the purpose and flood this session's context with every task's test/gate output.
Launch a subagent via the Agent tool with subagent_type: "fork" — it inherits this session's already-loaded OpenSpec context (Steps 1–2) for free, runs in the background, and keeps its tool output out of this session's context. Tell the user it's running in the background and they can keep working; do not poll for progress — wait for its completion notification.
Give the fork this brief, in full (it must be self-contained and unambiguous even though it inherits context):
Work through
<change name>'stasks.mdautonomously. Do not commit at any point — a human approves and commits after you report back.1. Classify tasks. For each task, decide whether it's manual (not agent-executable — dashboard clicks, external approvals, credential rotation, anything outside the codebase): prefer an explicit
(manual)tag at the end of the task line (e.g.- [ ] Rotate the prod API key (manual)); for untagged tasks, judge from the description. Manual tasks are excluded from the cycle below — leave their checkboxes unticked, they're the human's to do and tick themselves.2. Per-task cycle, for each non-manual, unticked task, in order:
- Write failing tests for the task. Mandatory — no implement-only path.
- Implement, applying the ponytail ladder throughout — stop at the first rung that solves the problem: (1) does it need to exist at all? skip speculative needs — (2) already in this codebase? reuse it — (3) does stdlib cover it? — (4) a native platform feature (CSS over JS, a DB constraint over app logic)? — (5) an already-installed dependency? never add a new one for a few lines — (6) a one-liner? — (7) minimal working code, only then. Fix bugs at the root cause / shared layer, never just in the caller that tripped on it. Never simplify away input validation, error handling, security, or accessibility. Mark any deliberate corner-cutting with a
ponytail:comment naming the ceiling and the upgrade path.- Gate: run the project's lint, typecheck, and test commands (detect from its tooling —
package.jsonscripts,Makefile, etc.). Fail → back to step 1/2 for this task, unless this failure is materially the same as the previous attempt's (same error, nothing changed) — then stop, this is a stall (see below). Pass → tick this task's checkbox immediately (never batch-tick), move to the next task.3. Review the whole change once every non-manual task's checkbox is ticked. Run in parallel:
mattpocock-skills:code-review(Standards + Spec) against the change's fixed point, and theopen-code-review-delegateskill on the uncommitted workspace. Follow its preview, rule, diff, review, and coverage steps. The host agent reviews the code; OCR only selects files and supplies rules. Do not runocr reviewor request OCR provider credentials. Merge and dedupe both reports into one findings list. Any findings → for each affected task, un-tick its checkbox, redo step 2 for just that task, then review again — unless a review round surfaces materially the same finding as the previous round with nothing changed, which is also a stall. Clean → done.4. Report back. If you stopped on a stall: report what was tried and why it's stuck, and leave the working tree exactly as the last attempt left it, uncommitted. If review came back clean: report total time taken, how many review→fix rounds ran, the findings from each round and what was fixed, and confirm the working tree is uncommitted and ready for human approval.
When the subagent's completion notification arrives:
loop mode ends here; there's nothing to approve.git diff <fixed-point>...HEAD) rather than the diff dumped inline — large multi-task changes don't fit in a brief.
SendMessage the same subagent, naming which task(s) to reopen and why; wait for its next report; re-run this step when it arrives.If all tasks are complete after commit, suggest archiving exactly as Step 5 does for tdd/implement mode.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
4 commands in this plugin
/captureStep 0: PreconditionsTurn the current conversation into an OpenSpec change proposal — no interview, just synthesis of what was already discussed/proposeStep 0: Dependency checkGrill the idea with a grilling interview, then write it up as an OpenSpec change proposal/setupCheck 1: Matt Pocock's skills pluginOne-time setup — install Matt Pocock's skills plugin and initialize OpenSpec in this reponpx claudepluginhub dadiogaosai/gogodev --plugin gogodevOther plugins' commands for the same job