Commit 8ea8b8
2026-03-16 04:04:58 Claude (MCP): [mcp] Document implementation workflow with Sonnet subagent pipeline| /dev/null .. Design/Implementation_Workflow.md | |
| @@ 0,0 1,94 @@ | |
| + | --- |
| + | category: reference |
| + | tags: [process, agents, workflow] |
| + | last_updated: 2026-03-16 |
| + | confidence: high |
| + | --- |
| + | |
| + | # Implementation Workflow |
| + | |
| + | How Claude Code orchestrates implementation tasks on robot.wtf using Sonnet subagents. |
| + | |
| + | ## Principles |
| + | |
| + | - **Opus orchestrates, Sonnet implements.** No Opus manager layer. The orchestrator (main Claude Code session) dispatches Sonnet agents directly. |
| + | - **Background everything.** Subagents, deploys, and tool calls run in background (`run_in_background: true`) so the orchestrator and user can keep talking. |
| + | - **Task list tracks the pipeline.** Each implementation task gets 5-6 task list items with dependencies. The orchestrator dispatches agents as blockers clear. |
| + | - **Rule of Two.** No subagent output is merged without independent verification by a second agent. |
| + | - **No VPS mutations outside Ansible.** Read-only SSH diagnostics only. All changes go through Ansible playbooks. |
| + | |
| + | ## Pipeline per task |
| + | |
| + | When the user and orchestrator agree on an implementation task: |
| + | |
| + | ### 1. Plan (Sonnet Plan agent) |
| + | - Reads relevant code |
| + | - Produces implementation plan with specific file changes |
| + | - Orchestrator reviews plan with user if non-trivial |
| + | - **Dispatch:** immediately |
| + | |
| + | ### 2. Implement (Sonnet agent, worktree isolation) |
| + | - Gets the plan output + file paths |
| + | - Writes code, writes tests, commits to feature branch |
| + | - **Dispatch:** when Plan completes |
| + | - **Always use `isolation: "worktree"`** |
| + | |
| + | ### 3. Chico review (Sonnet agent) |
| + | - Code quality, correctness, edge cases |
| + | - Rates issues: critical / important / minor |
| + | - **Dispatch:** when Implement completes (parallel with Zeppo) |
| + | |
| + | ### 4. Zeppo review (Sonnet agent) |
| + | - Security, infrastructure, deployment concerns |
| + | - Same rating scale |
| + | - **Dispatch:** when Implement completes (parallel with Chico) |
| + | |
| + | ### 5. Fix (Sonnet agent, same worktree) |
| + | - Gets review output + code |
| + | - Fixes critical and important issues |
| + | - Recommits to same branch |
| + | - **Dispatch:** when both reviews complete |
| + | - **Skip if:** no critical or important issues found |
| + | |
| + | ### 6. Verify (Sonnet agent) |
| + | - Reads the diff |
| + | - Runs tests if they exist |
| + | - Confirms changes match the spec |
| + | - Reports pass/fail |
| + | - **Dispatch:** when Fix completes (or after Implement if no Fix needed) |
| + | |
| + | ### 7. Report |
| + | - Orchestrator summarizes results and any concerns to the user |
| + | - User approves |
| + | - Orchestrator merges and deploys via Ansible |
| + | |
| + | ## Task list structure |
| + | |
| + | For a task "Foo", create these items: |
| + | |
| + | ``` |
| + | - [ ] Foo: Plan |
| + | - [ ] Foo: Implement (blocked by Plan) |
| + | - [ ] Foo: Chico review (blocked by Implement) |
| + | - [ ] Foo: Zeppo review (blocked by Implement) |
| + | - [ ] Foo: Fix (blocked by Chico + Zeppo) |
| + | - [ ] Foo: Verify (blocked by Fix) |
| + | ``` |
| + | |
| + | Mark each `in_progress` when the agent launches, `completed` when it returns. |
| + | |
| + | ## Agent prompts |
| + | |
| + | Keep prompts short and specific: |
| + | - "Read X, change Y, commit to branch Z" |
| + | - Include the Plan output for implementers |
| + | - Include the diff for reviewers |
| + | - Include review findings for fixers |
| + | - All agents: "Do NOT use git add -A. ALWAYS commit before reporting back. Do NOT push or merge." |
| + | |
| + | ## What NOT to do |
| + | |
| + | - Don't launch Opus managers that delegate to Sonnet workers (they do the work themselves at Opus cost) |
| + | - Don't merge without verification |
| + | - Don't debug VPS issues via SSH mutations |
| + | - Don't ask the user if they're done |