claude-dev-kit 2.1.0
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/.claude/agents/angelic-workshop-energy-clearing.md +113 -0
- package/.claude/agents/angelic-workshop-intake.md +84 -0
- package/.claude/agents/angelic-workshop-integration.md +140 -0
- package/.claude/agents/angelic-workshop-invocation.md +92 -0
- package/.claude/agents/angelic-workshop-lead.md +225 -0
- package/.claude/agents/angelic-workshop-transmission.md +108 -0
- package/.claude/agents/deep-think-partner.md +41 -0
- package/.claude/agents/dev-backend.md +74 -0
- package/.claude/agents/dev-e2e.md +101 -0
- package/.claude/agents/dev-frontend.md +82 -0
- package/.claude/agents/dev-lead.md +144 -0
- package/.claude/agents/dev-reviewer.md +122 -0
- package/.claude/agents/dev-test.md +88 -0
- package/.claude/agents/documentation-manager.md +73 -0
- package/.claude/agents/haiku-executor.md +8 -0
- package/.claude/agents/pm-groomer.md +98 -0
- package/.claude/agents/pm-prp-writer.md +144 -0
- package/.claude/agents/pm-sizer.md +84 -0
- package/.claude/agents/project-manager.md +91 -0
- package/.claude/agents/system-architect.md +98 -0
- package/.claude/agents/validation-gates.md +121 -0
- package/.claude/agents/workflow-builder.md +416 -0
- package/.claude/commands/ai/detect.md +117 -0
- package/.claude/commands/ai/route.md +128 -0
- package/.claude/commands/ai/switch.md +121 -0
- package/.claude/commands/bs/brainstorm_full.md +149 -0
- package/.claude/commands/bs/claude.md +37 -0
- package/.claude/commands/bs/codex.md +37 -0
- package/.claude/commands/bs/gemini.md +37 -0
- package/.claude/commands/bs/glm.md +37 -0
- package/.claude/commands/bs/grok.md +37 -0
- package/.claude/commands/bs/kimi.md +37 -0
- package/.claude/commands/bs/minimax.md +37 -0
- package/.claude/commands/bs/ollama.md +71 -0
- package/.claude/commands/code/build-and-fix.md +80 -0
- package/.claude/commands/code/simplify.md +77 -0
- package/.claude/commands/dev/backend.md +47 -0
- package/.claude/commands/dev/e2e.md +49 -0
- package/.claude/commands/dev/frontend.md +45 -0
- package/.claude/commands/dev/review.md +48 -0
- package/.claude/commands/dev/test.md +54 -0
- package/.claude/commands/dev-epic.md +121 -0
- package/.claude/commands/dev-issue.md +79 -0
- package/.claude/commands/dev.md +134 -0
- package/.claude/commands/execute-prp.md +113 -0
- package/.claude/commands/fix-github-issue.md +14 -0
- package/.claude/commands/generate-prp.md +73 -0
- package/.claude/commands/git/status.md +14 -0
- package/.claude/commands/haiku.md +13 -0
- package/.claude/commands/improve.md +178 -0
- package/.claude/commands/init.md +311 -0
- package/.claude/commands/pm/groom.md +58 -0
- package/.claude/commands/pm/plan-epic.md +74 -0
- package/.claude/commands/pm/size.md +46 -0
- package/.claude/commands/pm.md +47 -0
- package/.claude/commands/primer.md +16 -0
- package/.claude/commands/self-improve.md +243 -0
- package/.claude/commands/think.md +68 -0
- package/.claude/commands/workflow/angelic-workshop.md +89 -0
- package/.claude/commands/workflow/build.md +91 -0
- package/.claude/hooks/pre-tool-use/block-dangerous-commands.js +196 -0
- package/.claude/hooks/skill-activation-prompt/package-lock.json +560 -0
- package/.claude/hooks/skill-activation-prompt/package.json +16 -0
- package/.claude/hooks/skill-activation-prompt/skill-activation-prompt.ts +135 -0
- package/.claude/hooks/skill-activation-prompt/skill-rules.json +50 -0
- package/.claude/hooks/stop/context_monitor.py +155 -0
- package/.claude/hooks/stop/learning_logger.py +218 -0
- package/.claude/skills/ai-router/SKILL.md +119 -0
- package/.claude/skills/build-and-fix/SKILL.md +271 -0
- package/.claude/skills/build-and-fix/examples/javascript-lint-fix.md +37 -0
- package/.claude/skills/build-and-fix/language-configs/javascript.yaml +139 -0
- package/.claude/skills/build-and-fix/references/config-schema.md +120 -0
- package/.claude/skills/build-and-fix/references/error-patterns.md +273 -0
- package/.claude/skills/code-investigator/SKILL.md +299 -0
- package/.claude/skills/code-investigator/references/investigation-workflows.md +542 -0
- package/.claude/skills/code-investigator/references/language-specific.md +761 -0
- package/.claude/skills/code-investigator/references/search-patterns.md +258 -0
- package/.claude/skills/code-investigator/references/serena-patterns.md +328 -0
- package/.claude/skills/stack-detector/SKILL.md +153 -0
- package/.claude/skills/verification-before-completion/SKILL.md +143 -0
- package/.claude/templates/claude-md-template.md +56 -0
- package/.claude/templates/stacks/express-node.md +134 -0
- package/.claude/templates/stacks/fastapi.md +152 -0
- package/.claude/templates/stacks/generic.md +101 -0
- package/.claude/templates/stacks/nextjs-prisma.md +235 -0
- package/README.md +499 -0
- package/bin/claude-dev-kit.js +11 -0
- package/package.json +31 -0
- package/scripts/install.sh +448 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Analyze session learning logs to identify patterns and propose concrete improvements to agents, skills, and commands. The kit's feedback loop."
|
|
3
|
+
argument-hint: [days=14 | all]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /improve — Self-Improvement Analysis
|
|
7
|
+
|
|
8
|
+
Read session learning data captured by the learning logger, identify patterns, and propose concrete improvements to the kit's agents, skills, and skill-activation rules. Optionally auto-apply low-risk improvements.
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
### 1. Determine lookback window
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
DAYS = $ARGUMENTS (default: 14)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
If `$ARGUMENTS` is "all", read all available logs.
|
|
19
|
+
If empty, default to last 14 days.
|
|
20
|
+
|
|
21
|
+
### 2. Read learning logs
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ls .claude/learning/sessions/ 2>/dev/null | sort -r | head -30
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
For each relevant log file (within the requested date window):
|
|
28
|
+
```bash
|
|
29
|
+
cat .claude/learning/sessions/<YYYY-MM-DD>.jsonl
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 3. Aggregate statistics
|
|
33
|
+
|
|
34
|
+
Compute across all sessions:
|
|
35
|
+
|
|
36
|
+
**Command frequency:**
|
|
37
|
+
- Which slash commands were used most? (`slash_commands` field)
|
|
38
|
+
- Which were never used?
|
|
39
|
+
|
|
40
|
+
**Agent usage:**
|
|
41
|
+
- Which agents were spawned most? (`agents_spawned` field)
|
|
42
|
+
- Agent-to-turn ratio (efficiency indicator)
|
|
43
|
+
|
|
44
|
+
**Tool call patterns:**
|
|
45
|
+
- Most-used tools (`tools_called` field)
|
|
46
|
+
- Any tools never used?
|
|
47
|
+
|
|
48
|
+
**Error patterns:**
|
|
49
|
+
- Common error substrings from `errors` field
|
|
50
|
+
- Which sessions had the most errors?
|
|
51
|
+
|
|
52
|
+
**Token consumption:**
|
|
53
|
+
- Average tokens per session
|
|
54
|
+
- Most expensive sessions
|
|
55
|
+
|
|
56
|
+
**Skill activation gaps:**
|
|
57
|
+
- Compare `slash_commands` against `skill-rules.json` triggers
|
|
58
|
+
- Identify user phrases that DIDN'T trigger skills but should have
|
|
59
|
+
|
|
60
|
+
### 4. Read current skill rules
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
cat .claude/hooks/skill-activation-prompt/skill-rules.json
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 5. Read current agent files (sample)
|
|
67
|
+
|
|
68
|
+
Read the agents that showed the highest usage or most errors:
|
|
69
|
+
```bash
|
|
70
|
+
cat .claude/agents/<most-used-agent>.md
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 6. Generate improvement report
|
|
74
|
+
|
|
75
|
+
Using the data, produce a structured analysis:
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
## /improve Analysis — Last <N> Days
|
|
79
|
+
|
|
80
|
+
### Usage Summary
|
|
81
|
+
- Sessions analyzed: <count>
|
|
82
|
+
- Total turns: <count>
|
|
83
|
+
- Total tokens consumed: <count>
|
|
84
|
+
- Average tokens/session: <count>
|
|
85
|
+
|
|
86
|
+
### Most-Used Commands
|
|
87
|
+
1. /<cmd> — <count> times
|
|
88
|
+
2. /<cmd> — <count> times
|
|
89
|
+
...
|
|
90
|
+
|
|
91
|
+
### Unused Commands (consider removing or improving)
|
|
92
|
+
- /<cmd> — 0 uses in <N> days
|
|
93
|
+
- /<cmd> — 0 uses in <N> days
|
|
94
|
+
|
|
95
|
+
### Skill Activation Gaps
|
|
96
|
+
Phrases found in user prompts that DIDN'T trigger a skill but likely should have:
|
|
97
|
+
- "<phrase>" → suggest adding trigger to <skill>
|
|
98
|
+
- "<phrase>" → suggest adding trigger to <skill>
|
|
99
|
+
|
|
100
|
+
### Agent Efficiency
|
|
101
|
+
- <agent>: avg <X> turns per spawn (high = may need tighter prompts)
|
|
102
|
+
- <agent>: avg <X> turns per spawn
|
|
103
|
+
|
|
104
|
+
### Common Error Patterns
|
|
105
|
+
- "<error snippet>" — appears in <N> sessions
|
|
106
|
+
→ Likely cause: <analysis>
|
|
107
|
+
→ Suggested fix: <fix>
|
|
108
|
+
|
|
109
|
+
### Token Hotspots
|
|
110
|
+
- Top consuming sessions: <count> tokens — commands used: <list>
|
|
111
|
+
→ Consider: caching results, using Haiku for this task, or splitting into smaller chunks
|
|
112
|
+
|
|
113
|
+
### Proposed Improvements
|
|
114
|
+
|
|
115
|
+
#### High Priority (auto-apply candidates)
|
|
116
|
+
1. **Add skill trigger**: Add "<phrase>" to `skill-rules.json` triggers for <skill>
|
|
117
|
+
- Evidence: seen in <N> sessions
|
|
118
|
+
|
|
119
|
+
2. **Agent prompt tightening**: <agent>.md — add constraint to reduce turn count
|
|
120
|
+
- Evidence: avg <X> turns, expected < <Y>
|
|
121
|
+
|
|
122
|
+
#### Medium Priority (review before applying)
|
|
123
|
+
3. **New skill needed**: Pattern "<X>" appears repeatedly with no skill match
|
|
124
|
+
- Suggested: create a new skill for <purpose>
|
|
125
|
+
|
|
126
|
+
4. **Command consolidation**: /<cmd1> and /<cmd2> often used together
|
|
127
|
+
- Suggested: create /<combined> shorthand
|
|
128
|
+
|
|
129
|
+
#### Low Priority (future consideration)
|
|
130
|
+
5. **Unused command cleanup**: /<cmd> — 0 uses in 14 days
|
|
131
|
+
- Suggested: add to README as "advanced" or deprecate
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 7. Offer to apply improvements
|
|
135
|
+
|
|
136
|
+
After showing the report, ask:
|
|
137
|
+
|
|
138
|
+
> **Auto-apply safe improvements?**
|
|
139
|
+
> This would update `skill-rules.json` with suggested new triggers only (no agent edits).
|
|
140
|
+
> Agent prompt changes require your review.
|
|
141
|
+
|
|
142
|
+
Use AskUserQuestion with options:
|
|
143
|
+
- "Yes — update skill-rules.json only"
|
|
144
|
+
- "Yes — update skill-rules.json AND show agent diffs for review"
|
|
145
|
+
- "No — just show the report"
|
|
146
|
+
|
|
147
|
+
### 8. Apply approved improvements
|
|
148
|
+
|
|
149
|
+
**For skill-rules.json updates:**
|
|
150
|
+
1. Read current rules
|
|
151
|
+
2. Add new trigger keywords to appropriate skill entries
|
|
152
|
+
3. Write back to `.claude/hooks/skill-activation-prompt/skill-rules.json`
|
|
153
|
+
4. Report which triggers were added
|
|
154
|
+
|
|
155
|
+
**For agent improvements:**
|
|
156
|
+
Show the proposed diff using a clear before/after format. Only apply after user confirmation.
|
|
157
|
+
|
|
158
|
+
### 9. Log improvement action
|
|
159
|
+
|
|
160
|
+
Append to `.claude/learning/improvements.jsonl`:
|
|
161
|
+
```json
|
|
162
|
+
{
|
|
163
|
+
"ts": <timestamp>,
|
|
164
|
+
"date": "<YYYY-MM-DD>",
|
|
165
|
+
"sessions_analyzed": <count>,
|
|
166
|
+
"improvements_proposed": <count>,
|
|
167
|
+
"improvements_applied": <count>,
|
|
168
|
+
"changes": ["<description>", ...]
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Notes
|
|
173
|
+
|
|
174
|
+
- This command reads only `.claude/learning/` data — no external network calls
|
|
175
|
+
- All analysis is local — session data stays on your machine
|
|
176
|
+
- Learning data is automatically pruned after 90 days (by the learning_logger hook)
|
|
177
|
+
- Run after every few development sessions for best results
|
|
178
|
+
- For AI-powered critique of the kit itself, use `/self-improve`
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Smart project setup. Detects your stack and generates customized agents, CLAUDE.md, and settings.json. Or interviews you to design a new project from scratch. Run once when adding Claude Dev Kit to any project."
|
|
3
|
+
argument-hint: [existing | new]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /init — Project Initialization
|
|
7
|
+
|
|
8
|
+
Set up Claude Dev Kit for this project. This command either detects an existing codebase and configures agents to match, or interviews you to design a new project from scratch.
|
|
9
|
+
|
|
10
|
+
## Phase 0: Determine Mode
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
If $ARGUMENTS is "new" → skip to Phase 3 (New Project Interview)
|
|
14
|
+
If $ARGUMENTS is "existing" → run Phase 1
|
|
15
|
+
Otherwise → auto-detect:
|
|
16
|
+
Run: ls -la
|
|
17
|
+
If fewer than 8 non-hidden files in root → likely new project → ask user
|
|
18
|
+
If package.json / pyproject.toml / Cargo.toml / go.mod found → existing project
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Phase 1: File Inventory (Existing Projects)
|
|
24
|
+
|
|
25
|
+
Run these reads in parallel to build a complete picture of the project:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Project manifest files
|
|
29
|
+
cat package.json 2>/dev/null || echo "NO_PACKAGE_JSON"
|
|
30
|
+
cat pyproject.toml 2>/dev/null || echo "NO_PYPROJECT"
|
|
31
|
+
cat Cargo.toml 2>/dev/null || echo "NO_CARGO"
|
|
32
|
+
cat go.mod 2>/dev/null || echo "NO_GO_MOD"
|
|
33
|
+
|
|
34
|
+
# Framework config
|
|
35
|
+
ls next.config.* nuxt.config.* svelte.config.* remix.config.* astro.config.* vite.config.* 2>/dev/null
|
|
36
|
+
|
|
37
|
+
# Database/ORM
|
|
38
|
+
ls prisma/schema.prisma drizzle.config.* 2>/dev/null
|
|
39
|
+
|
|
40
|
+
# Testing
|
|
41
|
+
ls jest.config.* vitest.config.* playwright.config.* cypress.config.* pytest.ini conftest.py 2>/dev/null
|
|
42
|
+
|
|
43
|
+
# Mobile
|
|
44
|
+
ls capacitor.config.ts app.json 2>/dev/null
|
|
45
|
+
|
|
46
|
+
# CI/CD
|
|
47
|
+
ls .github/workflows/ 2>/dev/null | head -5
|
|
48
|
+
ls Dockerfile docker-compose.yml 2>/dev/null
|
|
49
|
+
|
|
50
|
+
# Project structure (top-level only)
|
|
51
|
+
tree -L 2 --gitignore 2>/dev/null || find . -maxdepth 2 -not -path './.git/*' -not -path './node_modules/*' -not -path './.next/*' | sort
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Phase 2: Stack Detection
|
|
57
|
+
|
|
58
|
+
Analyze the inventory to produce a detection JSON. Use this decision tree — first match wins per category:
|
|
59
|
+
|
|
60
|
+
### Framework
|
|
61
|
+
| Detection | Result |
|
|
62
|
+
|-----------|--------|
|
|
63
|
+
| `"next"` in package.json deps | `nextjs` |
|
|
64
|
+
| `"@remix-run/node"` or `"@remix-run/serve"` | `remix` |
|
|
65
|
+
| `"@sveltejs/kit"` | `sveltekit` |
|
|
66
|
+
| `"nuxt"` | `nuxt` |
|
|
67
|
+
| `"@nestjs/core"` | `nestjs` |
|
|
68
|
+
| `"fastify"` | `fastify` |
|
|
69
|
+
| `"express"` | `express` |
|
|
70
|
+
| `"fastapi"` in pyproject deps | `fastapi` |
|
|
71
|
+
| `"django"` in pyproject deps | `django` |
|
|
72
|
+
| `"flask"` in pyproject deps | `flask` |
|
|
73
|
+
| go.mod exists + detect router from imports | `go` |
|
|
74
|
+
| Cargo.toml exists + detect crate from deps | `rust` |
|
|
75
|
+
|
|
76
|
+
### Package Manager
|
|
77
|
+
| Detection | Result |
|
|
78
|
+
|-----------|--------|
|
|
79
|
+
| `bun.lockb` exists | `bun` |
|
|
80
|
+
| `pnpm-lock.yaml` exists | `pnpm` |
|
|
81
|
+
| `yarn.lock` exists | `yarn` |
|
|
82
|
+
| `package-lock.json` exists | `npm` |
|
|
83
|
+
| `Pipfile.lock` / `poetry.lock` | `poetry` |
|
|
84
|
+
|
|
85
|
+
### ORM / Database Layer
|
|
86
|
+
| Detection | Result |
|
|
87
|
+
|-----------|--------|
|
|
88
|
+
| `prisma/schema.prisma` | `prisma` |
|
|
89
|
+
| `drizzle.config.*` | `drizzle` |
|
|
90
|
+
| `"mongoose"` in deps | `mongoose` |
|
|
91
|
+
| `"sqlalchemy"` in pyproject | `sqlalchemy` |
|
|
92
|
+
| `"django"` already detected | `django-orm` |
|
|
93
|
+
| `"gorm"` in go.mod | `gorm` |
|
|
94
|
+
| `"sqlx"` in Cargo.toml | `sqlx` |
|
|
95
|
+
|
|
96
|
+
### Test Runner
|
|
97
|
+
| Detection | Result |
|
|
98
|
+
|-----------|--------|
|
|
99
|
+
| `jest.config.*` | `jest` |
|
|
100
|
+
| `vitest.config.*` | `vitest` |
|
|
101
|
+
| `pytest.ini` or `conftest.py` | `pytest` |
|
|
102
|
+
| `cargo test` (Rust) | `cargo-test` |
|
|
103
|
+
| `go test` (Go) | `go-test` |
|
|
104
|
+
|
|
105
|
+
### E2E
|
|
106
|
+
| Detection | Result |
|
|
107
|
+
|-----------|--------|
|
|
108
|
+
| `playwright.config.*` | `playwright` |
|
|
109
|
+
| `cypress.config.*` | `cypress` |
|
|
110
|
+
|
|
111
|
+
### Mobile
|
|
112
|
+
| Detection | Result |
|
|
113
|
+
|-----------|--------|
|
|
114
|
+
| `capacitor.config.ts` | `capacitor` |
|
|
115
|
+
| `app.json` with `"expo"` key | `expo` |
|
|
116
|
+
|
|
117
|
+
### Ambiguous / Large Codebase Fallback
|
|
118
|
+
If the framework is not detectable from manifest files, use Gemini:
|
|
119
|
+
```bash
|
|
120
|
+
gemini -p "@./ Identify the web framework, ORM/database layer, test runner, E2E tool, and mobile platform used in this project. Respond in exactly this format:
|
|
121
|
+
FRAMEWORK: <name>
|
|
122
|
+
ORM: <name or none>
|
|
123
|
+
TEST_RUNNER: <name or none>
|
|
124
|
+
E2E: <name or none>
|
|
125
|
+
MOBILE: <name or none>
|
|
126
|
+
PACKAGE_MANAGER: <name>"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Phase 3: New Project Interview
|
|
132
|
+
|
|
133
|
+
Ask these questions sequentially using the AskUserQuestion tool. Wait for each answer before asking the next.
|
|
134
|
+
|
|
135
|
+
**Q1**: What are you building?
|
|
136
|
+
- A web application
|
|
137
|
+
- A mobile app (iOS/Android)
|
|
138
|
+
- A REST/GraphQL API
|
|
139
|
+
- A full-stack platform (web + mobile + API)
|
|
140
|
+
- Something else
|
|
141
|
+
|
|
142
|
+
**Q2**: Describe your idea in 2-3 sentences (free text — ask this as plain text, not multiple choice)
|
|
143
|
+
|
|
144
|
+
**Q3**: Expected scale and usage?
|
|
145
|
+
- Personal / hobby project
|
|
146
|
+
- Small team startup (< 50 users initially)
|
|
147
|
+
- Production SaaS (100s–1000s of users)
|
|
148
|
+
- Enterprise / high-scale
|
|
149
|
+
|
|
150
|
+
**Q4**: What language ecosystem do you prefer?
|
|
151
|
+
- TypeScript / JavaScript
|
|
152
|
+
- Python
|
|
153
|
+
- Go
|
|
154
|
+
- Rust
|
|
155
|
+
- Undecided — recommend for me
|
|
156
|
+
|
|
157
|
+
**Q5** (if TypeScript): Which framework?
|
|
158
|
+
- Next.js (full-stack, server + client)
|
|
159
|
+
- Remix (full-stack, web standards)
|
|
160
|
+
- SvelteKit (full-stack, lightweight)
|
|
161
|
+
- Nuxt (full-stack, Vue)
|
|
162
|
+
- Express / Fastify (API-only, no frontend)
|
|
163
|
+
- NestJS (enterprise API)
|
|
164
|
+
- Undecided — recommend for me
|
|
165
|
+
|
|
166
|
+
**Q6** (if TypeScript/fullstack): Database?
|
|
167
|
+
- PostgreSQL with Prisma ORM
|
|
168
|
+
- PostgreSQL with Drizzle ORM
|
|
169
|
+
- MongoDB with Mongoose
|
|
170
|
+
- SQLite (local / edge)
|
|
171
|
+
- Undecided — recommend for me
|
|
172
|
+
|
|
173
|
+
**Q7**: Authentication needed?
|
|
174
|
+
- Yes — Auth.js / NextAuth (for Next.js)
|
|
175
|
+
- Yes — BetterAuth (framework-agnostic)
|
|
176
|
+
- Yes — Clerk (managed service)
|
|
177
|
+
- Yes — Custom JWT
|
|
178
|
+
- No authentication needed
|
|
179
|
+
|
|
180
|
+
**Q8**: Payments?
|
|
181
|
+
- Stripe
|
|
182
|
+
- Other payment provider
|
|
183
|
+
- No payments needed
|
|
184
|
+
|
|
185
|
+
**Q9**: Mobile app?
|
|
186
|
+
- Yes — Capacitor (wrap web app for iOS/Android)
|
|
187
|
+
- Yes — Expo (React Native)
|
|
188
|
+
- No mobile needed
|
|
189
|
+
|
|
190
|
+
**Q10**: Testing approach?
|
|
191
|
+
- Full coverage: unit tests + E2E + coverage enforcement
|
|
192
|
+
- Unit tests only
|
|
193
|
+
- Minimal (lint + build only)
|
|
194
|
+
|
|
195
|
+
Build the stack map from answers. For "Undecided — recommend for me" answers, apply these defaults:
|
|
196
|
+
- TypeScript + small/medium scale + web → Next.js + Prisma + PostgreSQL
|
|
197
|
+
- TypeScript + API-only → Fastify + Drizzle
|
|
198
|
+
- Python → FastAPI + SQLAlchemy
|
|
199
|
+
- Go → Gin + GORM
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Phase 4: Read Stack Templates
|
|
204
|
+
|
|
205
|
+
Based on the detection result, read the matching templates from `.claude/templates/`:
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
Primary template: .claude/templates/stacks/<framework>-<orm>.md
|
|
209
|
+
(or .claude/templates/stacks/<framework>.md if no ORM)
|
|
210
|
+
Test template: .claude/templates/test-runners/<test-runner>.md
|
|
211
|
+
E2E template: .claude/templates/test-runners/<e2e-runner>.md (if applicable)
|
|
212
|
+
Mobile template: .claude/templates/mobile/<mobile>.md (if applicable)
|
|
213
|
+
Fallback: .claude/templates/stacks/generic.md
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Extract from each template:
|
|
217
|
+
- `BACKEND_AGENT_BODY` section → replaces body in `.claude/agents/dev-backend.md`
|
|
218
|
+
- `FRONTEND_AGENT_BODY` section → replaces body in `.claude/agents/dev-frontend.md`
|
|
219
|
+
- `TEST_AGENT_BODY` section → replaces body in `.claude/agents/dev-test.md`
|
|
220
|
+
- `E2E_AGENT_BODY` section → replaces body in `.claude/agents/dev-e2e.md`
|
|
221
|
+
- `LINT_CMD`, `TEST_CMD`, `BUILD_CMD`, `E2E_CMD` → used in CLAUDE.md + settings.json
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Phase 5: Generate Files
|
|
226
|
+
|
|
227
|
+
### 5a. Update engineering agents
|
|
228
|
+
|
|
229
|
+
For each agent: preserve the YAML frontmatter exactly. Replace everything after the closing `---` with the stack-specific body from the template.
|
|
230
|
+
|
|
231
|
+
Files to update:
|
|
232
|
+
- `.claude/agents/dev-backend.md`
|
|
233
|
+
- `.claude/agents/dev-frontend.md`
|
|
234
|
+
- `.claude/agents/dev-test.md`
|
|
235
|
+
- `.claude/agents/dev-e2e.md`
|
|
236
|
+
|
|
237
|
+
### 5b. Generate or update CLAUDE.md
|
|
238
|
+
|
|
239
|
+
**If CLAUDE.md exists:** Preserve content outside `<!-- CDK:START -->` / `<!-- CDK:END -->` fences. Only replace the fenced section.
|
|
240
|
+
|
|
241
|
+
**If new:** Generate the full file using `.claude/templates/claude-md-template.md` as the structure.
|
|
242
|
+
|
|
243
|
+
**Content to populate:**
|
|
244
|
+
- Project name from `package.json` `name` field (or ask for new projects)
|
|
245
|
+
- Stack summary
|
|
246
|
+
- Dev commands table (extracted from `package.json` `scripts` or language conventions)
|
|
247
|
+
- Validation gate commands
|
|
248
|
+
|
|
249
|
+
### 5c. Update .claude/settings.json
|
|
250
|
+
|
|
251
|
+
Read existing settings.json. Preserve the `hooks` section verbatim. Replace only the `permissions.allow` array with:
|
|
252
|
+
|
|
253
|
+
**Always include:**
|
|
254
|
+
```json
|
|
255
|
+
"Read", "Write", "Edit",
|
|
256
|
+
"Bash(gh:*)", "Bash(git:*)", "Bash(ls:*)", "Bash(grep:*)", "Bash(tree:*)",
|
|
257
|
+
"Bash(gemini:*)", "Bash(gemini -p:*)"
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**Per package manager:**
|
|
261
|
+
- bun → `"Bash(bun:*)"`, `"Bash(bunx:*)"`
|
|
262
|
+
- npm → `"Bash(npm run:*)"`, `"Bash(npx:*)"`
|
|
263
|
+
- pnpm → `"Bash(pnpm:*)"`, `"Bash(pnpm dlx:*)"`
|
|
264
|
+
- yarn → `"Bash(yarn:*)"`
|
|
265
|
+
- poetry → `"Bash(poetry:*)"`, `"Bash(python:*)"`
|
|
266
|
+
- go → `"Bash(go:*)"`
|
|
267
|
+
- cargo → `"Bash(cargo:*)"`
|
|
268
|
+
|
|
269
|
+
**Per tools:**
|
|
270
|
+
- Docker present → `"Bash(docker:*)"`, `"Bash(docker compose:*)"`
|
|
271
|
+
- Playwright → `"Bash(npx playwright:*)"` or `"Bash(bunx playwright:*)"`
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Phase 6: Completion Report
|
|
276
|
+
|
|
277
|
+
```markdown
|
|
278
|
+
## /init Complete ✅
|
|
279
|
+
|
|
280
|
+
### Detected / Configured Stack
|
|
281
|
+
| Component | Value |
|
|
282
|
+
|-----------|-------|
|
|
283
|
+
| Framework | Next.js 15 (App Router) |
|
|
284
|
+
| ORM | Prisma 7 + PostgreSQL |
|
|
285
|
+
| Package manager | Bun |
|
|
286
|
+
| Test runner | Jest |
|
|
287
|
+
| E2E | Playwright |
|
|
288
|
+
| Mobile | Capacitor |
|
|
289
|
+
|
|
290
|
+
### Files Generated/Updated
|
|
291
|
+
- `.claude/agents/dev-backend.md` — Next.js + Prisma patterns
|
|
292
|
+
- `.claude/agents/dev-frontend.md` — Next.js App Router + Tailwind patterns
|
|
293
|
+
- `.claude/agents/dev-test.md` — Jest + Bun + DI mock patterns
|
|
294
|
+
- `.claude/agents/dev-e2e.md` — Playwright patterns
|
|
295
|
+
- `CLAUDE.md` — project guide created/updated
|
|
296
|
+
- `.claude/settings.json` — permissions updated
|
|
297
|
+
|
|
298
|
+
### Next Steps
|
|
299
|
+
1. **Review** `CLAUDE.md` and add any project-specific conventions
|
|
300
|
+
2. **Run** `/primer` to verify Claude understands the project
|
|
301
|
+
3. **Plan** your backlog: `/pm:groom` → `/pm:size` → `/pm:plan-epic`
|
|
302
|
+
4. **Build**: `/dev <issue-number>` to implement your first feature
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Important Notes
|
|
308
|
+
|
|
309
|
+
- `/init` is safe to re-run — it preserves manual customizations in CLAUDE.md (outside CDK fences) and preserves all hooks in settings.json
|
|
310
|
+
- After a major stack change (e.g., adding a new ORM), re-run `/init` to refresh the engineering agents
|
|
311
|
+
- The `project-manager` and `dev-lead` orchestrators are stack-agnostic — they are never modified by `/init`
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Groom GitHub/Linear/Jira issues. Adds acceptance criteria, Definition of Done, and sub-tasks. Pass an issue number, milestone name, or leave empty to groom all ungroomed issues."
|
|
3
|
+
argument-hint: [issue-number | milestone-name | empty]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /pm:groom
|
|
7
|
+
|
|
8
|
+
Invoke the `project-manager` orchestrator to groom issues. The PM will internally spawn `pm-groomer` for each issue.
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
### 0. Rate limit preflight
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Check GitHub API availability before making bulk calls
|
|
16
|
+
gh api rate_limit --jq '.rate | "Remaining: \(.remaining)/\(.limit) (resets \(.reset | strftime("%H:%M")))"' 2>/dev/null || true
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
If remaining < 10, warn: "GitHub API rate limit is nearly exhausted. Wait until reset before grooming."
|
|
20
|
+
|
|
21
|
+
### 1. Identify issues to groom
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# If $ARGUMENTS is an issue number:
|
|
25
|
+
gh issue view $ARGUMENTS
|
|
26
|
+
|
|
27
|
+
# If $ARGUMENTS is a milestone name:
|
|
28
|
+
gh issue list --state open --milestone "$ARGUMENTS" --limit 50 --json number,title,body
|
|
29
|
+
|
|
30
|
+
# If $ARGUMENTS is empty — find ungroomed issues (no "Acceptance Criteria" heading):
|
|
31
|
+
gh issue list --state open --limit 50 --json number,title,body
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Filter for issues whose body does NOT contain "Acceptance Criteria".
|
|
35
|
+
|
|
36
|
+
### 2. Gather domain context
|
|
37
|
+
For each issue, search for 2-3 related source files using Grep on the issue title keywords. These file paths will be passed to the groomer as context.
|
|
38
|
+
|
|
39
|
+
### 3. Spawn project-manager
|
|
40
|
+
|
|
41
|
+
Use the Task tool with the `project-manager` agent:
|
|
42
|
+
```
|
|
43
|
+
Goal: "Groom the following issues and return updated issue bodies"
|
|
44
|
+
Context: [issue content + relevant file paths]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The project-manager will spawn `pm-groomer` for each issue or batch.
|
|
48
|
+
|
|
49
|
+
### 4. Present for confirmation
|
|
50
|
+
Show all updated issue bodies to the user. Ask: "Apply these updates to GitHub?"
|
|
51
|
+
|
|
52
|
+
If confirmed, run for each issue:
|
|
53
|
+
```bash
|
|
54
|
+
gh issue edit <number> --body "<updated-body>"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 5. Report
|
|
58
|
+
List all issues groomed with their new titles.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Full epic planning pipeline: groom all stories → size them → write PRPs for L/XL stories. Pass a milestone name."
|
|
3
|
+
argument-hint: [milestone-name]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /pm:plan-epic
|
|
7
|
+
|
|
8
|
+
Run the full planning pipeline for an epic (GitHub milestone). At the end, every story is groomed, sized, and L/XL stories have PRPs.
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
### 0. Rate limit preflight
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
gh api rate_limit --jq '.rate | "Remaining: \(.remaining)/\(.limit) (resets \(.reset | strftime("%H:%M")))"' 2>/dev/null || true
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
If remaining < 20, warn: "GitHub API rate limit is low. Epic planning makes many API calls — wait until reset or reduce the epic size."
|
|
19
|
+
|
|
20
|
+
### 1. Identify the epic
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# List milestones to pick from if $ARGUMENTS is empty
|
|
24
|
+
gh api repos/:owner/:repo/milestones --jq '.[].title'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If `$ARGUMENTS` is provided, use it as the milestone name.
|
|
28
|
+
|
|
29
|
+
### 2. List all stories in the epic
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
gh issue list --state open --milestone "$ARGUMENTS" --limit 50 --json number,title,body,labels
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 3. Grooming pass
|
|
36
|
+
|
|
37
|
+
For any issue without "Acceptance Criteria" in body:
|
|
38
|
+
- Run the `/pm:groom` flow (spawn project-manager with grooming goal)
|
|
39
|
+
- Confirm and apply before proceeding to sizing
|
|
40
|
+
|
|
41
|
+
### 4. Sizing pass
|
|
42
|
+
|
|
43
|
+
Run `/pm:size` flow for all stories in the epic.
|
|
44
|
+
Present sizing table. Confirm before applying labels.
|
|
45
|
+
|
|
46
|
+
### 5. PRP generation for L/XL stories
|
|
47
|
+
|
|
48
|
+
For each story sized L or XL, or with confidence < 0.7:
|
|
49
|
+
|
|
50
|
+
Spawn the `project-manager` with goal:
|
|
51
|
+
```
|
|
52
|
+
"Write a PRP for issue #<N>. Research the codebase and produce PRPs/<slug>.md"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The PM will internally spawn `pm-prp-writer`.
|
|
56
|
+
|
|
57
|
+
### 6. Epic summary report
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
## Epic Plan: <Milestone Name>
|
|
61
|
+
|
|
62
|
+
| # | Title | Size | Confidence | PRP |
|
|
63
|
+
|---|-------|------|------------|-----|
|
|
64
|
+
| #142 | Add pagination | M | 0.9 | — |
|
|
65
|
+
| #143 | Fix race condition | S | 0.8 | — |
|
|
66
|
+
| #144 | Stripe refunds | L | 0.6 | PRPs/stripe-refunds.md |
|
|
67
|
+
|
|
68
|
+
### Sprint Allocation
|
|
69
|
+
Sprint 1: #142, #143 (3 days total)
|
|
70
|
+
Sprint 2: #144 (after PRP review)
|
|
71
|
+
|
|
72
|
+
### Ready for development
|
|
73
|
+
Run: `/dev 142` to begin implementation
|
|
74
|
+
```
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Size stories for sprint planning. Adds t-shirt size labels (size:XS/S/M/L/XL) and confidence scores. Pass a milestone name, issue numbers, or leave empty for all groomed issues."
|
|
3
|
+
argument-hint: [milestone-name | issue-numbers | empty]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /pm:size
|
|
7
|
+
|
|
8
|
+
Invoke the `project-manager` orchestrator to size stories. The PM will internally spawn `pm-sizer`.
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
### 1. Fetch stories to size
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# If $ARGUMENTS is a milestone:
|
|
16
|
+
gh issue list --state open --milestone "$ARGUMENTS" --limit 50 --json number,title,body,labels
|
|
17
|
+
|
|
18
|
+
# If $ARGUMENTS is issue numbers (space-separated):
|
|
19
|
+
# Fetch each: gh issue view <N>
|
|
20
|
+
|
|
21
|
+
# If empty — all groomed issues (have "Acceptance Criteria"):
|
|
22
|
+
gh issue list --state open --limit 100 --json number,title,body,labels
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Filter for issues that have "Acceptance Criteria" in body (groomed) but do NOT already have a `size:*` label.
|
|
26
|
+
|
|
27
|
+
### 2. Get sprint capacity
|
|
28
|
+
Ask the user: "What is your sprint capacity in days?" (default: 10)
|
|
29
|
+
|
|
30
|
+
### 3. Spawn project-manager
|
|
31
|
+
|
|
32
|
+
Use the Task tool:
|
|
33
|
+
```
|
|
34
|
+
Goal: "Size the following groomed stories and produce a sprint plan"
|
|
35
|
+
Context: [full issue bodies + sprint capacity]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The project-manager will spawn `pm-sizer`.
|
|
39
|
+
|
|
40
|
+
### 4. Present sizing table
|
|
41
|
+
Show the sizing table and sprint plan. Ask: "Apply size labels to GitHub?"
|
|
42
|
+
|
|
43
|
+
If confirmed, run the `gh issue edit --add-label` commands returned by the sizer.
|
|
44
|
+
|
|
45
|
+
### 5. Flag L/XL stories
|
|
46
|
+
For any L or XL story, suggest: "Run `/pm:plan-epic` for issue #N to generate a PRP before scheduling."
|