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.
Files changed (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +111 -0
  3. package/bin/codecruise.js +68 -0
  4. package/config/CLAUDE.md +107 -0
  5. package/config/agents/analyst.md +48 -0
  6. package/config/agents/architect-reviewer.md +161 -0
  7. package/config/agents/architect.md +119 -0
  8. package/config/agents/critic.md +63 -0
  9. package/config/agents/developer.md +96 -0
  10. package/config/agents/devops.md +81 -0
  11. package/config/agents/orchestrator.md +91 -0
  12. package/config/agents/planner.md +139 -0
  13. package/config/agents/retro.md +52 -0
  14. package/config/agents/reviewer.md +101 -0
  15. package/config/agents/security-reviewer.md +57 -0
  16. package/config/agents/stack/expo/AGENT.md +473 -0
  17. package/config/agents/stack/expo/rules/critical.md +427 -0
  18. package/config/agents/stack/expo/rules/native.md +455 -0
  19. package/config/agents/stack/expo/rules/navigation.md +445 -0
  20. package/config/agents/stack/expo/rules/performance.md +415 -0
  21. package/config/agents/stack/fastify/AGENT.md +397 -0
  22. package/config/agents/stack/fastify/rules/api-design.md +283 -0
  23. package/config/agents/stack/fastify/rules/critical.md +232 -0
  24. package/config/agents/stack/fastify/rules/queues.md +303 -0
  25. package/config/agents/stack/fastify/rules/security.md +384 -0
  26. package/config/agents/stack/index.yaml +48 -0
  27. package/config/agents/stack/nextjs/AGENT.md +421 -0
  28. package/config/agents/stack/nextjs/rules/components.md +413 -0
  29. package/config/agents/stack/nextjs/rules/critical.md +391 -0
  30. package/config/agents/stack/nextjs/rules/performance.md +403 -0
  31. package/config/agents/stack/nextjs/rules/styling.md +334 -0
  32. package/config/agents/stack/shared-ts/AGENT.md +384 -0
  33. package/config/agents/stack/shared-ts/rules/critical.md +315 -0
  34. package/config/agents/stack/shared-ts/rules/patterns.md +384 -0
  35. package/config/agents/stack/shared-ts/rules/zod.md +427 -0
  36. package/config/agents/tester.md +79 -0
  37. package/config/commands/architect-discuss.md +366 -0
  38. package/config/commands/architect-list.md +160 -0
  39. package/config/commands/architect-review.md +111 -0
  40. package/config/commands/architect.md +118 -0
  41. package/config/commands/compact.md +118 -0
  42. package/config/commands/companion.md +279 -0
  43. package/config/commands/dashboard.md +152 -0
  44. package/config/commands/doctor.md +227 -0
  45. package/config/commands/dogfood-report.md +101 -0
  46. package/config/commands/flags/run-autonomous.md +110 -0
  47. package/config/commands/flags/run-pause.md +80 -0
  48. package/config/commands/ingest.md +173 -0
  49. package/config/commands/init.md +128 -0
  50. package/config/commands/metrics.md +87 -0
  51. package/config/commands/parallel.md +320 -0
  52. package/config/commands/pause.md +55 -0
  53. package/config/commands/plan-review.md +130 -0
  54. package/config/commands/plan.md +216 -0
  55. package/config/commands/production-check.md +308 -0
  56. package/config/commands/refine.md +323 -0
  57. package/config/commands/resume.md +72 -0
  58. package/config/commands/retro.md +121 -0
  59. package/config/commands/retry.md +75 -0
  60. package/config/commands/role.md +310 -0
  61. package/config/commands/run.md +417 -0
  62. package/config/commands/scope.md +85 -0
  63. package/config/commands/setup-permissions.md +104 -0
  64. package/config/commands/skip.md +75 -0
  65. package/config/commands/spec-forge.md +213 -0
  66. package/config/commands/spec-help.md +194 -0
  67. package/config/commands/spec-patch.md +342 -0
  68. package/config/commands/spec-resolve.md +110 -0
  69. package/config/commands/spec-review.md +153 -0
  70. package/config/commands/status.md +114 -0
  71. package/config/commands/sync.md +131 -0
  72. package/config/commands/task.md +138 -0
  73. package/config/commands/verify.md +124 -0
  74. package/config/hooks/README.md +632 -0
  75. package/config/hooks/activity-log.sh +187 -0
  76. package/config/hooks/anti-rationalize.sh +52 -0
  77. package/config/hooks/capture-verification.sh +112 -0
  78. package/config/hooks/collect-metrics.sh +135 -0
  79. package/config/hooks/enforce-file-scope.sh +75 -0
  80. package/config/hooks/enforce-state-machine.sh +161 -0
  81. package/config/hooks/enforce-tdd.sh +180 -0
  82. package/config/hooks/format.sh +40 -0
  83. package/config/hooks/lib/activity-helpers.sh +162 -0
  84. package/config/hooks/lib/read-settings.sh +71 -0
  85. package/config/hooks/load-context-skills.sh +95 -0
  86. package/config/hooks/notify.sh +81 -0
  87. package/config/hooks/pre-commit.sample +35 -0
  88. package/config/hooks/protect-files.sh +63 -0
  89. package/config/hooks/track-agents.sh +41 -0
  90. package/config/hooks/track-commands.sh +37 -0
  91. package/config/hooks/track-enforcement.sh +44 -0
  92. package/config/hooks/track-ooda.sh +77 -0
  93. package/config/hooks/validate-commit-msg.sh +35 -0
  94. package/config/hooks/validate-plan.sh +213 -0
  95. package/config/hooks/verify-criteria.sh +46 -0
  96. package/config/hooks/verify-todo-completion.sh +140 -0
  97. package/config/rules/comments.md +25 -0
  98. package/config/rules/decision-rules.md +308 -0
  99. package/config/rules/hygiene.md +247 -0
  100. package/config/rules/pattern-detection.md +372 -0
  101. package/config/rules/profiles.md +193 -0
  102. package/config/rules/recovery.md +83 -0
  103. package/config/rules/scope-detection.md +213 -0
  104. package/config/rules/standards.md +127 -0
  105. package/config/rules/workflow.md +121 -0
  106. package/config/schemas.md +767 -0
  107. package/config/settings.json +195 -0
  108. package/config/skills/backend/SKILL.md +734 -0
  109. package/config/skills/database/SKILL.md +426 -0
  110. package/config/skills/frontend/SKILL.md +434 -0
  111. package/config/skills/git/SKILL.md +396 -0
  112. package/config/skills/index.yaml +36 -0
  113. package/config/skills/observability/SKILL.md +430 -0
  114. package/config/skills/package-dev/SKILL.md +498 -0
  115. package/config/skills/performance/SKILL.md +378 -0
  116. package/config/skills/resilience/SKILL.md +573 -0
  117. package/config/skills/testing/SKILL.md +398 -0
  118. package/config/skills/testing-patterns/SKILL.md +276 -0
  119. package/config/skills/typescript/SKILL.md +152 -0
  120. package/config/templates/CLAUDE.md +70 -0
  121. package/config/templates/README.md +117 -0
  122. package/config/templates/steering/adr-template.md +102 -0
  123. package/config/templates/steering/product.md +60 -0
  124. package/config/templates/steering/rfc-template.md +159 -0
  125. package/config/templates/steering/structure.md +146 -0
  126. package/config/templates/steering/tech.md +85 -0
  127. package/package.json +40 -0
  128. package/src/install.js +163 -0
  129. package/src/report.js +310 -0
@@ -0,0 +1,323 @@
1
+ ---
2
+ name: refine
3
+ description: Upgrade weak roadmap structure to quality standards
4
+ model: sonnet
5
+ tools: Read, Write, Edit, Glob, Grep
6
+ ---
7
+
8
+ # /refine Command
9
+
10
+ Analyze and improve roadmap structure interactively. Upgrades weak TODOs to include subfeatures, dependencies, file mappings, and rich descriptions.
11
+
12
+ ## When to Use
13
+
14
+ - After `/init --assess` shows a low score
15
+ - When inheriting a project with flat TODO lists
16
+ - To improve execution efficiency (deps = correct order, files = faster work)
17
+
18
+ ## Usage
19
+
20
+ ```bash
21
+ /refine # Refine all roadmap files
22
+ /refine roadmap/phase-01/ # Refine specific phase
23
+ /refine roadmap/phase-01/feature-1.1.yaml # Refine specific feature
24
+ /refine --dry-run # Show suggestions without applying
25
+ /refine --auto # Apply obvious improvements without asking
26
+ ```
27
+
28
+ ## Process
29
+
30
+ ### 1. Scan Target Files
31
+
32
+ ```bash
33
+ /refine roadmap/phase-02/
34
+
35
+ Scanning roadmap/phase-02/...
36
+ Found 3 feature files with 47 TODOs
37
+ ```
38
+
39
+ ### 2. Analyze Quality
40
+
41
+ For each file, check:
42
+
43
+ | Element | Status | Count |
44
+ |---------|--------|-------|
45
+ | Subfeatures | ✗ Missing | 0/3 features |
46
+ | Dependencies | ✗ Missing | 0/47 TODOs |
47
+ | File mappings | ✗ Missing | 0/47 TODOs |
48
+ | Rich descriptions | ◐ Partial | 12/47 TODOs |
49
+
50
+ **Current score: 38/100**
51
+
52
+ ### 3. Present Improvement Plan
53
+
54
+ ```
55
+ Improvement Plan for roadmap/phase-02/
56
+
57
+ 1. ADD SUBFEATURES (High Impact)
58
+ Group 47 flat TODOs into logical subfeatures
59
+ - feature-2.1: 15 TODOs → ~3 subfeatures
60
+ - feature-2.2: 18 TODOs → ~4 subfeatures
61
+ - feature-2.3: 14 TODOs → ~3 subfeatures
62
+
63
+ 2. ADD DEPENDENCIES (High Impact)
64
+ Identify sequential work and add depends_on
65
+ - Estimate: ~60% of TODOs have implicit dependencies
66
+
67
+ 3. ADD FILE MAPPINGS (Medium Impact)
68
+ Map TODOs to target source files
69
+ - Can infer from TODO names and project structure
70
+
71
+ 4. ENRICH DESCRIPTIONS (Low Impact)
72
+ Expand one-liner descriptions with acceptance criteria
73
+ - 35 TODOs have weak descriptions
74
+
75
+ Proceed with refinement? [Y/n]
76
+ ```
77
+
78
+ ### 4. Interactive Refinement
79
+
80
+ #### Step 4a: Subfeatures
81
+
82
+ ```
83
+ ═══════════════════════════════════════════════════════════════
84
+ REFINE: feature-2.1-auth.yaml (15 TODOs)
85
+ ═══════════════════════════════════════════════════════════════
86
+
87
+ Current structure (flat):
88
+ - todo-001: Create user table
89
+ - todo-002: Create session table
90
+ - todo-003: Add password hashing
91
+ - todo-004: Implement login endpoint
92
+ - todo-005: Implement logout endpoint
93
+ - todo-006: Add JWT generation
94
+ - todo-007: Add JWT validation
95
+ - todo-008: Create auth middleware
96
+ - todo-009: Add refresh tokens
97
+ - todo-010: Write login tests
98
+ - todo-011: Write logout tests
99
+ - todo-012: Write middleware tests
100
+ - todo-013: Add rate limiting
101
+ - todo-014: Add brute force protection
102
+ - todo-015: Write security tests
103
+
104
+ Suggested subfeatures:
105
+ subfeature-2.1a: Database Schema (todo-001, todo-002)
106
+ subfeature-2.1b: Core Auth (todo-003 to todo-009)
107
+ subfeature-2.1c: Middleware (todo-008)
108
+ subfeature-2.1d: Security (todo-013, todo-014)
109
+ subfeature-2.1e: Tests (todo-010 to todo-012, todo-015)
110
+
111
+ [a]ccept [m]odify [s]kip [?]explain
112
+ ```
113
+
114
+ #### Step 4b: Dependencies
115
+
116
+ ```
117
+ ═══════════════════════════════════════════════════════════════
118
+ REFINE: Dependencies for subfeature-2.1b
119
+ ═══════════════════════════════════════════════════════════════
120
+
121
+ Analyzing TODO sequence...
122
+
123
+ Suggested dependencies:
124
+ todo-003 (password hashing)
125
+ └─ depends_on: [todo-001] # needs user table
126
+
127
+ todo-004 (login endpoint)
128
+ └─ depends_on: [todo-002, todo-003, todo-006]
129
+
130
+ todo-005 (logout endpoint)
131
+ └─ depends_on: [todo-002, todo-004]
132
+
133
+ todo-006 (JWT generation)
134
+ └─ depends_on: [] # independent utility
135
+
136
+ todo-007 (JWT validation)
137
+ └─ depends_on: [todo-006]
138
+
139
+ todo-009 (refresh tokens)
140
+ └─ depends_on: [todo-006, todo-007]
141
+
142
+ [a]ccept all [r]eview each [s]kip [?]explain
143
+ ```
144
+
145
+ #### Step 4c: File Mappings
146
+
147
+ ```
148
+ ═══════════════════════════════════════════════════════════════
149
+ REFINE: File mappings for subfeature-2.1b
150
+ ═══════════════════════════════════════════════════════════════
151
+
152
+ Scanning project structure...
153
+ Found: src/modules/auth/, src/lib/, tests/
154
+
155
+ Suggested mappings:
156
+ todo-003 (password hashing):
157
+ files:
158
+ - src/lib/crypto.ts
159
+ - src/lib/crypto.test.ts
160
+
161
+ todo-004 (login endpoint):
162
+ files:
163
+ - src/modules/auth/login.controller.ts
164
+ - src/modules/auth/login.service.ts
165
+ - tests/auth/login.test.ts
166
+
167
+ todo-006 (JWT generation):
168
+ files:
169
+ - src/lib/jwt.ts
170
+ - src/lib/jwt.test.ts
171
+
172
+ [a]ccept all [r]eview each [s]kip
173
+ ```
174
+
175
+ #### Step 4d: Rich Descriptions
176
+
177
+ ```
178
+ ═══════════════════════════════════════════════════════════════
179
+ REFINE: Descriptions
180
+ ═══════════════════════════════════════════════════════════════
181
+
182
+ Found 8 TODOs with weak descriptions.
183
+
184
+ Example - todo-004:
185
+ Current: "Implement login endpoint"
186
+
187
+ Suggested:
188
+ description: |
189
+ Implement POST /auth/login endpoint.
190
+
191
+ Request: { email, password }
192
+ Response: { accessToken, refreshToken, user }
193
+
194
+ Acceptance criteria:
195
+ - Validate email format
196
+ - Check password against hash
197
+ - Return JWT tokens on success
198
+ - Return 401 on invalid credentials
199
+ - Log failed attempts
200
+
201
+ [a]ccept [e]dit [s]kip [n]ext
202
+ ```
203
+
204
+ ### 5. Apply Changes
205
+
206
+ ```
207
+ ═══════════════════════════════════════════════════════════════
208
+ APPLYING REFINEMENTS
209
+ ═══════════════════════════════════════════════════════════════
210
+
211
+ Updating feature-2.1-auth.yaml...
212
+ ✓ Added 5 subfeatures
213
+ ✓ Added 12 dependencies
214
+ ✓ Added 15 file mappings
215
+ ✓ Enriched 8 descriptions
216
+
217
+ Updating feature-2.2-user.yaml...
218
+ ✓ Added 4 subfeatures
219
+ ✓ Added 14 dependencies
220
+ ✓ Added 18 file mappings
221
+ ✓ Enriched 6 descriptions
222
+
223
+ Updating feature-2.3-profile.yaml...
224
+ ✓ Added 3 subfeatures
225
+ ✓ Added 10 dependencies
226
+ ✓ Added 14 file mappings
227
+ ✓ Enriched 4 descriptions
228
+ ```
229
+
230
+ ### 6. Show Results
231
+
232
+ ```
233
+ ═══════════════════════════════════════════════════════════════
234
+ ✓ REFINEMENT COMPLETE
235
+ ═══════════════════════════════════════════════════════════════
236
+
237
+ roadmap/phase-02/ upgraded:
238
+
239
+ Before After
240
+ ──────────────────────────────
241
+ Score: 38 → 87
242
+ Subfeatures: 0 → 12
243
+ Dependencies: 0 → 36
244
+ File mappings: 0 → 47
245
+ Rich descriptions: 12 → 47
246
+
247
+ Files modified:
248
+ - roadmap/phase-02/feature-2.1-auth.yaml
249
+ - roadmap/phase-02/feature-2.2-user.yaml
250
+ - roadmap/phase-02/feature-2.3-profile.yaml
251
+
252
+ Next: /run phase-02 to start execution
253
+ ```
254
+
255
+ ## Options
256
+
257
+ | Flag | Description |
258
+ |------|-------------|
259
+ | `--dry-run` | Show what would change without modifying |
260
+ | `--auto` | Apply obvious improvements without confirmation |
261
+ | `--subfeatures` | Only add subfeatures |
262
+ | `--deps` | Only add dependencies |
263
+ | `--files` | Only add file mappings |
264
+ | `--descriptions` | Only enrich descriptions |
265
+ | `--score` | Only show current score |
266
+
267
+ ## Examples
268
+
269
+ ```bash
270
+ # Check score without changes
271
+ /refine --score
272
+
273
+ # See what would be improved
274
+ /refine --dry-run
275
+
276
+ # Only add dependencies (fastest impact)
277
+ /refine --deps
278
+
279
+ # Full auto-refinement
280
+ /refine --auto
281
+
282
+ # Refine specific feature
283
+ /refine roadmap/phase-01/feature-1.2-auth.yaml
284
+ ```
285
+
286
+ ## Inference Rules
287
+
288
+ ### Subfeature Grouping
289
+
290
+ Group TODOs by:
291
+ 1. **Prefix patterns**: `*-schema`, `*-service`, `*-controller`, `*-test`
292
+ 2. **Semantic clusters**: database, business logic, API, tests
293
+ 3. **Size target**: 3-7 TODOs per subfeature (natural checkpoint size)
294
+
295
+ ### Dependency Detection
296
+
297
+ Infer dependencies from:
298
+ 1. **Naming**: "Create X" before "Use X"
299
+ 2. **Patterns**: schema → repository → service → controller → tests
300
+ 3. **Keywords**: "after", "requires", "based on" in descriptions
301
+
302
+ ### File Mapping
303
+
304
+ Infer files from:
305
+ 1. **Project structure**: Scan `src/`, `lib/`, `packages/`
306
+ 2. **Naming conventions**: `{module}.service.ts`, `{module}.test.ts`
307
+ 3. **TODO names**: "Create user service" → `user.service.ts`
308
+
309
+ ### Description Enrichment
310
+
311
+ Expand descriptions with:
312
+ 1. **Input/Output**: What goes in, what comes out
313
+ 2. **Acceptance criteria**: Bullet points of done conditions
314
+ 3. **Edge cases**: Error handling, validation rules
315
+
316
+ ## Quality Bar
317
+
318
+ After refinement, the structure should have:
319
+ - ✓ Subfeatures grouping related work
320
+ - ✓ Dependencies defining execution order
321
+ - ✓ File mappings for each TODO
322
+ - ✓ Rich descriptions with acceptance criteria
323
+ - ✓ Score ≥ 70/100
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: resume
3
+ description: Re-enter OODA loop from paused state
4
+ model: sonnet
5
+ tools: Read, Write, Edit, Bash, Glob, Grep, Task
6
+ ---
7
+
8
+ # /resume
9
+
10
+ Re-enter OODA loop at OBSERVE phase with fresh environment sensing.
11
+
12
+ ## Usage
13
+
14
+ ```bash
15
+ /resume # Re-enter at OBSERVE
16
+ /resume --skip-current # Skip current TODO, OBSERVE next
17
+ /resume --from todo-1.1b-006 # Jump to specific TODO
18
+ /resume --restart # Clear partial work, fresh start
19
+ ```
20
+
21
+ ## Behavior
22
+
23
+ | Scenario | Action |
24
+ |----------|--------|
25
+ | Clean pause (after ACT) | OBSERVE current TODO |
26
+ | Dirty pause (mid-ACT) | OBSERVE, assess partial work |
27
+ | Interrupted session | Drift detection, then OBSERVE |
28
+ | `--restart` | Clear partial work, fresh OBSERVE |
29
+
30
+ ## Drift Detection
31
+
32
+ If paused > 1 hour or environment changed:
33
+
34
+ ```
35
+ ▶ RESUMING with drift detection
36
+
37
+ Paused: 3 hours ago
38
+ Changes: 2 new commits on main
39
+
40
+ [c] Continue with fresh OBSERVE
41
+ [r] Re-plan section
42
+ [a] Abort
43
+ ```
44
+
45
+ ## Output
46
+
47
+ ```
48
+ ▶ RESUMING OODA Loop
49
+
50
+ Re-entry: OBSERVE phase
51
+ Paused: 1h 30m ago
52
+ Drift: none detected
53
+
54
+ Starting OBSERVE...
55
+ ```
56
+
57
+ ## State Transition
58
+
59
+ ```yaml
60
+ # Before
61
+ execution_state:
62
+ status: paused
63
+
64
+ # After
65
+ execution_state:
66
+ status: running
67
+ resumed_at: {timestamp}
68
+ ```
69
+
70
+ ## OODA Integration
71
+
72
+ Resume always enters at **OBSERVE**, never mid-loop. See `/run` for full OODA documentation.
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: retro
3
+ description: Analyze daily conversations to extract learnings and recommend config improvements
4
+ model: opus
5
+ tools: Read, Write, Glob, Grep, Task
6
+ ---
7
+
8
+ # /retro — Daily Retrospective
9
+
10
+ Analyze conversations to extract insights, identify friction, and recommend improvements.
11
+
12
+ ## Usage
13
+
14
+ ```bash
15
+ /retro # Analyze today
16
+ /retro 2026-01-29 # Specific date
17
+ /retro --week # Last 7 days
18
+ /retro --apply # Apply recommendations
19
+ /retro --show # Show pending recommendations
20
+ /retro --dry-run # Preview without writing
21
+ ```
22
+
23
+ ## Storage
24
+
25
+ ```
26
+ ~/.claude/learnings/
27
+ ├── log.yaml # Stats (forever)
28
+ ├── daily/{date}.yaml # Analysis (7 days)
29
+ └── recommendations/
30
+ ├── pending.yaml # Actionable (forever)
31
+ └── applied.yaml # Audit trail (forever)
32
+ ```
33
+
34
+ ## Signal Detection
35
+
36
+ | Signal | Detection | Indicates |
37
+ |--------|-----------|-----------|
38
+ | Repeated Clarification | Same question 2+ times | Missing context in rules |
39
+ | Long Exchange | >10 exchanges for simple task | Missing command |
40
+ | Error-Retry Cycle | Error + fix attempts | Workflow issue |
41
+ | Manual Workaround | User provides solution | Automation opportunity |
42
+ | Command Failure | Command failed | Command needs fix |
43
+ | Knowledge Gap | Claude asks for existing context | Missing agent loading |
44
+ | Success Pattern | Smooth completion | Pattern to document |
45
+
46
+ ## Recommendation Mapping
47
+
48
+ | Signal | Type | Target |
49
+ |--------|------|--------|
50
+ | Repeated clarification | Rule update | `rules/{topic}.md` |
51
+ | Long exchange | New command | `commands/{name}.md` |
52
+ | Command failure | Command fix | `commands/{name}.md` |
53
+ | Knowledge gap | Agent update | `agents/` or `skills/` |
54
+ | Success pattern | Documentation | `rules/` or `skills/` |
55
+
56
+ ## Priority Criteria
57
+
58
+ | Priority | Criteria |
59
+ |----------|----------|
60
+ | P0 | Blocks work, repeated daily, security risk |
61
+ | P1 | Significant friction, affects multiple tasks |
62
+ | P2 | Minor improvement |
63
+
64
+ ## Output Files
65
+
66
+ **daily/{date}.yaml**:
67
+ ```yaml
68
+ date: 2026-01-30
69
+ sessions_analyzed: 5
70
+ total_exchanges: 147
71
+
72
+ insights:
73
+ - id: insight-001
74
+ type: friction
75
+ signal: repeated_clarification
76
+ description: "Asked 3x about file organization"
77
+ recommendation:
78
+ type: rule_update
79
+ target: "rules/standards.md"
80
+ priority: P1
81
+ ```
82
+
83
+ **recommendations/pending.yaml**:
84
+ ```yaml
85
+ recommendations:
86
+ - id: rec-001
87
+ from_insights: [insight-001]
88
+ type: rule_update
89
+ priority: P1
90
+ target: "rules/standards.md"
91
+ title: "Add File Organization Standards"
92
+ implementation: |
93
+ ## File Organization
94
+ | Type | Location |
95
+ |------|----------|
96
+ | Commands | `commands/` |
97
+ ```
98
+
99
+ ## Process
100
+
101
+ 1. **Discover**: Load sessions from index
102
+ 2. **Detect**: Scan for signal patterns
103
+ 3. **Extract**: Capture evidence with quotes
104
+ 4. **Generate**: Map signals to recommendations
105
+ 5. **Prioritize**: P0 > P1 > P2
106
+ 6. **Output**: Write to learnings/
107
+ 7. **Cleanup**: Delete daily files > 7 days old
108
+
109
+ ## Apply Mode
110
+
111
+ Interactive confirmation for each change:
112
+ - Preview diff
113
+ - Apply or skip
114
+ - Log to applied.yaml
115
+
116
+ ## Quality Bar
117
+
118
+ - Accurately identifies friction patterns
119
+ - Evidence-based recommendations
120
+ - Maintains audit trail
121
+ - Respects privacy (no PII in learnings)
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: retry
3
+ description: Reset TODO and re-enter OODA at OBSERVE
4
+ model: sonnet
5
+ tools: Read, Write, Edit, Bash, Glob, Grep, Task
6
+ ---
7
+
8
+ # /retry
9
+
10
+ Reset a failed/skipped TODO and re-enter OODA loop at OBSERVE.
11
+
12
+ ## Usage
13
+
14
+ ```bash
15
+ /retry # Retry current/last failed
16
+ /retry todo-1.1b-004 # Retry specific TODO
17
+ /retry --fresh # Clear partial work too
18
+ /retry --all-failed # Retry all failed TODOs
19
+ /retry --reset-confidence # Clear failure history
20
+ ```
21
+
22
+ ## Reset Levels
23
+
24
+ | Flag | Resets | Use When |
25
+ |------|--------|----------|
26
+ | (default) | Status only | Retry with existing work |
27
+ | `--fresh` | Status + partial work | Implementation was wrong |
28
+ | `--reset-confidence` | Status + OODA history | False failure pattern |
29
+ | `--all-failed` | All failed TODOs | Batch retry |
30
+
31
+ ## Output
32
+
33
+ ```
34
+ 🔄 RETRY: todo-1.1b-004
35
+
36
+ Previous: failed (3 attempts)
37
+ OODA: confidence recalculating...
38
+
39
+ Entering OBSERVE...
40
+ ```
41
+
42
+ ### On Success
43
+
44
+ ```
45
+ ✓ RETRY SUCCESSFUL
46
+
47
+ TODO: todo-1.1b-004
48
+ Attempt: 4
49
+ Commit: abc123
50
+ ```
51
+
52
+ ### On Failure
53
+
54
+ ```
55
+ ❌ RETRY FAILED
56
+
57
+ Error: Test assertion failed
58
+ Recommendation: replan
59
+
60
+ [1] Retry again
61
+ [2] Retry --fresh
62
+ [3] Skip
63
+ [4] Replan section
64
+ ```
65
+
66
+ ## Retry vs Resume
67
+
68
+ | Command | Purpose | OODA Entry |
69
+ |---------|---------|------------|
70
+ | `/resume` | Continue from pause | OBSERVE current |
71
+ | `/retry` | Re-attempt failed/skipped | OBSERVE with reset |
72
+
73
+ ## OODA Integration
74
+
75
+ Retry resets OODA state for the TODO. Previous failures cleared. See `/run` for full OODA documentation.