write-plan
npx machina-cli add skill mkrtchian/spec-driven-dev/write-plan --openclawObjective
Guide the user from an idea or spec to a reviewed, step-by-step implementation plan ready for /implement-plan.
The process has two modes: interactive discussion (you talk to the user), and isolated review passes (fresh sub-agents each handle one concern).
Phase 1: Discussion (interactive)
If $ARGUMENTS is provided, read it as requirements context (spec, user stories, discovery notes, or a rough plan).
Explore the codebase
- Read
./CLAUDE.mdat the project root (if it exists). - Identify which areas of the codebase are relevant to the user's idea. Read key source files to understand current patterns, types, and architecture.
- Check for nested
CLAUDE.mdfiles in relevant directories.
Clarify with the user
Ask questions to narrow the scope. Focus on:
- What: What exactly should the feature/change do? What are the acceptance criteria?
- Where: Which parts of the codebase are affected? Are there existing patterns to follow?
- How: What technical approach? Are there trade-offs to decide?
- Boundaries: What should NOT change? What's out of scope?
- Testing: What scenarios need test coverage?
Keep asking until you have enough to write a precise plan. The user signals readiness by saying something like "OK", "let's go", "write it", "that's enough", etc.
Phase 2: Draft the plan
Write the plan to plans/YYYY-MM-DD_slug.md where:
YYYY-MM-DDis today's dateslugis a short kebab-case name derived from the feature (e.g.,user-auth,api-pagination)
Create the plans/ directory if it doesn't exist.
The plan should cover:
- Context: What problem this solves, why this approach
- Approach: High-level strategy
- Files to modify: Exact paths, what changes in each
- Code details: Type signatures, method signatures, key logic
- What stays unchanged: Explicitly list what should NOT be touched
- Edge cases: Scenarios and expected behavior
- Test scenarios: What to test, with expected inputs/outputs
- Verification: Commands to run to confirm correctness
Tell the user the plan path when done. From this point on, $PLAN_PATH refers to the path of the plan file you just created.
Phase 3: Plan review (fresh sub-agent)
Display:
--- Pass 1: Plan Review ---
Checking for gaps, wrong assumptions, and integration risks...
Spawn a sub-agent:
Task(
subagent_type="spec-driven-dev:sdd-plan-reviewer",
model="opus",
description="Review plan for gaps",
prompt="
Plan to review: $PLAN_PATH
"
)
Report what was found/fixed to the user.
Phase 4: Plan standards (fresh sub-agent)
Display:
--- Pass 2: Plan Standards ---
Checking plan against project coding and testing standards...
Spawn a sub-agent:
Task(
subagent_type="spec-driven-dev:sdd-plan-standards",
model="opus",
description="Check plan standards",
prompt="
Plan to review: $PLAN_PATH
"
)
Report what was found/fixed to the user.
Phase 5: Step breakdown (fresh sub-agent)
Display:
--- Pass 3: Step Breakdown ---
Splitting plan into implementation steps...
Spawn a sub-agent:
Task(
subagent_type="spec-driven-dev:sdd-step-breakdown",
model="opus",
description="Break plan into steps",
prompt="
Plan to process: $PLAN_PATH
"
)
Report the step summary to the user.
Phase 6: Done
Display:
--- Plan Ready ---
Plan: $PLAN_PATH
Steps: N total
Review the plan and adjust as needed (manually or with my help).
When ready, run: /implement-plan $PLAN_PATH
Source
git clone https://github.com/mkrtchian/spec-driven-dev/blob/main/skills/write-plan/SKILL.mdView on GitHub Overview
This skill guides turning an idea or spec into a reviewed, step-by-step implementation plan ready for /implement-plan. It pairs interactive discovery with isolated review passes to surface gaps, risks, and test coverage. The plan is stored at plans/YYYY-MM-DD_slug.md for traceability.
How This Skill Works
It starts with optional ARGUMENTS to provide requirements context, then analyzes the codebase and clarifies scope with the user. It drafts a plan at plans/YYYY-MM-DD_slug.md, detailing context, approach, files to modify, code details, edge cases, and tests. Three fresh sub-agent passes (plan review, standards, and step breakdown) validate the plan and decompose it into executable steps, resulting in a ready-to-run plan path.
When to Use It
- When turning a feature concept or spec into a concrete plan before coding
- When the scope is ambiguous and explicit acceptance criteria and edge cases are needed
- When aligning the plan with coding standards and testing requirements
- When coordinating changes across multiple files or modules
- When preparing for a formal implementation sprint via /implement-plan
Quick Start
- Step 1: Provide the feature/spec as ARGUMENTS or say OK to start interactive discussion
- Step 2: I draft the plan at plans/2026-03-09_slug.md (slug derived from the feature) and present the path
- Step 3: Plan passes run (plan review, standards, step breakdown); to implement, run: /implement-plan plans/2026-03-09_slug.md
Best Practices
- Capture explicit acceptance criteria and success metrics
- Read relevant CLAUDE.md and key source files early
- Structure the plan with context, approach, files to modify, code details, edges, and tests
- Explicitly list what should not change
- Validate the plan through plan review, standards, and step breakdown passes
Example Use Cases
- Draft plan for a user-auth feature from a product spec
- Plan for API pagination to update a REST endpoint
- Plan for introducing feature flags and rollout gating
- Plan for backward-compatible database migration
- Plan for implementing rate-limited endpoints