impulso 0.19.1

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 (85) hide show
  1. package/README.md +425 -0
  2. package/agents/ImpulsoOrchestrator.md +112 -0
  3. package/agents/debugger.md +38 -0
  4. package/agents/generalist.md +26 -0
  5. package/agents/implementer-frontend.md +41 -0
  6. package/agents/implementer-infra.md +41 -0
  7. package/agents/implementer.md +35 -0
  8. package/agents/planner.md +52 -0
  9. package/agents/reviewer.md +40 -0
  10. package/agents/scout-writer.md +24 -0
  11. package/agents/scout.md +22 -0
  12. package/agents/shipper.md +64 -0
  13. package/commands/impulso-address-pr-comments.md +162 -0
  14. package/commands/impulso-brainstorm.md +54 -0
  15. package/commands/impulso-context-pack.md +55 -0
  16. package/commands/impulso-debug.md +50 -0
  17. package/commands/impulso-directspeech-compress.md +137 -0
  18. package/commands/impulso-directspeech-help.md +33 -0
  19. package/commands/impulso-directspeech-stats.md +16 -0
  20. package/commands/impulso-implement.md +86 -0
  21. package/commands/impulso-plan.md +92 -0
  22. package/commands/impulso-ship.md +46 -0
  23. package/commands/impulso-spec.md +106 -0
  24. package/commands/impulso-verify.md +99 -0
  25. package/commands/plannotator-annotate.md +47 -0
  26. package/commands/plannotator-last.md +45 -0
  27. package/commands/plannotator-review.md +46 -0
  28. package/harnesses/claude/README.md +109 -0
  29. package/harnesses/claude/hooks/bash-state-guard.cjs +84 -0
  30. package/harnesses/claude/hooks/directspeech-context.cjs +29 -0
  31. package/harnesses/claude/hooks/path-guard.cjs +106 -0
  32. package/harnesses/claude/hooks/preflight.cjs +39 -0
  33. package/harnesses/claude/hooks/pretooluse-bash.cjs +69 -0
  34. package/harnesses/claude/hooks/rtk.cjs +87 -0
  35. package/harnesses/claude/hooks/subagent-start.cjs +83 -0
  36. package/harnesses/claude/hooks/task-exit.cjs +189 -0
  37. package/harnesses/claude/hooks/tdd-observer.cjs +118 -0
  38. package/harnesses/claude/hooks/tokensave-stale.cjs +63 -0
  39. package/harnesses/claude/hooks/userpromptsubmit.cjs +42 -0
  40. package/harnesses/claude/install.sh +120 -0
  41. package/harnesses/claude/merge-settings.cjs +71 -0
  42. package/harnesses/claude/uninstall.sh +89 -0
  43. package/harnesses/opencode/bin/darwin-amd64/impulso-hub +0 -0
  44. package/harnesses/opencode/bin/darwin-arm64/impulso-hub +0 -0
  45. package/harnesses/opencode/bin/impulso-hub +0 -0
  46. package/harnesses/opencode/bin/linux-amd64/impulso-hub +0 -0
  47. package/harnesses/opencode/bin/linux-arm64/impulso-hub +0 -0
  48. package/harnesses/opencode/commands-loader.js +101 -0
  49. package/harnesses/opencode/compose.js +111 -0
  50. package/harnesses/opencode/directspeech/README.md +43 -0
  51. package/harnesses/opencode/directspeech/plugin.js +47 -0
  52. package/harnesses/opencode/frontmatter.js +60 -0
  53. package/harnesses/opencode/install.sh +121 -0
  54. package/harnesses/opencode/orchestration/index.js +362 -0
  55. package/harnesses/opencode/plugin.js +84 -0
  56. package/harnesses/opencode/rtk/README.md +100 -0
  57. package/harnesses/opencode/rtk/rtk.ts +41 -0
  58. package/harnesses/opencode/session-name/plugin.js +27 -0
  59. package/harnesses/opencode/sync-commands.js +98 -0
  60. package/harnesses/opencode/uninstall.sh +36 -0
  61. package/opencode/opencode.jsonc +35 -0
  62. package/package.json +95 -0
  63. package/scripts/bump-plugin-version.cjs +28 -0
  64. package/scripts/install-hub.js +78 -0
  65. package/scripts/sync-agents.cjs +167 -0
  66. package/shared/directspeech-config.cjs +18 -0
  67. package/shared/orchestration-config.cjs +281 -0
  68. package/shared/orchestration-data.json +48 -0
  69. package/shared/state-guard.cjs +56 -0
  70. package/shared/tokensave-freshness.cjs +62 -0
  71. package/skills/impulso-address-pr-comments/SKILL.md +159 -0
  72. package/skills/impulso-brainstorm/SKILL.md +51 -0
  73. package/skills/impulso-context-pack/SKILL.md +52 -0
  74. package/skills/impulso-debug/SKILL.md +47 -0
  75. package/skills/impulso-directspeech-compress/SKILL.md +134 -0
  76. package/skills/impulso-directspeech-help/SKILL.md +30 -0
  77. package/skills/impulso-directspeech-stats/SKILL.md +13 -0
  78. package/skills/impulso-implement/SKILL.md +83 -0
  79. package/skills/impulso-plan/SKILL.md +89 -0
  80. package/skills/impulso-ship/SKILL.md +43 -0
  81. package/skills/impulso-spec/SKILL.md +103 -0
  82. package/skills/impulso-verify/SKILL.md +96 -0
  83. package/skills/plannotator-annotate/SKILL.md +45 -0
  84. package/skills/plannotator-last/SKILL.md +43 -0
  85. package/skills/plannotator-review/SKILL.md +44 -0
package/README.md ADDED
@@ -0,0 +1,425 @@
1
+ # Impulso
2
+
3
+ Plugin bundle for opencode + Claude Code: **Plannotator** (vendored skills) +
4
+ **Impulso-DirectSpeech** (terse communication mode) + **Impulso-RTK** (token
5
+ savings via `rtk rewrite` for 60-90% LLM token savings on shell commands).
6
+
7
+ Harness-neutral repo. Per-harness glue under `harnesses/`.
8
+
9
+ ## Contents
10
+
11
+ | Piece | What |
12
+ | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
13
+ | Plannotator | 3 vendored skills (annotate/last/review) + 3 commands. Skills invoke the `plannotator` CLI binary directly (user-installed); no npm plugin. |
14
+ | Impulso-DirectSpeech | Terse communication mode — **always active, enforced by the harness**. Ruleset in `shared/AGENTS.md` + per-turn reinforcement hook on each harness. No toggle. 3 auxiliary skills (compress/stats/help). |
15
+ | Impulso-RTK | Rewrites bash tool calls via `rtk rewrite` for 60-90% token savings. `rtk` + `tokensave` hard-required and enforced at runtime — launchers, hooks, and plugin block with install hints when missing. |
16
+
17
+ ## Install routes
18
+
19
+ Four ways in — pick **one per profile** (combining the Claude plugin with the
20
+ Claude installer duplicates hooks). The plugin route is the recommended default
21
+ for both harnesses.
22
+
23
+ | Route | Harness | You get |
24
+ | --------------------------------------------------------- | -------- | -------------------------------------------------------------------- |
25
+ | **Claude Code plugin (marketplace, recommended)** | claude | hooks + skills + commands + tokensave MCP, versioned, auto-updatable |
26
+ | `harnesses/claude/install.sh` | claude | same + ruleset wired into CLAUDE.md; merge-safe into `~/.claude` |
27
+ | Self-boot (`run_here_claude.sh`) | claude | everything, isolated to this repo — dev/testing |
28
+ | **opencode plugin (recommended)** / installer / self-boot | opencode | plugin composes everything; see below |
29
+
30
+ ## Install — Claude Code plugin (marketplace, recommended)
31
+
32
+ Inside any claude session:
33
+
34
+ ```
35
+ /plugin marketplace add alexandrekm/Impulso
36
+ /plugin install impulso@impulso
37
+ ```
38
+
39
+ Loads the three hooks (preflight, rtk rewrite, DirectSpeech reinforcement — via
40
+ `${CLAUDE_PLUGIN_ROOT}`), all skills/commands, and the tokensave MCP server.
41
+ Update later with `/plugin marketplace update impulso`.
42
+
43
+ Not covered by the plugin (Claude Code plugins can't ship memory files): the
44
+ full ruleset in `shared/AGENTS.md`. DirectSpeech still enforces per turn via the
45
+ hook; for the complete ruleset add an import line to your `~/.claude/CLAUDE.md`
46
+ pointing at a checked-out copy, or use the installer route instead.
47
+
48
+ Requires `rtk` + `tokensave` on PATH — the preflight hook blocks prompts
49
+ otherwise (that's the point).
50
+
51
+ ## Install — opencode plugin (recommended)
52
+
53
+ Add one entry to your opencode config:
54
+
55
+ ```jsonc
56
+ {
57
+ "$schema": "https://opencode.ai/config.json",
58
+ "plugin": ["impulso@git+https://github.com/alexandrekm/Impulso.git"],
59
+ }
60
+ ```
61
+
62
+ Restart opencode (clear cache first):
63
+
64
+ ```bash
65
+ rm -rf ~/.cache/opencode/node_modules/impulso
66
+ pkill -f opencode
67
+ opencode
68
+ ```
69
+
70
+ The single plugin entry internally composes DirectSpeech + bundled skills and
71
+ commands. Plannotator skills invoke the user-installed `plannotator` binary
72
+ directly — no npm plugin dependency.
73
+
74
+ ### Update
75
+
76
+ opencode caches git+https plugins locally and won't refetch on its own. Pull the
77
+ latest revision with the same clear-cache-and-restart steps shown above:
78
+
79
+ ```bash
80
+ rm -rf ~/.cache/opencode/node_modules/impulso
81
+ pkill -f opencode
82
+ opencode
83
+ ```
84
+
85
+ If pinned to a tag or commit, bump it in your config first, then run the same
86
+ cache-clear + restart.
87
+
88
+ ### Pin a version
89
+
90
+ ```jsonc
91
+ "plugin": ["impulso@git+https://github.com/alexandrekm/Impulso.git#v0.1.0"]
92
+ ```
93
+
94
+ ### Install from a local clone
95
+
96
+ ```jsonc
97
+ "plugin": ["impulso@git+file:///abs/path/to/hip-liger"]
98
+ ```
99
+
100
+ The `file://` URL must be an **absolute path** with three slashes
101
+ (`file:///abs/...`) and the directory must be a git repo (have `.git/`).
102
+
103
+ ---
104
+
105
+ ## Quick start — target repo directly (no install)
106
+
107
+ Point `XDG_CONFIG_HOME` at the repo root:
108
+
109
+ ```bash
110
+ cd /path/to/impulso
111
+ XDG_CONFIG_HOME=$(pwd) opencode
112
+ ```
113
+
114
+ Or use the convenience wrapper:
115
+
116
+ ```bash
117
+ ./run_here.sh
118
+ ```
119
+
120
+ > **Prerequisite:** the `plannotator` binary must be on your `PATH` for the
121
+ > Plannotator skills to launch the annotation UI. Install it separately (not
122
+ > bundled with this repo).
123
+
124
+ ## Quick start — Claude Code
125
+
126
+ Point `CLAUDE_CONFIG_DIR` at the repo's bundled `claude/` config dir — no
127
+ install step, no separate profile dir. Skills and commands resolve via symlinks
128
+ inside `claude/`; hooks resolve via `$CLAUDE_CONFIG_DIR` shell expansion in
129
+ `settings.json`:
130
+
131
+ ```bash
132
+ cd /path/to/impulso
133
+ CLAUDE_CONFIG_DIR=$(pwd)/claude claude
134
+ ```
135
+
136
+ Or use the convenience wrapper:
137
+
138
+ ```bash
139
+ ./run_here_claude.sh
140
+ ```
141
+
142
+ For a permanent isolated install that leaves your main `~/.claude/` untouched:
143
+
144
+ ```bash
145
+ ./harnesses/claude/install.sh
146
+ CLAUDE_CONFIG_DIR=~/.config/impulso-profile/claude claude
147
+ ```
148
+
149
+ To install into `~/.claude/` directly (shared with your normal Claude Code
150
+ config): `IMPULSO_CLAUDE_PROFILE="$HOME/.claude" ./harnesses/claude/install.sh`
151
+
152
+ See [`harnesses/claude/README.md`](harnesses/claude/README.md) for Plannotator
153
+ upstream plugin setup and RTK install.
154
+
155
+ ## Install — isolated profiles
156
+
157
+ For permanent installs that leave your main config dirs untouched:
158
+
159
+ ```bash
160
+ ./harnesses/opencode/install.sh
161
+ XDG_CONFIG_HOME=~/.config/impulso-profile opencode
162
+
163
+ ./harnesses/claude/install.sh
164
+ CLAUDE_CONFIG_DIR=~/.config/impulso-profile/claude claude
165
+ ```
166
+
167
+ ## Token savings via RTK (hard-required)
168
+
169
+ `rtk` and `tokensave` are enforced at every layer — no degraded mode:
170
+
171
+ - `install.sh` scripts abort when either is missing.
172
+ - `run_here.sh` / `run_here_claude.sh` launchers fail fast.
173
+ - opencode: the Impulso plugin throws at init.
174
+ - Claude Code: a UserPromptSubmit preflight hook blocks prompts, and the rtk
175
+ PreToolUse hook blocks Bash calls — both with install hints.
176
+
177
+ ```bash
178
+ brew install rtk
179
+ # or: cargo install --git https://github.com/rtk-ai/rtk
180
+ # or: curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh
181
+ ```
182
+
183
+ The tokensave MCP server additionally needs a per-project index — run
184
+ `tokensave init` once in each repo you work in (`.tokensave/` is gitignored
185
+ globally by the installer).
186
+
187
+ See [`harnesses/opencode/rtk/README.md`](harnesses/opencode/rtk/README.md).
188
+
189
+ ## Usage — everything in one place
190
+
191
+ ### Daily use
192
+
193
+ DirectSpeech is always on — nothing to activate, no off-switch. RTK rewrites run
194
+ automatically on every bash call; write plain commands. tokensave MCP tools are
195
+ available once `tokensave init` has been run in the project.
196
+
197
+ | Slash command | What it does |
198
+ | ---------------------------------------- | --------------------------------------------------- |
199
+ | `/plannotator-annotate <file\|url\|dir>` | browser annotation UI, feedback returned to session |
200
+ | `/plannotator-last` | annotate the latest assistant message |
201
+ | `/plannotator-review [PR URL]` | browser code review of worktree or PR |
202
+ | `/impulso-directspeech-compress <file>` | compress a .md file to terse prose (~46% tokens) |
203
+ | `/impulso-directspeech-stats` | token-savings stats |
204
+ | `/impulso-directspeech-help` | reference card |
205
+
206
+ Plannotator commands need the `plannotator` binary:
207
+ `curl -fsSL https://plannotator.ai/install.sh | bash`
208
+
209
+ ### Per-project setup
210
+
211
+ ```bash
212
+ tokensave init # build the tokensave index (once per repo)
213
+ ```
214
+
215
+ ### Maintenance
216
+
217
+ ```bash
218
+ ./doctor.sh # health check: binaries, symlinks, configs, MCP
219
+ ./harnesses/claude/uninstall.sh # reverse the claude install (targeted, safe)
220
+ ./harnesses/opencode/uninstall.sh # remove the opencode profile
221
+ ```
222
+
223
+ ### Development (this repo)
224
+
225
+ ```bash
226
+ npm test # all unit suites
227
+ npm run lint && npm run format:check
228
+ npm run sync:commands # regen commands/ after editing skills/
229
+ ./harnesses/opencode/integration-tests.sh # live boot tests; model resolved via
230
+ # IMPULSO_TEST_MODEL > bedrock auth > CLI_PROXY_URL
231
+ claude plugin validate . # check plugin/marketplace manifests
232
+ ```
233
+
234
+ Editing rules: skills are the source — never edit `commands/` by hand (CI drift
235
+ check will fail); the ruleset lives only in `shared/AGENTS.md` (`claude/` and
236
+ `opencode/` symlink it); claude hooks live in `harnesses/claude/hooks/` and are
237
+ referenced from both `claude/settings.json` (self-boot/installer) and
238
+ `hooks/hooks.json` (plugin).
239
+
240
+ ## Agent orchestration
241
+
242
+ Multi-agent pipeline (orchestrator → specialist agents) on both harnesses, from
243
+ a single source of truth in `shared/orchestration-config.cjs`.
244
+
245
+ ### Roster
246
+
247
+ | Agent | Role | CC default | opencode default |
248
+ | -------------------- | ------------------------------------------------ | -------------- | -------------------------- |
249
+ | ImpulsoOrchestrator | Routes tasks to specialist agents; no file edits | session (null) | session (null) |
250
+ | scout | Read-only recon; returns path:line refs | haiku | `llm/scout` |
251
+ | planner | Drafts spec.md / plan.md | opus | `llm/planner` |
252
+ | implementer | Code, tests, refactors | sonnet | `llm/implementer` |
253
+ | implementer-frontend | UI, CSS, component trees | sonnet | `llm/implementer-frontend` |
254
+ | implementer-infra | Terraform, K8s, CI/CD | sonnet | `llm/implementer-infra` |
255
+ | reviewer | Code review (task-level and branch-level) | opus | `llm/reviewer` |
256
+ | debugger | Root-cause analysis, regression test, fix | sonnet | `llm/debugger` |
257
+ | shipper | Commits, push, PR | haiku | `llm/shipper` |
258
+ | generalist | Catch-all; prefer specialists when type is known | sonnet | `llm/generalist` |
259
+
260
+ ### Pipeline
261
+
262
+ Key orchestration behaviors:
263
+
264
+ - **Route self-check:** Estimate blast radius before committing to a route.
265
+ Prefer `small` for config-only / ≤~3-file / unambiguous changes; propose a
266
+ downgrade when the route feels heavier than the diff.
267
+ - **Brainstorm:** Batch all independent questions in one round (sequential only
268
+ for dependent decisions). Any post-plan design change restarts the brainstorm
269
+ cycle — no mid-pipeline pivots.
270
+ - **Spec:** Confirmed in chat with the user — no Plannotator gate at this phase.
271
+ Plannotator gates remain at Plan and the final branch/code review.
272
+ - **Parallel dispatch:** Plan tasks carry a `parallel-safe: yes|no` field. The
273
+ orchestrator fans out `parallel-safe: yes` tasks concurrently (edit-only
274
+ implementers; orchestrator owns gate state + commits); `parallel-safe: no`
275
+ tasks run sequentially.
276
+
277
+ ### Override — `.impulso/models.json`
278
+
279
+ Ladder (highest wins): `<repo>/.impulso/models.json` >
280
+ `~/.impulso/models.json` > shipped defaults.
281
+
282
+ The file is **harness-partitioned**: top-level keys must be `claude` and/or
283
+ `opencode`. Flat keys (e.g. `"planner": "opus"`) are rejected with a
284
+ migration-hint error. A file may carry only one block; the absent block
285
+ contributes no overrides.
286
+
287
+ Each block maps an agent key (roster name) to a model string or
288
+ `{ "model", "effort" }` object; fields merge per-key down the ladder, so an
289
+ effort-only override keeps the lower-rung model. Unknown keys or bad JSON = hard
290
+ fail, no silent fallback.
291
+
292
+ ```json
293
+ {
294
+ "claude": { "planner": "opus", "reviewer": "opus" },
295
+ "opencode": { "planner": "llm/deep", "implementer": { "effort": "xhigh" } }
296
+ }
297
+ ```
298
+
299
+ opencode values are **pass-through strings** — either a logical alias
300
+ (`llm/deep`) or a concrete provider model. Impulso does not resolve or validate
301
+ them; they replace the shipped `llm/<key>` default verbatim.
302
+
303
+ `effort` inside a `claude` block is a **hard error** — Claude Code effort comes
304
+ from `agents/<name>.md` frontmatter, not `models.json`. Place effort overrides
305
+ in the `opencode` block only.
306
+
307
+ ### opencode aliases (BYO-config required)
308
+
309
+ opencode ships logical aliases, not concrete model IDs. Every agent in the
310
+ `opencode` block resolves through an `llm/<key>` alias that must be mapped in
311
+ your opencode provider config — Impulso provides no fallback. An undefined alias
312
+ fails at dispatch. `doctor.sh` warns when aliases are active (spec §7).
313
+
314
+ | Agent | Shipped alias |
315
+ | -------------------- | -------------------------- |
316
+ | scout | `llm/scout` |
317
+ | scout-writer | `llm/scout-writer` |
318
+ | planner | `llm/planner` |
319
+ | implementer | `llm/implementer` |
320
+ | implementer-frontend | `llm/implementer-frontend` |
321
+ | implementer-infra | `llm/implementer-infra` |
322
+ | reviewer | `llm/reviewer` |
323
+ | debugger | `llm/debugger` |
324
+ | shipper | `llm/shipper` |
325
+ | generalist | `llm/generalist` |
326
+
327
+ To wire up aliases, define each `llm/<key>` entry in your opencode provider
328
+ config (exact syntax depends on your provider plugin). Alternatively, override
329
+ the `opencode` block in `.impulso/models.json` with concrete model IDs — that
330
+ bypasses the alias layer entirely.
331
+
332
+ ### Inspection
333
+
334
+ ```bash
335
+ impulso-hub models # full resolved map (claude, default)
336
+ impulso-hub models --agent reviewer # single agent
337
+ impulso-hub models --harness opencode # opencode alias map
338
+ ```
339
+
340
+ ### Caveats
341
+
342
+ Model strings are **not** validated at config load — a typo surfaces at dispatch
343
+ when the provider rejects the ID. Aliases (`sonnet`/`haiku`/`opus`) on the CC
344
+ side track the harness's default for that tier; pin full model IDs to lock a
345
+ specific version.
346
+
347
+ **Migration (flat `models.json`):** Existing files with flat top-level keys
348
+ (e.g. `{ "planner": "opus" }`) now fail at boot with a migration-hint error.
349
+ Wrap the content under `"claude"` and/or `"opencode"` blocks. Move any `effort`
350
+ values into the `opencode` block, or into `agents/<name>.md` frontmatter for
351
+ Claude Code effort.
352
+
353
+ **opencode default behavior change:** opencode no longer defaults to concrete
354
+ models; it defaults to `llm/<key>` aliases (see table above). Users who did not
355
+ previously override models must either define the `llm/*` aliases in their
356
+ opencode provider config or pin concrete models in the `opencode` block of
357
+ `models.json`. There is no fallback — undefined aliases fail at dispatch.
358
+
359
+ ### Harness differences
360
+
361
+ **Effort** behaves differently per harness:
362
+
363
+ - **opencode**: `effort` is registered at boot as `reasoningEffort` on the agent
364
+ config — a provider-passthrough value. The `models.json` ladder applies.
365
+ Interpretation is provider-specific.
366
+ - **Claude Code**: the Agent tool has no dispatch-time effort parameter, so the
367
+ `models.json` effort ladder does not apply — specifying `effort` in the
368
+ `claude` block of `models.json` is a **hard error** (use `agents/<name>.md`
369
+ frontmatter instead). Effort is a static `effort:` frontmatter key in
370
+ `agents/*.md` (validated by `sync:agents`; unset = inherit session).
371
+
372
+ **Model dispatch:**
373
+
374
+ - **opencode**: models are pinned at boot in `config.agent[name].model`. Boot
375
+ values are the `llm/<key>` aliases by default (see alias table).
376
+ - **Claude Code**: orchestrator pins the resolved model on every dispatch via
377
+ the Agent tool `model` parameter.
378
+
379
+ Use `impulso-hub models --harness claude|opencode` (default `claude`) to inspect
380
+ the full resolved map for either harness.
381
+
382
+ **Model ID format and `[1m]` context-suffix:** no difference. Neither harness
383
+ transforms or validates model IDs; no `[1m]` suffix support exists in either.
384
+
385
+ ### Deterministic orchestration ownership
386
+
387
+ Deterministic state and precondition validation
388
+ (`impulso-hub status --json schema v1`) are owned by `impulso-hub`. Specialized
389
+ skills retain human interview, dispatch, and remediation policy.
390
+
391
+ ## Structure
392
+
393
+ ```
394
+ impulso/
395
+ ├── AGENTS.md # contributor guide for AI agents working on this repo
396
+ ├── CLAUDE.md # @AGENTS.md import (Claude Code reads CLAUDE.md)
397
+ ├── .claude-plugin/ # plugin.json + marketplace.json (claude plugin route)
398
+ ├── hooks/hooks.json # plugin hook declarations (${CLAUDE_PLUGIN_ROOT})
399
+ ├── .mcp.json # tokensave MCP (plugin route + project-local)
400
+ ├── run_here.sh # boots opencode against this repo
401
+ ├── run_here_claude.sh # boots Claude Code against this repo
402
+ ├── doctor.sh # health checks: binaries, symlinks, configs, MCP
403
+ ├── opencode/ # self-boot config: opencode.jsonc + AGENTS.md -> shared/ + symlinks
404
+ ├── claude/ # self-boot config: settings.json + CLAUDE.md + AGENTS.md -> shared/ + symlinks
405
+ ├── skills/ # harness-agnostic skill files (SKILL.md per dir)
406
+ ├── commands/ # auto-generated from skills/ (sync-commands.js)
407
+ ├── shared/ # harness-neutral: AGENTS.md (canonical ruleset), directspeech-config.cjs, tests.cjs
408
+ └── harnesses/
409
+ ├── opencode/ # opencode-specific glue
410
+ │ ├── plugin.js # orchestrator (composes DirectSpeech + bundled skills/commands)
411
+ │ ├── compose.js # hook merging helper
412
+ │ ├── frontmatter.js # shared YAML frontmatter parser
413
+ │ ├── commands-loader.js # runtime command registration
414
+ │ ├── sync-commands.js # build-time cmd generation from skills
415
+ │ ├── install.sh # isolated profile installer
416
+ │ ├── uninstall.sh # removes the isolated profile
417
+ │ ├── directspeech/ # DirectSpeech plugin (always-on reinforcement)
418
+ │ └── rtk/ # vendored upstream RTK plugin (rtk.ts + README.md)
419
+ └── claude/ # Claude Code glue
420
+ ├── install.sh # profile installer (merge-safe for shared profiles)
421
+ ├── uninstall.sh # targeted reversal — never touches foreign content
422
+ ├── merge-settings.cjs # settings.json merge (foreign hooks/keys survive)
423
+ ├── tests.cjs
424
+ └── hooks/ # preflight.cjs, rtk.cjs, directspeech-context.cjs
425
+ ```
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: ImpulsoOrchestrator
3
+ description: Routes tasks to specialist agents.
4
+ tools: Read, Grep, Glob, Bash, Task, TaskCreate, TaskUpdate, AskUserQuestion
5
+ permission-class: dispatch-only
6
+ ---
7
+
8
+ # Orchestrator
9
+
10
+ Pure scheduler. Never implement, edit source, or write files. Touch `.impulso/`
11
+ state via `impulso-hub` only.
12
+
13
+ ## Route classification
14
+
15
+ | Route | When |
16
+ | -------- | ----------------------------------- |
17
+ | trivial | ≤5 min, no file writes, answer only |
18
+ | small | single bug fix or narrow change |
19
+ | feature | multi-task, needs spec + plan |
20
+ | debug | repro-first investigation |
21
+ | question | answer only, no code |
22
+
23
+ User-stated route wins. When ambiguous, ask.
24
+
25
+ Before choosing `feature`, estimate blast radius. Config-only or ≤~3-file
26
+ changes with no real ambiguity → prefer `small`. If the chosen route feels
27
+ heavier than the likely diff, propose downgrading to the user.
28
+
29
+ ## Session bootstrap
30
+
31
+ If `impulso-hub status` exits 2 with "No active workspace...", immediately run
32
+ `impulso-hub init <slug> --route <route>` using the route from classification
33
+ above — do not probe further with ls/find/cat/models first.
34
+
35
+ ## Brainstorm protocol (feature route)
36
+
37
+ Before dispatching the planner, gather ALL design decisions and
38
+ environment/context facts up front. Batch independent questions into one message
39
+ — reserve one-at-a-time strictly for decisions that depend on a prior answer.
40
+ Say verbatim:
41
+
42
+ <!-- prettier-ignore -->
43
+ Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Batch independent questions into one message; ask dependent decisions one at a time, waiting for each answer before proceeding. For each question, provide your recommended answer.
44
+
45
+ <!-- prettier-ignore -->
46
+ Ask each question via the interactive question tool (`AskUserQuestion` on Claude Code, `question` on opencode) — recommended answer as the first option; plain text otherwise.
47
+
48
+ Facts from the codebase come via scout. Decisions go to the human.
49
+
50
+ <!-- prettier-ignore -->
51
+ Do not enact the plan until I confirm we have reached a shared understanding.
52
+
53
+ Any design change surfaced after the plan is approved is a new brainstorm — do
54
+ not pivot mid-pipeline.
55
+
56
+ ## Dispatch rules
57
+
58
+ - Model per agent: `impulso-hub models --agent <name>` — never hardcode.
59
+ - Handoffs by path: brief files, report paths, review package paths — never
60
+ paste content.
61
+ - Dispatch each agent with explicit model and exact file paths.
62
+ - Expect ≤15-line status block from every dispatched agent.
63
+ - On NEEDS_CONTEXT or BLOCKED: surface to user, do not guess.
64
+ - Tasks marked `parallel-safe: yes` in the plan: dispatch concurrently. The
65
+ orchestrator alone calls `impulso-hub task start/done` and handles commits;
66
+ parallel-safe implementers are edit-only (no gate or git calls). Rationale:
67
+ `state.json` writes are atomic but concurrent gate calls from multiple agents
68
+ risk lost-updates — disallowed.
69
+
70
+ ## Phase transitions
71
+
72
+ Only via `impulso-hub advance`. On exit 2, do exactly what stderr says — no
73
+ other action.
74
+
75
+ Spec phase: run `impulso-hub spec-review-mode`. Output tells you the mode
76
+ (`confirm` or `plannotator`) and line count. If `confirm`: confirm spec with
77
+ user in chat, then `impulso-hub record-spec-confirmation`, then
78
+ `impulso-hub advance`. If `plannotator`: full Plannotator annotate → feedback →
79
+ `impulso-hub record-plannotator spec.md` → advance.
80
+
81
+ ## Deterministic orchestration ownership
82
+
83
+ Deterministic state and precondition validation (`impulso-hub status --json`
84
+ schema v1) are owned by `impulso-hub`. Specialized skills retain human
85
+ interview, dispatch, and remediation policy.
86
+
87
+ ## impulso-hub CLI reference
88
+
89
+ | Command | Usage |
90
+ | ------------------------ | -------------------------------------------------------------------------------------- |
91
+ | version | `impulso-hub version` |
92
+ | init | `impulso-hub init <slug> --route <route>` |
93
+ | status | `impulso-hub status [--json]` |
94
+ | advance | `impulso-hub advance` |
95
+ | record-test | `impulso-hub record-test --cmd <c> --exit-code <n> [--full] [--coverage] [--task <n>]` |
96
+ | run-test | `impulso-hub run-test [--full] [--coverage] [--task <n>]` |
97
+ | record-plannotator | `impulso-hub record-plannotator <artifact\|--review> [--output <path>]` |
98
+ | task | `impulso-hub task <start\|done> <n>` |
99
+ | brief | `impulso-hub brief <n>` |
100
+ | review-package | `impulso-hub review-package <base> <head>` |
101
+ | models | `impulso-hub models [--agent <a>] [--harness <h>]` |
102
+ | record-review-verdict | `impulso-hub record-review-verdict <clean\|findings>` |
103
+ | record-pr | `impulso-hub record-pr <url>` |
104
+ | config | `impulso-hub config set <key> <value>` |
105
+ | spec-review-mode | `impulso-hub spec-review-mode` |
106
+ | record-spec-confirmation | `impulso-hub record-spec-confirmation` |
107
+
108
+ **Note:** `run-test --full --coverage [--task <n>]` combines both flags in a
109
+ single subprocess execution, satisfying both `suite-green` and `coverage-pass`
110
+ preconditions at once. Do not call `--full` and `--coverage` separately if
111
+ `coverage_cmd` and `test_cmd` overlap — it double-runs the suite for no extra
112
+ signal.
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: debugger
3
+ description: Root-cause analysis and bug fixes.
4
+ model: sonnet
5
+ permission-class: full
6
+ ---
7
+
8
+ # Debugger
9
+
10
+ Reproduce first. No hypothesis before a red-capable repro command.
11
+
12
+ ## Protocol
13
+
14
+ 1. Produce a repro command: exact invocation + expected output + actual output.
15
+ 2. Confirm the command is red (fails reproducibly).
16
+ 3. Form 3–5 ranked falsifiable hypotheses. Most specific first.
17
+ 4. Test each hypothesis: one change, re-run repro, observe.
18
+ 5. Write regression test before applying the fix.
19
+ 6. Watch test fail → apply fix → watch test pass.
20
+
21
+ ## Rules
22
+
23
+ - If `.impulso/work/<slug>/context.md` exists, read it first — shared, read-only
24
+ codebase facts. It supplements the brief, never overrides it.
25
+ - No fix without a repro command.
26
+ - No fix without a passing regression test.
27
+ - Scope: the reported bug only. Do not refactor adjacent code.
28
+ - Mark deliberate cuts: `impulso: <ceiling>, <upgrade path>`.
29
+ - Write full report to the given report path before returning status.
30
+
31
+ ## Status block (≤15 lines, always last)
32
+
33
+ ```
34
+ STATUS: DONE|DONE_WITH_CONCERNS|NEEDS_CONTEXT|BLOCKED
35
+ commits: <sha7> <imperative summary>
36
+ tests: <one-line summary: N passed, N failed>
37
+ concerns: <none|description>
38
+ ```
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: generalist
3
+ description: Catch-all for tasks without a specialist fit.
4
+ model: sonnet
5
+ permission-class: full
6
+ ---
7
+
8
+ # Generalist
9
+
10
+ Catch-all route. Prefer a specialist when the task type is known.
11
+
12
+ ## Rules
13
+
14
+ - DirectSpeech: terse, technical, no filler.
15
+ - No scope creep — report back rather than expand.
16
+ - If the task fits scout/implementer/debugger/shipper, say so and stop.
17
+ - Write full report to the given report path before returning status.
18
+
19
+ ## Status block (≤15 lines, always last)
20
+
21
+ ```
22
+ STATUS: DONE|DONE_WITH_CONCERNS|NEEDS_CONTEXT|BLOCKED
23
+ commits: <sha7 or n/a>
24
+ tests: <one-line summary or n/a>
25
+ concerns: <none|description>
26
+ ```
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: implementer-frontend
3
+ description: Frontend-focused implementation agent.
4
+ model: sonnet
5
+ permission-class: full
6
+ ---
7
+
8
+ # Implementer — Frontend
9
+
10
+ Read the brief file first — it is the requirements. Do not deviate from scope.
11
+
12
+ Read `DESIGN.md` (repo root) before any UI code — holds frontend rules (design
13
+ tokens, a11y, component conventions). Binding alongside brief. Missing →
14
+ `NEEDS_CONTEXT`.
15
+
16
+ ## TDD iron law
17
+
18
+ NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST.
19
+
20
+ Write the failing test. Run via `impulso-hub run-test`. Confirm red. Then
21
+ implement. Confirm green.
22
+
23
+ ## Frontend-specific rules
24
+
25
+ - If `.impulso/work/<slug>/context.md` exists, read it first — shared, read-only
26
+ codebase facts. It supplements the brief, never overrides it.
27
+ - Design tokens and a11y first — never hardcode colors, spacings, or ARIA
28
+ bypasses.
29
+ - Reuse existing components before creating new ones.
30
+ - Check component library before writing any UI primitive.
31
+ - Mark deliberate cuts: `impulso: <ceiling>, <upgrade path>`.
32
+ - Write full report to the given report path before returning status.
33
+
34
+ ## Status block (≤15 lines, always last)
35
+
36
+ ```
37
+ STATUS: DONE|DONE_WITH_CONCERNS|NEEDS_CONTEXT|BLOCKED
38
+ commits: <sha7> <imperative summary>
39
+ tests: <one-line summary: N passed, N failed>
40
+ concerns: <none|description>
41
+ ```