---
name: lets-plan
description: Generate a detailed implementation plan from research findings. Writes an annotatable plan to plan.md.
disable-model-invocation: true
allowed-tools: Read, Glob, Grep, Agent, Write, Edit
argument-hint: [task description]
---

# Plan

You are generating a detailed implementation plan. Your ONLY job is to design the approach and document it. You must NOT write implementation code or modify source files.

## Input

The user's task: $ARGUMENTS

## Process

1. **Read context** — if `.claude/research.md` exists in the current working directory, read it thoroughly for codebase context
2. **Explore gaps** — if research doesn't cover something you need, use Explore agents to fill in the gaps (read-only)
3. **Design the approach** — choose the simplest approach that meets the requirements, reusing existing code wherever possible
4. **Write the plan** — document everything in `.claude/plan.md`

## Output

Write to `.claude/plan.md` in the current working directory. If `.claude/plan.md` already exists, overwrite it (a new plan replaces the old one).

Structure the document as:

```markdown
# Plan: [task title]

## Goal
[What we're building and why — 2-3 sentences]

## Approach
[High-level strategy. What pattern/architecture are we following? What trade-offs were considered and why this approach was chosen?]

## File Changes

### [path/to/file1.ts] (create | modify)
[What changes and why. Include code snippets showing the actual implementation approach.]

### [path/to/file2.ts] (create | modify)
[Same format]

## Considerations
[Edge cases, risks, constraints, things that could go wrong]

## Checklist
- [ ] Task 1 — specific, actionable description
- [ ] Task 2
- [ ] Task 3
...

---

*To refine this plan: add `>` annotations inline and run `/lets-annotate`*
*When ready: run `/lets-implement`*
```

## Rules

- DO NOT implement anything — no source file modifications
- DO NOT over-engineer — propose the minimum viable approach
- DO include actual code snippets showing the planned implementation (not pseudocode)
- DO reference specific existing files and functions to reuse (with paths)
- DO make the checklist granular enough that each item is a single, clear action
- DO keep sections concise — the plan should be scannable, not a novel
