|
| 1 | +--- |
| 2 | +description: Two-phase planning for big changes; builder must not be sole judge |
| 3 | +alwaysApply: true |
| 4 | +--- |
| 5 | + |
| 6 | +# Multi-Agent Workflow (Human Plan → Agent Execute) |
| 7 | + |
| 8 | +For **big changes**, split work into two phases. Do not skip Phase 1. |
| 9 | + |
| 10 | +## What counts as a big change |
| 11 | + |
| 12 | +- New feature, new standard importer, or new user-facing capability |
| 13 | +- Expected to touch **3+ files** or **>500 lines** of diff |
| 14 | +- Refactor or migration with behavioral risk |
| 15 | +- Touches critical paths (auth, secrets, production data, payments) |
| 16 | +- Incomplete requirements or meaningful product/design choices |
| 17 | + |
| 18 | +Small fixes: single-file bugfix, typo, test-only tweak, clear one-liner → `plan-first-workflow.mdc` only. |
| 19 | + |
| 20 | +## Phase 1 — Human-led planning (no code) |
| 21 | + |
| 22 | +**Stop before editing.** |
| 23 | + |
| 24 | +1. Acknowledge this is a big change; planning comes first. |
| 25 | +2. Ask minimum questions: goal, data sources, pattern to mirror, acceptance criteria, out of scope. |
| 26 | +3. Draft a plan: steps, `@` file paths, similar code, test/validation plan, risks. |
| 27 | +4. Wait for explicit approval ("proceed", "approved", or confirmed edited plan). |
| 28 | +5. No commits, push, or implementation code in Phase 1. Read-only research is fine. |
| 29 | + Tests and production code begin in Phase 2 after approval (see `tdd-workflow.mdc`). |
| 30 | + |
| 31 | +## Phase 2 — Agent execution |
| 32 | + |
| 33 | +After approval: |
| 34 | + |
| 35 | +1. Execute per `autonomous-workflow.mdc`. |
| 36 | +2. Follow the approved plan; pause if material deviation is needed. |
| 37 | +3. Implement incrementally; verify as you go (`verifiable-goals.mdc`). |
| 38 | +4. Hand off with checklist including test evidence. |
| 39 | + |
| 40 | +## Builder ≠ Judge (required on substantive work) |
| 41 | + |
| 42 | +| Role | Responsibility | |
| 43 | +|------|----------------| |
| 44 | +| **Builder** | Implements approved plan | |
| 45 | +| **Judge** | Independent review — edge cases, security, test gaps | |
| 46 | + |
| 47 | +Invoke judge via subagent, parallel agent, or fresh context: |
| 48 | + |
| 49 | +- "Use a subagent to review this change for edge cases and security issues." |
| 50 | + |
| 51 | +Do not mark substantive work complete without independent review or documented reason to skip. |
| 52 | + |
| 53 | +**Re-review:** Required only when judge findings change behavior, tests, or security posture materially. Style-only nits fixed in-place do not require a second judge pass. |
| 54 | + |
| 55 | +## Decision tree |
| 56 | + |
| 57 | +``` |
| 58 | +User request received |
| 59 | + │ |
| 60 | + ├─ Missing goal / criteria / context / constraints? |
| 61 | + │ └─ STOP → ask questions OR offer Requirements template (requirements-gate.mdc) |
| 62 | + │ |
| 63 | + ├─ Typo / rename / one-sentence fix? |
| 64 | + │ └─ Implement → quality checks → show evidence |
| 65 | + │ |
| 66 | + ├─ Multi-file / new feature / refactor / critical path? |
| 67 | + │ └─ Plan Mode → detailed plan → WAIT for approval → implement |
| 68 | + │ → quality checks → subagent review → handoff with evidence |
| 69 | + │ |
| 70 | + └─ Otherwise |
| 71 | + └─ Brief plan → implement → quality checks → handoff with evidence |
| 72 | +``` |
0 commit comments