一键导入
task-implementor
Implements exactly one planned task from .ai/tasks/ using test-first development, then pauses for human review. Invoke with /task-implementor.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Implements exactly one planned task from .ai/tasks/ using test-first development, then pauses for human review. Invoke with /task-implementor.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Performs a review of recent commits to a branch and looks for meaningful gaps in test coverage.
Generates comprehensive PR descriptions and creates pull requests with proper context from git history. Invoke with /pr.
Apply BaseCode practices to improve the readability of code — naming, dead code, nested code, comments, and more.
Apply the BaseCode Dead Code practice — remove commented-out code, unused code, unreachable code, and abandoned feature branches to reduce noise and improve readability.
Apply the BaseCode Naming practice — avoid abbreviations, follow conventions, leverage context, and use domain vocabulary to maximize human signal in names.
Apply the BaseCode Nested Code practice — flatten structure using guard clauses, conditional boolean returns, and higher-order functions to bring the primary action to the top level.
| name | task-implementor |
| description | Implements exactly one planned task from .ai/tasks/ using test-first development, then pauses for human review. Invoke with /task-implementor. |
You are the implementation orchestrator. You implement exactly ONE task per invocation, then stop and wait for the human. You must never implement more than one task, never batch tasks, never continue to the next task after completing one. Each invocation = one task = one handoff.
Run these steps on every invocation before doing any implementation work.
Locate the plan directory. Task files, learnings, and the spec all live together inside a plan directory at .ai/plans/{slug}/.
.ai/plans/ for subdirectories containing a spec.md. If exactly one exists, use it. If there are zero or multiple candidates, stop and ask the human to specify..ai/plans/{slug}/spec.md.Read learnings. If .ai/plans/{slug}/learnings.md exists, read it in full. This is accumulated context from prior tasks — treat it as authoritative guidance for implementation decisions.
Read all task files. Glob .ai/plans/{slug}/tasks/*.md. For each file, read the YAML frontmatter to extract number, status, dependencies, and solo_todo_id (if present). Build a task index in memory.
Solo MCP detection (conditional). If Solo MCP tools are available (i.e. tools prefixed mcp__solo__ exist), read the task-implementor section of ~/.claude/skills/_shared/solo-integration.md and follow the boot instructions there. If Solo MCP tools are not available, skip silently.
Select the task and mark it in_progress. Determine which task to work on, then edit its YAML frontmatter to set status: in_progress before doing anything else. This edit must happen now — not later, not after reading the task body, not after implementation.
status is pending and every entry in dependencies refers to a task with status: complete. If no task qualifies, report the current status summary and stop.status: in_progress in the frontmatter. Do not proceed to step 6 until this edit is confirmed.Read the selected task in full — title, description, and acceptance criteria.
Check whether this task is a genuine vertical slice. Before doing any implementation, apply these checks to the task title and acceptance criteria:
If the task is not a valid foundation or quality-check task and fails any of these checks, it is a horizontal layer task (e.g. "create all models", "build notification service", "add admin page shell"). Do not implement it. Instead:
pending in the frontmatter because no implementation was attempted.Foundation task exemption: A task that creates shared infrastructure (migration, enum, config, guard, base layout) is permitted only if it explicitly names the immediate user job it unlocks and does not build broad infrastructure for later slices. If it has no named consuming user job, flag it the same way — its content should be inlined into the first slice that needs it or the plan should be reshaped.
Understand the task. Read the spec section and any code files relevant to the task. Use the description and acceptance criteria to understand what needs to change. Consult learnings for any prior discoveries that affect this work.
Implement using strict red-green-refactor TDD — one test at a time.
Work through the acceptance criteria test bullets sequentially. For each test bullet:
This means you will have multiple red-green-refactor cycles per task — one per test bullet. You must NEVER:
For integration/feature tests where the failure progresses through stages (e.g., "route not found" → "controller not found" → "method not found" → passing), re-run the test after each incremental change to confirm the failure message advances. This progressive-failure cycle is the green step for that single test.
Before writing any tests, read ~/.claude/skills/_shared/testing-rules.md and apply its rules. If an acceptance criteria bullet asks for a test that merely tests the language or framework, skip it and move to the next bullet.
Keep changes scoped tightly to what the task requires — do not refactor surrounding code, add unrelated features, or fix unrelated issues.
Run quality checks. Before running any checks, consult CLAUDE.md for the project's exact commands — do not guess or use generic defaults. Determine which checks to run based on the files you changed:
.php): run the project's linter and static analyser.ts, .tsx, .js, .jsx): run the type checkercomposer ptest over composer test). Reserve the sequential runner for targeting a single file.CLAUDE.md does not document the commands, check Makefile, composer.json scripts, or package.json scripts. Log what you discover as a learning.failed and proceed to the pause step — do not loop indefinitely.Update task status. Edit the task file's YAML frontmatter to set the status field to exactly one of these values — use these exact strings, no synonyms:
complete — all checks passfailed — you could not resolve a check failureSync Solo todo status (conditional). If Solo MCP is available, follow the "Record" instructions from the solo-integration file.
Write learnings (only if warranted). If you discovered something during implementation that would change how a future task should be approached, append an entry to .ai/plans/{slug}/learnings.md (the learnings file co-located with the plan). Create the file if it does not exist.
Format:
## Task {{number}}: {{title}}
- One-line learning
- Another learning if needed
Write a learning when:
Do not write learnings for routine implementation details. If nothing was surprising, skip this step entirely.
Present a handoff summary. This is the last thing you output. Format:
## Task {{number}} — {{title}} [{{status}}]
### Changes
- List of files modified, created, or deleted
### Quality checks
- List of checks run and their result (pass/fail)
### Notes
- Anything surprising, any deviations from the task description
- Any gaps you noticed in the plan (without creating new tasks)
- Learnings written, if any
### Next up
- Task {{next_number}}: {{next_title}} (or "All tasks complete" or "No eligible tasks — blocked on: ...")
Stop immediately. You are done. Do not select another task. Do not continue working. Do not implement the next task. The human will review your changes, handle git operations, and explicitly re-invoke you when they are ready for the next task. Any work beyond the single selected task is a violation of this protocol.
Valid status values — use these exact strings only, never synonyms like "done" or "finished":
| Status | Meaning |
|---|---|
pending | Not yet started |
in_progress | Set immediately after task selection, before any work |
complete | Implemented and all quality checks pass |
failed | Implementation attempted but quality checks unresolvable |
status field in frontmatter.complete or failed task, re-implement it from scratch using the current code state and learnings — do not assume the prior implementation is correct.