codecruise 0.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/LICENSE +21 -0
- package/README.md +111 -0
- package/bin/codecruise.js +68 -0
- package/config/CLAUDE.md +107 -0
- package/config/agents/analyst.md +48 -0
- package/config/agents/architect-reviewer.md +161 -0
- package/config/agents/architect.md +119 -0
- package/config/agents/critic.md +63 -0
- package/config/agents/developer.md +96 -0
- package/config/agents/devops.md +81 -0
- package/config/agents/orchestrator.md +91 -0
- package/config/agents/planner.md +139 -0
- package/config/agents/retro.md +52 -0
- package/config/agents/reviewer.md +101 -0
- package/config/agents/security-reviewer.md +57 -0
- package/config/agents/stack/expo/AGENT.md +473 -0
- package/config/agents/stack/expo/rules/critical.md +427 -0
- package/config/agents/stack/expo/rules/native.md +455 -0
- package/config/agents/stack/expo/rules/navigation.md +445 -0
- package/config/agents/stack/expo/rules/performance.md +415 -0
- package/config/agents/stack/fastify/AGENT.md +397 -0
- package/config/agents/stack/fastify/rules/api-design.md +283 -0
- package/config/agents/stack/fastify/rules/critical.md +232 -0
- package/config/agents/stack/fastify/rules/queues.md +303 -0
- package/config/agents/stack/fastify/rules/security.md +384 -0
- package/config/agents/stack/index.yaml +48 -0
- package/config/agents/stack/nextjs/AGENT.md +421 -0
- package/config/agents/stack/nextjs/rules/components.md +413 -0
- package/config/agents/stack/nextjs/rules/critical.md +391 -0
- package/config/agents/stack/nextjs/rules/performance.md +403 -0
- package/config/agents/stack/nextjs/rules/styling.md +334 -0
- package/config/agents/stack/shared-ts/AGENT.md +384 -0
- package/config/agents/stack/shared-ts/rules/critical.md +315 -0
- package/config/agents/stack/shared-ts/rules/patterns.md +384 -0
- package/config/agents/stack/shared-ts/rules/zod.md +427 -0
- package/config/agents/tester.md +79 -0
- package/config/commands/architect-discuss.md +366 -0
- package/config/commands/architect-list.md +160 -0
- package/config/commands/architect-review.md +111 -0
- package/config/commands/architect.md +118 -0
- package/config/commands/compact.md +118 -0
- package/config/commands/companion.md +279 -0
- package/config/commands/dashboard.md +152 -0
- package/config/commands/doctor.md +227 -0
- package/config/commands/dogfood-report.md +101 -0
- package/config/commands/flags/run-autonomous.md +110 -0
- package/config/commands/flags/run-pause.md +80 -0
- package/config/commands/ingest.md +173 -0
- package/config/commands/init.md +128 -0
- package/config/commands/metrics.md +87 -0
- package/config/commands/parallel.md +320 -0
- package/config/commands/pause.md +55 -0
- package/config/commands/plan-review.md +130 -0
- package/config/commands/plan.md +216 -0
- package/config/commands/production-check.md +308 -0
- package/config/commands/refine.md +323 -0
- package/config/commands/resume.md +72 -0
- package/config/commands/retro.md +121 -0
- package/config/commands/retry.md +75 -0
- package/config/commands/role.md +310 -0
- package/config/commands/run.md +417 -0
- package/config/commands/scope.md +85 -0
- package/config/commands/setup-permissions.md +104 -0
- package/config/commands/skip.md +75 -0
- package/config/commands/spec-forge.md +213 -0
- package/config/commands/spec-help.md +194 -0
- package/config/commands/spec-patch.md +342 -0
- package/config/commands/spec-resolve.md +110 -0
- package/config/commands/spec-review.md +153 -0
- package/config/commands/status.md +114 -0
- package/config/commands/sync.md +131 -0
- package/config/commands/task.md +138 -0
- package/config/commands/verify.md +124 -0
- package/config/hooks/README.md +632 -0
- package/config/hooks/activity-log.sh +187 -0
- package/config/hooks/anti-rationalize.sh +52 -0
- package/config/hooks/capture-verification.sh +112 -0
- package/config/hooks/collect-metrics.sh +135 -0
- package/config/hooks/enforce-file-scope.sh +75 -0
- package/config/hooks/enforce-state-machine.sh +161 -0
- package/config/hooks/enforce-tdd.sh +180 -0
- package/config/hooks/format.sh +40 -0
- package/config/hooks/lib/activity-helpers.sh +162 -0
- package/config/hooks/lib/read-settings.sh +71 -0
- package/config/hooks/load-context-skills.sh +95 -0
- package/config/hooks/notify.sh +81 -0
- package/config/hooks/pre-commit.sample +35 -0
- package/config/hooks/protect-files.sh +63 -0
- package/config/hooks/track-agents.sh +41 -0
- package/config/hooks/track-commands.sh +37 -0
- package/config/hooks/track-enforcement.sh +44 -0
- package/config/hooks/track-ooda.sh +77 -0
- package/config/hooks/validate-commit-msg.sh +35 -0
- package/config/hooks/validate-plan.sh +213 -0
- package/config/hooks/verify-criteria.sh +46 -0
- package/config/hooks/verify-todo-completion.sh +140 -0
- package/config/rules/comments.md +25 -0
- package/config/rules/decision-rules.md +308 -0
- package/config/rules/hygiene.md +247 -0
- package/config/rules/pattern-detection.md +372 -0
- package/config/rules/profiles.md +193 -0
- package/config/rules/recovery.md +83 -0
- package/config/rules/scope-detection.md +213 -0
- package/config/rules/standards.md +127 -0
- package/config/rules/workflow.md +121 -0
- package/config/schemas.md +767 -0
- package/config/settings.json +195 -0
- package/config/skills/backend/SKILL.md +734 -0
- package/config/skills/database/SKILL.md +426 -0
- package/config/skills/frontend/SKILL.md +434 -0
- package/config/skills/git/SKILL.md +396 -0
- package/config/skills/index.yaml +36 -0
- package/config/skills/observability/SKILL.md +430 -0
- package/config/skills/package-dev/SKILL.md +498 -0
- package/config/skills/performance/SKILL.md +378 -0
- package/config/skills/resilience/SKILL.md +573 -0
- package/config/skills/testing/SKILL.md +398 -0
- package/config/skills/testing-patterns/SKILL.md +276 -0
- package/config/skills/typescript/SKILL.md +152 -0
- package/config/templates/CLAUDE.md +70 -0
- package/config/templates/README.md +117 -0
- package/config/templates/steering/adr-template.md +102 -0
- package/config/templates/steering/product.md +60 -0
- package/config/templates/steering/rfc-template.md +159 -0
- package/config/templates/steering/structure.md +146 -0
- package/config/templates/steering/tech.md +85 -0
- package/package.json +40 -0
- package/src/install.js +163 -0
- package/src/report.js +310 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
# Pattern Detection Rules
|
|
2
|
+
|
|
3
|
+
Rules for detecting patterns in execution history that warrant insights.
|
|
4
|
+
|
|
5
|
+
## Data Sources
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
sources:
|
|
9
|
+
execution_history:
|
|
10
|
+
path: .codecruise/execution_history.yaml
|
|
11
|
+
contains: sessions, skill_metrics
|
|
12
|
+
|
|
13
|
+
scorecards:
|
|
14
|
+
path: .codecruise/scorecards/*.json
|
|
15
|
+
contains: individual TODO results
|
|
16
|
+
|
|
17
|
+
progress:
|
|
18
|
+
path: progress.yaml
|
|
19
|
+
contains: current state, queue
|
|
20
|
+
|
|
21
|
+
verification:
|
|
22
|
+
path: .codecruise/verification/
|
|
23
|
+
contains: recent command outputs
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Pattern Categories
|
|
27
|
+
|
|
28
|
+
### 1. Retry Patterns
|
|
29
|
+
|
|
30
|
+
**High Retry Rate (Overall)**
|
|
31
|
+
|
|
32
|
+
```yaml
|
|
33
|
+
pattern: high_retry_rate_overall
|
|
34
|
+
type: friction
|
|
35
|
+
severity: medium
|
|
36
|
+
|
|
37
|
+
detection:
|
|
38
|
+
metric: total_retries / total_todos
|
|
39
|
+
threshold: 1.5
|
|
40
|
+
window: current_session OR last_7_days
|
|
41
|
+
|
|
42
|
+
insight:
|
|
43
|
+
message: "Overall retry rate is {rate:.1f} per TODO"
|
|
44
|
+
suggestion: "Review failing patterns in scorecards"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**High Retry Rate (Category)**
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
pattern: high_retry_rate_category
|
|
51
|
+
type: friction
|
|
52
|
+
severity: high
|
|
53
|
+
|
|
54
|
+
detection:
|
|
55
|
+
group_by: skill | file_extension | todo_prefix
|
|
56
|
+
metric: category_retries / category_todos
|
|
57
|
+
threshold: 2.0
|
|
58
|
+
min_sample: 3 # At least 3 TODOs in category
|
|
59
|
+
|
|
60
|
+
insight:
|
|
61
|
+
message: "{category} TODOs averaging {rate:.1f} retries"
|
|
62
|
+
suggestion: "Review {category} skill or add category-specific rules"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 2. Error Patterns
|
|
66
|
+
|
|
67
|
+
**Repeated Error Type**
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
pattern: repeated_error_type
|
|
71
|
+
type: blocker | friction
|
|
72
|
+
severity: high | medium
|
|
73
|
+
|
|
74
|
+
detection:
|
|
75
|
+
group_by: error_type # test_failure, lint_error, type_error, connection_error
|
|
76
|
+
threshold: 3 # Same error 3+ times
|
|
77
|
+
window: current_session
|
|
78
|
+
|
|
79
|
+
severity_rules:
|
|
80
|
+
blocker: error is blocking progress (consecutive failures)
|
|
81
|
+
friction: error recurring but not blocking
|
|
82
|
+
|
|
83
|
+
insight:
|
|
84
|
+
message: "{error_type} occurring repeatedly ({count} times)"
|
|
85
|
+
suggestion: based on error_type (see Error Suggestions below)
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Connection/Infrastructure Errors**
|
|
89
|
+
|
|
90
|
+
```yaml
|
|
91
|
+
pattern: infrastructure_error
|
|
92
|
+
type: blocker
|
|
93
|
+
severity: critical
|
|
94
|
+
|
|
95
|
+
detection:
|
|
96
|
+
error_patterns:
|
|
97
|
+
- "connection refused"
|
|
98
|
+
- "ECONNREFUSED"
|
|
99
|
+
- "timeout"
|
|
100
|
+
- "service unavailable"
|
|
101
|
+
- "docker"
|
|
102
|
+
threshold: 2
|
|
103
|
+
|
|
104
|
+
insight:
|
|
105
|
+
message: "Infrastructure issue detected: {pattern}"
|
|
106
|
+
suggestion: "Check if required services are running"
|
|
107
|
+
fix_command: infer from error (docker, redis, postgres, etc.)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 3. Quality Patterns
|
|
111
|
+
|
|
112
|
+
**Quality Decline**
|
|
113
|
+
|
|
114
|
+
```yaml
|
|
115
|
+
pattern: quality_decline
|
|
116
|
+
type: opportunity
|
|
117
|
+
severity: medium
|
|
118
|
+
|
|
119
|
+
detection:
|
|
120
|
+
metric: avg_quality_score
|
|
121
|
+
compare: current_session vs previous_session
|
|
122
|
+
threshold: -0.1 # 10% decline
|
|
123
|
+
|
|
124
|
+
insight:
|
|
125
|
+
message: "Quality trending down ({previous:.2f} → {current:.2f})"
|
|
126
|
+
suggestion: "Check recent changes, consider more detailed specs"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Category Quality Gap**
|
|
130
|
+
|
|
131
|
+
```yaml
|
|
132
|
+
pattern: category_quality_gap
|
|
133
|
+
type: friction
|
|
134
|
+
severity: medium
|
|
135
|
+
|
|
136
|
+
detection:
|
|
137
|
+
compare: category_avg vs overall_avg
|
|
138
|
+
threshold: -0.15 # 15% below average
|
|
139
|
+
min_sample: 3
|
|
140
|
+
|
|
141
|
+
insight:
|
|
142
|
+
message: "{category} quality ({cat_avg:.2f}) below average ({overall:.2f})"
|
|
143
|
+
suggestion: "Review {category} skill or add patterns"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Alignment Issues**
|
|
147
|
+
|
|
148
|
+
```yaml
|
|
149
|
+
pattern: low_alignment
|
|
150
|
+
type: friction
|
|
151
|
+
severity: medium
|
|
152
|
+
|
|
153
|
+
detection:
|
|
154
|
+
metric: alignment_score
|
|
155
|
+
threshold: 0.75
|
|
156
|
+
frequency: 3+ TODOs with low alignment
|
|
157
|
+
|
|
158
|
+
insight:
|
|
159
|
+
message: "Alignment scores low on recent TODOs"
|
|
160
|
+
suggestion: "Specs may need more detail on expected files/criteria"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### 4. Context Patterns
|
|
164
|
+
|
|
165
|
+
**Long Session**
|
|
166
|
+
|
|
167
|
+
```yaml
|
|
168
|
+
pattern: long_session
|
|
169
|
+
type: opportunity
|
|
170
|
+
severity: low | medium
|
|
171
|
+
|
|
172
|
+
detection:
|
|
173
|
+
metric: exchange_count (if available) OR todo_count
|
|
174
|
+
thresholds:
|
|
175
|
+
warning: 15 exchanges OR 10 TODOs
|
|
176
|
+
critical: 25 exchanges OR 15 TODOs
|
|
177
|
+
|
|
178
|
+
insight:
|
|
179
|
+
message: "Session running long ({count} exchanges)"
|
|
180
|
+
suggestion: "Consider /compact to preserve context quality"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Missing Compaction**
|
|
184
|
+
|
|
185
|
+
```yaml
|
|
186
|
+
pattern: missing_compaction
|
|
187
|
+
type: opportunity
|
|
188
|
+
severity: medium
|
|
189
|
+
|
|
190
|
+
detection:
|
|
191
|
+
metric: todos_since_last_compact
|
|
192
|
+
threshold: 8
|
|
193
|
+
|
|
194
|
+
insight:
|
|
195
|
+
message: "No compaction in {count} TODOs"
|
|
196
|
+
suggestion: "Run /compact to maintain context quality"
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### 5. Positive Patterns (Wins)
|
|
200
|
+
|
|
201
|
+
**High Quality Category**
|
|
202
|
+
|
|
203
|
+
```yaml
|
|
204
|
+
pattern: high_quality_category
|
|
205
|
+
type: win
|
|
206
|
+
severity: positive
|
|
207
|
+
|
|
208
|
+
detection:
|
|
209
|
+
metric: category_avg_quality
|
|
210
|
+
threshold: overall_avg + 0.1
|
|
211
|
+
min_sample: 5
|
|
212
|
+
|
|
213
|
+
insight:
|
|
214
|
+
message: "{category} quality excellent ({avg:.2f})"
|
|
215
|
+
suggestion: "Skill is effective - consider similar for other areas"
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**Zero Retry Streak**
|
|
219
|
+
|
|
220
|
+
```yaml
|
|
221
|
+
pattern: zero_retry_streak
|
|
222
|
+
type: win
|
|
223
|
+
severity: positive
|
|
224
|
+
|
|
225
|
+
detection:
|
|
226
|
+
metric: consecutive_todos_without_retry
|
|
227
|
+
threshold: 5
|
|
228
|
+
|
|
229
|
+
insight:
|
|
230
|
+
message: "{count} TODOs completed without retries"
|
|
231
|
+
suggestion: "Great flow - patterns are working well"
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**Improving Trend**
|
|
235
|
+
|
|
236
|
+
```yaml
|
|
237
|
+
pattern: improving_trend
|
|
238
|
+
type: win
|
|
239
|
+
severity: positive
|
|
240
|
+
|
|
241
|
+
detection:
|
|
242
|
+
metric: avg_quality
|
|
243
|
+
compare: 3-session moving average
|
|
244
|
+
threshold: +0.05 # 5% improvement
|
|
245
|
+
|
|
246
|
+
insight:
|
|
247
|
+
message: "Quality improving over recent sessions"
|
|
248
|
+
suggestion: "Keep up the good work!"
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## Error Suggestions Map
|
|
252
|
+
|
|
253
|
+
```yaml
|
|
254
|
+
error_suggestions:
|
|
255
|
+
test_failure:
|
|
256
|
+
message: "Tests failing"
|
|
257
|
+
suggestions:
|
|
258
|
+
- "Check test expectations match implementation"
|
|
259
|
+
- "Verify test setup/teardown"
|
|
260
|
+
- "Look for async timing issues"
|
|
261
|
+
|
|
262
|
+
lint_error:
|
|
263
|
+
message: "Lint errors"
|
|
264
|
+
suggestions:
|
|
265
|
+
- "Run lint with --fix flag"
|
|
266
|
+
- "Check eslint configuration"
|
|
267
|
+
- "Review code style guidelines"
|
|
268
|
+
|
|
269
|
+
type_error:
|
|
270
|
+
message: "TypeScript errors"
|
|
271
|
+
suggestions:
|
|
272
|
+
- "Check type definitions"
|
|
273
|
+
- "Verify function signatures"
|
|
274
|
+
- "Look for implicit any usage"
|
|
275
|
+
|
|
276
|
+
connection_refused:
|
|
277
|
+
message: "Connection refused"
|
|
278
|
+
suggestions:
|
|
279
|
+
- "Check if database is running"
|
|
280
|
+
- "Verify docker containers: docker ps"
|
|
281
|
+
- "Check service ports and config"
|
|
282
|
+
|
|
283
|
+
timeout:
|
|
284
|
+
message: "Operation timeout"
|
|
285
|
+
suggestions:
|
|
286
|
+
- "Check network connectivity"
|
|
287
|
+
- "Increase timeout settings"
|
|
288
|
+
- "Look for infinite loops or blocking calls"
|
|
289
|
+
|
|
290
|
+
import_error:
|
|
291
|
+
message: "Import/module errors"
|
|
292
|
+
suggestions:
|
|
293
|
+
- "Check file paths and extensions"
|
|
294
|
+
- "Verify exports match imports"
|
|
295
|
+
- "Run npm/pnpm install"
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## Aggregation Rules
|
|
299
|
+
|
|
300
|
+
### Session-Level Aggregation
|
|
301
|
+
|
|
302
|
+
```yaml
|
|
303
|
+
aggregate_session:
|
|
304
|
+
from: scorecards/*.json
|
|
305
|
+
|
|
306
|
+
metrics:
|
|
307
|
+
total_todos: count(scorecards)
|
|
308
|
+
total_retries: sum(scorecard.attempt - 1)
|
|
309
|
+
avg_quality: mean(scorecard.scores.overall)
|
|
310
|
+
avg_alignment: mean(scorecard.scores.alignment)
|
|
311
|
+
|
|
312
|
+
group_by:
|
|
313
|
+
skill: extract from todo_id or files
|
|
314
|
+
file_type: extract from files touched
|
|
315
|
+
error_type: extract from verification results
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Cross-Session Aggregation
|
|
319
|
+
|
|
320
|
+
```yaml
|
|
321
|
+
aggregate_history:
|
|
322
|
+
from: execution_history.sessions
|
|
323
|
+
window: 7 days
|
|
324
|
+
|
|
325
|
+
metrics:
|
|
326
|
+
sessions_count: count(sessions)
|
|
327
|
+
total_todos: sum(session.todos.completed)
|
|
328
|
+
trend: compare(recent_3, previous_3)
|
|
329
|
+
|
|
330
|
+
skill_metrics:
|
|
331
|
+
per_skill:
|
|
332
|
+
todos: count
|
|
333
|
+
avg_quality: mean
|
|
334
|
+
avg_retries: mean
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## Priority Rules
|
|
338
|
+
|
|
339
|
+
When multiple insights detected, prioritize:
|
|
340
|
+
|
|
341
|
+
```yaml
|
|
342
|
+
priority_order:
|
|
343
|
+
1: blocker (critical) # Show first, always
|
|
344
|
+
2: blocker (high)
|
|
345
|
+
3: friction (high)
|
|
346
|
+
4: friction (medium)
|
|
347
|
+
5: opportunity (medium)
|
|
348
|
+
6: opportunity (low)
|
|
349
|
+
7: win # Show to reinforce good patterns
|
|
350
|
+
|
|
351
|
+
max_insights_shown:
|
|
352
|
+
checkpoint: 3 # At checkpoints during /run
|
|
353
|
+
companion: 10 # Full /companion output
|
|
354
|
+
status: 1 # Just blocker count in /status
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
## Staleness Rules
|
|
358
|
+
|
|
359
|
+
```yaml
|
|
360
|
+
staleness:
|
|
361
|
+
# Don't repeat same insight too often
|
|
362
|
+
min_interval: 1 hour OR 5 TODOs
|
|
363
|
+
|
|
364
|
+
# Auto-resolve if condition no longer true
|
|
365
|
+
auto_resolve:
|
|
366
|
+
blocker: check every TODO
|
|
367
|
+
friction: check every 3 TODOs
|
|
368
|
+
opportunity: check every session
|
|
369
|
+
|
|
370
|
+
# Dismiss if user explicitly skips
|
|
371
|
+
user_dismiss: remember for session
|
|
372
|
+
```
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Execution Profiles
|
|
2
|
+
|
|
3
|
+
Profiles control the strictness/speed tradeoff during execution.
|
|
4
|
+
|
|
5
|
+
## Available Profiles
|
|
6
|
+
|
|
7
|
+
### ship-fast
|
|
8
|
+
|
|
9
|
+
**Use for:** Client work, vibe coding, speed over polish
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
profile: ship-fast
|
|
13
|
+
|
|
14
|
+
guardrails:
|
|
15
|
+
no_secrets: true # Always check for secrets
|
|
16
|
+
no_new_deps: false # Allow new dependencies without asking
|
|
17
|
+
atomic_commit: false # Batched commits OK
|
|
18
|
+
coverage_threshold: null # No coverage requirement
|
|
19
|
+
|
|
20
|
+
quality_threshold: 0.70 # Lower bar for "good enough"
|
|
21
|
+
checkpoint_mode: feature # Pause only at feature boundaries
|
|
22
|
+
max_retries: 2 # Fail faster, move on
|
|
23
|
+
on_error: skip # Log and continue by default
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### balanced (Default)
|
|
27
|
+
|
|
28
|
+
**Use for:** Own product, good default for most work
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
profile: balanced
|
|
32
|
+
|
|
33
|
+
guardrails:
|
|
34
|
+
no_secrets: true # Always check for secrets
|
|
35
|
+
no_new_deps: ask # Ask before adding dependencies
|
|
36
|
+
atomic_commit: true # One logical change per commit
|
|
37
|
+
coverage_threshold: null # No strict coverage requirement
|
|
38
|
+
|
|
39
|
+
quality_threshold: 0.85 # Standard quality bar
|
|
40
|
+
checkpoint_mode: subfeature # Pause at subfeature boundaries
|
|
41
|
+
max_retries: 3 # Standard retry limit
|
|
42
|
+
on_error: ask # Ask user on failure
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### careful
|
|
46
|
+
|
|
47
|
+
**Use for:** Existing codebases, high safety requirements
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
profile: careful
|
|
51
|
+
|
|
52
|
+
guardrails:
|
|
53
|
+
no_secrets: true # Always check for secrets
|
|
54
|
+
no_new_deps: block # Block new dependencies without explicit approval
|
|
55
|
+
atomic_commit: true # Strict atomic commits
|
|
56
|
+
coverage_threshold: 80 # Require 80% coverage
|
|
57
|
+
|
|
58
|
+
quality_threshold: 0.95 # High quality bar
|
|
59
|
+
checkpoint_mode: todo # Review after each TODO
|
|
60
|
+
max_retries: 3 # Standard retry limit
|
|
61
|
+
on_error: ask # Always ask on failure
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Profile Selection
|
|
65
|
+
|
|
66
|
+
### In CLAUDE.md (project default)
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
# Project CLAUDE.md
|
|
70
|
+
profile: balanced
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Per-command override
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
/run feature-1.2 --profile ship-fast
|
|
77
|
+
/run "add auth" --profile careful
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Priority order
|
|
81
|
+
|
|
82
|
+
1. Command-line flag (`--profile X`)
|
|
83
|
+
2. Project CLAUDE.md (`profile: X`)
|
|
84
|
+
3. Default (`balanced`)
|
|
85
|
+
|
|
86
|
+
## Guardrail Definitions
|
|
87
|
+
|
|
88
|
+
### no_secrets
|
|
89
|
+
|
|
90
|
+
Scan for potential secrets in staged changes:
|
|
91
|
+
- API keys, tokens
|
|
92
|
+
- Passwords, credentials
|
|
93
|
+
- Private keys
|
|
94
|
+
- .env file contents
|
|
95
|
+
|
|
96
|
+
**Actions:**
|
|
97
|
+
- `true`: Block commit if secrets detected
|
|
98
|
+
- `false`: No check (not recommended)
|
|
99
|
+
|
|
100
|
+
### no_new_deps
|
|
101
|
+
|
|
102
|
+
Control dependency additions:
|
|
103
|
+
- `false`: Allow without asking
|
|
104
|
+
- `ask`: Prompt user before adding
|
|
105
|
+
- `block`: Fail if new dependency detected
|
|
106
|
+
|
|
107
|
+
**Detection:** Compare package.json before/after TODO execution
|
|
108
|
+
|
|
109
|
+
### atomic_commit
|
|
110
|
+
|
|
111
|
+
Ensure commits are logically atomic:
|
|
112
|
+
- `true`: One TODO = one commit (or related changes only)
|
|
113
|
+
- `false`: Batch multiple TODOs into single commit
|
|
114
|
+
|
|
115
|
+
### coverage_threshold
|
|
116
|
+
|
|
117
|
+
Minimum test coverage requirement:
|
|
118
|
+
- `null`: No requirement
|
|
119
|
+
- `80`: Require 80% coverage
|
|
120
|
+
- Fail if coverage drops below threshold
|
|
121
|
+
|
|
122
|
+
## Quality Threshold
|
|
123
|
+
|
|
124
|
+
The `quality_threshold` determines the minimum overall score for a TODO to pass:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
Score calculation:
|
|
128
|
+
overall = (quality * 0.4) + (alignment * 0.4) + (guardrails * 0.2)
|
|
129
|
+
|
|
130
|
+
Decision:
|
|
131
|
+
overall >= threshold → proceed
|
|
132
|
+
overall >= threshold - 0.1 → proceed with comment
|
|
133
|
+
overall < threshold - 0.1 → retry
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Checkpoint Modes
|
|
137
|
+
|
|
138
|
+
### todo
|
|
139
|
+
|
|
140
|
+
Pause and show summary after every TODO. Maximum visibility.
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
✓ todo-1.1a-001 complete
|
|
144
|
+
Continue? [y/n]
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### subfeature (Default)
|
|
148
|
+
|
|
149
|
+
Pause at subfeature boundaries. Balanced approach.
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
✓ CHECKPOINT: subfeature-1.1a complete (7 TODOs)
|
|
153
|
+
Continue to subfeature-1.1b? [y/n]
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### feature
|
|
157
|
+
|
|
158
|
+
Pause only at feature boundaries. Minimal interruption.
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
✓ CHECKPOINT: feature-1.1 complete (14 TODOs)
|
|
162
|
+
Continue to feature-1.2? [y/n]
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### none
|
|
166
|
+
|
|
167
|
+
No pauses. Run until scope completes or error occurs.
|
|
168
|
+
|
|
169
|
+
## Error Handling Modes
|
|
170
|
+
|
|
171
|
+
### ask (Default)
|
|
172
|
+
|
|
173
|
+
Pause execution and present options:
|
|
174
|
+
```
|
|
175
|
+
✗ todo-1.2a-005 failed (3/3)
|
|
176
|
+
[r]etry [s]kip [f]ix [a]bort: _
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### skip
|
|
180
|
+
|
|
181
|
+
Log error and continue to next TODO:
|
|
182
|
+
```
|
|
183
|
+
⚠ todo-1.2a-005 failed - skipping
|
|
184
|
+
Dependent TODOs may also fail
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### abort
|
|
188
|
+
|
|
189
|
+
Stop execution immediately:
|
|
190
|
+
```
|
|
191
|
+
✗ todo-1.2a-005 failed - aborting
|
|
192
|
+
State saved. Run /retry to try again.
|
|
193
|
+
```
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Recovery & Troubleshooting
|
|
2
|
+
|
|
3
|
+
Quick fixes for common problems.
|
|
4
|
+
|
|
5
|
+
## Undo Claude's Changes (Checkpointing)
|
|
6
|
+
|
|
7
|
+
Claude automatically creates checkpoints before every edit.
|
|
8
|
+
|
|
9
|
+
### Rewind Options
|
|
10
|
+
|
|
11
|
+
1. Press `Esc + Esc` (double-tap Escape)
|
|
12
|
+
2. Or run `/rewind`
|
|
13
|
+
3. Choose what to restore:
|
|
14
|
+
- **Conversation only**: Keep code changes, rewind chat
|
|
15
|
+
- **Code only**: Keep conversation, restore files
|
|
16
|
+
- **Both**: Full restore to previous state
|
|
17
|
+
|
|
18
|
+
### When to Use
|
|
19
|
+
|
|
20
|
+
- Claude made unwanted changes
|
|
21
|
+
- Want to try a different approach
|
|
22
|
+
- Need to compare before/after
|
|
23
|
+
|
|
24
|
+
### Limitations
|
|
25
|
+
|
|
26
|
+
- Only tracks changes made BY Claude (not external edits)
|
|
27
|
+
- Bash command side effects (npm install, etc.) not reversible
|
|
28
|
+
- Not a replacement for git - use for quick undo, git for history
|
|
29
|
+
|
|
30
|
+
## progress.yaml Corrupted
|
|
31
|
+
|
|
32
|
+
1. Check git history: `git log --oneline -- progress.yaml`
|
|
33
|
+
2. Restore: `git checkout HEAD~1 -- progress.yaml`
|
|
34
|
+
3. Or rebuild from roadmap/ files (source of truth for TODOs)
|
|
35
|
+
|
|
36
|
+
## Branch in Bad State
|
|
37
|
+
|
|
38
|
+
1. Stash work: `git stash`
|
|
39
|
+
2. Return to main: `git checkout main && git pull`
|
|
40
|
+
3. Create fresh branch: `git checkout -b feature/{name}`
|
|
41
|
+
4. Apply stash if needed: `git stash pop`
|
|
42
|
+
|
|
43
|
+
## Quality Check Keeps Failing
|
|
44
|
+
|
|
45
|
+
1. Read the error carefully
|
|
46
|
+
2. Fix one issue at a time
|
|
47
|
+
3. After 3 failed attempts → STOP
|
|
48
|
+
4. Ask: Is this a test issue or implementation issue?
|
|
49
|
+
5. If stuck: `git stash` and ask for help
|
|
50
|
+
|
|
51
|
+
## Context Feels Lost
|
|
52
|
+
|
|
53
|
+
1. Run `/status` to see current state
|
|
54
|
+
2. Read `progress.yaml` for context
|
|
55
|
+
3. If still unclear: `/compact` and restart
|
|
56
|
+
|
|
57
|
+
## Merge Conflicts
|
|
58
|
+
|
|
59
|
+
1. Never force push to main
|
|
60
|
+
2. Rebase feature branch: `git rebase main`
|
|
61
|
+
3. Resolve conflicts file by file
|
|
62
|
+
4. Run quality check after resolution
|
|
63
|
+
|
|
64
|
+
## MCP Server Not Working
|
|
65
|
+
|
|
66
|
+
1. Check if configured: look in `~/.claude.json` or `.mcp.json`
|
|
67
|
+
2. Check if disabled: look in `settings.json` → `disabledMcpjsonServers`
|
|
68
|
+
3. Restart Claude Code after config changes
|
|
69
|
+
4. Run `/mcp` to see server status
|
|
70
|
+
5. Test manually: e.g., `gh mcp` for github
|
|
71
|
+
|
|
72
|
+
## Dashboard Not Generating
|
|
73
|
+
|
|
74
|
+
1. Ensure `roadmap/` and `progress.yaml` exist
|
|
75
|
+
2. Run `/init` if project not bootstrapped
|
|
76
|
+
3. Check for YAML syntax errors in progress.yaml
|
|
77
|
+
|
|
78
|
+
## Tests Pass Locally but Fail in CI
|
|
79
|
+
|
|
80
|
+
1. Check for environment differences
|
|
81
|
+
2. Look for hardcoded paths or timestamps
|
|
82
|
+
3. Ensure all dependencies installed
|
|
83
|
+
4. Check for race conditions in async tests
|