liteagents 2.24.1 → 3.5.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 (160) hide show
  1. package/CHANGELOG.md +206 -0
  2. package/README.md +120 -160
  3. package/installer/cli.js +40 -5
  4. package/installer/installation-engine.js +8 -0
  5. package/package.json +4 -3
  6. package/packages/ampcode/AGENT.md +11 -20
  7. package/packages/ampcode/agents/code-developer.md +11 -17
  8. package/packages/ampcode/agents/orchestrator.md +3 -3
  9. package/packages/ampcode/agents/quality-assurance.md +3 -1
  10. package/packages/ampcode/{commands/brainstorming.md → skills/brainstorming/SKILL.md} +2 -3
  11. package/packages/ampcode/{commands/branch-review.md → skills/branch-review/SKILL.md} +13 -13
  12. package/packages/{claude/commands/docs-builder.md → ampcode/skills/docs-builder/SKILL.md} +1 -1
  13. package/packages/ampcode/{commands/live-canvas.md → skills/live-canvas/SKILL.md} +8 -4
  14. package/packages/ampcode/{commands/refactor.md → skills/refactor/SKILL.md} +57 -9
  15. package/packages/ampcode/{commands/release.md → skills/release/SKILL.md} +4 -4
  16. package/packages/{claude/commands → ampcode/skills}/remember/AGENT_RULES.md +44 -84
  17. package/packages/ampcode/{commands/remember.md → skills/remember/SKILL.md} +86 -13
  18. package/packages/ampcode/{commands → skills}/remember/friction.cjs +0 -0
  19. package/packages/ampcode/skills/remember/stub-check.cjs +206 -0
  20. package/packages/ampcode/skills/remember/sync-rules.cjs +178 -0
  21. package/packages/ampcode/skills/remember/version-check.cjs +214 -0
  22. package/packages/ampcode/skills/root-cause/SKILL.md +220 -0
  23. package/packages/ampcode/{commands/trace-back → skills/root-cause}/find-polluter.sh +0 -0
  24. package/packages/{claude/commands/security.md → ampcode/skills/security/SKILL.md} +1 -1
  25. package/packages/{claude/commands/ship.md → ampcode/skills/ship/SKILL.md} +1 -1
  26. package/packages/ampcode/skills/skill-creator/LICENSE.txt +202 -0
  27. package/packages/ampcode/{commands/skill-creator.md → skills/skill-creator/SKILL.md} +1 -2
  28. package/packages/ampcode/{commands → skills}/skill-creator/scripts/init_skill.py +0 -0
  29. package/packages/ampcode/{commands → skills}/skill-creator/scripts/package_skill.py +0 -0
  30. package/packages/ampcode/{commands → skills}/skill-creator/scripts/quick_validate.py +0 -0
  31. package/packages/ampcode/{commands/stash.md → skills/stash/SKILL.md} +2 -1
  32. package/packages/{claude/commands/test-generate.md → ampcode/skills/test-generate/SKILL.md} +2 -2
  33. package/packages/ampcode/variants.json +2 -2
  34. package/packages/claude/CLAUDE.md +11 -19
  35. package/packages/claude/agents/code-developer.md +11 -17
  36. package/packages/claude/agents/orchestrator.md +4 -5
  37. package/packages/claude/agents/quality-assurance.md +3 -1
  38. package/packages/claude/skills/brainstorming/SKILL.md +1 -2
  39. package/packages/claude/{commands/branch-review.md → skills/branch-review/SKILL.md} +1 -1
  40. package/packages/{ampcode/commands/docs-builder.md → claude/skills/docs-builder/SKILL.md} +7 -7
  41. package/packages/claude/skills/live-canvas/SKILL.md +5 -1
  42. package/packages/claude/{commands/refactor.md → skills/refactor/SKILL.md} +53 -5
  43. package/packages/claude/{commands/release.md → skills/release/SKILL.md} +1 -1
  44. package/packages/{ampcode/commands → claude/skills}/remember/AGENT_RULES.md +38 -78
  45. package/packages/claude/{commands/remember.md → skills/remember/SKILL.md} +86 -13
  46. package/packages/claude/{commands → skills}/remember/friction.cjs +0 -0
  47. package/packages/claude/skills/remember/stub-check.cjs +206 -0
  48. package/packages/claude/skills/remember/sync-rules.cjs +178 -0
  49. package/packages/claude/skills/remember/version-check.cjs +214 -0
  50. package/packages/claude/skills/root-cause/SKILL.md +220 -0
  51. package/packages/{ampcode/commands/security.md → claude/skills/security/SKILL.md} +2 -2
  52. package/packages/{ampcode/commands/ship.md → claude/skills/ship/SKILL.md} +2 -2
  53. package/packages/claude/skills/skill-creator/SKILL.md +1 -2
  54. package/packages/claude/{commands/stash.md → skills/stash/SKILL.md} +2 -1
  55. package/packages/{ampcode/commands/test-generate.md → claude/skills/test-generate/SKILL.md} +3 -3
  56. package/packages/claude/variants.json +1 -2
  57. package/packages/droid/AGENTS.md +10 -16
  58. package/packages/droid/commands/brainstorming.md +1 -4
  59. package/packages/droid/commands/branch-review.md +11 -14
  60. package/packages/droid/commands/docs-builder.md +0 -3
  61. package/packages/droid/commands/live-canvas.md +7 -5
  62. package/packages/droid/commands/refactor.md +55 -10
  63. package/packages/droid/commands/release.md +2 -5
  64. package/packages/droid/commands/remember/AGENT_RULES.md +38 -78
  65. package/packages/droid/commands/remember/stub-check.cjs +206 -0
  66. package/packages/droid/commands/remember/sync-rules.cjs +178 -0
  67. package/packages/droid/commands/remember/version-check.cjs +214 -0
  68. package/packages/droid/commands/remember.md +84 -14
  69. package/packages/droid/commands/root-cause.md +218 -0
  70. package/packages/droid/commands/security.md +0 -3
  71. package/packages/droid/commands/ship.md +0 -3
  72. package/packages/droid/commands/skill-creator/LICENSE.txt +202 -0
  73. package/packages/droid/commands/skill-creator.md +0 -4
  74. package/packages/droid/commands/stash.md +0 -2
  75. package/packages/droid/commands/test-generate.md +1 -4
  76. package/packages/droid/droids/1-create-prd.md +6 -2
  77. package/packages/droid/droids/2-generate-tasks.md +1 -2
  78. package/packages/droid/droids/3-process-task-list.md +1 -2
  79. package/packages/droid/droids/code-developer.md +12 -19
  80. package/packages/droid/droids/feature-planner.md +1 -2
  81. package/packages/droid/droids/market-researcher.md +1 -2
  82. package/packages/droid/droids/orchestrator.md +3 -4
  83. package/packages/droid/droids/quality-assurance.md +4 -3
  84. package/packages/droid/droids/system-architect.md +1 -2
  85. package/packages/droid/droids/ui-designer.md +1 -2
  86. package/packages/opencode/AGENTS.md +10 -16
  87. package/packages/opencode/agent/code-developer.md +11 -17
  88. package/packages/opencode/agent/orchestrator.md +2 -2
  89. package/packages/opencode/agent/quality-assurance.md +3 -1
  90. package/packages/opencode/command/brainstorming.md +1 -4
  91. package/packages/opencode/command/branch-review.md +11 -15
  92. package/packages/opencode/command/docs-builder.md +0 -4
  93. package/packages/opencode/command/live-canvas.md +7 -5
  94. package/packages/opencode/command/refactor.md +55 -11
  95. package/packages/opencode/command/release.md +2 -5
  96. package/packages/opencode/command/remember/AGENT_RULES.md +38 -78
  97. package/packages/opencode/command/remember/stub-check.cjs +206 -0
  98. package/packages/opencode/command/remember/sync-rules.cjs +178 -0
  99. package/packages/opencode/command/remember/version-check.cjs +214 -0
  100. package/packages/opencode/command/remember.md +84 -14
  101. package/packages/opencode/command/root-cause.md +218 -0
  102. package/packages/opencode/command/security.md +0 -4
  103. package/packages/opencode/command/ship.md +0 -3
  104. package/packages/opencode/command/skill-creator/LICENSE.txt +202 -0
  105. package/packages/opencode/command/skill-creator.md +0 -4
  106. package/packages/opencode/command/stash.md +0 -3
  107. package/packages/opencode/command/test-generate.md +1 -5
  108. package/packages/opencode/opencode.jsonc +4 -34
  109. package/packages/subagentic-manual.md +147 -314
  110. package/packages/ampcode/agents/context-builder.md +0 -144
  111. package/packages/ampcode/commands/debug-method.md +0 -297
  112. package/packages/ampcode/commands/live-canvas/README.md +0 -264
  113. package/packages/ampcode/commands/optimize.md +0 -61
  114. package/packages/ampcode/commands/tdd-flow.md +0 -390
  115. package/packages/ampcode/commands/test-traps/example.ts +0 -158
  116. package/packages/ampcode/commands/test-traps.md +0 -378
  117. package/packages/ampcode/commands/trace-back.md +0 -176
  118. package/packages/ampcode/commands/verify-done.md +0 -152
  119. package/packages/claude/agents/context-builder.md +0 -145
  120. package/packages/claude/commands/optimize.md +0 -61
  121. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/README.md +0 -89
  122. package/packages/claude/skills/debug-method/CREATION-LOG.md +0 -119
  123. package/packages/claude/skills/debug-method/SKILL.md +0 -296
  124. package/packages/claude/skills/debug-method/test-academic.md +0 -14
  125. package/packages/claude/skills/debug-method/test-pressure-1.md +0 -58
  126. package/packages/claude/skills/debug-method/test-pressure-2.md +0 -68
  127. package/packages/claude/skills/debug-method/test-pressure-3.md +0 -69
  128. package/packages/claude/skills/live-canvas/README.md +0 -269
  129. package/packages/claude/skills/tdd-flow/SKILL.md +0 -392
  130. package/packages/claude/skills/test-traps/SKILL.md +0 -378
  131. package/packages/claude/skills/test-traps/example.ts +0 -158
  132. package/packages/claude/skills/trace-back/SKILL.md +0 -176
  133. package/packages/claude/skills/verify-done/SKILL.md +0 -152
  134. package/packages/droid/commands/debug-method.md +0 -297
  135. package/packages/droid/commands/live-canvas/README.md +0 -264
  136. package/packages/droid/commands/optimize.md +0 -61
  137. package/packages/droid/commands/tdd-flow.md +0 -390
  138. package/packages/droid/commands/test-traps/example.ts +0 -158
  139. package/packages/droid/commands/test-traps.md +0 -378
  140. package/packages/droid/commands/trace-back.md +0 -176
  141. package/packages/droid/commands/verify-done.md +0 -152
  142. package/packages/droid/droids/context-builder.md +0 -144
  143. package/packages/opencode/agent/context-builder.md +0 -148
  144. package/packages/opencode/command/debug-method.md +0 -297
  145. package/packages/opencode/command/live-canvas/README.md +0 -264
  146. package/packages/opencode/command/optimize.md +0 -61
  147. package/packages/opencode/command/tdd-flow.md +0 -390
  148. package/packages/opencode/command/test-traps/example.ts +0 -158
  149. package/packages/opencode/command/test-traps.md +0 -378
  150. package/packages/opencode/command/trace-back.md +0 -176
  151. package/packages/opencode/command/verify-done.md +0 -152
  152. /package/packages/ampcode/{commands → skills}/docs-builder/docs-builder.cjs +0 -0
  153. /package/packages/ampcode/{commands → skills}/live-canvas/DESIGN_PRINCIPLES.md +0 -0
  154. /package/packages/ampcode/{commands → skills}/live-canvas/dev/post-variants.html +0 -0
  155. /package/packages/ampcode/{commands → skills}/live-canvas/templates/lab-banner.html +0 -0
  156. /package/packages/ampcode/{commands → skills}/live-canvas/templates/overlay-vanilla.js +0 -0
  157. /package/packages/claude/{commands → skills}/docs-builder/docs-builder.cjs +0 -0
  158. /package/packages/claude/skills/{trace-back → root-cause}/find-polluter.sh +0 -0
  159. /package/packages/droid/commands/{trace-back → root-cause}/find-polluter.sh +0 -0
  160. /package/packages/opencode/command/{trace-back → root-cause}/find-polluter.sh +0 -0
@@ -1,269 +0,0 @@
1
- # Live Canvas
2
-
3
- Click-to-annotate UI design tool for Claude Code. Renders N variants of a component or page in your browser, you click an element and type what to change, and Claude edits the variant file while you watch in the browser. No window switching, no pasted JSON.
4
-
5
- Ships as a Claude Code skill plus an MCP channel plugin. Works in every tool liteagents supports (Claude, Droid, Amp, Opencode), but **Live mode only works in Claude Code** — other tools run in JSON mode only (see modes below).
6
-
7
- ---
8
-
9
- ## How it works
10
-
11
- ```
12
- ┌──────────────────────┐ POST /feedback ┌─────────────────────┐
13
- │ Overlay in browser │ ─────────────────────────► │ live-canvas-channel │
14
- │ (vanilla JS, ~500 lines)│ │ (Node MCP server) │
15
- └──────────────────────┘ └──────────┬──────────┘
16
- ▲ │
17
- │ dev server hot-reloads the page │ notifications/
18
- │ after Claude edits the variant │ claude/channel
19
- │ ▼
20
- ┌──────────────────────┐ ┌─────────────────────┐
21
- │ Dev server (yours) │ ◄──── Claude edits ─────── │ Claude Code session │
22
- │ e.g. pnpm dev :3000 │ variant file │ (with --dangerously-│
23
- └──────────────────────┘ │ load-development- │
24
- │ channels flag) │
25
- └─────────────────────┘
26
- ```
27
-
28
- Each Save in the overlay streams into the Claude session as a `<channel>` tag with the variant, element selector, and user comment. Claude edits the corresponding `.claude-design/lab/variants/Variant<X>.tsx` file. Your dev server hot-reloads. You never leave the browser.
29
-
30
- ---
31
-
32
- ## Modes
33
-
34
- The skill asks you which mode you want every time `/live-canvas` runs.
35
-
36
- | Mode | Use when | What happens per Save |
37
- |---|---|---|
38
- | **Live** | You launched the session with `live-claude` (sets `--dangerously-load-development-channels`) | Comment streams into Claude's context; Claude edits the file; dev server hot-reloads. Toast: "Pushed to Claude ✨". |
39
- | **JSON** | Any session, any tool (Claude, Droid, Amp, Opencode) | Comment stays local. On Submit it POSTs to a `/feedback-jsonl` route on the channel server, which writes to `<project>/.claude-design/feedback.jsonl`. Falls back to browser download only when the MCP isn't running (e.g. Droid/Amp/Opencode users). |
40
-
41
- If you pick Live but the session lacks the channels flag, `channel_open` returns `no_channel_capability` and the skill prints the exact relaunch command — it never silently downgrades to JSON. If another live-canvas session is already holding port 8788, `channel_open` takes over (same plugin + same user = safe) and announces it. Foreign processes on 8788 (e.g. a stray dev server) are refused with the holder's pid so you know what to investigate.
42
-
43
- ---
44
-
45
- ## One-time setup (Live mode, Claude Code only)
46
-
47
- Run this once per machine. Without it, the skill still works in JSON mode.
48
-
49
- ### 1. Run the installer
50
-
51
- ```bash
52
- bash packages/claude/plugins/live-canvas-marketplace/setup.sh
53
- ```
54
-
55
- The installer:
56
- - copies the marketplace into `~/.claude/plugins/live-canvas-marketplace/` (overwrites any prior install)
57
- - runs `npm install` inside the channel plugin
58
- - adds a `live-claude` shell function to `~/.zshrc` and `~/.bashrc` (idempotent — re-runs replace in place)
59
-
60
- ### 2. Register the marketplace in Claude Code
61
-
62
- ```
63
- /plugin marketplace add ~/.claude/plugins/live-canvas-marketplace
64
- ```
65
-
66
- ### 3. Install the plugin
67
-
68
- ```
69
- /plugin install live-canvas-channel@live-canvas-marketplace
70
- ```
71
-
72
- ### 4. Open a fresh shell
73
-
74
- `live-claude` is now available. Use plain `claude` for everything else; use `live-claude` when you want Live mode for this skill.
75
-
76
- ---
77
-
78
- ## Everyday use
79
-
80
- ### Start a session
81
-
82
- Either `claude` (JSON only) or `live-claude` (Live available).
83
-
84
- ### Invoke the skill in a project
85
-
86
- ```
87
- /live-canvas
88
- ```
89
-
90
- Phase 0 always asks which mode you want — Live channel or JSON file — then calls the MCP tool that binds (or refuses) port 8788:
91
-
92
- | Choice | `channel_open` / `batch_open` result | Skill behavior |
93
- |---|---|---|
94
- | Live | `opened` | ✨ Live mode — announces it, starts the interview |
95
- | Live | `opened` + `took_over: <pid>` | ✨ Live mode — announces it and that it took over a sibling live-canvas server (your prior session) |
96
- | Live | `no_channel_capability` | Stops. Prints the exact `live-claude --continue` command for relaunch |
97
- | Live | `in_use` (foreign holder) | Stops. Prints the holder pid + `ps -fp <pid>` so you can investigate |
98
- | JSON | `opened` / `already_listening` | 📝 JSON mode — Submit writes to `.claude-design/feedback.jsonl` |
99
- | JSON | `in_use` / MCP unavailable | 📝 JSON mode — Submit downloads a JSON file you paste back |
100
-
101
- ### Interview & generation
102
-
103
- Skill asks 5 short questions (scope, pain points, inspiration, persona, constraints). Then generates 5 variants in `.claude-design/lab/variants/` and wires a route at `/__live_canvas` in your app.
104
-
105
- ### Iterate in the browser
106
-
107
- Open `http://localhost:<dev-port>/__live_canvas`. Click **Add Feedback** (bottom right), click any element in any variant, type a one-liner, Save.
108
-
109
- - Live mode: toast says "Pushed to Claude ✨", Claude acknowledges and edits the file, dev server hot-reloads.
110
- - JSON mode: toast says "Saved — submit when ready", pin stays on the element, counter in the Submit button ticks up.
111
-
112
- Need the page back? The overlay has a "−" button next to **Add Feedback** that collapses everything to a small circle in the corner — tap to expand again. Useful on mobile where the bar can cover what's underneath.
113
-
114
- Keep clicking until a winner emerges.
115
-
116
- ### Finish
117
-
118
- Click the pink **Finish** (Live) or **Submit** (JSON) button:
119
-
120
- 1. Type the overall direction: e.g. *"Go with B's layout, A's button styling"*
121
- 2. Click Finish
122
-
123
- Skill then:
124
- - Generates `DESIGN_PLAN.md` in project root (winner, files to change, component API, states, a11y checklist)
125
- - Updates or creates `DESIGN_MEMORY.md` with the patterns it learned
126
- - Deletes `.claude-design/` and the `/__live_canvas` route
127
-
128
- Done.
129
-
130
- ---
131
-
132
- ## Files and where they live
133
-
134
- ### In this repo (source)
135
-
136
- ```
137
- packages/claude/
138
- ├── skills/live-canvas/
139
- │ ├── SKILL.md # Skill instructions (phases, flow)
140
- │ ├── DESIGN_PRINCIPLES.md # UX/a11y/motion reference
141
- │ ├── README.md # This file
142
- │ ├── dev/post-variants.html # Standalone demo for local QA of the overlay
143
- │ └── templates/
144
- │ ├── overlay-vanilla.js # Framework-agnostic overlay (~500 lines)
145
- │ └── lab-banner.html # "This is a temp lab" notice snippet
146
- └── plugins/
147
- └── live-canvas-marketplace/
148
- ├── .claude-plugin/marketplace.json
149
- ├── setup.sh # Runs npm install and prints manual steps
150
- └── plugins/live-canvas-channel/
151
- ├── .claude-plugin/plugin.json
152
- ├── server.js # MCP server + HTTP listener on :8788
153
- ├── schema.json # Feedback payload schema (v1.0)
154
- ├── package.json # @modelcontextprotocol/sdk dep
155
- └── README.md # Plugin-specific docs (protocol, debug)
156
- ```
157
-
158
- ### On the user's disk after liteagents install
159
-
160
- ```
161
- ~/.claude/
162
- ├── skills/live-canvas/ # Copied from packages/claude/skills/
163
- └── plugins/live-canvas-marketplace/ # Copied from packages/claude/plugins/
164
- ```
165
-
166
- `node_modules/` is NOT copied — `setup.sh` creates it locally via `npm install`.
167
-
168
- ### After `/plugin install` (Claude Code's own register step)
169
-
170
- ```
171
- ~/.claude/plugins/cache/live-canvas-marketplace/ # Claude Code's registered copy
172
- ```
173
-
174
- Two different dirs:
175
- - `~/.claude/plugins/live-canvas-marketplace/` — where liteagents puts the source
176
- - `~/.claude/plugins/cache/live-canvas-marketplace/` — where Claude Code puts its own registered copy after `/plugin install`
177
-
178
- The skill checks the cache dir to tell first-time vs returning users apart.
179
-
180
- ### Per-project, during a session
181
-
182
- ```
183
- <project-root>/
184
- └── .claude-design/
185
- ├── lab/variants/VariantA.tsx … VariantE.tsx
186
- ├── overlay-vanilla.js (copied into the project's public/static dir)
187
- ├── design-brief.json # Structured output from the interview
188
- └── feedback.jsonl # JSON mode only; deleted on Finish
189
- ```
190
-
191
- Plus a temporary route (e.g. `app/__live_canvas/page.tsx` for Next.js App Router). Everything under `.claude-design/` and the temporary route is deleted on Finish or Abort.
192
-
193
- ### What survives after Finish
194
-
195
- ```
196
- <project-root>/
197
- ├── DESIGN_PLAN.md # Winner + implementation steps
198
- └── DESIGN_MEMORY.md # Accumulated design-system patterns
199
- ```
200
-
201
- ---
202
-
203
- ## The install pipeline, end to end
204
-
205
- 1. **Liteagents installer** copies the skill:
206
- - `packages/claude/skills/live-canvas/` → `~/.claude/skills/live-canvas/`
207
- 2. **User, once:** runs `bash packages/claude/plugins/live-canvas-marketplace/setup.sh` → copies marketplace to `~/.claude/plugins/`, runs `npm install`, adds `live-claude` function to `~/.zshrc` and `~/.bashrc`
208
- 3. **User, once:** in a Claude session, runs `/plugin marketplace add ~/.claude/plugins/live-canvas-marketplace` + `/plugin install live-canvas-channel@live-canvas-marketplace`
209
- 4. **User, every session that wants Live mode:** runs `live-claude` (function installed by step 2)
210
- 5. **User, whenever:** `/live-canvas` in any project
211
-
212
- Steps 1, 2, 3 are truly one-time. Step 4 is per-session. Step 5 is per-project-use.
213
-
214
- ---
215
-
216
- ## Troubleshooting
217
-
218
- ### Port 8788 stuck from a prior session
219
-
220
- You shouldn't hit this — `channel_open` now detects sibling live-canvas servers (same uid, same plugin) and takes them over automatically. If you do see `{status: "in_use", holder_pid: <pid>}` from the tool, that means the holder is **not** a live-canvas server (the plugin refuses to kill anything it doesn't own). Investigate with:
221
-
222
- ```bash
223
- ps -fp <pid> # what is it
224
- kill <pid> # only if it's safe to stop
225
- ```
226
-
227
- Then re-run `/live-canvas`.
228
-
229
- ### Skill says `no_channel_capability` and refuses Live mode
230
-
231
- The session was started with plain `claude`, which can't receive channel notifications (notifications would be silently dropped). Open a fresh terminal and run `live-claude` — the function added to your shellrc by `setup.sh` runs `claude --dangerously-load-development-channels plugin:live-canvas-channel@live-canvas-marketplace`. Then `/live-canvas` in the new session works.
232
-
233
- ### Skill says `/mcp` shows the plugin as failed
234
-
235
- The plugin subprocess died on startup (usually a node/dep error). In the session, run `/mcp` — "Failed to connect" means look at `~/.claude/debug/<session-id>.txt` for the stderr. Common fix: re-run `setup.sh` so `npm install` runs again inside the plugin dir.
236
-
237
- ### Overlay loads in the browser but no pills appear
238
-
239
- The overlay script didn't load. Most common cause: you started a static file server inside the wrong directory so the relative `overlay-vanilla.js` path couldn't resolve. Start the server from the directory containing the lab's `index.html` (or `__live_canvas` route).
240
-
241
- ### "Pushed to Claude ✨" toast appears but nothing lands in the terminal
242
-
243
- This shouldn't happen with v0.3.0+ — the flag gate refuses bind from plain-claude sessions so the silent black-hole case is impossible. If you do see it, one of:
244
- - You're on an old plugin (v0.2.0 or earlier). Run `/reload-plugins` in the session; the new in-memory MCP will be v0.5.0+.
245
- - You're typing in the wrong session. Channel notifications go to whichever Claude session's MCP bound port 8788 — check `ss -lntp | grep 8788`, walk up the parent pid until you find the `claude` process, and switch terminals to that one.
246
-
247
- ### I want to uninstall
248
-
249
- 1. Remove the plugin from Claude Code: `/plugin uninstall live-canvas-channel`
250
- 2. Delete the marketplace: `/plugin marketplace remove live-canvas-marketplace`
251
- 3. Remove the dev flag from your alias/shortcut
252
- 4. Rerun liteagents installer in remove mode (or delete `~/.claude/skills/live-canvas/` and `~/.claude/plugins/live-canvas-marketplace/` by hand)
253
-
254
- ---
255
-
256
- ## Why the multi-step setup can't be hidden
257
-
258
- The `--dangerously-load-development-channels` flag is a per-session startup argument of Claude Code itself. A running session can't promote itself to channel-enabled mid-flight; only the next session launched with the flag gets it. Same reason a skill can't silently do `/plugin install` on your behalf — the plugin system needs explicit user consent for research-preview plugins.
259
-
260
- Until channels leave research preview and custom channels are allowlisted, step 4 is the irreducible friction. The alias removes the retyping cost.
261
-
262
- ---
263
-
264
- ## Pointers
265
-
266
- - Plugin details: [`~/.claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/README.md`](../../plugins/live-canvas-marketplace/plugins/live-canvas-channel/README.md)
267
- - Skill flow: [`SKILL.md`](./SKILL.md)
268
- - Design principles reference: [`DESIGN_PRINCIPLES.md`](./DESIGN_PRINCIPLES.md)
269
- - Channels reference (upstream): <https://code.claude.com/docs/en/channels-reference>
@@ -1,392 +0,0 @@
1
- ---
2
- name: tdd-flow
3
- description: Use when implementing any feature or bugfix, before writing implementation code - write the test first, watch it fail, write minimal code to pass; ensures tests actually verify behavior by requiring failure first
4
- usage: /tdd-flow <feature-or-behavior-to-test>
5
- auto_trigger: true
6
- ---
7
-
8
- # TDD Flow
9
-
10
- ## Auto-Trigger
11
-
12
- **APPLIES WHEN:**
13
- - About to write new production code (function, method, class)
14
- - Implementing any feature or bug fix
15
- - Modifying behavior of existing code
16
- - Task metadata includes `tdd: yes`
17
- - User requests feature implementation
18
-
19
- **APPLIES TO:**
20
- - All production code changes
21
- - Feature implementations
22
- - Bug fixes
23
- - Refactoring that changes behavior
24
- - API endpoint creation
25
- - Model/class creation
26
-
27
- **DOES NOT APPLY TO:**
28
- - Documentation files
29
- - Configuration files (unless logic-bearing)
30
- - Throwaway prototypes (with explicit user permission)
31
- - Generated code (with explicit user permission)
32
-
33
- **ENFORCEMENT:**
34
- If you find yourself writing implementation code before tests, STOP immediately. Delete the implementation and start over with TDD.
35
-
36
- ## Overview
37
-
38
- Write the test first. Watch it fail. Write minimal code to pass.
39
-
40
- **Core principle:** If you didn't watch the test fail, you don't know if it tests the right thing.
41
-
42
- **Violating the letter of the rules is violating the spirit of the rules.**
43
-
44
- ## When to Use
45
-
46
- **Always:**
47
- - New features
48
- - Bug fixes
49
- - Refactoring
50
- - Behavior changes
51
-
52
- **Exceptions (ask your human partner):**
53
- - Throwaway prototypes
54
- - Generated code
55
- - Configuration files
56
-
57
- Thinking "skip TDD just this once"? Stop. That's rationalization.
58
-
59
- ## The Iron Law
60
-
61
- ```
62
- NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
63
- ```
64
-
65
- Write code before the test? Delete it. Start over.
66
-
67
- **No exceptions:**
68
- - Don't keep it as "reference"
69
- - Don't "adapt" it while writing tests
70
- - Don't look at it
71
- - Delete means delete
72
-
73
- Implement fresh from tests. Period.
74
-
75
- ## Red-Green-Refactor
76
-
77
- ```dot
78
- digraph tdd_cycle {
79
- rankdir=LR;
80
- red [label="RED\nWrite failing test", shape=box, style=filled, fillcolor="#ffcccc"];
81
- verify_red [label="Verify fails\ncorrectly", shape=diamond];
82
- green [label="GREEN\nMinimal code", shape=box, style=filled, fillcolor="#ccffcc"];
83
- verify_green [label="Verify passes\nAll green", shape=diamond];
84
- refactor [label="REFACTOR\nClean up", shape=box, style=filled, fillcolor="#ccccff"];
85
- next [label="Next", shape=ellipse];
86
-
87
- red -> verify_red;
88
- verify_red -> green [label="yes"];
89
- verify_red -> red [label="wrong\nfailure"];
90
- green -> verify_green;
91
- verify_green -> refactor [label="yes"];
92
- verify_green -> green [label="no"];
93
- refactor -> verify_green [label="stay\ngreen"];
94
- verify_green -> next;
95
- next -> red;
96
- }
97
- ```
98
-
99
- ### RED - Write Failing Test
100
-
101
- Write one minimal test showing what should happen.
102
-
103
- <Good>
104
- ```typescript
105
- test('retries failed operations 3 times', async () => {
106
- let attempts = 0;
107
- const operation = () => {
108
- attempts++;
109
- if (attempts < 3) throw new Error('fail');
110
- return 'success';
111
- };
112
-
113
- const result = await retryOperation(operation);
114
-
115
- expect(result).toBe('success');
116
- expect(attempts).toBe(3);
117
- });
118
- ```
119
- Clear name, tests real behavior, one thing
120
- </Good>
121
-
122
- <Bad>
123
- ```typescript
124
- test('retry works', async () => {
125
- const mock = jest.fn()
126
- .mockRejectedValueOnce(new Error())
127
- .mockRejectedValueOnce(new Error())
128
- .mockResolvedValueOnce('success');
129
- await retryOperation(mock);
130
- expect(mock).toHaveBeenCalledTimes(3);
131
- });
132
- ```
133
- Vague name, tests mock not code
134
- </Bad>
135
-
136
- **Requirements:**
137
- - One behavior
138
- - Clear name
139
- - Real code (no mocks unless unavoidable)
140
-
141
- ### Verify RED - Watch It Fail
142
-
143
- **MANDATORY. Never skip.**
144
-
145
- ```bash
146
- npm test path/to/test.test.ts
147
- ```
148
-
149
- Confirm:
150
- - Test fails (not errors)
151
- - Failure message is expected
152
- - Fails because feature missing (not typos)
153
-
154
- **Test passes?** You're testing existing behavior. Fix test.
155
-
156
- **Test errors?** Fix error, re-run until it fails correctly.
157
-
158
- ### GREEN - Minimal Code
159
-
160
- Write simplest code to pass the test.
161
-
162
- <Good>
163
- ```typescript
164
- async function retryOperation<T>(fn: () => Promise<T>): Promise<T> {
165
- for (let i = 0; i < 3; i++) {
166
- try {
167
- return await fn();
168
- } catch (e) {
169
- if (i === 2) throw e;
170
- }
171
- }
172
- throw new Error('unreachable');
173
- }
174
- ```
175
- Just enough to pass
176
- </Good>
177
-
178
- <Bad>
179
- ```typescript
180
- async function retryOperation<T>(
181
- fn: () => Promise<T>,
182
- options?: {
183
- maxRetries?: number;
184
- backoff?: 'linear' | 'exponential';
185
- onRetry?: (attempt: number) => void;
186
- }
187
- ): Promise<T> {
188
- // YAGNI
189
- }
190
- ```
191
- Over-engineered
192
- </Bad>
193
-
194
- Don't add features, refactor other code, or "improve" beyond the test.
195
-
196
- ### Verify GREEN - Watch It Pass
197
-
198
- **MANDATORY.**
199
-
200
- ```bash
201
- npm test path/to/test.test.ts
202
- ```
203
-
204
- Confirm:
205
- - Test passes
206
- - Other tests still pass
207
- - Output pristine (no errors, warnings)
208
-
209
- **Test fails?** Fix code, not test.
210
-
211
- **Other tests fail?** Fix now.
212
-
213
- ### REFACTOR - Clean Up
214
-
215
- After green only:
216
- - Remove duplication
217
- - Improve names
218
- - Extract helpers
219
-
220
- Keep tests green. Don't add behavior.
221
-
222
- ### Repeat
223
-
224
- Next failing test for next feature.
225
-
226
- ## Good Tests
227
-
228
- | Quality | Good | Bad |
229
- |---------|------|-----|
230
- | **Minimal** | One thing. "and" in name? Split it. | `test('validates email and domain and whitespace')` |
231
- | **Clear** | Name describes behavior | `test('test1')` |
232
- | **Shows intent** | Demonstrates desired API | Obscures what code should do |
233
-
234
- ## Why Order Matters
235
-
236
- **"I'll write tests after to verify it works"**
237
-
238
- Tests written after code pass immediately. Passing immediately proves nothing:
239
- - Might test wrong thing
240
- - Might test implementation, not behavior
241
- - Might miss edge cases you forgot
242
- - You never saw it catch the bug
243
-
244
- Test-first forces you to see the test fail, proving it actually tests something.
245
-
246
- **"I already manually tested all the edge cases"**
247
-
248
- Manual testing is ad-hoc. You think you tested everything but:
249
- - No record of what you tested
250
- - Can't re-run when code changes
251
- - Easy to forget cases under pressure
252
- - "It worked when I tried it" ≠ comprehensive
253
-
254
- Automated tests are systematic. They run the same way every time.
255
-
256
- **"Deleting X hours of work is wasteful"**
257
-
258
- Sunk cost fallacy. The time is already gone. Your choice now:
259
- - Delete and rewrite with TDD (X more hours, high confidence)
260
- - Keep it and add tests after (30 min, low confidence, likely bugs)
261
-
262
- The "waste" is keeping code you can't trust. Working code without real tests is technical debt.
263
-
264
- **"TDD is dogmatic, being pragmatic means adapting"**
265
-
266
- TDD IS pragmatic:
267
- - Finds bugs before commit (faster than debugging after)
268
- - Prevents regressions (tests catch breaks immediately)
269
- - Documents behavior (tests show how to use code)
270
- - Enables refactoring (change freely, tests catch breaks)
271
-
272
- "Pragmatic" shortcuts = debugging in production = slower.
273
-
274
- **"Tests after achieve the same goals - it's spirit not ritual"**
275
-
276
- No. Tests-after answer "What does this do?" Tests-first answer "What should this do?"
277
-
278
- Tests-after are biased by your implementation. You test what you built, not what's required. You verify remembered edge cases, not discovered ones.
279
-
280
- Tests-first force edge case discovery before implementing. Tests-after verify you remembered everything (you didn't).
281
-
282
- 30 minutes of tests after ≠ TDD. You get coverage, lose proof tests work.
283
-
284
- ## Common Rationalizations
285
-
286
- | Excuse | Reality |
287
- |--------|---------|
288
- | "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
289
- | "I'll test after" | Tests passing immediately prove nothing. |
290
- | "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
291
- | "Already manually tested" | Ad-hoc ≠ systematic. No record, can't re-run. |
292
- | "Deleting X hours is wasteful" | Sunk cost fallacy. Keeping unverified code is technical debt. |
293
- | "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. |
294
- | "Need to explore first" | Fine. Throw away exploration, start with TDD. |
295
- | "Test hard = design unclear" | Listen to test. Hard to test = hard to use. |
296
- | "TDD will slow me down" | TDD faster than debugging. Pragmatic = test-first. |
297
- | "Manual test faster" | Manual doesn't prove edge cases. You'll re-test every change. |
298
- | "Existing code has no tests" | You're improving it. Add tests for existing code. |
299
-
300
- ## Red Flags - STOP and Start Over
301
-
302
- - Code before test
303
- - Test after implementation
304
- - Test passes immediately
305
- - Can't explain why test failed
306
- - Tests added "later"
307
- - Rationalizing "just this once"
308
- - "I already manually tested it"
309
- - "Tests after achieve the same purpose"
310
- - "It's about spirit not ritual"
311
- - "Keep as reference" or "adapt existing code"
312
- - "Already spent X hours, deleting is wasteful"
313
- - "TDD is dogmatic, I'm being pragmatic"
314
- - "This is different because..."
315
-
316
- **All of these mean: Delete code. Start over with TDD.**
317
-
318
- ## Example: Bug Fix
319
-
320
- **Bug:** Empty email accepted
321
-
322
- **RED**
323
- ```typescript
324
- test('rejects empty email', async () => {
325
- const result = await submitForm({ email: '' });
326
- expect(result.error).toBe('Email required');
327
- });
328
- ```
329
-
330
- **Verify RED**
331
- ```bash
332
- $ npm test
333
- FAIL: expected 'Email required', got undefined
334
- ```
335
-
336
- **GREEN**
337
- ```typescript
338
- function submitForm(data: FormData) {
339
- if (!data.email?.trim()) {
340
- return { error: 'Email required' };
341
- }
342
- // ...
343
- }
344
- ```
345
-
346
- **Verify GREEN**
347
- ```bash
348
- $ npm test
349
- PASS
350
- ```
351
-
352
- **REFACTOR**
353
- Extract validation for multiple fields if needed.
354
-
355
- ## Verification Checklist
356
-
357
- Before marking work complete:
358
-
359
- - [ ] Every new function/method has a test
360
- - [ ] Watched each test fail before implementing
361
- - [ ] Each test failed for expected reason (feature missing, not typo)
362
- - [ ] Wrote minimal code to pass each test
363
- - [ ] All tests pass
364
- - [ ] Output pristine (no errors, warnings)
365
- - [ ] Tests use real code (mocks only if unavoidable)
366
- - [ ] Edge cases and errors covered
367
-
368
- Can't check all boxes? You skipped TDD. Start over.
369
-
370
- ## When Stuck
371
-
372
- | Problem | Solution |
373
- |---------|----------|
374
- | Don't know how to test | Write wished-for API. Write assertion first. Ask your human partner. |
375
- | Test too complicated | Design too complicated. Simplify interface. |
376
- | Must mock everything | Code too coupled. Use dependency injection. |
377
- | Test setup huge | Extract helpers. Still complex? Simplify design. |
378
-
379
- ## Debugging Integration
380
-
381
- Bug found? Write failing test reproducing it. Follow TDD cycle. Test proves fix and prevents regression.
382
-
383
- Never fix bugs without a test.
384
-
385
- ## Final Rule
386
-
387
- ```
388
- Production code → test exists and failed first
389
- Otherwise → not TDD
390
- ```
391
-
392
- No exceptions without your human partner's permission.