implement
Run the implement loop: dispatch fresh pi subagents to build each ticket as a red-green vertical slice, then run the full suite, review the diff, and commit. Use when the user asks to implement or build a spec or tickets, or when another skill must execute the loop.
- License 许可
- MIT
- 最近更新
- 2026-10-12
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- implement
- description
- Run the implement loop: dispatch fresh pi subagents to build each ticket as a red-green vertical slice, then run the full suite, review the diff, and commit. Use when the user asks to implement or build a spec or tickets, or when another skill must execute the loop.
02 资源文件 1
- 参考文档agents/openai.yaml139 B
03 SKILL.md 正文
The implement loop
A fixed state machine. You are the loop runner: you never write the code yourself. Each state dispatches one fresh pi subagent, checks its reply against the state's completion criterion, then advances. Every state runs once, in order; only a state's own fix branch repeats it.
If the user passes a ticket reference, fetch it from the issue tracker and state its title before starting. If the reference is ambiguous, ask.
One dispatch shape, always from the repo root:
pi --no-session -p "<PROMPT>"
Subagent prompts are context pointers, never pasted content: point at files with @path, name the seam, and let the subagent read the rest. Fill each <...> placeholder; nothing else changes between runs.
0. Pin the queue
Read the spec and tickets and write the work order: an ordered list of vertical slices, each with its seam — the public interface the slice is tested at. Take the seam from the spec, ticket, or an ADR; ask the user only for a slice that declares none. Record the review base before any dispatch: git rev-parse HEAD.
Done when every slice has a seam and the base commit is recorded. No dispatch before both hold.
1. RED — write the failing test
Dispatch pi:
Load the
tddskill. You are building one vertical slice. Spec:@<spec-path>. Ticket:@<ticket-path>. Seam:<seam>. Write one failing test for<slice>at that seam, in the project's existing test layout. Run it and confirm it fails for the asserted reason — not a missing import, not a setup error. Write only the test; the implementation is the next step's job.
Done when the reply shows the test on disk and a run that failed at the assertion, not the harness.
2. GREEN — make it pass
Dispatch pi:
Load the
tddskill. Spec:@<spec-path>. Ticket:@<ticket-path>. Seam:<seam>. The failing test is@<test-path>. Make that test pass with the smallest change. Run the project's typecheck and only that test file. Add only what the test forces; touch only what it forces.
Done when the single test passes and the typecheck is clean. If either fails, dispatch pi once more — "Fix the failures in @<test-path>; run the typecheck and that test file" — and re-check. After two failed fix attempts, stop and report to the user.
3. Advance
Move to the next slice in the work order and return to RED. When the queue is empty, go to FULL.
4. FULL — the whole suite
Dispatch pi:
Run the full test suite and the typecheck. Fix anything that broke, re-running the suite until clean. Report what passes and any failure you could not fix.
Done when the reply reports the full suite and the typecheck clean.
5. REVIEW — two axes
Dispatch pi:
Load the
code-reviewskill and run it. Fixed point:<base>. Spec:@<spec-path>.
Done when the two-axis report is back. If it found issues, dispatch pi once — "Fix these findings in the working tree: <findings>; re-run the affected tests and the full suite" — and re-check. Leave committing to the final step.
6. COMMIT
Commit the work to the current branch with a message naming the tickets it closes.
04 同仓库更多 Skills
writing-for-agents
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.
wizard
Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.
wayfinder
Plan a huge chunk of work (more than one agent session can hold) as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.
triage
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
to-tickets
Break a plan, spec, or the current conversation into a set of tracer-bullet tickets, each declaring its blocking edges, published to the configured tracker (edges as text in one file per ticket locally, or native blocking links on a real tracker).
to-spec
Turn the current conversation into a spec and publish it to the project issue tracker: no interview, just synthesis of what you've already discussed.