Plan Feature
Explore the codebase and produce an implementation plan for a feature.
/plan-feature<feature description>npx agentscamp add commands/plan-featureInstall to ~/.claude/commands/plan-feature.md
A slash command that explores the codebase read-only and writes an implementation plan for a feature: it restates the request, maps the affected files and patterns with Read/Grep/Glob, then delivers a structured plan covering assumptions, approach, trade-offs, risks, ordered implementation steps, and a test plan.
Scope
Treat $ARGUMENTS as the feature request — what the user wants to build (add CSV export to the reports page, support OAuth login, rate-limit the public API). Restate it in one sentence to confirm you understood it before planning.
If $ARGUMENTS is empty, ask one focused question: "What feature should I plan?" Do not guess a feature out of thin air.
WARNING
Read-only mode. Do not modify the repository, run migrations, install packages, or scaffold code. Your only output is the written plan. If the user wants you to start building, that is a separate follow-up.
NOTE
Where the request is ambiguous (auth provider, storage backend, UI placement, scope boundaries), state your assumptions explicitly and plan against them rather than stalling. Flag each assumption so the user can correct it.
Step 1 — Understand the request
Break the feature into concrete capabilities and acceptance criteria before touching the code.
- What is the user-facing behavior when this is done? What is the smallest version that ships value?
- What is explicitly out of scope? Name it so the plan stays bounded.
- What existing behavior must not break?
Step 2 — Explore the code to ground the plan
A plan written without reading the code is a guess. Map the feature onto the real structure before proposing anything. You only have Read, Grep, and Glob here — explore with those, not the shell:
- Orient first:
ReadREADME.md,package.json, andCLAUDE.mdfor project type, scripts, conventions, and the test/lint/typecheck commands. UseGlob(e.g.src/**/*.ts,**/routes/**) to see how the tree is laid out. - Find the area the feature touches:
Grepfor terms drawn from$ARGUMENTS(e.g.export|report|download) to locate the relevant files. Map the entry points, data flow, and layers the feature crosses (routes, services, models, UI). - Find a pattern to mirror:
Grepfor the shape of similar existing features (e.g.router\.|app\.(get|post)|export function), thenReadthe closest existing feature end to end. The cleanest plan usually copies an established pattern rather than inventing one.
Step 3 — Write the plan
Output the plan in this structure. Be specific — cite real file paths and symbols you found in Step 2, not placeholders.
## Plan — <one-line feature summary>
### Assumptions
- <each ambiguity you resolved, and how>
### Affected files & modules
- `path/to/file.ts` — <what changes and why>
- `path/to/other.ts` — <new function / modified signature>
### Proposed approach
<2-4 paragraphs describing the design: data flow, where new code lives,
how it hooks into existing patterns, and the public interface.>
### Trade-offs & alternatives
- **Chosen:** <approach> — <why it wins here>
- **Alternative:** <other option> — <why rejected / when it would be better>
### Risks & unknowns
- <thing that could break, perf concern, migration risk, or open question>
### Implementation steps
1. <smallest first, each independently reviewable>
2. ...
### Test plan
- <unit / integration tests to add, key cases & edge cases>
- <how to verify manually; commands to run>Report
Deliver the plan as your message — it is the whole deliverable. Keep it tight enough to read in one pass, specific enough to start coding from immediately, and end with the single recommended first step. Remember: no files were changed; this is a plan to act on, not the action.
Related
- Breakdown TaskDecompose a task into an ordered checklist of small, verifiable steps.
- System ArchitectUse this agent for high-level system design — service boundaries, data flow, scaling, trade-offs. Examples — designing a new system, evaluating a monolith-to-services split, a scalability review.
- Building Multi-Step Agent WorkflowsPatterns for building multi-step agent workflows in Claude Code: decompose tasks, fan-out to parallel subagents, verify every step, and orchestrate.
- Spec-Driven Development with AI AgentsWrite the spec, let the agent implement against it — the SDD workflow (spec → plan → tasks → implement), when it beats prompt-and-iterate, and the tooling.
- Linear MCPLinear's hosted MCP server — find, create, and update issues, projects, and comments from your AI agent, with OAuth and one-command setup.
- Sequential Thinking MCPThe official MCP reference server for structured reasoning — a sequential_thinking tool that lets agents decompose, revise, and branch their thinking.
- Spec KitGitHub's open-source toolkit for spec-driven development — a specify CLI and /speckit slash commands that walk any coding agent from spec to implementation.
- Estimate EffortProduce a grounded effort and complexity estimate for a task by exploring the codebase read-only.
- Write Design DocExplore the codebase and write a decision-oriented design doc / RFC for a feature or system change.
- Create Slash CommandScaffold a new Claude Code slash command into .claude/commands/ — a valid Markdown file with frontmatter, a least-privilege allowed-tools allowlist, and a $ARGUMENTS-driven body of numbered steps ending in a Report.