claude-pro-minmax 1.0.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/CLAUDE.md +60 -0
- package/.claude/agents/README.ko.md +210 -0
- package/.claude/agents/README.md +210 -0
- package/.claude/agents/builder.md +96 -0
- package/.claude/agents/dplanner.md +58 -0
- package/.claude/agents/planner.md +52 -0
- package/.claude/agents/reviewer.md +69 -0
- package/.claude/commands/README.ko.md +381 -0
- package/.claude/commands/README.md +381 -0
- package/.claude/commands/analyze-failures.md +49 -0
- package/.claude/commands/compact-phase.md +75 -0
- package/.claude/commands/do-opus.md +43 -0
- package/.claude/commands/do-sonnet.md +43 -0
- package/.claude/commands/do.md +56 -0
- package/.claude/commands/dplan.md +36 -0
- package/.claude/commands/learn.md +64 -0
- package/.claude/commands/llms-txt.md +50 -0
- package/.claude/commands/load-context.md +46 -0
- package/.claude/commands/plan.md +62 -0
- package/.claude/commands/review.md +55 -0
- package/.claude/commands/session-load.md +61 -0
- package/.claude/commands/session-save.md +79 -0
- package/.claude/commands/watch.md +58 -0
- package/.claude/contexts/README.ko.md +94 -0
- package/.claude/contexts/README.md +94 -0
- package/.claude/contexts/backend-context.md +23 -0
- package/.claude/contexts/frontend-context.md +24 -0
- package/.claude/rules/README.ko.md +98 -0
- package/.claude/rules/README.md +98 -0
- package/.claude/rules/code-style.md +21 -0
- package/.claude/rules/critical-actions.md +34 -0
- package/.claude/rules/security.md +13 -0
- package/.claude/sessions/2025-01-27-auth-jwt-refresh.md +32 -0
- package/.claude/sessions/README.ko.md +195 -0
- package/.claude/sessions/README.md +195 -0
- package/.claude/settings.json +167 -0
- package/.claude/settings.local.example.json +3 -0
- package/.claude/skills/README.ko.md +60 -0
- package/.claude/skills/README.md +60 -0
- package/.claude/skills/cli-wrappers/SKILL.md +38 -0
- package/.claude/skills/cli-wrappers/references/github-cli.md +18 -0
- package/.claude/skills/cli-wrappers/references/mgrep.md +18 -0
- package/.claude/skills/learned/README.ko.md +64 -0
- package/.claude/skills/learned/README.md +64 -0
- package/.claude.json +28 -0
- package/.claudeignore +17 -0
- package/LICENSE +21 -0
- package/README.ko.md +441 -0
- package/README.md +441 -0
- package/bin/cpmm.js +171 -0
- package/install.sh +154 -0
- package/package.json +59 -0
- package/scripts/README.ko.md +150 -0
- package/scripts/README.md +150 -0
- package/scripts/analyze-failures.sh +145 -0
- package/scripts/build.sh +34 -0
- package/scripts/claude_command_smoke.sh +116 -0
- package/scripts/commit.sh +7 -0
- package/scripts/create-branch.sh +14 -0
- package/scripts/hooks/README.ko.md +117 -0
- package/scripts/hooks/README.md +118 -0
- package/scripts/hooks/compact-suggest.sh +52 -0
- package/scripts/hooks/critical-action-check.sh +68 -0
- package/scripts/hooks/notification.sh +47 -0
- package/scripts/hooks/post-edit-format.sh +39 -0
- package/scripts/hooks/pre-compact.sh +55 -0
- package/scripts/hooks/readonly-check.sh +19 -0
- package/scripts/hooks/retry-check.sh +32 -0
- package/scripts/hooks/session-cleanup.sh +83 -0
- package/scripts/hooks/session-start.sh +70 -0
- package/scripts/hooks/stop-collect-context.sh +39 -0
- package/scripts/hooks/tool-failure-log.sh +46 -0
- package/scripts/lint.sh +34 -0
- package/scripts/runtime/README.ko.md +60 -0
- package/scripts/runtime/README.md +60 -0
- package/scripts/runtime/adapters/README.ko.md +68 -0
- package/scripts/runtime/adapters/README.md +68 -0
- package/scripts/runtime/adapters/_interface.sh +53 -0
- package/scripts/runtime/adapters/_template.sh +67 -0
- package/scripts/runtime/adapters/generic.sh +78 -0
- package/scripts/runtime/adapters/go.sh +51 -0
- package/scripts/runtime/adapters/jvm.sh +97 -0
- package/scripts/runtime/adapters/node.sh +104 -0
- package/scripts/runtime/adapters/python.sh +116 -0
- package/scripts/runtime/adapters/rust.sh +49 -0
- package/scripts/runtime/detect.sh +52 -0
- package/scripts/scrub-secrets.js +48 -0
- package/scripts/snapshot.sh +45 -0
- package/scripts/test.sh +34 -0
- package/scripts/verify.sh +35 -0
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
> **[한국어 버전](README.ko.md)**
|
|
2
|
+
|
|
3
|
+
# Commands Directory
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
Contains slash command definitions for common workflows.
|
|
7
|
+
|
|
8
|
+
> **Path note:** Command/agent prompts reference installed paths (`~/.claude/...`). In this repository, the corresponding source paths are `./.claude/...` and `./scripts/...`.
|
|
9
|
+
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
| Command | Purpose | Key Feature |
|
|
13
|
+
|---------|---------|-------------|
|
|
14
|
+
| `do.md` | Batch execution | Atomic plan+build+verify in ONE response with rollback on failure |
|
|
15
|
+
| `do-sonnet.md` | Execute with Sonnet | context: fork, model: sonnet |
|
|
16
|
+
| `do-opus.md` | Execute with Opus | context: fork, model: opus |
|
|
17
|
+
| `plan.md` | Complex tasks | @planner → @builder chain |
|
|
18
|
+
| `dplan.md` | Deep Planning | @dplanner (Sequential Thinking + Perplexity + Context7) |
|
|
19
|
+
| `review.md` | Code review | Read-only, categories |
|
|
20
|
+
| `learn.md` | Capture patterns | Auto-extract or explicit |
|
|
21
|
+
| `session-save.md` | Save state | Secret scrubbing |
|
|
22
|
+
| `session-load.md` | Resume work | Context restoration |
|
|
23
|
+
| `load-context.md` | Load context | Read tool, cost economy |
|
|
24
|
+
| `compact-phase.md` | Strategic compact | Phase-aware pruning |
|
|
25
|
+
| `watch.md` | tmux monitoring | Zero message cost |
|
|
26
|
+
| `llms-txt.md` | LLM Documentation | Fetch /llms.txt from URLs |
|
|
27
|
+
| `analyze-failures.md` | Analyze tool errors | Hybrid learning (log + analyze) |
|
|
28
|
+
|
|
29
|
+
## Command Categories
|
|
30
|
+
|
|
31
|
+
### Execution Commands
|
|
32
|
+
| Command | When to Use | Resource Usage |
|
|
33
|
+
|---------|-------------|----------------|
|
|
34
|
+
| `/do` | Simple-to-medium tasks (1-3 files). Atomic batch with rollback on failure | Minimal (session model) |
|
|
35
|
+
| `/do-sonnet` | Complex logic requiring deeper reasoning | Moderate (Sonnet 4.6) |
|
|
36
|
+
| `/do-opus` | Critical decisions, Sonnet failed | Higher (Opus 4.6—API pricing reflects cost) |
|
|
37
|
+
| `/plan` | Multi-file tasks, architecture decisions | Moderate (Sonnet 4.6 → Haiku 4.5 chain) |
|
|
38
|
+
| `/dplan` | Research-heavy, complex architecture | Higher (Sonnet 4.6 + MCP tools) |
|
|
39
|
+
|
|
40
|
+
### Quality Assurance
|
|
41
|
+
| Command | When to Use | Resource Usage |
|
|
42
|
+
|---------|-------------|----------------|
|
|
43
|
+
| `/review` | Post-implementation quality check | Minimal (Haiku 4.5, read-only) |
|
|
44
|
+
|
|
45
|
+
### Session Management
|
|
46
|
+
| Command | When to Use | Resource Usage |
|
|
47
|
+
|---------|-------------|----------------|
|
|
48
|
+
| `/session-save` | Save work summary for later | Local script (zero API usage) |
|
|
49
|
+
| `/session-load` | Resume previous work | Minimal (Read tool for context) |
|
|
50
|
+
|
|
51
|
+
### Context Management
|
|
52
|
+
| Command | When to Use | Resource Usage |
|
|
53
|
+
|---------|-------------|----------------|
|
|
54
|
+
| `/load-context` | Load project context templates | Minimal (Read tool) |
|
|
55
|
+
| `/compact-phase` | Strategic context pruning | Guidance only (no execution) |
|
|
56
|
+
|
|
57
|
+
### Learning & Analysis
|
|
58
|
+
| Command | When to Use | Resource Usage |
|
|
59
|
+
|---------|-------------|----------------|
|
|
60
|
+
| `/learn` | Capture patterns for future reference | Minimal (Write to learned/) |
|
|
61
|
+
| `/analyze-failures` | Analyze accumulated tool failures | Moderate (requires LLM analysis) |
|
|
62
|
+
|
|
63
|
+
### Utilities
|
|
64
|
+
| Command | When to Use | Resource Usage |
|
|
65
|
+
|---------|-------------|----------------|
|
|
66
|
+
| `/watch` | Monitor long-running processes | Local tmux (zero API usage) |
|
|
67
|
+
| `/llms-txt` | Fetch LLM-optimized documentation | Minimal (WebFetch) |
|
|
68
|
+
|
|
69
|
+
## Workflow Examples
|
|
70
|
+
|
|
71
|
+
### Simple Feature Implementation
|
|
72
|
+
```bash
|
|
73
|
+
# 1. Direct execution for simple, well-defined tasks
|
|
74
|
+
/do Create a user service with CRUD operations
|
|
75
|
+
|
|
76
|
+
# 2. Review after implementation
|
|
77
|
+
/review src/services/user-service.ts
|
|
78
|
+
```
|
|
79
|
+
**Quota:** Low (Session model execution + Haiku 4.5 review)
|
|
80
|
+
|
|
81
|
+
### Complex Feature Implementation
|
|
82
|
+
```bash
|
|
83
|
+
# 1. Plan architecture first
|
|
84
|
+
/plan Add JWT authentication with refresh tokens
|
|
85
|
+
|
|
86
|
+
# 2. Planner designs → Builder implements → Auto-review
|
|
87
|
+
# (Agent chain handles this automatically)
|
|
88
|
+
|
|
89
|
+
# 3. Manual review if needed
|
|
90
|
+
/review src/auth/
|
|
91
|
+
```
|
|
92
|
+
**Quota:** Medium (Sonnet 4.6 planning + Haiku 4.5 implementation + Haiku 4.5 review)
|
|
93
|
+
|
|
94
|
+
### Research-Heavy Architecture
|
|
95
|
+
```bash
|
|
96
|
+
# 1. Deep planning with research tools
|
|
97
|
+
/dplan Analyze trade-offs between event sourcing and CQRS for our use case
|
|
98
|
+
|
|
99
|
+
# 2. Load relevant context after research
|
|
100
|
+
/load-context backend
|
|
101
|
+
|
|
102
|
+
# 3. Implement based on research findings
|
|
103
|
+
# (Use /plan or /do based on complexity)
|
|
104
|
+
```
|
|
105
|
+
**Quota:** High (Sonnet 4.6 + Sequential Thinking + Perplexity + Context7)
|
|
106
|
+
|
|
107
|
+
### Debugging & Learning
|
|
108
|
+
```bash
|
|
109
|
+
# 1. Analyze recent failures
|
|
110
|
+
/analyze-failures 50
|
|
111
|
+
|
|
112
|
+
# 2. Extract patterns and create learned skills
|
|
113
|
+
/learn "Use type guards before accessing union properties"
|
|
114
|
+
|
|
115
|
+
# 3. Show learned patterns
|
|
116
|
+
/learn --show
|
|
117
|
+
```
|
|
118
|
+
**Quota:** Medium (LLM analysis of failure logs)
|
|
119
|
+
|
|
120
|
+
### Long Session Management
|
|
121
|
+
```bash
|
|
122
|
+
# 1. Load previous context
|
|
123
|
+
/session-load auth-feature
|
|
124
|
+
|
|
125
|
+
# 2. Work on tasks...
|
|
126
|
+
|
|
127
|
+
# 3. Save progress before break
|
|
128
|
+
/session-save auth-feature-v2
|
|
129
|
+
|
|
130
|
+
# 4. Compact context strategically
|
|
131
|
+
/compact-phase implementation
|
|
132
|
+
```
|
|
133
|
+
**Quota:** Low (mostly script-based operations)
|
|
134
|
+
|
|
135
|
+
## Command Comparison
|
|
136
|
+
|
|
137
|
+
### Execution: /do vs /do-sonnet vs /do-opus vs /plan vs /dplan
|
|
138
|
+
|
|
139
|
+
| Aspect | /do | /do-sonnet | /do-opus | /plan | /dplan |
|
|
140
|
+
|--------|-----|------------|----------|-------|--------|
|
|
141
|
+
| **Model** | Session model | Sonnet 4.6 | Opus 4.6 | Sonnet 4.6 → Haiku 4.5 | Sonnet 4.6 + MCP |
|
|
142
|
+
| **Relative Cost** | Low | Medium | High | Medium-High | Highest |
|
|
143
|
+
| **Planning** | Internal (batch) | Internal (batch) | Internal (batch) | Architecture design | Deep research |
|
|
144
|
+
| **Use Case** | Simple tasks | Complex logic | Critical decisions | Multi-file features | Unknown unknowns |
|
|
145
|
+
| **Files Affected** | 1-3 | 1-3 | Any | 5+ | Any |
|
|
146
|
+
| **Questions** | No | No | No | ≤3 (with defaults) | Unlimited |
|
|
147
|
+
| **Research Tools** | No | No | No | No | Yes (Perplexity, Context7) |
|
|
148
|
+
|
|
149
|
+
**Decision Tree:**
|
|
150
|
+
```
|
|
151
|
+
Task Complexity
|
|
152
|
+
├─ Simple (1-3 files, clear requirements)
|
|
153
|
+
│ └─→ /do
|
|
154
|
+
│
|
|
155
|
+
├─ Moderate (4-5 files, some complexity)
|
|
156
|
+
│ ├─ Logic-heavy → /do-sonnet
|
|
157
|
+
│ └─ Multi-file → /plan
|
|
158
|
+
│
|
|
159
|
+
└─ Complex (5+ files, unclear approach)
|
|
160
|
+
├─ Known domain → /plan
|
|
161
|
+
├─ Needs research → /dplan
|
|
162
|
+
└─ Critical/Sonnet failed → /do-opus
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Context: /session-save vs /load-context
|
|
166
|
+
|
|
167
|
+
| Aspect | /session-save | /load-context |
|
|
168
|
+
|--------|---------------|---------------|
|
|
169
|
+
| **Purpose** | Save entire session state | Load pre-defined templates |
|
|
170
|
+
| **Content** | Work history, decisions, code | Project structure, conventions |
|
|
171
|
+
| **Scope** | Session-specific | Project-wide patterns |
|
|
172
|
+
| **When** | End of work session | Start of new task |
|
|
173
|
+
| **Format** | Markdown summary | Structured context file |
|
|
174
|
+
|
|
175
|
+
**Use together:**
|
|
176
|
+
```bash
|
|
177
|
+
# Start of day
|
|
178
|
+
/session-load yesterday-work # Resume from yesterday
|
|
179
|
+
/load-context backend # Load project conventions
|
|
180
|
+
|
|
181
|
+
# End of day
|
|
182
|
+
/session-save today-progress # Save for tomorrow
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Best Practices
|
|
186
|
+
|
|
187
|
+
### 1. Choose the Right Execution Command
|
|
188
|
+
|
|
189
|
+
**Use `/do` when:**
|
|
190
|
+
- Task is well-defined with clear requirements
|
|
191
|
+
- Affects 1-3 files only
|
|
192
|
+
- No architectural decisions needed
|
|
193
|
+
- Example: "Add validation to user input"
|
|
194
|
+
|
|
195
|
+
**Use `/plan` when:**
|
|
196
|
+
- Task affects 5+ files
|
|
197
|
+
- Requires architectural decisions
|
|
198
|
+
- Requirements need clarification
|
|
199
|
+
- Example: "Add multi-tenant support"
|
|
200
|
+
|
|
201
|
+
**Use `/dplan` when:**
|
|
202
|
+
- Unknown technology or pattern
|
|
203
|
+
- Need to evaluate multiple approaches
|
|
204
|
+
- Debugging complex race conditions
|
|
205
|
+
- Example: "Design distributed transaction handling"
|
|
206
|
+
|
|
207
|
+
**Use `/do-opus` when:**
|
|
208
|
+
- Task is critical (production hotfix)
|
|
209
|
+
- Sonnet failed after 2 retries
|
|
210
|
+
- Maximum reasoning capability needed
|
|
211
|
+
- Example: "Fix memory leak in production"
|
|
212
|
+
|
|
213
|
+
### 2. Strategic Context Management
|
|
214
|
+
|
|
215
|
+
**Compact early and often:**
|
|
216
|
+
```bash
|
|
217
|
+
# After planning phase
|
|
218
|
+
/compact-phase planning
|
|
219
|
+
|
|
220
|
+
# After implementation
|
|
221
|
+
/compact-phase implementation
|
|
222
|
+
|
|
223
|
+
# After review
|
|
224
|
+
/compact-phase review
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**Load context selectively:**
|
|
228
|
+
```bash
|
|
229
|
+
# Don't load everything at once
|
|
230
|
+
/load-context backend # ✓ Load what you need
|
|
231
|
+
/load-context frontend # ✗ Don't load if not needed
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### 3. Learning from Failures
|
|
235
|
+
|
|
236
|
+
**Analyze failures regularly:**
|
|
237
|
+
```bash
|
|
238
|
+
# Weekly analysis
|
|
239
|
+
/analyze-failures 100
|
|
240
|
+
|
|
241
|
+
# After difficult debugging session
|
|
242
|
+
/analyze-failures 20
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**Capture patterns immediately:**
|
|
246
|
+
```bash
|
|
247
|
+
# Right after solving a tricky issue
|
|
248
|
+
/learn "Use AbortController for cancellable fetch requests"
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### 4. Session Management
|
|
252
|
+
|
|
253
|
+
**Save at natural breakpoints:**
|
|
254
|
+
- End of work session
|
|
255
|
+
- Before switching tasks
|
|
256
|
+
- After major milestone
|
|
257
|
+
- Before experimental changes
|
|
258
|
+
|
|
259
|
+
**Load when resuming:**
|
|
260
|
+
- Start of work session
|
|
261
|
+
- Switching back to previous task
|
|
262
|
+
- Need context from past work
|
|
263
|
+
|
|
264
|
+
### 5. Pro Plan Optimization
|
|
265
|
+
|
|
266
|
+
**Minimize high-cost commands:**
|
|
267
|
+
- Use `/do` instead of `/plan` when possible
|
|
268
|
+
- Use `/do-sonnet` instead of `/do-opus` when possible
|
|
269
|
+
- Use `/plan` instead of `/dplan` when research isn't critical
|
|
270
|
+
|
|
271
|
+
**Batch operations:**
|
|
272
|
+
```bash
|
|
273
|
+
# ✗ Multiple separate /do calls
|
|
274
|
+
/do Create user model
|
|
275
|
+
/do Create user controller
|
|
276
|
+
/do Create user tests
|
|
277
|
+
|
|
278
|
+
# ✓ Single /plan call
|
|
279
|
+
/plan Create user module with model, controller, and tests
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**Use zero-cost tools:**
|
|
283
|
+
- `/session-save`, `/session-load` (script-based)
|
|
284
|
+
- `/watch` (tmux-based)
|
|
285
|
+
- `/compact-phase` (guidance only)
|
|
286
|
+
|
|
287
|
+
## Usage Examples
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
# Direct execution (simple tasks)
|
|
291
|
+
/do Create a user service
|
|
292
|
+
/do-sonnet Implement complex caching logic
|
|
293
|
+
|
|
294
|
+
# Complex tasks (planning needed)
|
|
295
|
+
/plan Add user authentication with JWT
|
|
296
|
+
/dplan Analyze potential deadlocks in transaction manager
|
|
297
|
+
|
|
298
|
+
# Code review
|
|
299
|
+
/review src/auth/
|
|
300
|
+
/review --security
|
|
301
|
+
|
|
302
|
+
# Learning
|
|
303
|
+
/learn "Always use zod for validation"
|
|
304
|
+
/learn --show
|
|
305
|
+
/analyze-failures 50
|
|
306
|
+
|
|
307
|
+
# Sessions
|
|
308
|
+
/session-save auth-feature
|
|
309
|
+
/session-load
|
|
310
|
+
|
|
311
|
+
# Context
|
|
312
|
+
/load-context backend
|
|
313
|
+
/load-context frontend
|
|
314
|
+
|
|
315
|
+
# Phases
|
|
316
|
+
/compact-phase implementation
|
|
317
|
+
/watch tests
|
|
318
|
+
/llms-txt https://docs.example.com
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
## Design Decisions
|
|
322
|
+
|
|
323
|
+
| Decision | Rationale |
|
|
324
|
+
|----------|-----------|
|
|
325
|
+
| `/do-sonnet` and `/do-opus` as separate commands | Frontmatter `model:` field only works with `context: fork`. Separate commands are required to route execution through the intended subagent model |
|
|
326
|
+
| `/plan` uses `agent: planner`, `/review` uses `agent: reviewer` | These commands need specific tool restrictions. `planner` is read-only (no Write/Edit). `reviewer` is also read-only. The `agent:` field applies that agent's tools/permissions |
|
|
327
|
+
| `/load-context` with `disable-model-invocation: false` | Must be `false` so Claude can auto-invoke this command. If `true`, Claude cannot use Read tool to load context files |
|
|
328
|
+
| `/compact-phase` as guidance only | Claude Code's `/compact` requires user input. This command provides phase-specific prompts to copy-paste |
|
|
329
|
+
|
|
330
|
+
## Adding Custom Commands
|
|
331
|
+
|
|
332
|
+
Create a new `.md` file with **frontmatter** (required for official compliance):
|
|
333
|
+
|
|
334
|
+
```markdown
|
|
335
|
+
---
|
|
336
|
+
name: your-command
|
|
337
|
+
description: What this command does and when to use it
|
|
338
|
+
argument-hint: [required-arg] or --flag [optional]
|
|
339
|
+
disable-model-invocation: true
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
# /your-command Command
|
|
343
|
+
|
|
344
|
+
## Purpose
|
|
345
|
+
What this command does.
|
|
346
|
+
|
|
347
|
+
## Input
|
|
348
|
+
$ARGUMENTS
|
|
349
|
+
|
|
350
|
+
## Execution
|
|
351
|
+
1. Step one
|
|
352
|
+
2. Step two
|
|
353
|
+
|
|
354
|
+
## Output
|
|
355
|
+
\`\`\`
|
|
356
|
+
Expected output format
|
|
357
|
+
\`\`\`
|
|
358
|
+
|
|
359
|
+
## Examples
|
|
360
|
+
\`\`\`bash
|
|
361
|
+
/your-command example
|
|
362
|
+
\`\`\`
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Frontmatter Fields
|
|
366
|
+
|
|
367
|
+
| Field | Required | Description |
|
|
368
|
+
|-------|:--------:|-------------|
|
|
369
|
+
| `name` | Yes | Command name (lowercase, hyphens) |
|
|
370
|
+
| `description` | Yes | When to use this command (for Claude auto-invocation) |
|
|
371
|
+
| `argument-hint` | No | Shows in autocomplete |
|
|
372
|
+
| `disable-model-invocation` | No | `true` = manual only, `false` = Claude can auto-invoke |
|
|
373
|
+
| `allowed-tools` | No | Restrict tools (e.g., `Read, Grep`) |
|
|
374
|
+
| `model` | No | Force model (`sonnet`, `haiku`, `opus`) |
|
|
375
|
+
| `context` | No | `fork` = run in subagent context |
|
|
376
|
+
| `agent` | No | Subagent type when `context: fork` (e.g., `planner`, `reviewer`) |
|
|
377
|
+
| `hooks` | No | Lifecycle hooks (`PreToolUse`, `PostToolUse`, `Stop`) |
|
|
378
|
+
|
|
379
|
+
### Location
|
|
380
|
+
- Global: `~/.claude/commands/` (all projects)
|
|
381
|
+
- Project: `./.claude/commands/` (this project only)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: analyze-failures
|
|
3
|
+
description: Analyze accumulated tool failure logs to extract recurring patterns and suggest improvements.
|
|
4
|
+
argument-hint: [limit] (default: 50)
|
|
5
|
+
disable-model-invocation: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /analyze-failures Command
|
|
9
|
+
|
|
10
|
+
Analyze tool failure logs to identify recurring errors and suggest patterns for the `/learn` command.
|
|
11
|
+
|
|
12
|
+
## Input
|
|
13
|
+
- `limit` (optional): Number of recent failures to analyze. Default is 50.
|
|
14
|
+
|
|
15
|
+
## Execution
|
|
16
|
+
Run the bash script to parse `~/.claude/logs/tool-failures.log`:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
bash ~/.claude/scripts/analyze-failures.sh "$ARGUMENTS"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## How It Works
|
|
23
|
+
1. **Collection**: Failures are automatically logged by `~/.claude/scripts/hooks/tool-failure-log.sh` (Zero-cost).
|
|
24
|
+
2. **Analysis**: This command uses `awk` to aggregate and count errors locally (Zero-cost for generation).
|
|
25
|
+
3. **Insight**: The output summary is added to context, allowing Claude to offer specific advice if needed.
|
|
26
|
+
|
|
27
|
+
## Output Example
|
|
28
|
+
```markdown
|
|
29
|
+
## Failure Analysis
|
|
30
|
+
|
|
31
|
+
**Total failures logged**: 120
|
|
32
|
+
**Analyzing last**: 50
|
|
33
|
+
|
|
34
|
+
### Top Failures
|
|
35
|
+
1. **Edit tool**: "old_string not found" (15 failures)
|
|
36
|
+
2. **Grep tool**: "pattern syntax error" (8 failures)
|
|
37
|
+
|
|
38
|
+
### Most Problematic Tools
|
|
39
|
+
- **Edit tool**: 25 failures
|
|
40
|
+
- **Grep tool**: 12 failures
|
|
41
|
+
|
|
42
|
+
💡 **Recommendations**:
|
|
43
|
+
- Review frequent failures and update your approach
|
|
44
|
+
- Consider saving learned patterns with `/learn [pattern]`
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Difference from `/learn`
|
|
48
|
+
- **`/analyze-failures`**: **Quantitative**. Looks at *past errors* from logs. "What went wrong?"
|
|
49
|
+
- **`/learn`**: **Qualitative**. Extracts *successful patterns* from current context. "What went right?"
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: compact-phase
|
|
3
|
+
description: Strategic phase-based context pruning. Removes unnecessary context based on planning, implementation, or review phase.
|
|
4
|
+
argument-hint: planning | implementation | review | deep-planning
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /compact-phase Command
|
|
9
|
+
|
|
10
|
+
Strategic phase-based context pruning.
|
|
11
|
+
|
|
12
|
+
## Phase
|
|
13
|
+
$ARGUMENTS
|
|
14
|
+
|
|
15
|
+
## Execution
|
|
16
|
+
This command provides the appropriate `/compact` instruction for your current phase. Copy and run the suggested command:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# After planning phase
|
|
20
|
+
/compact Keep: decisions, task list, architecture choices. Discard: exploration attempts, rejected alternatives, research notes.
|
|
21
|
+
|
|
22
|
+
# After implementation phase
|
|
23
|
+
/compact Keep: final code, tests, working solutions. Discard: debug attempts, failed approaches, intermediate versions.
|
|
24
|
+
|
|
25
|
+
# After review phase
|
|
26
|
+
/compact Keep: final state, confirmed issues, applied fixes. Discard: iteration history, superseded feedback.
|
|
27
|
+
|
|
28
|
+
# After deep planning phase
|
|
29
|
+
/compact Keep: validated logic, research sources, architecture diagram. Discard: internal monologue, failed research queries, temporary notes.
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
> Note: This command guides you to run `/compact` with the right instructions. It does not automatically compact context.
|
|
33
|
+
|
|
34
|
+
## Phase-Specific Rules
|
|
35
|
+
|
|
36
|
+
| Phase | Keep | Discard |
|
|
37
|
+
|-------|------|---------|
|
|
38
|
+
| planning | Decisions, task list | Exploration, reviewed alternatives |
|
|
39
|
+
| implementation | Final code, tests | Debug attempts, intermediate versions |
|
|
40
|
+
| review | Final state, issue list | Iteration history |
|
|
41
|
+
| deep-planning | Validated logic, final plan | Intermediate thoughts, raw search results |
|
|
42
|
+
|
|
43
|
+
## Cost Savings
|
|
44
|
+
- planning → implementation: ~40% context reduction
|
|
45
|
+
- implementation → review: ~30% context reduction
|
|
46
|
+
- review → complete: ~50% context reduction
|
|
47
|
+
|
|
48
|
+
## Output
|
|
49
|
+
```
|
|
50
|
+
Compact: [phase] phase completed
|
|
51
|
+
|
|
52
|
+
Kept:
|
|
53
|
+
- [retained items]
|
|
54
|
+
|
|
55
|
+
Discarded:
|
|
56
|
+
- [removed items]
|
|
57
|
+
|
|
58
|
+
Context reduced: [X]% → [Y]%
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## When to Use
|
|
62
|
+
```
|
|
63
|
+
/plan feature-x # Plan
|
|
64
|
+
/compact-phase planning # Prune exploration
|
|
65
|
+
|
|
66
|
+
/do implement task-1 # Implement
|
|
67
|
+
/do implement task-2
|
|
68
|
+
/compact-phase implementation # Prune debug attempts
|
|
69
|
+
|
|
70
|
+
/review src/ # Review
|
|
71
|
+
/compact-phase review # Prune iterations
|
|
72
|
+
|
|
73
|
+
/dplan analyze-race # Deep Plan
|
|
74
|
+
/compact-phase deep-planning # Keep verified logic, discard raw thoughts
|
|
75
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: do-opus
|
|
3
|
+
description: Direct execution with Opus model for critical decisions. Use for the most complex tasks requiring maximum reasoning.
|
|
4
|
+
argument-hint: [task]
|
|
5
|
+
context: fork
|
|
6
|
+
model: opus
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /do-opus Command
|
|
10
|
+
|
|
11
|
+
Direct execution with Opus model via subagent.
|
|
12
|
+
|
|
13
|
+
## Task
|
|
14
|
+
$ARGUMENTS
|
|
15
|
+
|
|
16
|
+
## Protocol
|
|
17
|
+
1. Check CRITICAL_ACTIONS → confirm if found
|
|
18
|
+
2. **Snapshot**: `~/.claude/scripts/snapshot.sh push cpmm-opus`
|
|
19
|
+
3. Execute immediately (no planner)
|
|
20
|
+
4. Verify with `~/.claude/scripts/verify.sh` (runtime-adaptive)
|
|
21
|
+
5. **On Success**: `~/.claude/scripts/snapshot.sh drop`
|
|
22
|
+
6. **On Failure (2 retries)**: `~/.claude/scripts/snapshot.sh pop`. Then STOP + escalate.
|
|
23
|
+
|
|
24
|
+
## Verification (Runtime-Adaptive)
|
|
25
|
+
| Type | Verification |
|
|
26
|
+
|------|--------------|
|
|
27
|
+
| Config/Docs/Styles | Syntax only |
|
|
28
|
+
| Logic changes | `~/.claude/scripts/verify.sh` |
|
|
29
|
+
|
|
30
|
+
DO NOT call build tools directly. Use `~/.claude/scripts/verify.sh`.
|
|
31
|
+
|
|
32
|
+
## Cost Note
|
|
33
|
+
Opus is the most expensive model. Use only when:
|
|
34
|
+
- Sonnet also failed on the task
|
|
35
|
+
- Critical architectural decisions
|
|
36
|
+
- Tasks requiring maximum reasoning depth
|
|
37
|
+
|
|
38
|
+
## Escalation
|
|
39
|
+
```
|
|
40
|
+
Attempt 1 → FAIL → Attempt 2 → FAIL → STOP
|
|
41
|
+
→ Report error
|
|
42
|
+
→ Suggest: Break task into smaller pieces
|
|
43
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: do-sonnet
|
|
3
|
+
description: Direct execution with Sonnet model for complex logic. Use when default /do fails or task requires deeper reasoning.
|
|
4
|
+
argument-hint: [task]
|
|
5
|
+
context: fork
|
|
6
|
+
model: sonnet
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /do-sonnet Command
|
|
10
|
+
|
|
11
|
+
Direct execution with Sonnet model via subagent.
|
|
12
|
+
|
|
13
|
+
## Task
|
|
14
|
+
$ARGUMENTS
|
|
15
|
+
|
|
16
|
+
## Protocol
|
|
17
|
+
1. Check CRITICAL_ACTIONS → confirm if found
|
|
18
|
+
2. **Snapshot**: `~/.claude/scripts/snapshot.sh push cpmm-sonnet`
|
|
19
|
+
3. Execute immediately (no planner)
|
|
20
|
+
4. Verify with `~/.claude/scripts/verify.sh` (runtime-adaptive)
|
|
21
|
+
5. **On Success**: `~/.claude/scripts/snapshot.sh drop`
|
|
22
|
+
6. **On Failure (2 retries)**: `~/.claude/scripts/snapshot.sh pop`. Then STOP + escalate.
|
|
23
|
+
|
|
24
|
+
## Verification (Runtime-Adaptive)
|
|
25
|
+
| Type | Verification |
|
|
26
|
+
|------|--------------|
|
|
27
|
+
| Config/Docs/Styles | Syntax only |
|
|
28
|
+
| Logic changes | `~/.claude/scripts/verify.sh` |
|
|
29
|
+
|
|
30
|
+
DO NOT call build tools directly. Use `~/.claude/scripts/verify.sh`.
|
|
31
|
+
|
|
32
|
+
## Cost Note
|
|
33
|
+
Sonnet costs ~3x more than Haiku (API pricing: $3 vs $1 /MTok input). Use only when:
|
|
34
|
+
- Default `/do` failed after 2 retries
|
|
35
|
+
- Task requires complex reasoning or multi-step logic
|
|
36
|
+
- Architecture-level code changes
|
|
37
|
+
|
|
38
|
+
## Escalation
|
|
39
|
+
```
|
|
40
|
+
Attempt 1 → FAIL → Attempt 2 → FAIL → STOP
|
|
41
|
+
→ Report error
|
|
42
|
+
→ Suggest: /plan for architecture review
|
|
43
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: do
|
|
3
|
+
description: Direct execution without planner overhead. Use for simple bug fixes, single file changes, or clear tasks.
|
|
4
|
+
argument-hint: [task]
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /do Command
|
|
9
|
+
|
|
10
|
+
Direct execution. No agent overhead.
|
|
11
|
+
|
|
12
|
+
## Task
|
|
13
|
+
$ARGUMENTS
|
|
14
|
+
|
|
15
|
+
## Model Selection
|
|
16
|
+
- Default: current session model
|
|
17
|
+
- For stronger model: use `/do-sonnet [task]` or `/do-opus [task]`
|
|
18
|
+
|
|
19
|
+
## Protocol
|
|
20
|
+
1. Check CRITICAL_ACTIONS → confirm if found
|
|
21
|
+
2. **Snapshot**: `~/.claude/scripts/snapshot.sh push` → outputs `SNAPSHOT=true` or `SNAPSHOT=false`
|
|
22
|
+
3. **Internal Planning** (no agent call): Identify files to modify, changes needed, verify approach
|
|
23
|
+
4. **Execute all changes** in a single pass
|
|
24
|
+
5. Verify with `~/.claude/scripts/verify.sh` (runtime-adaptive)
|
|
25
|
+
6. **On Success**: `~/.claude/scripts/snapshot.sh drop` (auto-checks label — safe no-op if no snapshot)
|
|
26
|
+
7. **On Failure (2 retries exhausted)**: `~/.claude/scripts/snapshot.sh pop` (restores snapshot or `git checkout .` fallback). Then escalate.
|
|
27
|
+
|
|
28
|
+
## Batch Execution
|
|
29
|
+
This command handles plan+build+verify in ONE response.
|
|
30
|
+
- Do NOT spawn @planner — plan internally
|
|
31
|
+
- Do NOT ask for confirmation between steps
|
|
32
|
+
- Do NOT split work across multiple messages
|
|
33
|
+
- Result: user sends 1 message, receives 1 complete response
|
|
34
|
+
|
|
35
|
+
## Atomic Rollback
|
|
36
|
+
All rollback logic is in `~/.claude/scripts/snapshot.sh` (deterministic, not model-reasoned):
|
|
37
|
+
- **`push`**: Depth guard + labeled stash. Returns `SNAPSHOT=true/false`.
|
|
38
|
+
- **`drop`**: Label check before drop. Safe no-op if no cpmm stash exists.
|
|
39
|
+
- **`pop`**: Label check before pop. Falls back to `git checkout .` if no cpmm stash.
|
|
40
|
+
- Cost: 0 API tokens (local git operation)
|
|
41
|
+
- Limitation: Untracked (new) files are NOT stashed. For full cleanup after failure: `git clean -fd`
|
|
42
|
+
|
|
43
|
+
## Verification (Runtime-Adaptive)
|
|
44
|
+
| Type | Verification |
|
|
45
|
+
|------|--------------|
|
|
46
|
+
| Config/Docs/Styles | Syntax only |
|
|
47
|
+
| Logic changes | `~/.claude/scripts/verify.sh` |
|
|
48
|
+
|
|
49
|
+
DO NOT call build tools directly. Use `~/.claude/scripts/verify.sh`.
|
|
50
|
+
|
|
51
|
+
## Escalation
|
|
52
|
+
```
|
|
53
|
+
Attempt 1 → FAIL → Attempt 2 → FAIL → STOP
|
|
54
|
+
→ Report error
|
|
55
|
+
→ Suggest: /do-sonnet or /plan
|
|
56
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dplan
|
|
3
|
+
description: Deep planning with @dplanner. Use for extremely complex tasks requiring Sequential Thinking, Perplexity research, and Context7 documentation.
|
|
4
|
+
argument-hint: [complex feature description]
|
|
5
|
+
context: fork
|
|
6
|
+
agent: dplanner
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /dplan Command
|
|
10
|
+
|
|
11
|
+
**"Deep Plan"** - Runs in **@dplanner** subagent context.
|
|
12
|
+
|
|
13
|
+
## Purpose
|
|
14
|
+
Invokes the **Deep Planner** for high-complexity architectural design and research.
|
|
15
|
+
Unlike `/plan`, this command utilizes `sequential-thinking`, `perplexity`, and `context7` for maximum depth.
|
|
16
|
+
|
|
17
|
+
## Arguments
|
|
18
|
+
$ARGUMENTS
|
|
19
|
+
|
|
20
|
+
## Flow
|
|
21
|
+
1. Forks conversation to **@dplanner** context.
|
|
22
|
+
2. **@dplanner**:
|
|
23
|
+
- Analyzes request.
|
|
24
|
+
- Uses Sequential Thinking for logic verification.
|
|
25
|
+
- Uses Perplexity for web research.
|
|
26
|
+
- Uses Context7 for library documentation.
|
|
27
|
+
- Produces a comprehensive "Deep Plan".
|
|
28
|
+
3. Returns plan to main conversation.
|
|
29
|
+
|
|
30
|
+
## When to Use
|
|
31
|
+
- **New Architecture**: "Design microservices event bus"
|
|
32
|
+
- **Complex Debugging**: "Analyze race condition in payment module"
|
|
33
|
+
- **Tech Stack Research**: "Compare Redux vs Zustand for our specific needs"
|
|
34
|
+
|
|
35
|
+
## Output Format
|
|
36
|
+
See `@dplanner` documentation for detailed output structure.
|