@dzhechkov/p-replicator 1.3.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/bin/cli.js +0 -0
- package/package.json +7 -2
- package/src/cli.js +23 -6
- package/src/commands/doctor.js +46 -29
- package/src/commands/init.js +61 -8
- package/src/commands/list.js +5 -26
- package/src/commands/update.js +73 -7
- package/src/commands/verify.js +111 -0
- package/src/utils.js +275 -4
- package/templates/.claude/commands/deploy.md +100 -0
- package/templates/.claude/commands/docs.md +79 -0
- package/templates/.claude/commands/feature.md +134 -0
- package/templates/.claude/commands/go.md +115 -0
- package/templates/.claude/commands/myinsights.md +72 -0
- package/templates/.claude/commands/next.md +110 -0
- package/templates/.claude/commands/plan.md +88 -0
- package/templates/.claude/commands/replicate.md +103 -17
- package/templates/.claude/commands/run.md +151 -0
- package/templates/.claude/commands/start.md +88 -0
- package/templates/.claude/hooks/autocommit-insights.cjs +39 -0
- package/templates/.claude/hooks/autocommit-plans.cjs +39 -0
- package/templates/.claude/hooks/autocommit-roadmap.cjs +44 -0
- package/templates/.claude/hooks/session-insights.cjs +28 -0
- package/templates/.claude/hooks/state-update.cjs +79 -0
- package/templates/.claude/hooks/statusline.cjs +399 -0
- package/templates/.claude/rules/feature-lifecycle.md +145 -0
- package/templates/.claude/rules/git-workflow.md +74 -0
- package/templates/.claude/rules/insights-capture.md +77 -0
- package/templates/.claude/rules/replicate-pipeline.md +92 -19
- package/templates/.claude/settings.json +44 -0
- package/templates/.claude/skills/brutal-honesty-review/scripts/assess-code.sh +0 -0
- package/templates/.claude/skills/brutal-honesty-review/scripts/assess-tests.sh +0 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/ed25519_verifier.py +0 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/goap_planner.py +0 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Full SPARC-mini feature lifecycle (PLAN → VALIDATE → IMPLEMENT → REVIEW). Generates per-feature SPARC docs, validates against INVEST/SMART, implements in parallel, reviews with brutal-honesty-review. For features touching 4+ files or introducing new architecture.
|
|
3
|
+
argument-hint: '<feature-name>'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /feature $ARGUMENTS
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Run a 4-phase lifecycle on a single feature: PLAN → VALIDATE → IMPLEMENT →
|
|
11
|
+
REVIEW. Project-context-aware (reads `docs/`), checkpoint-driven, parallel
|
|
12
|
+
where independent.
|
|
13
|
+
|
|
14
|
+
## Use case: existing project (Mode 2)
|
|
15
|
+
|
|
16
|
+
`/feature` is the canonical entry point for adding new features both to
|
|
17
|
+
projects bootstrapped via `/replicate` (Mode 1) and to **existing projects**
|
|
18
|
+
that already have stack, PRD, Specification, Architecture, and CLAUDE.md
|
|
19
|
+
defined (Mode 2).
|
|
20
|
+
|
|
21
|
+
The 4-phase pipeline (PLAN → VALIDATE → IMPLEMENT → REVIEW) is **identical
|
|
22
|
+
in both modes**. The only difference is operational context: in Mode 2 the
|
|
23
|
+
project's CLAUDE.md and existing scaffold are NOT regenerated by `/feature`.
|
|
24
|
+
|
|
25
|
+
### Prerequisites for Mode 2
|
|
26
|
+
|
|
27
|
+
- `npx @dzhechkov/p-replicator init` has been run (idempotent — preserves
|
|
28
|
+
the user's existing CLAUDE.md and `.claude/` files)
|
|
29
|
+
- `npx @dzhechkov/p-replicator verify` reports pre-shipped contract intact
|
|
30
|
+
- Project documentation lives at standard SPARC slot paths:
|
|
31
|
+
- `docs/PRD.md` (REQUIRED — used as context for Phase 1)
|
|
32
|
+
- `docs/Specification.md` (RECOMMENDED — used for AC inheritance)
|
|
33
|
+
- `docs/Architecture.md` (RECOMMENDED — used for component placement)
|
|
34
|
+
- Pseudocode/Refinement/Completion are OPTIONAL — `/feature` proceeds without them
|
|
35
|
+
- If existing docs are at non-standard paths (e.g., `docs/product/PRD.md`),
|
|
36
|
+
the user must rename or symlink them ONE-TIME (no `--prd-path` flag yet —
|
|
37
|
+
see KNOWN_LIMITATIONS.md M3)
|
|
38
|
+
|
|
39
|
+
### What does NOT happen in Mode 2
|
|
40
|
+
|
|
41
|
+
- `/start` MUST NOT be invoked — it expects an empty/fresh scaffold
|
|
42
|
+
- Phase 4 (`brutal-honesty-review`) does NOT modify CLAUDE.md unless a finding
|
|
43
|
+
explicitly requires it
|
|
44
|
+
- `feature-roadmap.json` is NOT auto-generated — the user creates it manually
|
|
45
|
+
if they want batch automation via `/run mvp`; otherwise ad-hoc `/feature <id>`
|
|
46
|
+
works without any roadmap
|
|
47
|
+
|
|
48
|
+
### Three sub-paths for Mode 2
|
|
49
|
+
|
|
50
|
+
| Path | When | Invocation |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| **A. /feature directly** | Single feature, ≥ 4 files | `/feature <id>` |
|
|
53
|
+
| **B. /go auto-router** | Mixed complexity | `/go <id>` (routes to /plan or /feature based on heuristics) |
|
|
54
|
+
| **C. Direct skill calls** | Only validation cycle, no full lifecycle | Invoke `requirements-validator` + `brutal-honesty-review` skills directly |
|
|
55
|
+
|
|
56
|
+
### Verification
|
|
57
|
+
|
|
58
|
+
After completion in Mode 2, run:
|
|
59
|
+
```bash
|
|
60
|
+
npx @dzhechkov/p-replicator verify
|
|
61
|
+
```
|
|
62
|
+
Pre-shipped contract should remain intact. The existing-project state of
|
|
63
|
+
CLAUDE.md and project files should not have changed except for Phase 3
|
|
64
|
+
implementation diffs.
|
|
65
|
+
|
|
66
|
+
## Phases
|
|
67
|
+
|
|
68
|
+
### Phase 1: PLAN (sparc-prd-mini)
|
|
69
|
+
|
|
70
|
+
Read: `.claude/skills/sparc-prd-mini/SKILL.md`
|
|
71
|
+
|
|
72
|
+
Generate per-feature SPARC docs in `docs/features/<feature>/`:
|
|
73
|
+
- `01_specification.md` — requirements + acceptance criteria
|
|
74
|
+
- `02_pseudocode.md` — algorithms + data flow
|
|
75
|
+
- `03_architecture.md` — component placement + dependencies
|
|
76
|
+
- `04_refinement.md` — edge cases + error paths
|
|
77
|
+
- `05_completion.md` — testing + deployment notes
|
|
78
|
+
|
|
79
|
+
**Checkpoint:**
|
|
80
|
+
```
|
|
81
|
+
═══════════════════════════════════════════════════════════════
|
|
82
|
+
✅ PHASE 1: PLAN — docs/features/<feature>/ created
|
|
83
|
+
⏸️ "ок" — next | "превью plan" — show docs
|
|
84
|
+
═══════════════════════════════════════════════════════════════
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Phase 2: VALIDATE (requirements-validator)
|
|
88
|
+
|
|
89
|
+
Read: `.claude/skills/requirements-validator/SKILL.md`
|
|
90
|
+
|
|
91
|
+
Run validation against INVEST + SMART + BDD scenario completeness.
|
|
92
|
+
|
|
93
|
+
| Verdict | Score | Action |
|
|
94
|
+
|---------|-------|--------|
|
|
95
|
+
| 🟢 READY | ≥ 70 average | → Phase 3 |
|
|
96
|
+
| 🟡 CAVEATS | 50-69 with warnings | → Phase 3 with notes |
|
|
97
|
+
| 🔴 NEEDS WORK | < 50 OR blocked items | → Return to Phase 1 (max 3 retries) |
|
|
98
|
+
|
|
99
|
+
Output: `docs/features/<feature>/validation-report.md`
|
|
100
|
+
|
|
101
|
+
### Phase 3: IMPLEMENT (parallel agents)
|
|
102
|
+
|
|
103
|
+
1. Read SPARC docs from Phase 1
|
|
104
|
+
2. Identify independent work units
|
|
105
|
+
3. Spawn parallel `Task` tool calls, one per unit
|
|
106
|
+
4. Each Task: implement + write tests + commit
|
|
107
|
+
5. Coordinator merges/integrates after Tasks complete
|
|
108
|
+
6. Run full test suite
|
|
109
|
+
|
|
110
|
+
### Phase 4: REVIEW (brutal-honesty-review)
|
|
111
|
+
|
|
112
|
+
Read: `.claude/skills/brutal-honesty-review/SKILL.md`
|
|
113
|
+
|
|
114
|
+
Findings classified by severity. Critical (blocker | high) MUST be fixed.
|
|
115
|
+
|
|
116
|
+
## Final Steps
|
|
117
|
+
|
|
118
|
+
1. Update `.claude/feature-roadmap.json`: status `in_progress` → `done`
|
|
119
|
+
2. Commit: `feat(<feature>): complete lifecycle [phases 1-4]`
|
|
120
|
+
3. Push
|
|
121
|
+
|
|
122
|
+
## AUTO mode (when called from /go or /run)
|
|
123
|
+
|
|
124
|
+
Skip per-phase user confirmations. Auto-decisions:
|
|
125
|
+
- Phase 1: proceed if all docs exist
|
|
126
|
+
- Phase 2: proceed if 🟢 or 🟡; auto-retry once on 🔴
|
|
127
|
+
- Phase 3: proceed if tests + lint + build green
|
|
128
|
+
- Phase 4: auto-fix `high` if straightforward; halt on `blocker`
|
|
129
|
+
|
|
130
|
+
## Related
|
|
131
|
+
|
|
132
|
+
- `/plan` — lighter alternative for small tasks
|
|
133
|
+
- `/go` — auto-routes between /plan and /feature
|
|
134
|
+
- `.claude/rules/feature-lifecycle.md` — phase rules
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Intelligent feature implementation router. Scores complexity and dispatches to /plan (simple), /feature (standard), or /feature-ent (complex + enterprise, only if available). Executes autonomously without per-phase confirmations. Supports `--feature-branches` for per-feature git branch workflow (teaching/demo).
|
|
3
|
+
argument-hint: '[feature-name | feature-id | description] [--feature-branches] [--auto-merge]'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /go $ARGUMENTS
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
One-command feature implementation that picks the right pipeline by scoring
|
|
11
|
+
complexity, then runs it without interactive checkpoints.
|
|
12
|
+
|
|
13
|
+
## Step 1: Determine Target Feature
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
IF $ARGUMENTS provided:
|
|
17
|
+
Parse as feature-name | roadmap-id | free-form description
|
|
18
|
+
Look up in .claude/feature-roadmap.json if it matches an id
|
|
19
|
+
ELSE:
|
|
20
|
+
Run /next logic — pick highest-priority `next`/`planned` feature
|
|
21
|
+
Confirm selection before proceeding
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Step 2: Detect Available Pipelines
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
✅ /plan — always available
|
|
28
|
+
✅ /feature — always available
|
|
29
|
+
⚠️ /feature-ent — ONLY if .claude/commands/feature-ent.md exists
|
|
30
|
+
(generated by idea2prd-manual pipeline with DDD docs)
|
|
31
|
+
|
|
32
|
+
CHECK: feature_ent_available = fileExists(".claude/commands/feature-ent.md")
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Step 3: Score Complexity
|
|
36
|
+
|
|
37
|
+
| Signal | Score |
|
|
38
|
+
|--------|-------|
|
|
39
|
+
| Touches ≤ 3 files | -2 |
|
|
40
|
+
| Touches 4-10 files | 0 |
|
|
41
|
+
| Touches > 10 files | +3 |
|
|
42
|
+
| External API integration | +2 |
|
|
43
|
+
| New database entities | +2 |
|
|
44
|
+
| Cross-bounded-context dependencies | +3 |
|
|
45
|
+
| Hotfix or minor improvement | -3 |
|
|
46
|
+
| DDD docs in `docs/ddd/` exist | +1 |
|
|
47
|
+
| Gherkin scenarios for this feature | +1 |
|
|
48
|
+
| Estimated < 30 min | -2 |
|
|
49
|
+
| Estimated > 2 hours | +3 |
|
|
50
|
+
|
|
51
|
+
## Step 4: Decision Matrix
|
|
52
|
+
|
|
53
|
+
| Total Score | Pipeline | Rationale |
|
|
54
|
+
|-------------|----------|-----------|
|
|
55
|
+
| ≤ -2 | `/plan` | Simple, lightweight plan suffices |
|
|
56
|
+
| -1 to +4 | `/feature` | Standard SPARC-mini lifecycle |
|
|
57
|
+
| ≥ +5 AND `feature_ent_available` | `/feature-ent` | Complex enterprise with DDD/ADR/C4 |
|
|
58
|
+
| ≥ +5 AND NOT `feature_ent_available` | `/feature` (fallback) | Use `/feature` with extra architecture care |
|
|
59
|
+
|
|
60
|
+
## Step 5: Execute
|
|
61
|
+
|
|
62
|
+
### `/plan` selected
|
|
63
|
+
1. `/plan <feature-name>` → creates `docs/plans/<feature>.md`
|
|
64
|
+
2. Implement plan immediately (parallel Tasks where independent)
|
|
65
|
+
3. Run tests, commit + push
|
|
66
|
+
|
|
67
|
+
### `/feature` selected
|
|
68
|
+
1. `/feature <feature-name>` in AUTO mode (no inter-phase confirmations)
|
|
69
|
+
2. Spawn parallel Tasks where work is independent
|
|
70
|
+
3. Commit after each phase, push at end
|
|
71
|
+
|
|
72
|
+
### `/feature-ent` selected (if available)
|
|
73
|
+
Same as `/feature` but with idea2prd-manual + DDD coherence + ADR consistency
|
|
74
|
+
+ 7-agent validation + 6-agent review.
|
|
75
|
+
|
|
76
|
+
## Step 6: Post-Implementation
|
|
77
|
+
|
|
78
|
+
1. Update roadmap: feature `status: done`, `files: [actually-touched]`
|
|
79
|
+
2. Commit: `docs(roadmap): mark <feature> as done`
|
|
80
|
+
3. Push, report
|
|
81
|
+
|
|
82
|
+
## Flag: `--feature-branches` (v1.5.0)
|
|
83
|
+
|
|
84
|
+
Wrap the chosen pipeline (`/plan` or `/feature`) in a per-feature git branch.
|
|
85
|
+
|
|
86
|
+
### Workflow when `--feature-branches` is passed
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
1. Verify on `main` (else fail with hint)
|
|
90
|
+
2. If working tree dirty:
|
|
91
|
+
git stash push -u -m "auto-stash before /go feature-branches"
|
|
92
|
+
3. Read roadmap entry for target feature; assign `number` if absent
|
|
93
|
+
4. git checkout -b feature/{NNN}-{id} # NNN = zero-padded 3-digit
|
|
94
|
+
5. Run selected pipeline (/plan | /feature | /feature-ent) inside this branch
|
|
95
|
+
6. git push origin feature/{NNN}-{id} --set-upstream
|
|
96
|
+
7. Update roadmap: status=done, branch="feature/{NNN}-{id}"
|
|
97
|
+
8. git checkout main
|
|
98
|
+
9. If --auto-merge: git merge --no-ff feature/{NNN}-{id}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Branch format: `feature/{NNN}-{id}` (e.g., `feature/001-auth-jwt`).
|
|
102
|
+
|
|
103
|
+
### Companion flag: `--auto-merge`
|
|
104
|
+
|
|
105
|
+
Off by default. When passed: feature branch is merged into `main` after
|
|
106
|
+
completion via `git merge --no-ff`. Without it: branch is pushed but stays
|
|
107
|
+
unmerged for instructor/reviewer to handle.
|
|
108
|
+
|
|
109
|
+
See `/run.md` for full per-feature-branch workflow rationale and use cases.
|
|
110
|
+
|
|
111
|
+
## Related
|
|
112
|
+
|
|
113
|
+
- `/next` — picks the feature when `$ARGUMENTS` empty
|
|
114
|
+
- `/plan`, `/feature` — implementation pipelines
|
|
115
|
+
- `/run` — autonomous loop that calls `/go` per feature (also accepts `--feature-branches`)
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Capture and recall development insights. Append a new insight to `.claude/insights/index.md` with structured fields (problem, solution, tags). Auto-injected into context on SessionStart for relevant tasks.
|
|
3
|
+
argument-hint: '[recall <query> | <free-form insight>]'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /myinsights $ARGUMENTS
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Build a project-local knowledge base of "грабли" (rakes) — errors, workarounds,
|
|
11
|
+
discoveries — so they don't have to be re-learned. Insights are auto-loaded
|
|
12
|
+
into Claude Code context on each session start (via `SessionStart` hook in
|
|
13
|
+
`.claude/settings.json`) when their tags match the current task.
|
|
14
|
+
|
|
15
|
+
## Modes
|
|
16
|
+
|
|
17
|
+
### Capture (default)
|
|
18
|
+
|
|
19
|
+
Run `/myinsights` with a free-form description, or no arguments to be prompted.
|
|
20
|
+
|
|
21
|
+
Process:
|
|
22
|
+
1. Ask 3 short questions (or extract from `$ARGUMENTS`):
|
|
23
|
+
- **Problem** — what went wrong / surprised you
|
|
24
|
+
- **Solution** — what fixed it
|
|
25
|
+
- **Tags** — keywords for future recall
|
|
26
|
+
2. Append entry to `.claude/insights/index.md`:
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
## <ISO date> — <short title>
|
|
30
|
+
|
|
31
|
+
**Tags:** <comma-separated>
|
|
32
|
+
|
|
33
|
+
**Problem:**
|
|
34
|
+
<1-3 sentences>
|
|
35
|
+
|
|
36
|
+
**Solution:**
|
|
37
|
+
<1-5 sentences with code if relevant>
|
|
38
|
+
|
|
39
|
+
**References:** <file:line | commit hash>
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
3. Auto-commit (Stop hook handles this if `.claude/settings.json` is in place).
|
|
45
|
+
|
|
46
|
+
### Recall
|
|
47
|
+
|
|
48
|
+
`/myinsights recall <query>`:
|
|
49
|
+
|
|
50
|
+
1. Read `.claude/insights/index.md`
|
|
51
|
+
2. Filter entries whose tags or text match `<query>` (case-insensitive)
|
|
52
|
+
3. Print top 5 matches with relevance score
|
|
53
|
+
|
|
54
|
+
## Storage
|
|
55
|
+
|
|
56
|
+
`.claude/insights/index.md` — chronological log, Markdown format. One file per
|
|
57
|
+
project to keep recall trivial.
|
|
58
|
+
|
|
59
|
+
## Auto-injection on SessionStart
|
|
60
|
+
|
|
61
|
+
The default `.claude/settings.json` configures `node .claude/hooks/session-insights.cjs`
|
|
62
|
+
which: (1) reads recent insights, (2) prints them to stdout, (3) Claude Code
|
|
63
|
+
captures stdout and injects into the initial context.
|
|
64
|
+
|
|
65
|
+
This is what makes insights compounding: every session benefits from past
|
|
66
|
+
mistakes without manual recall.
|
|
67
|
+
|
|
68
|
+
## Related
|
|
69
|
+
|
|
70
|
+
- `.claude/rules/insights-capture.md` — when/how to capture
|
|
71
|
+
- `.claude/hooks/session-insights.cjs` — session injection
|
|
72
|
+
- `/harvest` — extracts reusable patterns from insights at project end
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Determine the next feature to work on. Reads `.claude/feature-roadmap.json`, applies priority + status filters, and returns the top entry. Subcommands: default (show top 3), `update` (scan codebase + suggest status changes), `<feature-id>` (mark a specific feature done and cascade unblock).
|
|
3
|
+
argument-hint: '[update | <feature-id>]'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /next $ARGUMENTS
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Single source of "what to work on next" backed by `.claude/feature-roadmap.json`.
|
|
11
|
+
Used by `/run` for autonomous loops and by humans to navigate sprint state.
|
|
12
|
+
|
|
13
|
+
## Modes
|
|
14
|
+
|
|
15
|
+
### Default (no arguments)
|
|
16
|
+
|
|
17
|
+
1. Read `.claude/feature-roadmap.json`
|
|
18
|
+
2. Filter entries to `status ∈ {next, planned}`
|
|
19
|
+
3. Sort by priority (`mvp` > `high` > `medium` > `low`), then by `id`
|
|
20
|
+
4. Output top 3 entries with: id, name, priority, complexity hint, blockers
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
═══════════════════════════════════════════════════════════════
|
|
24
|
+
Next 3 features:
|
|
25
|
+
1. [mvp] auth-jwt — User login with JWT tokens (medium, 2-4h)
|
|
26
|
+
2. [mvp] user-profile — Profile CRUD endpoints (simple, 1-2h)
|
|
27
|
+
3. [high] payment-webhook — Stripe webhook handler (complex, 4-6h)
|
|
28
|
+
|
|
29
|
+
In progress: <id> [<name>]
|
|
30
|
+
Done: <N> / <total>
|
|
31
|
+
Blocked: <count> (run /next blocked to see)
|
|
32
|
+
═══════════════════════════════════════════════════════════════
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### `/next update`
|
|
36
|
+
|
|
37
|
+
1. Scan codebase for evidence of feature completion (e.g., file paths in
|
|
38
|
+
roadmap entry's `expected_files` exist + tests pass)
|
|
39
|
+
2. Suggest status updates for each detected feature:
|
|
40
|
+
- `planned` → `next` if dependencies met
|
|
41
|
+
- `in_progress` → `done` if implementation + tests present
|
|
42
|
+
- `next` → `blocked` if dependency entry is `blocked`
|
|
43
|
+
3. Print proposed diff, ask for confirmation
|
|
44
|
+
4. Apply, commit `docs(roadmap): update statuses`
|
|
45
|
+
|
|
46
|
+
### `/next <feature-id>`
|
|
47
|
+
|
|
48
|
+
1. Mark that feature `done` in roadmap
|
|
49
|
+
2. Cascade: any feature that listed `<feature-id>` as a blocker is unblocked
|
|
50
|
+
(status `blocked` → `next`)
|
|
51
|
+
3. Update `last_completed` field
|
|
52
|
+
4. Commit roadmap, return next item to work on
|
|
53
|
+
|
|
54
|
+
## Roadmap Schema
|
|
55
|
+
|
|
56
|
+
`.claude/feature-roadmap.json`:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"version": "1.0",
|
|
61
|
+
"features": [
|
|
62
|
+
{
|
|
63
|
+
"id": "auth-jwt",
|
|
64
|
+
"number": 1,
|
|
65
|
+
"branch": "feature/001-auth-jwt",
|
|
66
|
+
"name": "JWT-based authentication",
|
|
67
|
+
"priority": "mvp",
|
|
68
|
+
"status": "next",
|
|
69
|
+
"complexity": "medium",
|
|
70
|
+
"estimated_hours": "2-4",
|
|
71
|
+
"blockers": [],
|
|
72
|
+
"expected_files": [
|
|
73
|
+
"packages/backend/src/auth/jwt.ts",
|
|
74
|
+
"packages/backend/src/auth/middleware.ts"
|
|
75
|
+
],
|
|
76
|
+
"depends_on": []
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Schema fields (post v1.5.0)
|
|
83
|
+
|
|
84
|
+
| Field | Required | Populated by | Purpose |
|
|
85
|
+
|-------|----------|--------------|---------|
|
|
86
|
+
| `id` | yes | initial roadmap generation | Stable kebab-case slug |
|
|
87
|
+
| `number` | optional | `--feature-branches` flag in `/run` or `/go` | Sequential 1, 2, 3 ... assigned on first encounter; used to compose branch name |
|
|
88
|
+
| `branch` | optional | `--feature-branches` flag after feature completes | `feature/{NNN}-{id}` actually pushed |
|
|
89
|
+
| `name` | recommended | initial generation | Human-readable title |
|
|
90
|
+
| `priority` | yes | initial generation | `mvp` \| `high` \| `medium` \| `low` |
|
|
91
|
+
| `status` | yes | lifecycle | `planned` \| `next` \| `in_progress` \| `done` \| `blocked` |
|
|
92
|
+
| `complexity` | optional | initial generation | `simple` \| `medium` \| `complex` |
|
|
93
|
+
| `estimated_hours` | optional | initial generation | Time hint |
|
|
94
|
+
| `blockers` | optional | manual | List of blocking issue IDs |
|
|
95
|
+
| `expected_files` | optional | initial generation | Used by `/next update` to detect completion |
|
|
96
|
+
| `depends_on` | optional | initial generation | Other feature IDs that must complete first |
|
|
97
|
+
|
|
98
|
+
## Auto-Generation
|
|
99
|
+
|
|
100
|
+
If `.claude/feature-roadmap.json` does not exist when `/next` is called:
|
|
101
|
+
1. Read `docs/PRD.md` and extract user stories
|
|
102
|
+
2. Generate initial roadmap with all stories as `planned`
|
|
103
|
+
3. Set MVP scope from PRD's "MVP" section
|
|
104
|
+
4. Commit `docs(roadmap): initial roadmap from PRD`
|
|
105
|
+
|
|
106
|
+
## Related
|
|
107
|
+
|
|
108
|
+
- `/run mvp` — automated loop over MVP-scoped roadmap entries
|
|
109
|
+
- `/go <id>` — work on a specific feature (called by /run)
|
|
110
|
+
- `docs/PRD.md` — source for initial roadmap generation
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Lightweight implementation planning. Creates a single plan file in `docs/plans/<feature>.md` with sections (Goal, Tasks, Files, Dependencies, Risks). Faster alternative to `/feature` for tasks touching ≤ 3 files.
|
|
3
|
+
argument-hint: '<feature-name | task-description>'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /plan $ARGUMENTS
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Generate a focused implementation plan for a small task without running the
|
|
11
|
+
full SPARC-mini lifecycle. Plans live in `docs/plans/` and are auto-committed.
|
|
12
|
+
|
|
13
|
+
## When to use /plan vs /feature
|
|
14
|
+
|
|
15
|
+
| Use `/plan` | Use `/feature` |
|
|
16
|
+
|-------------|----------------|
|
|
17
|
+
| ≤ 3 files | ≥ 4 files |
|
|
18
|
+
| < 30 min implementation | > 1 hour |
|
|
19
|
+
| No new architecture | New layer/pattern |
|
|
20
|
+
| Bug fix or small improvement | New capability |
|
|
21
|
+
|
|
22
|
+
If unsure, run `/go <name>` — it scores complexity and routes correctly.
|
|
23
|
+
|
|
24
|
+
## Process
|
|
25
|
+
|
|
26
|
+
### 1. Clarify (if ambiguous)
|
|
27
|
+
|
|
28
|
+
Read `$ARGUMENTS`. If task is too vague, ask 1-3 targeted questions before
|
|
29
|
+
proceeding.
|
|
30
|
+
|
|
31
|
+
### 2. Read Context
|
|
32
|
+
|
|
33
|
+
- `docs/Architecture.md` — relevant subsystems
|
|
34
|
+
- `docs/Specification.md` — requirements that touch this task
|
|
35
|
+
- Source files matching the task scope (use Grep to locate)
|
|
36
|
+
|
|
37
|
+
### 3. Write Plan
|
|
38
|
+
|
|
39
|
+
Create `docs/plans/<slug>.md` with:
|
|
40
|
+
|
|
41
|
+
```markdown
|
|
42
|
+
# Plan: <feature-name>
|
|
43
|
+
|
|
44
|
+
**Status:** draft
|
|
45
|
+
**Created:** <ISO timestamp>
|
|
46
|
+
**Estimated:** <time>
|
|
47
|
+
|
|
48
|
+
## Goal
|
|
49
|
+
<1-2 sentence outcome statement>
|
|
50
|
+
|
|
51
|
+
## Tasks
|
|
52
|
+
- [ ] Task 1 — concrete, verifiable
|
|
53
|
+
- [ ] Task 2
|
|
54
|
+
|
|
55
|
+
## Files Touched
|
|
56
|
+
| File | Change | Reason |
|
|
57
|
+
|------|--------|--------|
|
|
58
|
+
|
|
59
|
+
## Dependencies
|
|
60
|
+
- Blocks: <feature-id>
|
|
61
|
+
- Blocked by: <feature-id>
|
|
62
|
+
|
|
63
|
+
## Risks
|
|
64
|
+
- <risk> — <mitigation>
|
|
65
|
+
|
|
66
|
+
## Verification
|
|
67
|
+
How to confirm done.
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 4. Auto-Commit
|
|
71
|
+
|
|
72
|
+
If `Stop` hook is configured (default in v1.4+), the plan auto-commits when
|
|
73
|
+
the response ends. Otherwise: `git add docs/plans/<slug>.md && git commit
|
|
74
|
+
-m "docs(plan): <feature-name>"`.
|
|
75
|
+
|
|
76
|
+
### 5. Report
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
✅ Plan saved: docs/plans/<slug>.md
|
|
80
|
+
Tasks: <N>, Files: <count>
|
|
81
|
+
Next: implement directly, or run /go <slug> for autonomous execution
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Related
|
|
85
|
+
|
|
86
|
+
- `/feature` — full SPARC-mini lifecycle (heavier)
|
|
87
|
+
- `/go` — auto-pick between /plan and /feature
|
|
88
|
+
- `docs/plans/` — directory of all plans
|