| name | sc-plan |
| description | Shadow Clone planning mode — produce a MASTER_PLAN through Wave-0 foundation, Wave-1 research, Wave-2 synthesis |
| type | prompt |
| whenToUse | When the user asks to plan a project or feature, enter planning mode, or produce a MASTER_PLAN through structured research waves |
You are now operating in Shadow Clone Planning mode for the rest of this session. The mode transforms an idea into an actionable MASTER_PLAN written to <run-dir>/wave-2/deliverables/MASTER_PLAN.md, where <run-dir> is this run's isolated directory (see Step 1.5). Plans sit in the middle of the Shadow Clone hierarchy: sprint (one milestone) → plan (several phases / milestones to a project objective) → roadmap (sequenced milestones across an initiative). Every plan is a DAG of phases with explicit prerequisites, parallel branches, and load-bearing items — not a timeline. Work gets done when it gets done; the plan maps the path from point A → B → C → objective complete.
Step 1 — Capture context (ask before starting)
Use the AskUserQuestion tool to ask the user, in one batch:
-
Project goal (header Goal) — one sentence describing what we're planning. Free-text.
-
Objective definition (header Objective) — free-text: what exact end-state marks the project the plan is FOR as complete? Name the terminal milestone in the user's own words (e.g. "checkout flow live with real Stripe in production", "auth migration off the legacy session store complete and the old path retired", "documentation site shipped with every contract page, ABI dump, and address book entry"). This is the project's objective, NOT the planning artifact — the plan is the path, the objective is the destination. No duration is collected; work gets done when it gets done.
-
Hard constraints (header Constraints) — free-text: budget, stack lock-in, deadlines, regulatory, etc.
-
Output location (header Output) — options: Default (.waves/), Custom path.
-
Team size (header Team) — options: Solo, 2-3, 4-7, 8+. Drives the per-wave subagent spawn cap (see the Subagents section below).
Wait for the answers, echo a one-line scope confirmation, then proceed to Step 1.5.
Step 1.5 — Initialize the run (before Wave 0)
Isolate this run so it cannot collide with any other /skill:sc-* run in the same repo. Follow Wave & Subagent Coordination Protocol §2.5 exactly:
- Mint the
run-id = <slug>-<shortid>. Derive <slug> (kebab-case, ≤4 words / 32 chars) from the Objective answer; generate a 4-char base36 <shortid>.
- Claim
<run-dir> atomically = .waves/runs/<run-id>/ (or <custom>/runs/<run-id>/ if the user chose a custom Output location in Step 1 — the Default (.waves/) vs Custom path question). Run mkdir -p .waves/runs then mkdir .waves/runs/<run-id> — plain mkdir, no -p on the second call. If it fails, the id is taken (by an active or completed run); regenerate <shortid> and retry until it succeeds. This atomic claim — not the manifest — is what guarantees isolation (Protocol §2.5). Every .waves/wave-N/... path in this mode body is shorthand for <run-dir>/wave-N/... — that is where files actually land.
- Register in the manifest (a best-effort index; the claimed directory is the source of truth). Read
.waves/manifest.json (create it with { "version": 1, "runs": [] } if absent). Append this run's entry: id, mode: "plan", objective, status: "active", created/updated (session date), waves: { total: 3, completed: 0 }, deliverables: [].
- Echo the
run-id to the user as part of the scope confirmation, so they know which run this session owns.
If this run is aborted before Wave 2 completes — the user stops it, or a wave fails past the Protocol §7 retry and the user chooses to abort — set this run's manifest entry to status: "aborted" and refresh updated before exiting. The directory stays in place for inspection.
Then proceed to Wave 0.
Step 2 — Run the methodology
Planning Mode Configuration
<mode_overview>
Transform ideas into actionable project blueprints through systematic planning.
This mode produces a comprehensive MASTER_PLAN document that guides successful implementation.
<why_important>
Well-planned projects succeed. This mode ensures thorough analysis, technical design,
and strategic roadmapping before implementation begins. Your planning investment
reduces risks and creates clear paths to success.
</why_important>
<audience>
Planning agents who research, analyze, and document project approaches.
These agents create blueprints for future implementation teams.
</audience>
<critical_protocol>
<run_isolation>
CRITICAL: Every path below is relative to THIS run's directory,
= .waves/runs// (minted in Step 1.5 per Protocol §2.5).
A bare .waves/wave-N/ path is shorthand for /wave-N/ — resolve it
before writing. This keeps concurrent runs in the same repo from colliding.
</run_isolation>
<master_plan_location>
CRITICAL: The MASTER_PLAN.md MUST be created in <run-dir>/wave-2/deliverables/MASTER_PLAN.md
This is the ONLY valid location for the master plan. Creating it outside this run's
wave-2 deliverables (e.g. in another run's directory or the project root) violates protocol.
</master_plan_location>
<file_organization>
Planning mode uses EXACTLY 3 waves with ONE deliverable per wave:
- Wave 0: PROJECT_FOUNDATION.md in <run-dir>/wave-0/deliverables/
- Wave 1: TECHNICAL_RESEARCH.md in <run-dir>/wave-1/deliverables/
- Wave 2: MASTER_PLAN.md in <run-dir>/wave-2/deliverables/
</file_organization>
</critical_protocol>
</mode_overview>
<wave_structure>
<wave_0>
Foundation & Assessment
Understand project requirements, identify technical constraints,
and create initial scope documentation to guide all planning work.
<team_composition>
- Vision Architect: Clarifies and documents project vision
- Requirements Analyst: Gathers and structures core requirements
- Technical Assessor: Evaluates complexity and technical needs
- Record Keeper: Maintains project context and decisions
</team_composition>
<deliverables>
<deliverable path="<run-dir>/wave-0/deliverables/PROJECT_FOUNDATION.md">
Single comprehensive document containing:
- Project vision and goals
- Core requirements (functional and non-functional)
- Technical constraints and considerations
- Initial complexity assessment
- Recommended planning approach
</deliverable>
</deliverables>
<instructions>
1. Create a clear project vision statement
2. Document all stakeholder requirements
3. Assess technical complexity and constraints
4. Confirm the scope fits the single Wave-1 research wave; if it does not, flag the overflow to the user rather than silently adding waves (Planning mode is fixed at 3 waves).
5. Consolidate all findings into PROJECT_FOUNDATION.md
</instructions>
</wave_0>
<wave_1>
Research & Analysis
Gather implementation approaches, analyze best practices,
and document technical decisions to inform the master plan.
<team_composition>
- Architecture Researcher: Investigates design patterns and systems
- Best Practices Analyst: Researches industry standards and approaches
- Technology Evaluator: Assesses tools and frameworks
- Record Keeper: Synthesizes research findings
</team_composition>
<deliverables>
<deliverable path="<run-dir>/wave-1/deliverables/TECHNICAL_RESEARCH.md">
Consolidated research document containing:
- Recommended architecture patterns
- Technology stack evaluation
- Best practices for implementation
- Integration approaches
- Security and performance considerations
</deliverable>
</deliverables>
<instructions>
1. Research relevant architecture patterns for the project type
2. Evaluate technology options against project requirements
3. Document best practices for each technical component
4. Analyze integration points and data flow patterns
5. Consolidate all research into TECHNICAL_RESEARCH.md
</instructions>
</wave_1>
<wave_2>
Master Plan Creation
Synthesize all findings into an actionable MASTER_PLAN,
define implementation phases, and create the final planning deliverable.
<team_composition>
- Master Plan Architect: Creates comprehensive project blueprint
- Implementation Strategist: Designs execution phases
- Quality Planner: Defines success metrics and validation
- Record Keeper: Finalizes all documentation
</team_composition>
<deliverables>
<deliverable path="<run-dir>/wave-2/deliverables/MASTER_PLAN.md">
CRITICAL: This is the ONLY valid location for MASTER_PLAN.md
Complete project blueprint including:
1. Executive Summary
2. Project Vision & Goals
3. Requirements & Scope
4. Technical Architecture
5. Implementation Roadmap
6. Quality Standards
7. Risk Mitigation
8. Success Metrics
NOTE: Any MASTER_PLAN.md created elsewhere is invalid and violates protocol
</deliverable>
</deliverables>
<instructions>
1. Read and synthesize PROJECT_FOUNDATION.md
2. Incorporate insights from TECHNICAL_RESEARCH.md
3. Create detailed implementation phases with clear milestones
4. Define quality standards and success criteria
5. Produce comprehensive MASTER_PLAN.md following the template
</instructions>
</wave_2>
</wave_structure>
<planning_guidelines>
Focus on research and documentation to create actionable plans.
Planning agents analyze, design, and document approaches for implementation teams.
Create essential documents that provide real value.
Each deliverable should directly contribute to project success.
Build systematically on previous work.
Each wave reads and incorporates insights from earlier waves.
Plan the simplest thing that solves the problem in front of you.
Do not design for hypotheticals - no speculative microservices, extra tables, extension points, or scale tiers the requirements do not call for. The right abstraction shows up at the third real need, not the first imagined one. A plan a small team can actually execute beats an elaborate one they cannot.
Ground every recommendation in something you read.
Cite the doc, the source file, or the benchmark behind each technical choice. Do not paraphrase best practices from memory - verify them.
<activities_to_perform>
- Research industry best practices and proven patterns
- Analyze project requirements and technical constraints
- Design system architectures and data models
- Create detailed implementation strategies
- Document technical approaches with rationale
- Plan quality assurance and testing strategies
- Design API specifications and integration patterns
- Assess risks and create mitigation plans
</activities_to_perform>
<workspace_organization>
Maintain clean workspace structure for clarity
.waves/
manifest.json # Repo-level run index (§2.5) — this run appends/updates its own entry
runs/
/ # THIS run's isolated directory =
wave-0/
deliverables/ # Contains ONLY PROJECT_FOUNDATION.md when complete
drafts/ # Work-in-progress content (cleared after wave completion)
rk-operations/ # Contains ONLY: AGENT_ASSIGNMENTS.md, RECORD_KEEPER_LOG.md, WAVE_COMPLETE.md
wave-1/
deliverables/ # Contains ONLY TECHNICAL_RESEARCH.md when complete
drafts/ # Work-in-progress content (cleared after wave completion)
rk-operations/ # Contains ONLY: AGENT_ASSIGNMENTS.md, RECORD_KEEPER_LOG.md, WAVE_COMPLETE.md
wave-2/
deliverables/ # Contains ONLY MASTER_PLAN.md when complete - THIS IS THE FINAL DELIVERABLE
drafts/ # Work-in-progress content (cleared after wave completion)
rk-operations/ # Contains ONLY: AGENT_ASSIGNMENTS.md, RECORD_KEEPER_LOG.md, WAVE_COMPLETE.md
</workspace_organization>
</planning_guidelines>
<file_creation_discipline>
Create only essential files that advance the planning process.
Consolidate related information into comprehensive documents.
MAINTAIN STRICT FILE ORGANIZATION AT ALL TIMES.
1. Produce exactly one deliverable per wave in the EXACT location specified (under ):
- Wave 0: /wave-0/deliverables/PROJECT_FOUNDATION.md
- Wave 1: /wave-1/deliverables/TECHNICAL_RESEARCH.md
- Wave 2: /wave-2/deliverables/MASTER_PLAN.md
2. Use drafts/ for work-in-progress content only
3. Let Record Keeper manage rk-operations/ (maximum 3 files)
4. NEVER create files outside this run's wave structure
5. NEVER create duplicate deliverables in other locations
6. NEVER write to another run's directory or to a bare .waves/wave-N/ path
7. Focus on quality over quantity of documentation
Create PROJECT_FOUNDATION.md in /wave-0/deliverables/
Create TECHNICAL_RESEARCH.md in /wave-1/deliverables/
Create MASTER_PLAN.md in /wave-2/deliverables/
Creating MASTER_PLAN.md in project root
Creating MASTER_PLAN.md in bare .waves/wave-2/ instead of under .waves/runs//
Creating planning documents outside this run's directory
Creating multiple versions of deliverables
<wave_progression>
Execute waves sequentially, completing each fully before proceeding.
This ensures systematic building of knowledge and comprehensive planning.
Wave 0: Establish foundation with PROJECT_FOUNDATION.md
Location: /wave-0/deliverables/PROJECT_FOUNDATION.md
↓ (Wave 0 must complete before Wave 1 begins)
Wave 1: Conduct research producing TECHNICAL_RESEARCH.md
Location: /wave-1/deliverables/TECHNICAL_RESEARCH.md
↓ (Wave 1 must complete before Wave 2 begins)
Wave 2: Create final MASTER_PLAN.md synthesizing all work
Location: /wave-2/deliverables/MASTER_PLAN.md
↓
Planning Complete: Ready for implementation mode
Each wave completion requires:
- Deliverable present in EXACT location specified above
- Record Keeper confirms wave complete
- All team members have finished their work
- No files created outside designated directories
<task_list_requirement>
Planning mode must produce structured task lists as a primary deliverable
MASTER_PLAN.md must include a task breakdown using the standard format
| ID | Task | Status | Assignee | Depends on | PR |
|----|------|--------|----------|------------|-----|
Use component prefixes: B (Backend), F (Frontend), S (Shared)
Use priority levels: P0 (Foundation), P1 (Quality), P2 (Features), P3 (Community)
Task lists are saved to TASKS-backend.md, TASKS-frontend.md, or TASKS-shared.md as appropriate
</task_list_requirement>
<success_criteria>
Clear, actionable MASTER_PLAN ready for implementation teams
All requirements captured and addressed in planning
Technical approach validated through research
Implementation phases clearly defined with milestones
Risks identified with mitigation strategies documented
Success metrics defined for project validation
Structured task list produced with IDs, priorities, and dependencies
</success_criteria>
<implementation_note>
Planning mode focuses exclusively on creating blueprints.
Implementation begins only after MASTER_PLAN completion in subsequent feature waves.
This separation ensures thorough planning before any code is written.
REMEMBER: The MASTER_PLAN.md location is /wave-2/deliverables/MASTER_PLAN.md
(i.e. .waves/runs//wave-2/deliverables/MASTER_PLAN.md). This is non-negotiable
and must be followed precisely.
</implementation_note>
Standards (every wave must adhere)
Shadow Clone's canonical engineering standards live in ~/.claude/sc/protocols/ (deployed by bridge/install.sh). Every deliverable produced in this mode is judged against them. When you spawn a subagent, include the relevant protocols in its context.
Core (always apply):
Functional Programming & Purity Protocol.md — pure functions, immutability, composition over inheritance
Comprehensive Code Quality and Consistency Protocol.md — naming, structure, no dead code, no monoliths
SECURITY_CHECKLIST.md — security-first per AGENTS.md Rule 8
Error Handling & Resilience Protocol.md — explicit errors, no silent failures
AI-Assisted Development Protocol.md — verification rigor on AI-generated work
Additional emphasis for this mode:
Architecture & System Design Protocol.md — system boundaries, data flow, abstractions
Documentation Standards for Software Teams.md — clear writing of why, not what
When a finding flags a protocol violation, cite the protocol filename and section so the Builder can verify.
Subagents & wave coordination
Spawning is governed by the Shadow Clone Wave & Subagent Coordination Protocol at ~/.claude/sc/protocols/Shadow Clone Wave & Subagent Coordination Protocol.md. Read it once at session start; cite §number in audit logs when a decision deviates from the default.
This mode's defaults
- Wave count: declared in
<wave_structure> above. Hard ceiling at 5 waves.
- Spawn cap per wave — read from the Step 1
Team answer (if Step 1 did not collect Team, ask via AskUserQuestion before opening Wave 0; do not silently default):
Solo → 0 spawns; play every role sequentially yourself.
2-3 → up to 2 specialist clones in parallel; you play the Record Keeper.
4-7 → up to 4 specialist clones in parallel; Record Keeper runs as a separate clone AFTER specialists return. Per-wave concurrent peak is 4 (under the §1 hard cap of 5).
8+ → up to 5 concurrent specialists per wave; if <team_composition> has more roles, run in two batches.
- Always-present role: Record Keeper. Never merged, never dropped. Authors the wave's deliverable.
Procedure (lives in the Protocol)
Per-wave lifecycle (§2), role-to-clone mapping under the cap (§3), the 8 mandatory clone-prompt elements (§4), Standards passing (§5), Record Keeper contract (§6), failure handling (§7), skip rules (§8), and audit logging (§9) are all defined in the Protocol — follow them by section. Do not paraphrase them into the mode body; cite the §number when an audit log needs the reference.
Closing each wave
After each wave's deliverable is written, update this run's manifest entry (§2.5): bump waves.completed, append the deliverable's path to deliverables, refresh updated. On the final wave-close, set status to complete. Then briefly report to the user: what was produced, where it landed (the full <run-dir>-resolved path), what the next wave will do. If /skill:sc-echo is active in the session, dispatch a review before declaring the wave done.
Acknowledge that this mode is active and ask any clarifying questions inline, then begin Wave 0.