Generate the greenfield execution plan plus root and scoped AGENTS.md files. Use after /technical-spec to create the phased task breakdown.
Generate the execution plan and agent guidelines for the current project.
Copy this checklist and track progress:
Generate Plan Progress:
- [ ] Step 1: Directory guard
- [ ] Step 2: Check prerequisites (plans/greenfield specs)
- [ ] Step 3: Check for toolkit setup
- [ ] Step 4: Check for existing output files
- [ ] Step 5: Process specs into task breakdown
- [ ] Step 6: Create root and scoped CLAUDE.md files (if missing)
- [ ] Step 7: Verify plan completeness
- [ ] Step 8: Review and refine with user
- [ ] Step 9: Suggest next step (/fresh-start)
.toolkit-marker exists in the current working directory → STOP:
"You're in the toolkit repo. Run this from your project directory instead:
cd ~/Projects/your-project && /generate-plan"Before generating any files, confirm the output location with the user:
Will write:
- `AGENTS.md` to: {absolute path of cwd}/
- planning docs to: {absolute path of cwd}/plans/greenfield/
Continue? (Yes / Change directory)
If the user says "Change directory", ask for the correct path and instruct them to cd there first.
plans/greenfield/PRODUCT_SPEC.md first.PRODUCT_SPEC.md in the current directory.plans/greenfield/TECHNICAL_SPEC.md first.TECHNICAL_SPEC.md in the current directory.plans/greenfield/ before proceeding so the project adopts the canonical layout./product-spec and /technical-spec first."Check if .claude/toolkit-version.json exists in the current directory:
Toolkit not initialized in this project. Execution skills (/fresh-start,
/phase-start, etc.) won't be available after plan generation.
Recommended: Run /setup from the toolkit first to install execution skills.
Continue with plan generation anyway? (Yes / Run /setup first)
If user says "Run /setup first", stop and instruct them to run /setup from the toolkit directory.
If user says "Yes", continue — spec generation will work, but they'll need /setup before execution.Before generating anything, ensure plans/greenfield/ exists, then check whether any output files already exist:
AGENTS.md
plans/greenfield/EXECUTION_PLAN.md
plans/greenfield/AGENTS.md
If none exist: continue normally.
If one or more exist: STOP and ask the user what to do for the existing file(s):
{path}.bak.YYYYMMDD-HHMMSS, then write the new document(s) to the original path(s)Read .claude/skills/generate-plan/PROMPT.md and follow its instructions exactly:
plans/greenfield/AGENTS.md with durable project-wide workflow guidelinesplans/greenfield/AGENTS.md with greenfield execution-specific guidanceWrite these files:
AGENTS.mdplans/greenfield/EXECUTION_PLAN.mdplans/greenfield/AGENTS.mdIf CLAUDE.md does not exist in the current directory, create it with:
@AGENTS.md
If it already exists, do not overwrite it.
If plans/greenfield/CLAUDE.md does not exist, create it with:
@AGENTS.md
If it already exists, do not overwrite it.
--lean)When --lean is passed:
/verify-spec, /codex-consult, or /criteria-audit. Report each as LEAN_SKIP in the output.--lean)These gates MUST execute before you produce the "Next Step" output. The output template requires results from each gate. Reporting SKIPPED without --lean is a skill violation — go back and run the gate.
Count the lines in the generated root AGENTS.md:
Thresholds:
AGENTS.mdIf WARN or FAIL, offer to help split the file before proceeding.
Run the spec-verification workflow:
.claude/skills/spec-verification/SKILL.md for the verification processTECHNICAL_SPEC.md and PRODUCT_SPEC.md appear as tasks or acceptance criteriaIMPORTANT: Do not proceed to Gate 3 until verification passes or user explicitly chooses to proceed with noted issues.
Run /criteria-audit plans/greenfield to validate verification metadata in plans/greenfield/EXECUTION_PLAN.md.
After verification passes, run cross-model review if Codex CLI is available:
codex --version/codex-consult with upstream contextConsultation invocation:
/codex-consult --upstream plans/greenfield/TECHNICAL_SPEC.md --research "execution planning, task breakdown" plans/greenfield/EXECUTION_PLAN.md
If Codex finds issues:
If Codex CLI is not installed or not authenticated: Report UNAVAILABLE (not SKIPPED — the distinction matters).
| Situation | Action |
|---|---|
PRODUCT_SPEC.md or TECHNICAL_SPEC.md not found in plans/greenfield/ or project root | Stop and report which file is missing with instructions to generate it |
PROMPT.md not found at .claude/skills/generate-plan/PROMPT.md | Stop and report "Skill asset missing — reinstall toolkit or run /setup" |
AGENTS_TEMPLATE.md not found at .claude/skills/generate-plan/AGENTS_TEMPLATE.md | Stop and report "Skill asset missing — reinstall toolkit or run /setup" |
PLAN_AGENTS_TEMPLATE.md not found at .claude/skills/generate-plan/PLAN_AGENTS_TEMPLATE.md | Stop and report "Skill asset missing — reinstall toolkit or run /setup" |
| Contradictions between specs | Stop and list contradictions. Ask user to resolve before continuing |
| Codex CLI invocation fails or times out | Log the error, skip cross-model review, proceed to Next Step |
Pre-condition: All gates above have completed, or --lean was explicitly passed. If you have not run them, STOP and run them now. Reporting SKIPPED without --lean is a skill violation.
When complete, inform the user:
Root AGENTS.md plus greenfield plan files created and verified.
AGENTS.md Size: PASS | WARN | LEAN_SKIP
Verification: PASSED | PASSED WITH NOTES | NEEDS REVIEW | LEAN_SKIP
Criteria Audit: PASSED | WARN | LEAN_SKIP
Cross-Model Review: PASSED | PASSED WITH NOTES | UNAVAILABLE | LEAN_SKIP
Your project is ready for execution:
1. cd plans/greenfield
2. /fresh-start
3. /configure-verification
4. /phase-prep 1
5. /phase-start 1