--- name: gogodev-apply description: Implement an approved OpenSpec change task by task with TDD, verification, review, and honest task bookkeeping. --- # Apply an OpenSpec change Verify the OpenSpec CLI and project root. Select the named change, infer it if unambiguous, or use `openspec list --json` and ask. Run `openspec status --change "" --json` and `openspec instructions apply --change "" --json`. If blocked, report missing artifacts. If complete, suggest `openspec archive `. Otherwise read every returned `contextFiles` entry and report task progress. Read `design.md` for `## Execution mode`. If it is absent, recommend and ask once: `tdd` for testable behavior, `implement` for wiring or UI, or `loop` for a multi-task change needing stricter gates and a final approval. Record the choice, date, and reason under `## Execution mode` in `design.md`. For changes to Go code, use JetBrains' `use-modern-go` skill when it is available. It supplies version-aware idioms; do not assume newer Go features are valid for the target module. If the skill is missing, point to `gogodev-setup` for its Codex installation and continue with the project's Go version and conventions. For `tdd` or `implement`, work the task list in order. Use Matt Pocock's `tdd` skill when installed and applicable, passing the agreed seams from the OpenSpec design. In `tdd`, write a failing behavior test at a confirmed seam, implement the smallest passing change, and move to the next vertical slice; save refactoring for review. In `implement`, consult his installed `implement` skill when available and follow its checks: typecheck and run focused tests regularly, use TDD at agreed seams, and run the full suite at the end. Do not invoke the upstream `implement` skill wholesale: it commits at the end, while this workflow controls the commit boundary. Keep the checkboxes in `tasks.md` as the sole task ledger. Tick each checkbox immediately after that task is verified; never batch-tick or mark unfinished work complete. If implementation reveals a material design problem, update the OpenSpec artifacts with the user's agreement. When finished, consult Matt's installed `code-review` skill when available and review the complete uncommitted diff on its two axes, Standards and Spec. His skill expects committed `HEAD` and a tracker spec, so use its rubric with the OpenSpec artifacts as the spec rather than invoking it directly on this working tree. Run the project's checks and report progress and findings. Commit only when authorized by the user or established project workflow. Suggest `openspec archive ` when all tasks are done. For `loop`, require `ocr` on `PATH` and the `open-code-review-delegate` skill from the OCR plugin. OCR provider/model configuration is not required. Work each non-manual task with failing tests first, using Matt's `tdd` skill where available, then implement using Ponytail's skill if installed. Otherwise apply its ladder directly: skip speculative code, reuse existing code, prefer the standard library, native platform features, installed dependencies, and a one-liner before adding minimal new code. Fix causes at the shared layer and preserve validation, error handling, security, and accessibility. Run the project's lint, typecheck, and test gate. Leave `(manual)` tasks unticked. Fix failures and only tick a task when its gate passes. Stop if the same blocker recurs without progress. After all agent-executable tasks, review the uncommitted diff on Matt's Standards and Spec axes using the OpenSpec artifacts, and use `open-code-review-delegate` on the same workspace: preview every reviewable file, load its rules, inspect its diff, and account for every file in the review report. The host agent performs the review; OCR only selects files and resolves rules. Do not run `ocr review` or request OCR provider credentials. Merge duplicate findings, reopen affected tasks, fix them, rerun the gate, and repeat review until clean or stalled. Keep the tree uncommitted. Report time, review rounds, findings, and the diff location; ask for human approval before the one final commit. If Codex exposes a background agent in this session, the task cycle may run there; otherwise run it in the current session with progress updates.