Create a phased implementation plan with subtasks, dependencies, and verification criteria. Reads spec.md if available, outputs plan.json.
From workflownpx claudepluginhub moonsite/moonsite-claude-extensions --plugin workflow/planRestates requirements, assesses risks and blockers, creates step-by-step implementation plan with phases and estimates, and waits for user confirmation before coding.
/planStarts Manus-style file-based planning: creates task_plan.md, findings.md, progress.md if missing, invokes planning skill, and guides through workflow.
/planBreaks project into small verifiable tasks with acceptance criteria, dependencies, checkpoints. Reads spec/codebase, presents plan for review, saves to tasks/plan.md and tasks/todo.md.
/planLaunches interactive 7-step wizard to build Scope, Metrics, Direction, and Verification from a goal description.
/planRestates requirements, assesses risks and dependencies, creates phased step-by-step implementation plan with complexity estimates, and waits for user confirmation before coding.
/planCaptures user intent via 5 structured questions, creates strategic execution plan, saves to .claude/session-plan.md and session-intent.md for review.
You create a subtask-based implementation plan that defines what to build, in what order, and how to verify each step. The output is a plan.json file that downstream agents or developers execute against.
Key Principle: Subtasks, not tests. Implementation order matters. Each subtask is a scoped unit of work with explicit files and verification.
MANDATORY: You MUST call the Write tool to create plan.json. Describing the plan in your text response does NOT count — the file must exist on disk.
Determine where to find task information:
If a task slug was provided (e.g., /plan add-user-auth):
.workflow/tasks/{slug}/spec.md if it exists (preferred — richest context)assessment.json if no specIf no slug was provided (/plan):
.workflow/tasks/Read project context:
.workflow/project_context.json for tech stack, test commands, and conventionsIf no spec exists and no task directory exists:
SKIP this step if ANY of these exist (check in order):
.workflow/tasks/{slug}/investigation.json— cached investigation from/spec(PREFERRED — load this instead of re-investigating)spec.mdalready contains investigation findings (file lists, patterns, conventions)If either exists, read it and jump to Step 3.
If no spec AND no cached investigation exists, you MUST investigate before planning:
Use Glob to discover the project layout:
**/*.ts, **/*.tsx, **/*.py, **/*.js, **/*.go, **/*.rs — find source files**/package.json, **/pyproject.toml, **/Cargo.toml, **/go.mod — find project configs**/tsconfig.json, **/.env.example, **/docker-compose*.yml — find configurationIdentify:
This is the most important step. For whatever you're building, find SIMILAR existing implementations:
Use Grep to search for related patterns:
Use Read to examine matching files in detail.
YOU MUST READ AT LEAST 3 PATTERN FILES before planning:
Before creating the plan, note:
If you skip this step, your plan will reference wrong files and miss existing patterns.
Determine the workflow type from the spec (if available) or from the nature of the task, then apply the matching phase structure:
For new features, enhancements, or additions:
| Phase | Name | Purpose |
|---|---|---|
| 1 | Backend/API | Endpoints, data models, business logic |
| 2 | Workers/Services | Background jobs, integrations (if applicable) |
| 3 | Frontend/UI | Components, pages, state management (if applicable) |
| 4 | Integration | Wire everything together, end-to-end verification |
Skip phases that don't apply (e.g., skip Workers if there are none, skip Frontend for API-only features).
For restructuring, re-architecting, or replacing existing systems:
| Phase | Name | Purpose |
|---|---|---|
| 1 | Add New | Build new system alongside old |
| 2 | Migrate | Move consumers to new system |
| 3 | Remove Old | Delete deprecated code |
| 4 | Cleanup | Polish, verify, update docs |
For bug hunting, debugging, performance issues:
| Phase | Name | Purpose |
|---|---|---|
| 1 | Reproduce | Create reliable reproduction, add logging |
| 2 | Investigate | Analyze, form hypotheses, document root cause |
| 3 | Fix | Implement solution (BLOCKED until Phase 2 completes) |
| 4 | Harden | Add tests, monitoring, prevent recurrence |
For data migrations, version upgrades, platform moves:
| Phase | Name | Purpose |
|---|---|---|
| 1 | Prepare | Write scripts, setup target |
| 2 | Test | Small batch, verify correctness |
| 3 | Execute | Full migration |
| 4 | Cleanup | Remove old, verify, update config |
For small, single-concern tasks (config change, single file fix, docs update):
Build subtasks within each phase following these quality rules:
description.patterns_from: Reference files to copy patterns from.files_to_modify and files_to_create: No ambiguity about what changes.ONLY these 6 verification types are valid. Do NOT invent others.
| Type | When to Use | Format |
|---|---|---|
command | CLI verification, running tests | {"type": "command", "command": "npm test", "expected": "All tests pass"} |
api | REST endpoint testing | {"type": "api", "method": "GET", "url": "http://localhost:3000/api/users", "expected_status": 200} |
browser | UI rendering checks | {"type": "browser", "url": "http://localhost:3000/page", "checks": ["renders", "no errors"]} |
e2e | Full flow verification | {"type": "e2e", "steps": ["Step 1", "Step 2"]} |
manual | Human judgment, code review | {"type": "manual", "instructions": "Verify X by doing Y"} |
none | No verification needed | {"type": "none"} |
Do NOT use types like code_review, component, test, lint, build. Use manual for human review, command for running tests/linters/builds.
Use the project's actual test command from project_context.json in verification steps (e.g., npm test, pytest, go test ./...).
Investigation subtasks output knowledge, not just code:
{
"id": "subtask-investigate-1",
"title": "Identify memory leak root cause",
"description": "Profile heap allocations and analyze retention paths.",
"expected_output": "Root cause document with evidence and proposed fix",
"files_to_modify": [],
"files_to_create": [],
"patterns_from": [],
"verification": {
"type": "manual",
"instructions": "Review root cause analysis for completeness"
},
"status": "pending"
}
Refactor subtasks must preserve existing behavior:
{
"id": "subtask-refactor-1",
"title": "Add new auth system alongside old",
"description": "Create new auth module. Old auth must continue working.",
"files_to_modify": ["src/auth/index.ts"],
"files_to_create": ["src/auth/new-auth.ts"],
"patterns_from": ["src/auth/old-auth.ts"],
"verification": {
"type": "command",
"command": "npm test -- --grep auth",
"expected": "All tests pass"
},
"status": "pending"
}
After defining phases, determine which can run concurrently:
Two phases can run in parallel if:
depends_on arraysfiles_to_modify or files_to_createConservative default: If unsure, recommend 1. Parallel execution adds complexity.
Use the Write tool to create plan.json in .workflow/tasks/{slug}/.
{
"feature": "Short descriptive name",
"workflow_type": "feature|refactor|investigation|migration|simple",
"workflow_rationale": "Why this workflow type was chosen",
"phases": [
{
"id": "phase-1-backend",
"name": "Backend API",
"type": "implementation",
"description": "Build the REST API endpoints",
"depends_on": [],
"parallel_safe": true,
"subtasks": [
{
"id": "subtask-1-1",
"title": "Create user data models",
"description": "Detailed implementation notes referencing patterns from existing-model.ts. Include fields for name, email, role. Add migration.",
"files_to_modify": ["src/models/index.ts"],
"files_to_create": ["src/models/user.ts"],
"patterns_from": ["src/models/existing-model.ts"],
"verification": {
"type": "command",
"command": "npm test -- --grep user",
"expected": "All tests pass"
},
"status": "pending"
}
]
}
],
"verification_strategy": {
"risk_level": "low|medium|high|critical",
"test_types_required": ["unit", "integration"],
"security_scan_required": false,
"reasoning": "Why this validation depth was chosen"
},
"summary": {
"total_phases": 0,
"total_subtasks": 0,
"parallelism": {
"max_parallel_phases": 1,
"parallel_groups": [
{
"phases": ["phase-2-worker", "phase-3-frontend"],
"reason": "Both depend only on phase-1, different file sets"
}
],
"recommended_workers": 1
}
}
}
Use ONLY these values for the type field in phases:
| Type | When to Use |
|---|---|
setup | Project scaffolding, environment setup |
implementation | Writing code (most phases use this) |
investigation | Debugging, analyzing, reproducing issues |
integration | Wiring components together, end-to-end verification |
cleanup | Removing old code, polish, deprecation |
Do NOT use service names as phase types (e.g., not backend, frontend, worker). Use the phase name and description to indicate the domain; the type describes the nature of the work.
Determine the appropriate depth of verification based on risk:
| Risk Level | Test Requirements | Security Scan |
|---|---|---|
| low | Unit tests only | No |
| medium | Unit + Integration tests | No |
| high | Unit + Integration + E2E | Yes |
| critical | Full test suite + Manual review | Yes |
If assessment.json exists and contains a risk_level, use that. Otherwise, assess based on:
After writing plan.json, print a summary:
/implement to start executing subtasks" or "Run /status to see the plan overview"plan.json.setup, implementation, investigation, integration, cleanup. NOT service names.depends_on arrays.project_context.json in verification steps./spec — The plan is better with a spec, but it must work standalone by doing inline investigation..workflow/ is for local workflow state.--extend)When the user runs /plan --extend [slug], you are adding NEW work to a completed plan — not replacing it.
The user has completed all subtasks in a plan and wants to iterate: add features, extend functionality, or address follow-up work — without creating a whole new spec/plan cycle.
Step E1: Load existing plan
.workflow/tasks/{slug}/plan.jsonStep E2: Understand what to add
spec.md and memory/patterns.md for context on what was already builtStep E3: Categorize the extension
Is this:
Step E4: Create new phase(s)
{
"id": "phase-5-followup",
"name": "Follow-Up: [Brief Name]",
"type": "implementation",
"description": "[What this phase accomplishes]",
"depends_on": ["phase-4-integration"],
"parallel_safe": false,
"subtasks": [
{
"id": "subtask-5-1",
"title": "Short description",
"description": "Detailed notes — reference files created in earlier phases",
"files_to_modify": ["file-from-phase-2.ts"],
"files_to_create": [],
"patterns_from": ["file-from-phase-2.ts"],
"verification": { "type": "command", "command": "npm test", "expected": "All pass" },
"status": "pending"
}
]
}
Key: new subtasks should reference files from earlier phases in patterns_from to maintain consistency.
Step E5: Update plan.json
Rewrite plan.json with:
phases arraysummary with new totalsqa_signoff set to null (needs re-validation)Step E6: Announce
Follow-up planning complete.
Added: [N] new phase(s), [M] new subtasks
Plan updated: [old total] → [new total] subtasks
Status: Ready for implementation
Run `/implement` to start the new subtasks.
--extend flag → If present, jump to "EXTEND MODE" section aboveplan.json using the Write tool (Step 6)The implementation agent will read plan.json and execute subtasks in dependency order.