|
| 1 | +--- |
| 2 | +description: Human plans big changes first; agent executes after explicit approval |
| 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 | +Treat the change as **big** when any of these apply: |
| 13 | + |
| 14 | +- New feature, new standard importer, or new user-facing capability |
| 15 | +- Expected to touch **3+ files** or **>500 lines** of diff |
| 16 | +- Refactor or migration with behavioral risk |
| 17 | +- Touches critical paths (auth, secrets, production data, payments) |
| 18 | +- Requirements are incomplete or have meaningful product/design choices |
| 19 | + |
| 20 | +Small fixes (single-file bugfix, typo, test-only tweak, clear one-liner scope) skip this rule; use `plan-first-workflow.mdc` only. |
| 21 | + |
| 22 | +## Phase 1 — Human-Led Planning (Agent Facilitates, No Code) |
| 23 | + |
| 24 | +**Stop before editing.** Your job is to help the human produce and approve a plan. |
| 25 | + |
| 26 | +1. **Acknowledge** this is a big change and that planning comes first. |
| 27 | +2. **Ask the human** the minimum questions needed to plan well. Prefer a short numbered list over a long questionnaire. Typical prompts: |
| 28 | + - What is the goal and definition of done? |
| 29 | + - What source format / data / URLs does FOOBAR (or the feature) use? |
| 30 | + - Which existing pattern should we mirror (e.g. a similar importer or route)? |
| 31 | + - Acceptance criteria and manual checks? |
| 32 | + - Out of scope / constraints? |
| 33 | +3. **Draft a plan** for the human to edit, including: |
| 34 | + - Goal and acceptance criteria |
| 35 | + - Steps in execution order |
| 36 | + - Files likely touched (with `@`-style paths where helpful) |
| 37 | + - Similar code to follow |
| 38 | + - Test and validation plan (`make lint`, `make mypy`, `make test`, import smoke if relevant) |
| 39 | + - Risks and open questions |
| 40 | +4. **Wait for explicit approval** before Phase 2. Approval looks like: "looks good", "proceed", "approved", or an edited plan the human confirms. |
| 41 | +5. **Do not** create commits, push, or write implementation code during Phase 1. Research and read-only exploration are fine. |
| 42 | + |
| 43 | +If the human already supplied a complete plan, reflect it back briefly and ask them to confirm before executing. |
| 44 | + |
| 45 | +## Phase 2 — Agent Execution (Autonomous) |
| 46 | + |
| 47 | +After the human approves the plan: |
| 48 | + |
| 49 | +1. **Execute end-to-end** per `autonomous-workflow.mdc` and `AGENTS.md`. |
| 50 | +2. **Follow the approved plan**; if you discover a material deviation, pause and ask before continuing. |
| 51 | +3. **Implement in small increments** when possible; run validation as you go. |
| 52 | +4. **Evaluate** against acceptance criteria: run tests, note manual spot-checks for the human. |
| 53 | +5. **Hand off** with the standard checklist (changes, checks, CI status, risks). |
| 54 | + |
| 55 | +## Optional Cursor Agent Window Roles |
| 56 | + |
| 57 | +When using parallel agents, map roles to phases: |
| 58 | + |
| 59 | +| Role | Phase | Responsibility | |
| 60 | +|------|-------|----------------| |
| 61 | +| Planner | 1 | Expand prompt into spec + acceptance criteria; human approves | |
| 62 | +| Builder | 2 | Implement approved plan | |
| 63 | +| Evaluator | 2 | Run tests/checks; compare results to acceptance criteria | |
| 64 | + |
| 65 | +One agent can cover Builder + Evaluator; Phase 1 still requires human approval before Builder starts. |
0 commit comments