| name | plan-optimization |
| description | Use when hypotheses have been generated and need to be converted into an executable stage plan. Produces a standard stage plan that /build-app executes unchanged. |
Plan Optimization
Convert batched hypotheses from /generate-hypotheses into a standard stage plan. The output uses the exact stage-plan.md template format so /build-app executes it without modification.
Instructions
CRITICAL — NON-INTERACTIVE: Execute all steps without pausing. Never ask questions, request confirmation, or wait for input. Read state, plan, write output, update state, stop.
Step 0: Initialize
-
Read factory/evolution-state.json:
- Verify status is
"planning"
- Set
CYCLE to current_cycle
- If status is not
"planning", display error and stop
-
Read the latest hypotheses file:
- Find the most recent
factory/hypotheses/hyp-{CYCLE}-*.json
- Extract the
batched: true hypotheses
-
Read project context:
CLAUDE.md — project name, stack, conventions
- Current source files referenced in hypothesis
implementation_sketch
Step 1: Expand Implementation Sketches
For each batched hypothesis, expand the implementation_sketch into full task specifications:
- Read the actual source files listed in
pages_affected and