diff options
| author | soryu <soryu@soryu.co> | 2026-02-01 00:51:12 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-01 00:51:12 +0000 |
| commit | 15d680a8a3c22be03a8faacd7bd43214e62a37f4 (patch) | |
| tree | f96e693b5e18ac4648e45a3d934d89a88f385408 /makima/src/daemon | |
| parent | 7567153e6281b94e39e52be5d060b381ed69597d (diff) | |
| download | soryu-15d680a8a3c22be03a8faacd7bd43214e62a37f4.tar.gz soryu-15d680a8a3c22be03a8faacd7bd43214e62a37f4.zip | |
fix(supervisor): ensure all implementation phases are executed before PR (#53)
Previously the supervisor would implement only the first phase of a
multi-phase plan and then create a PR. This change updates the supervisor
system prompt to explicitly instruct it to:
1. Read and parse plan documents for multiple implementation phases
2. Execute phases sequentially
3. Track completion of each phase
4. Only create PR after ALL phases are complete
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'makima/src/daemon')
| -rw-r--r-- | makima/src/daemon/task/manager.rs | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/makima/src/daemon/task/manager.rs b/makima/src/daemon/task/manager.rs index d246ac8..e0437ce 100644 --- a/makima/src/daemon/task/manager.rs +++ b/makima/src/daemon/task/manager.rs @@ -770,6 +770,82 @@ The ask command will block until the user responds (or timeout). Use this to: ### For "Specification" contracts (Research → Specify → Plan → Execute → Review): Progress through each phase, spawning tasks as needed and asking for user feedback. +## Multi-Phase Plan Execution (CRITICAL) + +Plan documents often contain MULTIPLE implementation phases (e.g., "Phase 1: Foundation", "Phase 2: Core Features", "Phase 3: Integration"). You MUST implement ALL phases, not just the first one! + +### Detecting Implementation Phases + +At the START of the Execute phase: +1. Read the plan document using `makima contract files` and `makima contract file <id>` +2. Look for implementation phase sections like: + - "## Phase 1: ..." / "## Phase 2: ..." + - "## Step 1: ..." / "## Step 2: ..." + - "## Part 1: ..." / "## Part 2: ..." + - Any numbered sections that represent sequential work +3. Create a mental list of ALL implementation phases that need to be completed + +### Executing Multi-Phase Plans + +1. **Execute phases SEQUENTIALLY** - complete ALL tasks for Phase 1 before starting Phase 2 +2. **Track your progress** - keep track of which phases are done vs remaining +3. **Confirm between phases** - use `makima supervisor ask` to confirm: "Phase N complete. Ready for Phase N+1?" +4. **ONLY create PR when ALL phases are done** - DO NOT create a PR after just the first phase! + +### Multi-Phase Workflow Example + +```bash +# 1. First, read the plan to understand all phases +makima contract files # List files to find plan document +makima contract file <plan-file-id> # Read the plan content + +# 2. Identify phases (example shows 3 phases) +# Found: +# - Phase 1: Setup and Dependencies +# - Phase 2: Core Implementation +# - Phase 3: Testing and Documentation + +# 3. Execute Phase 1 completely +makima supervisor spawn "Phase 1: Setup" "Details from plan..." +makima supervisor wait <task_id> +makima supervisor merge <task_id> --to "makima/feature-name" + +# 4. Confirm before moving to Phase 2 +makima supervisor ask "Phase 1 (Setup) complete. Ready to proceed to Phase 2 (Core Implementation)?" --choices "Yes,Need changes,Stop" + +# 5. Execute Phase 2 completely +makima supervisor spawn "Phase 2: Core Implementation" "Details from plan..." +makima supervisor wait <task_id> +makima supervisor merge <task_id> --to "makima/feature-name" + +# 6. Confirm before Phase 3 +makima supervisor ask "Phase 2 (Core Implementation) complete. Ready to proceed to Phase 3 (Testing)?" --choices "Yes,Need changes,Stop" + +# 7. Execute Phase 3 +makima supervisor spawn "Phase 3: Testing" "Details from plan..." +makima supervisor wait <task_id> +makima supervisor merge <task_id> --to "makima/feature-name" + +# 8. ONLY NOW create the PR (all phases complete!) +makima supervisor pr "makima/feature-name" --title "Complete feature implementation" +``` + +### Common Multi-Phase Mistakes + +- ❌ Creating a PR after only the first phase completes +- ❌ Not reading the plan document to identify all phases +- ❌ Trying to implement all phases in a single giant task +- ❌ Skipping the confirmation step between phases + +### Correct Multi-Phase Behavior + +- ✅ Read plan document first to identify ALL implementation phases +- ✅ Execute each phase as separate task(s) +- ✅ Wait for each phase to complete before starting the next +- ✅ Confirm with user between phases +- ✅ Create PR ONLY after ALL phases are complete +- ✅ The PR title/description should mention all completed phases + ## Phase Management Commands Check contract status (including current phase): |
