implement-spec
Implement a whole spec through parallel ticket worktrees on one integration branch.
svyatov · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add svyatov/supermatt --skill implement-spec技能说明
name: implement-spec description: "Implement a whole spec through parallel ticket worktrees on one integration branch." argument-hint: "[spec path or issue reference]" disable-model-invocation: true license: MIT
Implement the supplied spec and its tickets on one integration branch, ready for a single pull request. Use the host's native subagents and git worktrees; Herdr is not required. Keep communication sparse: pass pointers to the spec, tickets, commits, and evidence instead of repeating their contents.
1. Pin the spec and task graph
Read docs/agents/issue-tracker.md, then use its operations to read the spec, every child ticket, and their blocking relationships. If the tracker instructions are missing, tell the user to run /setup-supermatt-skills in Claude linked installs or Cursor, /supermatt:setup-supermatt-skills from the Claude plugin, $setup-supermatt-skills in Codex, or /skill:setup-supermatt-skills in OMP, then stop. If the spec has no implementation tickets, tell the user to run /to-tickets in Claude linked installs or Cursor, /supermatt:to-tickets from the Claude plugin, $to-tickets in Codex, or /skill:to-tickets in OMP, then stop.
Build a task graph with ticket states pending, running, integrated, and blocked. Keep it with the worker assignments, branch names, commit SHAs, and evidence paths in an OS temporary directory outside the repository. A closed ticket counts as integrated only after verifying its implementation is in the integration branch. Surface contradictory criteria before implementation. An open blocker outside this spec stays blocked until its work is merged into the default branch; a dependency cycle needs a user decision.
The frontier contains pending tickets whose prerequisites are all present on the integration branch. Within this run, a ticket becomes integrated after step 3 verifies its merge. That makes its dependents eligible even though its tracker issue stays open. An empty frontier with unfinished tickets and no running worker is blocked, not complete: report the blocking edges and stop.
2. Prepare the integration branch
Discover the default branch and record its current commit as BASE, the fixed point for final QA and review. Create a branch from it using the repository's naming convention in a dedicated worktree. Preserve the caller's existing work and branches. If the user supplied an existing integration branch, inspect it, record its merge-base with the default branch as BASE, and reconcile the graph against its actual commits before assigning work.
Create each worker's worktree on its own new branch from the current integration tip. Verify that starting commit before dispatch; if the base is wrong, preserve the worktree and correct the assignment instead of resetting existing work. Respect the host's available subagent slots. Without subagents, work one ticket at a time using the same worktree and verification steps.
3. Build and integrate the frontier
Before dispatching parallel workers, read Parallel resources and record their resource ownership with the task graph. Dispatch frontier tickets only where their edits and mutable resources can proceed independently. Give each implementer its ticket, relevant spec sections, worktree, starting SHA, resource assignment, and this contract:
- Work only in the assigned worktree. Load and follow the
tddskill through the host's skill mechanism at the agreed test seams. For a refactor without tests, first pin current behavior with characterization tests in a separate commit. - Before changing data contracts, state transitions, shared mutable state, or retryable effects, load
codebase-designthrough the host's skill mechanism. Follow its state-contract guidance for the affected behavior. - Use focused checks during TDD cycles. Before committing a completed behavior, complete the repository's full required gate. Reuse passing checks only when their relevant files, dependencies, configuration, and environment are unchanged.
- Commit the completed work with the ticket reference. Report the commit SHA, acceptance-criterion coverage, check results, evidence paths, and any unresolved question. Leave tracker issues open and let the coordinator integrate the branch.
The coordinator owns a single merge slot. When a worker finishes, hold that slot while it brings the latest integration tip into its branch. Resolve conflicts by loading and following the resolving-merge-conflicts skill through the host's skill mechanism in that worktree, then rerun checks invalidated by the merge, including the full required gate on the combined code. A failed check or unresolved question keeps the ticket out of the integration branch.
Wait for the worker and its subagents to finish writing. In the integration worktree, merge the verified worker commit with git merge --ff-only. If the integration tip advanced, sync and verify the worker again before retrying; never force the branch forward. Verify that the reported commit is now an ancestor of the integration tip, record its evidence, mark the ticket integrated, and release the merge slot. Recompute the frontier and dispatch newly eligible tickets. A merge into this branch does not close a tracker issue.
After the first successful merge, open a draft PR only if the tracker closes work through PRs or the user requested one. Target the default branch, reference the spec and all tickets it will finish, and load and follow the pr skill through the host's skill mechanism for the body. Keep one PR for the integration branch. Without a PR, retain the branch for the later shipping step.
4. Verify the whole spec
Once every ticket is integrated, run the repository's full required gate on the final integration commit, reusing unchanged valid results. Then run these checks in order:
For independently evolving providers and consumers, first identify the spec's au
阅读完整来源 ↗