Skip to content

Commit 93772c8

Browse files
aRustyDevclaude
andcommitted
refactor(plan-commands): Move schema and examples out of commands/
- Move SCHEMA.md to docs/src/context/plan/schema.md - Move examples/ to tests/plans/ - Update references in create.md, review.md, refine.md - Symlinks in commands/ ARE followed for discovery (tested) Files outside commands/ don't appear in slash command autocomplete. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 743871e commit 93772c8

8 files changed

Lines changed: 1142 additions & 172 deletions

File tree

Lines changed: 129 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
description: Create a new plan document with proper structure for multi-phase work
3-
argument-hint: <plan-name> [--phases N] [--location .claude|.plans]
3+
argument-hint: <plan-name> [--phases N] [--location .claude|.plans] [--minimal]
44
allowed-tools: Read, Write, Bash(mkdir:*), Bash(ls:*), AskUserQuestion
55
---
66

77
# Create Plan
88

9-
Create a structured plan document for multi-phase work with proper organization.
9+
Create a structured plan document for multi-phase work with proper organization. Generated plans comply with the schema defined in `docs/src/context/plan/schema.md`.
1010

1111
## Arguments
1212

@@ -15,12 +15,13 @@ Create a structured plan document for multi-phase work with proper organization.
1515
- `--location` - Where to create the plan:
1616
- `.claude` (default): `.claude/plans/<plan-name>/`
1717
- `.plans`: `.plans/<plan-name>/`
18+
- `--minimal` - Skip interactive questions, use placeholder values
1819

1920
## Output
2021

2122
```text
2223
<location>/<plan-name>/
23-
├── index.md # Plan overview and status
24+
├── PLAN.md # Unified plan (schema-compliant)
2425
└── phase/
2526
├── 1-<name>.md # Phase documents
2627
├── 2-<name>.md
@@ -35,54 +36,76 @@ Create a structured plan document for multi-phase work with proper organization.
3536
2. Validate format: `^[a-z][a-z0-9-]{0,46}[a-z0-9]$`
3637
3. Parse `--phases` (default: 3)
3738
4. Parse `--location` (default: `.claude`)
38-
5. Determine target path
39-
6. Check if plan exists — ask to overwrite or rename
39+
5. Parse `--minimal` flag (default: false)
40+
6. Determine target path
41+
7. Check if plan exists — ask to overwrite or rename
4042

4143
### Step 2: Gather Plan Information
4244

45+
Skip this step if `--minimal` flag is set (use placeholders instead).
46+
4347
Use AskUserQuestion to collect:
4448

4549
1. **Plan Title**: Human-readable title
46-
2. **Objective**: What does this plan accomplish? (2-3 sentences)
47-
3. **Success Criteria**: How do we know it's done? (3-5 bullet points)
48-
4. **Phase Names**: Name for each phase (or use defaults)
50+
2. **Objectives**: What does this plan accomplish? (Ask for 2-3 measurable objectives)
51+
- Prompt: "List 2-3 objectives. For each, include how you will measure success. Example: 'Reduce API latency to <100ms (measured via p95 metrics)'"
52+
3. **Current State Metrics**: What is the current state?
53+
- Prompt: "List 1-3 metrics with current values and target values. Example: 'API latency: Current=350ms, Target=100ms'"
54+
4. **Phase Names**: Name for each phase (or use defaults like "Setup", "Implementation", "Validation")
55+
5. **Key Risks**: What could go wrong?
56+
- Prompt: "List 1-2 potential risks and how you would mitigate them."
4957

5058
### Step 3: Create Directory Structure
5159

5260
```bash
5361
mkdir -p "<location>/<plan-name>/phase"
5462
```
5563

56-
### Step 4: Generate Index
64+
### Step 4: Generate PLAN.md
5765

58-
Write `index.md`:
66+
Write `PLAN.md`:
5967

6068
```markdown
6169
# <Plan Title>
6270

63-
## Objective
71+
**Created:** <YYYY-MM-DD>
72+
**Updated:** <YYYY-MM-DD>
73+
**Owner:** <user or team>
6474

65-
<objective from user>
75+
## Objectives
6676

67-
## Status
77+
| # | Objective | Measurable | Success Metric |
78+
|---|-----------|------------|----------------|
79+
| 1 | <objective 1> | Yes | <how to measure> |
80+
| 2 | <objective 2> | Yes | <how to measure> |
6881

69-
| Phase | Name | Status | Notes |
70-
|-------|------|--------|-------|
71-
| 1 | <phase-1-name> | pending | |
72-
| 2 | <phase-2-name> | pending | |
73-
| ... | ... | ... | |
82+
## Current State
7483

75-
## Success Criteria
76-
77-
- [ ] <criterion 1>
78-
- [ ] <criterion 2>
79-
- [ ] <criterion 3>
84+
| Metric | Current | Target | Gap |
85+
|--------|---------|--------|-----|
86+
| <metric 1> | <current value> | <target value> | <delta> |
87+
| <metric 2> | <current value> | <target value> | <delta> |
8088

8189
## Phases
8290

83-
1. [<Phase 1 Name>](./phase/1-<slug>.md)
84-
2. [<Phase 2 Name>](./phase/2-<slug>.md)
85-
...
91+
| ID | Name | Status | Dependencies | Success Criteria |
92+
|----|------|--------|--------------|------------------|
93+
| phase-1 | <phase-1-name> | pending | - | <summary> |
94+
| phase-2 | <phase-2-name> | pending | phase-1 | <summary> |
95+
| phase-3 | <phase-3-name> | pending | phase-2 | <summary> |
96+
97+
### Phase Details
98+
99+
1. [Phase 1: <Phase 1 Name>](./phase/1-<slug>.md)
100+
2. [Phase 2: <Phase 2 Name>](./phase/2-<slug>.md)
101+
3. [Phase 3: <Phase 3 Name>](./phase/3-<slug>.md)
102+
103+
## Risks
104+
105+
| Risk | Likelihood | Impact | Mitigation |
106+
|------|------------|--------|------------|
107+
| <risk 1> | Medium | Medium | <mitigation strategy> |
108+
| <risk 2> | Low | High | <mitigation strategy> |
86109

87110
## Timeline
88111

@@ -92,11 +115,9 @@ Write `index.md`:
92115
| Phase 1 complete | | |
93116
| All phases complete | | |
94117

95-
## Risks
118+
## Rollback Strategy
96119

97-
| Risk | Likelihood | Impact | Mitigation |
98-
|------|------------|--------|------------|
99-
| | | | |
120+
<describe how to revert changes if needed>
100121

101122
## Notes
102123

@@ -110,37 +131,71 @@ For each phase, write `phase/N-<slug>.md`:
110131
```markdown
111132
# Phase N: <Phase Name>
112133

134+
**ID:** `phase-N`
135+
**Dependencies:** <phase-ids or None>
136+
**Status:** pending
137+
**Effort:** <estimate or TBD>
138+
113139
## Objective
114140

115-
<What this phase accomplishes>
141+
<What this phase accomplishes - 1-2 sentences>
142+
143+
## Success Criteria
116144

117-
## Prerequisites
145+
- [ ] <measurable criterion 1>
146+
- [ ] <measurable criterion 2>
147+
- [ ] <measurable criterion 3>
118148

119-
- [ ] <dependency from previous phase>
149+
## Deliverables
150+
151+
| Deliverable | Location | Format |
152+
|-------------|----------|--------|
153+
| <deliverable 1> | `<file path>` | <type> |
154+
| <deliverable 2> | `<file path>` | <type> |
155+
156+
## Files
157+
158+
**Create:**
159+
- `<path/to/new/file>` (or "None" if no files to create)
160+
161+
**Modify:**
162+
- `<path/to/existing/file>` (or "None" if no files to modify)
120163

121164
## Tasks
122165

123166
- [ ] Task 1
124167
- [ ] Task 2
125168
- [ ] Task 3
126169

127-
## Deliverables
170+
## Notes
128171

129-
| Deliverable | Status | Location |
130-
|-------------|--------|----------|
131-
| | pending | |
172+
<phase-specific notes>
173+
```
132174

133-
## Acceptance Criteria
175+
### Step 6: Validate Output
134176

135-
- [ ] <criterion 1>
136-
- [ ] <criterion 2>
177+
Before reporting, validate the generated plan against the schema:
137178

138-
## Notes
179+
1. **PLAN.md Validation:**
180+
- [ ] Has `## Objectives` section with table containing `Measurable` column
181+
- [ ] Has `## Current State` section with `Current`, `Target`, `Gap` columns
182+
- [ ] Has `## Phases` section with `ID`, `Dependencies`, `Status` columns
183+
- [ ] Has `## Risks` section with `Mitigation` column
184+
- [ ] At least 1 objective, 1 metric, 1 phase, 1 risk
139185

140-
<phase-specific notes>
141-
```
186+
2. **Phase Document Validation (for each phase):**
187+
- [ ] Has metadata block with `**ID:**`, `**Dependencies:**`, `**Status:**`
188+
- [ ] Has `## Objective` section (non-empty)
189+
- [ ] Has `## Success Criteria` as checklist with 2+ items
190+
- [ ] Has `## Deliverables` table with `Location` column
191+
- [ ] Has `## Files` section with `**Create:**` and/or `**Modify:**` subsections
192+
193+
3. **Record validation result:**
194+
- `PASS` - All required elements present
195+
- `WARN` - Optional elements missing (still valid)
196+
- `FAIL` - Required elements missing (should not happen with this command)
142197

143-
### Step 6: Report
198+
### Step 7: Report
144199

145200
```text
146201
## Plan Created
@@ -150,13 +205,20 @@ For each phase, write `phase/N-<slug>.md`:
150205
| Plan | <plan-name> |
151206
| Location | <path> |
152207
| Phases | N |
208+
| Schema | PASS |
153209
154210
**Files created:**
155-
- <path>/index.md
211+
- <path>/PLAN.md
156212
- <path>/phase/1-<name>.md
157213
- <path>/phase/2-<name>.md
158214
...
159215
216+
**Schema validation:**
217+
- PLAN.md: PASS (all required sections present)
218+
- Phase 1: PASS
219+
- Phase 2: PASS
220+
...
221+
160222
**Next steps:**
161223
1. Review and refine phase details
162224
2. Run `/context:plan:review <path>` to check for gaps
@@ -174,6 +236,9 @@ For each phase, write `phase/N-<slug>.md`:
174236

175237
# Create in .plans/ directory
176238
/context:plan:create feature-rollout --location .plans
239+
240+
# Quick scaffolding without interactive questions
241+
/context:plan:create quick-fix --minimal
177242
```
178243

179244
## Plan Status Values
@@ -184,9 +249,26 @@ For each phase, write `phase/N-<slug>.md`:
184249
| `in-progress` | Currently being worked |
185250
| `blocked` | Waiting on dependency |
186251
| `complete` | Finished and verified |
187-
| `deferred` | Postponed |
252+
| `skipped` | Intentionally skipped |
253+
254+
## Placeholder Values (for --minimal mode)
255+
256+
When `--minimal` is used, populate with these placeholders:
257+
258+
| Field | Placeholder |
259+
|-------|-------------|
260+
| Objectives | "Define objective (make measurable)" |
261+
| Current State Metric | "Metric TBD" |
262+
| Current/Target Values | "TBD" |
263+
| Gap | "-" |
264+
| Risk | "None identified" |
265+
| Mitigation | "N/A" |
266+
| Phase Names | "Setup", "Implementation", "Validation" |
267+
| Deliverables | "TBD" |
268+
| Files Create/Modify | "None" |
188269

189270
## Related Commands
190271

191-
- `/context:plan:review` - Review plan for gaps
272+
- `/context:plan:review` - Review plan for gaps and schema compliance
273+
- `/context:plan:refine` - Refine plan with AI assistance
192274
- `/string-beads` - Convert plan to beads issues

0 commit comments

Comments
 (0)