liteagents 2.8.3 → 2.10.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 (113) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +25 -31
  3. package/installer/cli.js +6 -2
  4. package/package.json +3 -3
  5. package/packages/ampcode/AGENT.md +9 -15
  6. package/packages/ampcode/agents/code-developer.md +11 -12
  7. package/packages/ampcode/agents/quality-assurance.md +1 -1
  8. package/packages/{droid/commands/systematic-debugging.md → ampcode/commands/debug-method.md} +9 -9
  9. package/packages/ampcode/commands/diff-review.md +78 -0
  10. package/packages/ampcode/commands/friction/friction.js +348 -122
  11. package/packages/ampcode/commands/optimize.md +45 -4
  12. package/packages/ampcode/commands/refactor.md +33 -1
  13. package/packages/ampcode/commands/remember.md +107 -46
  14. package/packages/ampcode/commands/security.md +28 -1
  15. package/packages/ampcode/commands/stash.md +7 -0
  16. package/packages/{droid/commands/test-driven-development.md → ampcode/commands/tdd-flow.md} +2 -2
  17. package/packages/ampcode/commands/test-generate.md +64 -15
  18. package/packages/{opencode/command/testing-anti-patterns.md → ampcode/commands/test-traps.md} +77 -3
  19. package/packages/{droid/commands/root-cause-tracing.md → ampcode/commands/trace-back.md} +3 -3
  20. package/packages/ampcode/commands/{verification-before-completion.md → verify-done.md} +3 -3
  21. package/packages/claude/CLAUDE.md +9 -15
  22. package/packages/claude/agents/code-developer.md +11 -12
  23. package/packages/claude/agents/quality-assurance.md +1 -1
  24. package/packages/claude/commands/diff-review.md +78 -0
  25. package/packages/claude/commands/friction/friction.js +348 -122
  26. package/packages/claude/commands/optimize.md +45 -4
  27. package/packages/claude/commands/refactor.md +33 -1
  28. package/packages/claude/commands/remember.md +107 -46
  29. package/packages/claude/commands/security.md +28 -1
  30. package/packages/claude/commands/stash.md +7 -0
  31. package/packages/claude/commands/test-generate.md +64 -15
  32. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/package-lock.json +3 -3
  33. package/packages/claude/skills/{systematic-debugging → debug-method}/CREATION-LOG.md +1 -1
  34. package/packages/claude/skills/{systematic-debugging → debug-method}/SKILL.md +9 -9
  35. package/packages/claude/skills/{systematic-debugging → debug-method}/test-academic.md +1 -1
  36. package/packages/claude/skills/{systematic-debugging → debug-method}/test-pressure-1.md +1 -1
  37. package/packages/claude/skills/{systematic-debugging → debug-method}/test-pressure-2.md +1 -1
  38. package/packages/claude/skills/{systematic-debugging → debug-method}/test-pressure-3.md +1 -1
  39. package/packages/claude/skills/{test-driven-development → tdd-flow}/SKILL.md +3 -3
  40. package/packages/claude/skills/{testing-anti-patterns → test-traps}/SKILL.md +77 -3
  41. package/packages/claude/skills/{root-cause-tracing → trace-back}/SKILL.md +3 -3
  42. package/packages/claude/skills/{verification-before-completion → verify-done}/SKILL.md +3 -3
  43. package/packages/droid/AGENTS.md +8 -14
  44. package/packages/{opencode/command/systematic-debugging.md → droid/commands/debug-method.md} +9 -9
  45. package/packages/droid/commands/diff-review.md +78 -0
  46. package/packages/droid/commands/friction/friction.js +348 -122
  47. package/packages/droid/commands/optimize.md +45 -4
  48. package/packages/droid/commands/refactor.md +33 -1
  49. package/packages/droid/commands/remember.md +107 -46
  50. package/packages/droid/commands/security.md +28 -1
  51. package/packages/droid/commands/stash.md +7 -0
  52. package/packages/{opencode/command/test-driven-development.md → droid/commands/tdd-flow.md} +2 -2
  53. package/packages/droid/commands/test-generate.md +64 -15
  54. package/packages/droid/commands/{testing-anti-patterns.md → test-traps.md} +77 -3
  55. package/packages/{opencode/command/root-cause-tracing.md → droid/commands/trace-back.md} +3 -3
  56. package/packages/droid/commands/{verification-before-completion.md → verify-done.md} +3 -3
  57. package/packages/droid/droids/code-developer.md +11 -12
  58. package/packages/droid/droids/quality-assurance.md +1 -1
  59. package/packages/opencode/AGENTS.md +8 -14
  60. package/packages/opencode/agent/code-developer.md +11 -12
  61. package/packages/opencode/agent/quality-assurance.md +1 -1
  62. package/packages/{ampcode/commands/systematic-debugging.md → opencode/command/debug-method.md} +9 -9
  63. package/packages/opencode/command/diff-review.md +78 -0
  64. package/packages/opencode/command/friction/friction.js +348 -122
  65. package/packages/opencode/command/optimize.md +45 -4
  66. package/packages/opencode/command/refactor.md +33 -1
  67. package/packages/opencode/command/remember.md +107 -46
  68. package/packages/opencode/command/security.md +28 -1
  69. package/packages/opencode/command/stash.md +7 -0
  70. package/packages/{ampcode/commands/test-driven-development.md → opencode/command/tdd-flow.md} +2 -2
  71. package/packages/opencode/command/test-generate.md +64 -15
  72. package/packages/{ampcode/commands/testing-anti-patterns.md → opencode/command/test-traps.md} +77 -3
  73. package/packages/{ampcode/commands/root-cause-tracing.md → opencode/command/trace-back.md} +3 -3
  74. package/packages/opencode/command/{verification-before-completion.md → verify-done.md} +3 -3
  75. package/packages/opencode/opencode.jsonc +13 -37
  76. package/packages/subagentic-manual.md +55 -51
  77. package/packages/ampcode/commands/code-review.md +0 -107
  78. package/packages/ampcode/commands/condition-based-waiting.md +0 -122
  79. package/packages/ampcode/commands/debug.md +0 -20
  80. package/packages/ampcode/commands/explain.md +0 -18
  81. package/packages/ampcode/commands/friction.md +0 -139
  82. package/packages/ampcode/commands/git-commit.md +0 -14
  83. package/packages/ampcode/commands/review.md +0 -18
  84. package/packages/claude/commands/debug.md +0 -20
  85. package/packages/claude/commands/explain.md +0 -18
  86. package/packages/claude/commands/friction.md +0 -139
  87. package/packages/claude/commands/git-commit.md +0 -14
  88. package/packages/claude/commands/review.md +0 -18
  89. package/packages/claude/skills/code-review/SKILL.md +0 -107
  90. package/packages/claude/skills/code-review/code-reviewer.md +0 -146
  91. package/packages/claude/skills/condition-based-waiting/SKILL.md +0 -122
  92. package/packages/droid/commands/code-review.md +0 -107
  93. package/packages/droid/commands/condition-based-waiting.md +0 -122
  94. package/packages/droid/commands/debug.md +0 -20
  95. package/packages/droid/commands/explain.md +0 -18
  96. package/packages/droid/commands/friction.md +0 -139
  97. package/packages/droid/commands/git-commit.md +0 -14
  98. package/packages/droid/commands/review.md +0 -18
  99. package/packages/opencode/command/code-review.md +0 -107
  100. package/packages/opencode/command/condition-based-waiting.md +0 -122
  101. package/packages/opencode/command/debug.md +0 -20
  102. package/packages/opencode/command/explain.md +0 -18
  103. package/packages/opencode/command/friction.md +0 -139
  104. package/packages/opencode/command/git-commit.md +0 -14
  105. package/packages/opencode/command/review.md +0 -18
  106. /package/packages/ampcode/commands/{condition-based-waiting → test-traps}/example.ts +0 -0
  107. /package/packages/ampcode/commands/{root-cause-tracing → trace-back}/find-polluter.sh +0 -0
  108. /package/packages/claude/skills/{condition-based-waiting → test-traps}/example.ts +0 -0
  109. /package/packages/claude/skills/{root-cause-tracing → trace-back}/find-polluter.sh +0 -0
  110. /package/packages/droid/commands/{condition-based-waiting → test-traps}/example.ts +0 -0
  111. /package/packages/droid/commands/{root-cause-tracing → trace-back}/find-polluter.sh +0 -0
  112. /package/packages/opencode/command/{condition-based-waiting → test-traps}/example.ts +0 -0
  113. /package/packages/opencode/command/{root-cause-tracing → trace-back}/find-polluter.sh +0 -0
@@ -113,58 +113,38 @@
113
113
  }
114
114
  },
115
115
  "command": {
116
- "systematic-debugging": {
117
- "template": "{file:./command/systematic-debugging.md}",
116
+ "debug-method": {
117
+ "template": "{file:./command/debug-method.md}",
118
118
  "description": "Systematic four-phase debugging framework - investigate root cause before any fixes"
119
119
  },
120
- "verification-before-completion": {
121
- "template": "{file:./command/verification-before-completion.md}",
120
+ "verify-done": {
121
+ "template": "{file:./command/verify-done.md}",
122
122
  "description": "Verify work meets requirements before marking complete - prevents incomplete deliverables"
123
123
  },
124
124
  "skill-creator": {
125
125
  "template": "{file:./command/skill-creator.md}",
126
126
  "description": "Create reusable skills with proper structure, validation, and documentation"
127
127
  },
128
- "test-driven-development": {
129
- "template": "{file:./command/test-driven-development.md}",
128
+ "tdd-flow": {
129
+ "template": "{file:./command/tdd-flow.md}",
130
130
  "description": "Write test first, watch it fail, write minimal code to pass - ensures tests actually verify behavior"
131
131
  },
132
- "testing-anti-patterns": {
133
- "template": "{file:./command/testing-anti-patterns.md}",
132
+ "test-traps": {
133
+ "template": "{file:./command/test-traps.md}",
134
134
  "description": "Identify and avoid common testing anti-patterns that create fragile, useless tests"
135
135
  },
136
- "root-cause-tracing": {
137
- "template": "{file:./command/root-cause-tracing.md}",
136
+ "trace-back": {
137
+ "template": "{file:./command/trace-back.md}",
138
138
  "description": "Trace issues to their root cause using systematic investigation techniques"
139
139
  },
140
- "condition-based-waiting": {
141
- "template": "{file:./command/condition-based-waiting.md}",
142
- "description": "Implement robust waiting mechanisms based on conditions rather than fixed delays"
143
- },
144
140
  "brainstorming": {
145
141
  "template": "{file:./command/brainstorming.md}",
146
142
  "description": "Facilitate structured brainstorming sessions with proven techniques and frameworks"
147
143
  },
148
- "code-review": {
149
- "template": "{file:./command/code-review.md}",
150
- "description": "Conduct thorough code reviews with focus on quality, security, and maintainability"
151
- },
152
144
  "docs-builder": {
153
145
  "template": "{file:./command/docs-builder/SKILL.md}",
154
146
  "description": "Create comprehensive project documentation with structured /docs hierarchy"
155
147
  },
156
- "debug": {
157
- "template": "{file:./command/debug.md}",
158
- "description": "Debug an issue systematically using structured investigation techniques"
159
- },
160
- "explain": {
161
- "template": "{file:./command/explain.md}",
162
- "description": "Explain code for someone new to the codebase"
163
- },
164
- "git-commit": {
165
- "template": "{file:./command/git-commit.md}",
166
- "description": "Analyze changes and create intelligent git commits"
167
- },
168
148
  "live-canvas": {
169
149
  "template": "{file:./command/live-canvas.md}",
170
150
  "description": "Design UI variations and collect click-to-annotate feedback from the browser (batch mode only on Opencode)"
@@ -177,8 +157,8 @@
177
157
  "template": "{file:./command/refactor.md}",
178
158
  "description": "Refactor code while maintaining behavior and tests"
179
159
  },
180
- "review": {
181
- "template": "{file:./command/review.md}",
160
+ "diff-review": {
161
+ "template": "{file:./command/diff-review.md}",
182
162
  "description": "Comprehensive code review including quality, tests, and architecture"
183
163
  },
184
164
  "security": {
@@ -189,10 +169,6 @@
189
169
  "template": "{file:./command/ship.md}",
190
170
  "description": "Pre-deployment verification checklist"
191
171
  },
192
- "friction": {
193
- "template": "{file:./command/friction.md}",
194
- "description": "Analyze session logs for failure patterns and behavioral signals"
195
- },
196
172
  "remember": {
197
173
  "template": "{file:./command/remember.md}",
198
174
  "description": "Consolidate stashes + friction into project memory"
@@ -203,7 +179,7 @@
203
179
  },
204
180
  "test-generate": {
205
181
  "template": "{file:./command/test-generate.md}",
206
- "description": "Generate comprehensive test suites for existing code"
182
+ "description": "Generate tests, run them, and verify each test actually exercises the code (not just passes)"
207
183
  },
208
184
  "subagent-spawning": {
209
185
  "template": "{file:./command/subagent-spawning.md}",
@@ -31,10 +31,10 @@ Install for your platform:
31
31
 
32
32
  | Platform | Installation | What's Included |
33
33
  |----------|--------------|-----------------|
34
- | **Claude Code** | `cp -r claude/* ~/.claude/` | 11 subagents + 11 skills + 12 commands + live-canvas-channel plugin |
35
- | **Droid** | `cp -r droid/* ~/.factory/` | 23 commands (subagent references) |
36
- | **Ampcode** | `cp -r ampcode/* ~/.config/amp/` | 11 subagents + 11 skills + 12 commands |
37
- | **OpenCode** | `cp -r opencode/* ~/.config/opencode/` | 23 commands (subagent references) |
34
+ | **Claude Code** | `cp -r claude/* ~/.claude/` | 11 subagents + 9 skills + 8 commands + live-canvas-channel plugin |
35
+ | **Droid** | `cp -r droid/* ~/.factory/` | 17 commands (subagent references) |
36
+ | **Ampcode** | `cp -r ampcode/* ~/.config/amp/` | 11 subagents + 9 skills + 8 commands |
37
+ | **OpenCode** | `cp -r opencode/* ~/.config/opencode/` | 17 commands (subagent references) |
38
38
 
39
39
  **Key Difference**:
40
40
  - **Claude Code / Ampcode** implement full subagent system with orchestrator
@@ -50,12 +50,12 @@ Install for your platform:
50
50
  - 3 Workflow Agents (PRD, Tasks, Implementation)
51
51
  - 8 Specialist Agents (UX, QA, Architecture, Product, Development, etc.)
52
52
 
53
- **11 Skills** - Auto-triggering + manual workflow components
54
- - test-driven-development, testing-anti-patterns, verification-before-completion (auto-trigger)
55
- - brainstorming, code-review, systematic-debugging, docs-builder, live-canvas, etc.
53
+ **10 Skills** - Auto-triggering + manual workflow components
54
+ - tdd-flow, test-traps, verify-done (auto-trigger)
55
+ - brainstorming, debug-method, docs-builder, live-canvas, etc.
56
56
 
57
- **12 Commands** - Simple workflow helpers
58
- - debug, explain, friction, git-commit, optimize, refactor, remember, review, security, ship, stash, test-generate
57
+ **8 Commands** - Simple workflow helpers
58
+ - optimize, refactor, remember, diff-review, security, ship, stash, test-generate
59
59
 
60
60
  **Orchestration System**
61
61
  - Automatic intent matching to 9 workflow patterns
@@ -64,7 +64,7 @@ Install for your platform:
64
64
 
65
65
  ### Droid/OpenCode (Commands Only)
66
66
 
67
- **23 Commands** - All workflow capabilities in command form
67
+ **18 Commands** - All workflow capabilities in command form
68
68
  - Combines skills + commands into unified command set
69
69
  - Same functionality, different invocation model (no auto-triggering)
70
70
  - Includes reference documentation for subagents
@@ -102,38 +102,32 @@ Install for your platform:
102
102
 
103
103
  ## Commands Reference
104
104
 
105
- ### Claude Code / Ampcode: 23 Total (11 Skills + 12 Commands)
105
+ ### Claude Code / Ampcode: 18 Total (9 Skills + 9 Commands)
106
106
 
107
107
  **Auto-Triggering Skills (3)**
108
- - `test-driven-development` - Write test first, watch fail, minimal passing code
109
- - `testing-anti-patterns` - Prevent mocking anti-patterns and test pollution
110
- - `verification-before-completion` - Run verification before claiming done
108
+ - `tdd-flow` - Write test first, watch fail, minimal passing code
109
+ - `test-traps` - Prevent mocking anti-patterns and test pollution
110
+ - `verify-done` - Run verification before claiming done
111
111
 
112
- **Manual Skills (8)**
112
+ **Manual Skills (6)**
113
113
  - `brainstorming` - Refine rough ideas through collaborative questioning
114
- - `code-review` - Review implementation against requirements
115
- - `condition-based-waiting` - Replace timeouts with condition polling
116
114
  - `docs-builder` - Create structured /docs hierarchy
117
115
  - `live-canvas` - Design UI variations with click-to-annotate browser feedback. **Claude Code ships a companion MCP channel plugin (`live-canvas-channel`) that enables live mode — each overlay Save streams into the session in real time.** Other tools run in batch mode only. One-time setup required: see `packages/claude/skills/live-canvas/README.md`.
118
- - `root-cause-tracing` - Trace bugs backward through call stack
116
+ - `trace-back` - Trace bugs backward through call stack
119
117
  - `skill-creator` - Guide for creating new skills
120
- - `systematic-debugging` - Four-phase debugging framework
118
+ - `debug-method` - Four-phase debugging framework
121
119
 
122
- **Simple Commands (12)**
123
- - `debug` - Systematic investigation techniques
124
- - `explain` - Explain code for newcomers
125
- - `friction` - Analyze session logs for failure patterns and behavioral signals
126
- - `git-commit` - Intelligent commit creation
120
+ **Simple Commands (8)**
127
121
  - `optimize` - Performance analysis
128
122
  - `refactor` - Maintain behavior while improving code
129
123
  - `remember` - Consolidate stashes + friction into project memory
130
- - `review` - Comprehensive code review
124
+ - `diff-review` - Review a file, branch, or range; verifies findings before fixing
131
125
  - `security` - Vulnerability scanning
132
126
  - `ship` - Pre-deployment checklist
133
127
  - `stash` - Save session context for compaction recovery or handoffs
134
128
  - `test-generate` - Test suite generation
135
129
 
136
- ### Droid/OpenCode: 23 Commands
130
+ ### Droid/OpenCode: 17 Commands
137
131
 
138
132
  Same functionality as skills+commands, but:
139
133
  - All invoked as commands (no auto-triggering)
@@ -142,24 +136,34 @@ Same functionality as skills+commands, but:
142
136
  - `live-canvas` runs in batch mode only (no channel plugin — that's Claude Code specific)
143
137
 
144
138
  **Command Categories**:
145
- - **Development & Testing (9)**: test-driven-development, testing-anti-patterns, test-generate, code-review, systematic-debugging, root-cause-tracing, debug, condition-based-waiting, verification-before-completion
146
- - **Code Operations (6)**: refactor, optimize, explain, review, security, ship
147
- - **Session & Memory (7)**: brainstorming, skill-creator, docs-builder, git-commit, stash, friction, remember
139
+ - **Development & Testing (6)**: tdd-flow, test-traps, test-generate, debug-method, trace-back, verify-done
140
+ - **Code Operations (5)**: refactor, optimize, diff-review, security, ship
141
+ - **Session & Memory (5)**: brainstorming, skill-creator, docs-builder, stash, remember
148
142
  - **Design (1)**: live-canvas
149
143
 
150
144
  ---
151
145
 
152
146
  ## Hot Memory
153
147
 
154
- Lightweight session memory that learns from your usage patterns across sessions.
148
+ Lightweight session memory that learns from your usage patterns across sessions. **`/stash` is
149
+ the only command you actively run — it drives the whole pipeline.** Once a few stashes pile up
150
+ it nudges you to run `/remember`, which does everything else: friction analysis, consolidation,
151
+ and wiring the memory into your agent config file.
155
152
 
156
153
  ```
157
- /stash → /friction → /remember
154
+ /stash → (nudge at 5+ unprocessed) → /remember
158
155
  ```
159
156
 
160
- 1. **`/stash`** - Snapshot current session context to `.claude/stash/`. Use before compaction, handoffs, or ending complex work.
161
- 2. **`/friction`** - Analyze session logs for failure patterns. Scores sessions, clusters failures by signal and tool sequence, outputs actionable antigens to `.claude/friction/`.
162
- 3. **`/remember`** - Consolidate stashes + friction into `.claude/memory/MEMORY.md`. Extracts facts, episodes, and behavioral preferences. References into CLAUDE.md via `@MEMORY.md`.
157
+ 1. **`/stash`** - Snapshot current session context to the tool's `…/stash/`. Use before
158
+ compaction, handoffs, or ending complex work. After saving it counts the unprocessed backlog
159
+ (`stash files .processed entries`) and, at 5+, nudges you to run `/remember`. No counter is
160
+ stored; running `/remember` clears the backlog.
161
+ 2. **`/remember`** - Runs friction analysis first (best-effort — scores sessions across *all* your
162
+ projects from the tool's global sessions root, clusters failures into antigens), then
163
+ consolidates stashes + antigens into `…/memory/MEMORY.md` and injects `@MEMORY.md` into the
164
+ **per-tool agent config — `CLAUDE.md` (Claude Code), `AGENTS.md` (Droid / OpenCode), or
165
+ `AGENT.md` (Ampcode)** — so every future session loads it. Each package writes to its own
166
+ tool's config file; the global probe list only governs which logs friction *reads*.
163
167
 
164
168
  **Result:** Project-local memory that accumulates across sessions — no external dependencies, no databases, just markdown.
165
169
 
@@ -201,7 +205,7 @@ Orchestrator: "Start systematic implementation?" [Yes/No]
201
205
  **Bypass Options**:
202
206
  - Direct agent: `@quality-assurance review this code`
203
207
  - Role syntax: `As system-architect, design the API layer`
204
- - Skills: `/test-driven-development login-feature`
208
+ - Skills: `/tdd-flow login-feature`
205
209
 
206
210
  ### 9 Pre-Defined Workflow Patterns
207
211
 
@@ -220,9 +224,9 @@ Each pattern includes conditional decision points requiring user approval.
220
224
  ### Droid/OpenCode: Direct Command Invocation
221
225
 
222
226
  No orchestrator - invoke commands directly:
223
- - `/debug <issue>`
227
+ - `/diff-review <file-or-branch>`
224
228
  - `/refactor <code-section>`
225
- - `/test-driven-development <feature>`
229
+ - `/tdd-flow <feature>`
226
230
 
227
231
  Subagent workflows require manual coordination.
228
232
 
@@ -257,8 +261,8 @@ Subagent workflows require manual coordination.
257
261
  ~/.claude/
258
262
  ├── CLAUDE.md # Registry + orchestrator workflows
259
263
  ├── agents/ # 11 subagent implementations (*.md)
260
- ├── skills/ # 11 skills (subdirectories with SKILL.md)
261
- └── commands/ # 12 commands (*.md)
264
+ ├── skills/ # 9 skills (subdirectories with SKILL.md)
265
+ └── commands/ # 8 commands (*.md)
262
266
  ```
263
267
 
264
268
  **Features**:
@@ -272,8 +276,8 @@ Subagent workflows require manual coordination.
272
276
  ~/.config/amp/
273
277
  ├── AGENT.md # Reference doc (subagents + commands)
274
278
  ├── agents/ # 11 subagent implementations (*.md)
275
- ├── skills/ # 11 skills (subdirectories with SKILL.md)
276
- └── commands/ # 12 commands (*.md)
279
+ ├── skills/ # 9 skills (subdirectories with SKILL.md)
280
+ └── commands/ # 8 commands (*.md)
277
281
  ```
278
282
 
279
283
  **Features**:
@@ -285,7 +289,7 @@ Subagent workflows require manual coordination.
285
289
  ```
286
290
  ~/.factory/
287
291
  ├── AGENTS.md # Reference doc (subagents + commands)
288
- └── commands/ # 23 commands (*.md)
292
+ └── commands/ # 17 commands (*.md)
289
293
  ```
290
294
 
291
295
  **Features**:
@@ -297,7 +301,7 @@ Subagent workflows require manual coordination.
297
301
  ```
298
302
  ~/.config/opencode/
299
303
  ├── AGENTS.md # Reference doc (subagents + commands)
300
- └── command/ # 23 commands (*.md)
304
+ └── command/ # 17 commands (*.md)
301
305
  ```
302
306
 
303
307
  **Features**:
@@ -326,10 +330,10 @@ color: purple
326
330
  **Skills** (`skills/*/SKILL.md`):
327
331
  ```yaml
328
332
  ---
329
- id: test-driven-development
330
- name: test-driven-development
333
+ id: tdd-flow
334
+ name: tdd-flow
331
335
  description: Write test first, watch it fail, write minimal code to pass
332
- usage: /test-driven-development <feature-or-behavior-to-test>
336
+ usage: /tdd-flow <feature-or-behavior-to-test>
333
337
  auto_trigger: true
334
338
  ---
335
339
  ```
@@ -337,11 +341,11 @@ auto_trigger: true
337
341
  **Commands** (`commands/*.md`):
338
342
  ```yaml
339
343
  ---
340
- id: debug
341
- name: debug
342
- description: Debug an issue systematically using structured investigation techniques
343
- usage: /debug <issue-description>
344
- argument-hint: [description of the problem]
344
+ id: refactor
345
+ name: refactor
346
+ description: Refactor code while maintaining behavior and tests
347
+ usage: /refactor <code-section>
348
+ argument-hint: [file-or-function]
345
349
  ---
346
350
  ```
347
351
 
@@ -1,107 +0,0 @@
1
- ---
2
- name: code-review
3
- description: Use when completing tasks, implementing major features, or before merging to verify work meets requirements - reviews implementation against plan or requirements before proceeding
4
- usage: /code-review <review-scope> <focus-areas>
5
- auto_trigger: false
6
- ---
7
-
8
- # Requesting Code Review
9
-
10
- Review code thoroughly to catch issues before they cascade.
11
-
12
- **Core principle:** Review early, review often.
13
-
14
- ## When to Request Review
15
-
16
- **Mandatory:**
17
- - After each task in subagent-driven development
18
- - After completing major feature
19
- - Before merge to main
20
-
21
- **Optional but valuable:**
22
- - When stuck (fresh perspective)
23
- - Before refactoring (baseline check)
24
- - After fixing complex bug
25
-
26
- ## How to Request
27
-
28
- **1. Get git SHAs:**
29
- ```bash
30
- BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
31
- HEAD_SHA=$(git rev-parse HEAD)
32
- ```
33
-
34
- **2. Conduct code review:**
35
-
36
- Review implementation against requirements and plan
37
-
38
- **Placeholders:**
39
- - `{WHAT_WAS_IMPLEMENTED}` - What you just built
40
- - `{PLAN_OR_REQUIREMENTS}` - What it should do
41
- - `{BASE_SHA}` - Starting commit
42
- - `{HEAD_SHA}` - Ending commit
43
- - `{DESCRIPTION}` - Brief summary
44
-
45
- **3. Act on feedback:**
46
- - Fix Critical issues immediately
47
- - Fix Important issues before proceeding
48
- - Note Minor issues for later
49
- - Push back if reviewer is wrong (with reasoning)
50
-
51
- ## Example
52
-
53
- ```
54
- [Just completed Task 2: Add verification function]
55
-
56
- You: Let me request code review before proceeding.
57
-
58
- BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
59
- HEAD_SHA=$(git rev-parse HEAD)
60
-
61
- [Conduct code review]
62
- WHAT_WAS_IMPLEMENTED: Verification and repair functions for conversation index
63
- PLAN_OR_REQUIREMENTS: Task 2 from docs/plans/deployment-plan.md
64
- BASE_SHA: a7981ec
65
- HEAD_SHA: 3df7661
66
- DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
67
-
68
- [Subagent returns]:
69
- Strengths: Clean architecture, real tests
70
- Issues:
71
- Important: Missing progress indicators
72
- Minor: Magic number (100) for reporting interval
73
- Assessment: Ready to proceed
74
-
75
- You: [Fix progress indicators]
76
- [Continue to Task 3]
77
- ```
78
-
79
- ## Integration with Workflows
80
-
81
- **Subagent-Driven Development:**
82
- - Review after EACH task
83
- - Catch issues before they compound
84
- - Fix before moving to next task
85
-
86
- **Executing Plans:**
87
- - Review after each batch (3 tasks)
88
- - Get feedback, apply, continue
89
-
90
- **Ad-Hoc Development:**
91
- - Review before merge
92
- - Review when stuck
93
-
94
- ## Red Flags
95
-
96
- **Never:**
97
- - Skip review because "it's simple"
98
- - Ignore Critical issues
99
- - Proceed with unfixed Important issues
100
- - Argue with valid technical feedback
101
-
102
- **If reviewer wrong:**
103
- - Push back with technical reasoning
104
- - Show code/tests that prove it works
105
- - Request clarification
106
-
107
- See template at: requesting-code-review/code-reviewer.md
@@ -1,122 +0,0 @@
1
- ---
2
- name: condition-based-waiting
3
- description: Use when tests have race conditions, timing dependencies, or inconsistent pass/fail behavior - replaces arbitrary timeouts with condition polling to wait for actual state changes, eliminating flaky tests from timing guesses
4
- usage: /condition-based-waiting <condition-type> <timeout-specs>
5
- auto_trigger: false
6
- ---
7
-
8
- # Condition-Based Waiting
9
-
10
- ## Overview
11
-
12
- Flaky tests often guess at timing with arbitrary delays. This creates race conditions where tests pass on fast machines but fail under load or in CI.
13
-
14
- **Core principle:** Wait for the actual condition you care about, not a guess about how long it takes.
15
-
16
- ## When to Use
17
-
18
- ```dot
19
- digraph when_to_use {
20
- "Test uses setTimeout/sleep?" [shape=diamond];
21
- "Testing timing behavior?" [shape=diamond];
22
- "Document WHY timeout needed" [shape=box];
23
- "Use condition-based waiting" [shape=box];
24
-
25
- "Test uses setTimeout/sleep?" -> "Testing timing behavior?" [label="yes"];
26
- "Testing timing behavior?" -> "Document WHY timeout needed" [label="yes"];
27
- "Testing timing behavior?" -> "Use condition-based waiting" [label="no"];
28
- }
29
- ```
30
-
31
- **Use when:**
32
- - Tests have arbitrary delays (`setTimeout`, `sleep`, `time.sleep()`)
33
- - Tests are flaky (pass sometimes, fail under load)
34
- - Tests timeout when run in parallel
35
- - Waiting for async operations to complete
36
-
37
- **Don't use when:**
38
- - Testing actual timing behavior (debounce, throttle intervals)
39
- - Always document WHY if using arbitrary timeout
40
-
41
- ## Core Pattern
42
-
43
- ```typescript
44
- // ❌ BEFORE: Guessing at timing
45
- await new Promise(r => setTimeout(r, 50));
46
- const result = getResult();
47
- expect(result).toBeDefined();
48
-
49
- // ✅ AFTER: Waiting for condition
50
- await waitFor(() => getResult() !== undefined);
51
- const result = getResult();
52
- expect(result).toBeDefined();
53
- ```
54
-
55
- ## Quick Patterns
56
-
57
- | Scenario | Pattern |
58
- |----------|---------|
59
- | Wait for event | `waitFor(() => events.find(e => e.type === 'DONE'))` |
60
- | Wait for state | `waitFor(() => machine.state === 'ready')` |
61
- | Wait for count | `waitFor(() => items.length >= 5)` |
62
- | Wait for file | `waitFor(() => fs.existsSync(path))` |
63
- | Complex condition | `waitFor(() => obj.ready && obj.value > 10)` |
64
-
65
- ## Implementation
66
-
67
- Generic polling function:
68
- ```typescript
69
- async function waitFor<T>(
70
- condition: () => T | undefined | null | false,
71
- description: string,
72
- timeoutMs = 5000
73
- ): Promise<T> {
74
- const startTime = Date.now();
75
-
76
- while (true) {
77
- const result = condition();
78
- if (result) return result;
79
-
80
- if (Date.now() - startTime > timeoutMs) {
81
- throw new Error(`Timeout waiting for ${description} after ${timeoutMs}ms`);
82
- }
83
-
84
- await new Promise(r => setTimeout(r, 10)); // Poll every 10ms
85
- }
86
- }
87
- ```
88
-
89
- See @example.ts for complete implementation with domain-specific helpers (`waitForEvent`, `waitForEventCount`, `waitForEventMatch`) from actual debugging session.
90
-
91
- ## Common Mistakes
92
-
93
- **❌ Polling too fast:** `setTimeout(check, 1)` - wastes CPU
94
- **✅ Fix:** Poll every 10ms
95
-
96
- **❌ No timeout:** Loop forever if condition never met
97
- **✅ Fix:** Always include timeout with clear error
98
-
99
- **❌ Stale data:** Cache state before loop
100
- **✅ Fix:** Call getter inside loop for fresh data
101
-
102
- ## When Arbitrary Timeout IS Correct
103
-
104
- ```typescript
105
- // Tool ticks every 100ms - need 2 ticks to verify partial output
106
- await waitForEvent(manager, 'TOOL_STARTED'); // First: wait for condition
107
- await new Promise(r => setTimeout(r, 200)); // Then: wait for timed behavior
108
- // 200ms = 2 ticks at 100ms intervals - documented and justified
109
- ```
110
-
111
- **Requirements:**
112
- 1. First wait for triggering condition
113
- 2. Based on known timing (not guessing)
114
- 3. Comment explaining WHY
115
-
116
- ## Real-World Impact
117
-
118
- From debugging session (2025-10-03):
119
- - Fixed 15 flaky tests across 3 files
120
- - Pass rate: 60% → 100%
121
- - Execution time: 40% faster
122
- - No more race conditions
@@ -1,20 +0,0 @@
1
- ---
2
- name: debug
3
- description: Debug issue [issue]
4
- usage: /debug <issue-description>
5
- argument-hint: [description of the problem]
6
- ---
7
- Debug: $ARGUMENTS
8
-
9
- ## Process
10
- 1. Clarify: What's expected vs actual behavior?
11
- 2. Reproduce: What triggers the issue?
12
- 3. Isolate: Which component/function is responsible?
13
- 4. Trace: Follow the data flow
14
- 5. Fix: Implement and verify the solution
15
-
16
- ## Output
17
- - Root cause
18
- - Affected code paths
19
- - Fix with explanation
20
- - Prevention strategy
@@ -1,18 +0,0 @@
1
- ---
2
- name: explain
3
- description: Explain [code]
4
- usage: /explain <code-section>
5
- argument-hint: [file, function, or concept]
6
- model: claude-3-5-haiku-20241022
7
- ---
8
- Explain $ARGUMENTS.
9
-
10
- ## Cover
11
- - What it does (purpose)
12
- - How it works (step by step)
13
- - Why it's designed this way
14
- - Dependencies and side effects
15
- - Potential gotchas
16
-
17
- Assume reader knows the language but not this codebase.
18
-