brainclaw 1.8.0 → 1.9.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 (178) hide show
  1. package/README.md +592 -505
  2. package/dist/brainclaw-vscode.vsix +0 -0
  3. package/dist/cli.js +138 -13
  4. package/dist/commands/add-step.js +1 -1
  5. package/dist/commands/bootstrap.js +2 -26
  6. package/dist/commands/check-security-mcp.js +50 -33
  7. package/dist/commands/check-security.js +86 -43
  8. package/dist/commands/claim.js +22 -21
  9. package/dist/commands/confirm.js +26 -0
  10. package/dist/commands/context-diff.js +1 -1
  11. package/dist/commands/dispatch-watch.js +142 -0
  12. package/dist/commands/doctor.js +113 -2
  13. package/dist/commands/estimation-report.js +115 -16
  14. package/dist/commands/harvest.js +286 -23
  15. package/dist/commands/hooks.js +73 -73
  16. package/dist/commands/init.js +124 -22
  17. package/dist/commands/install-hooks.js +78 -78
  18. package/dist/commands/loops-handlers.js +4 -0
  19. package/dist/commands/mcp-read-handlers.js +253 -41
  20. package/dist/commands/mcp.js +664 -102
  21. package/dist/commands/memory.js +21 -17
  22. package/dist/commands/migrate.js +81 -17
  23. package/dist/commands/prune.js +78 -4
  24. package/dist/commands/reflect.js +26 -20
  25. package/dist/commands/register-agent.js +57 -1
  26. package/dist/commands/repair.js +20 -0
  27. package/dist/commands/session-end.js +15 -6
  28. package/dist/commands/session-start.js +18 -1
  29. package/dist/commands/setup-security.js +39 -18
  30. package/dist/commands/setup.js +26 -27
  31. package/dist/commands/stale.js +16 -2
  32. package/dist/commands/switch.js +26 -5
  33. package/dist/commands/uninstall.js +126 -34
  34. package/dist/commands/update-step.js +6 -0
  35. package/dist/commands/version.js +1 -1
  36. package/dist/commands/worktree.js +60 -0
  37. package/dist/core/actions.js +12 -3
  38. package/dist/core/agent-capability.js +30 -17
  39. package/dist/core/agent-files.js +963 -666
  40. package/dist/core/agent-integrations.js +0 -3
  41. package/dist/core/agent-inventory.js +67 -0
  42. package/dist/core/agent-registry.js +163 -29
  43. package/dist/core/agentrun-reconciler.js +33 -2
  44. package/dist/core/agentruns.js +7 -1
  45. package/dist/core/ai-agent-detection.js +31 -44
  46. package/dist/core/archival.js +15 -9
  47. package/dist/core/assignment-reconciler.js +56 -0
  48. package/dist/core/assignment-sweeper.js +127 -4
  49. package/dist/core/assignments.js +69 -11
  50. package/dist/core/bootstrap.js +233 -67
  51. package/dist/core/brainclaw-version.js +22 -0
  52. package/dist/core/candidates.js +21 -1
  53. package/dist/core/claims.js +313 -150
  54. package/dist/core/codev-prompts.js +38 -38
  55. package/dist/core/config.js +6 -1
  56. package/dist/core/context-diff.js +148 -20
  57. package/dist/core/context.js +129 -8
  58. package/dist/core/coordination.js +22 -3
  59. package/dist/core/default-profiles/doctor.yaml +11 -11
  60. package/dist/core/default-profiles/janitor.yaml +11 -11
  61. package/dist/core/default-profiles/onboarder.yaml +11 -11
  62. package/dist/core/default-profiles/reviewer.yaml +13 -13
  63. package/dist/core/dispatch-status.js +79 -5
  64. package/dist/core/dispatcher.js +65 -12
  65. package/dist/core/entity-operations.js +74 -27
  66. package/dist/core/entity-registry.js +31 -5
  67. package/dist/core/event-log.js +138 -21
  68. package/dist/core/events/checkpoint.js +258 -0
  69. package/dist/core/events/genesis.js +220 -0
  70. package/dist/core/events/journal.js +507 -0
  71. package/dist/core/events/materialize.js +126 -0
  72. package/dist/core/events/registry-post-image.js +110 -0
  73. package/dist/core/events/verify.js +109 -0
  74. package/dist/core/execution-adapters.js +23 -0
  75. package/dist/core/execution.js +1 -1
  76. package/dist/core/facade-schema.js +38 -0
  77. package/dist/core/gc-semantic.js +130 -5
  78. package/dist/core/handoff-snapshot.js +68 -0
  79. package/dist/core/ids.js +19 -8
  80. package/dist/core/instruction-templates.js +34 -115
  81. package/dist/core/io.js +39 -3
  82. package/dist/core/json-store.js +10 -1
  83. package/dist/core/lock.js +153 -28
  84. package/dist/core/loops/bootstrap-acquire.js +25 -1
  85. package/dist/core/loops/facade-schema.js +2 -0
  86. package/dist/core/loops/hooks/survey-signals-baseline.js +36 -0
  87. package/dist/core/loops/index.js +1 -0
  88. package/dist/core/loops/presets/bootstrap.js +7 -0
  89. package/dist/core/loops/store.js +17 -0
  90. package/dist/core/loops/verbs.js +24 -2
  91. package/dist/core/markdown.js +8 -76
  92. package/dist/core/mcp-command-resolution.js +245 -0
  93. package/dist/core/memory-compactor.js +5 -3
  94. package/dist/core/memory-lifecycle.js +282 -0
  95. package/dist/core/merge-risk.js +150 -0
  96. package/dist/core/messaging.js +10 -3
  97. package/dist/core/migration.js +11 -1
  98. package/dist/core/observer-mode.js +26 -0
  99. package/dist/core/operations/memory-mutation.js +90 -65
  100. package/dist/core/operations/plan.js +27 -1
  101. package/dist/core/protocol-skills.js +210 -0
  102. package/dist/core/reflection-safety.js +6 -7
  103. package/dist/core/reputation.js +84 -2
  104. package/dist/core/runtime-signals.js +72 -10
  105. package/dist/core/runtime.js +84 -1
  106. package/dist/core/schema.js +114 -0
  107. package/dist/core/search.js +19 -2
  108. package/dist/core/security-detectors.js +125 -0
  109. package/dist/core/security-extract.js +189 -0
  110. package/dist/core/security-guard.js +217 -139
  111. package/dist/core/security-packages.js +121 -0
  112. package/dist/core/security-scoring.js +76 -9
  113. package/dist/core/security.js +34 -2
  114. package/dist/core/sequence.js +11 -2
  115. package/dist/core/setup-flow.js +141 -13
  116. package/dist/core/spawn-check.js +16 -2
  117. package/dist/core/staleness.js +73 -2
  118. package/dist/core/state.js +250 -54
  119. package/dist/core/store-resolution.js +45 -12
  120. package/dist/core/worktree.js +90 -26
  121. package/dist/facts.js +8 -8
  122. package/dist/facts.json +7 -7
  123. package/docs/PROTOCOL.md +223 -0
  124. package/docs/adapters/openclaw.md +43 -43
  125. package/docs/architecture/project-refs.md +328 -328
  126. package/docs/cli.md +2097 -2096
  127. package/docs/concepts/coordination.md +52 -52
  128. package/docs/concepts/coordinator-runbook.md +129 -0
  129. package/docs/concepts/dispatch-lifecycle.md +245 -245
  130. package/docs/concepts/event-log-store.md +928 -0
  131. package/docs/concepts/ideation-loop.md +317 -317
  132. package/docs/concepts/loop-engine.md +520 -511
  133. package/docs/concepts/mcp-governance.md +268 -268
  134. package/docs/concepts/memory.md +89 -88
  135. package/docs/concepts/multi-agent-workflows.md +167 -167
  136. package/docs/concepts/observer-protocol.md +361 -0
  137. package/docs/concepts/parallel-merge-protocol.md +71 -0
  138. package/docs/concepts/plans-and-claims.md +217 -174
  139. package/docs/concepts/project-md-convention.md +35 -35
  140. package/docs/concepts/runtime-notes.md +38 -38
  141. package/docs/concepts/skills.md +78 -0
  142. package/docs/concepts/troubleshooting.md +254 -254
  143. package/docs/concepts/workspace-bootstrapping.md +142 -81
  144. package/docs/context-format-changelog.md +35 -35
  145. package/docs/context-format.md +48 -48
  146. package/docs/index.md +65 -65
  147. package/docs/integrations/agents.md +162 -162
  148. package/docs/integrations/claude-code.md +23 -23
  149. package/docs/integrations/cline.md +87 -88
  150. package/docs/integrations/codex.md +2 -2
  151. package/docs/integrations/continue.md +60 -60
  152. package/docs/integrations/copilot.md +82 -80
  153. package/docs/integrations/cursor.md +23 -23
  154. package/docs/integrations/kilocode.md +72 -72
  155. package/docs/integrations/mcp.md +377 -377
  156. package/docs/integrations/mistral-vibe.md +122 -122
  157. package/docs/integrations/openclaw.md +99 -98
  158. package/docs/integrations/opencode.md +84 -84
  159. package/docs/integrations/overview.md +122 -122
  160. package/docs/integrations/roo.md +74 -74
  161. package/docs/integrations/windsurf.md +83 -83
  162. package/docs/mcp-schema-changelog.md +360 -329
  163. package/docs/playbooks/integration/index.md +121 -121
  164. package/docs/playbooks/orchestration.md +37 -0
  165. package/docs/playbooks/productivity/index.md +99 -99
  166. package/docs/playbooks/team/index.md +117 -117
  167. package/docs/product/agent-first-model.md +184 -184
  168. package/docs/product/entity-model-audit.md +462 -462
  169. package/docs/product/positioning.md +86 -86
  170. package/docs/quickstart-existing-project.md +107 -107
  171. package/docs/quickstart.md +148 -147
  172. package/docs/release-maintenance.md +79 -79
  173. package/docs/reputation.md +52 -52
  174. package/docs/review.md +45 -45
  175. package/docs/security.md +212 -53
  176. package/docs/server-operations.md +118 -118
  177. package/docs/storage.md +110 -108
  178. package/package.json +86 -69
@@ -1,60 +1,60 @@
1
- # Continue Integration
2
-
3
- brainclaw integrates with Continue through MCP tools and project-scoped rules, giving Continue access to shared memory, plans, claims, and coordination state.
4
-
5
- ## Auto-setup
6
-
7
- `brainclaw init` detects Continue and writes `.continue/rules/brainclaw.md` automatically. Or manually:
8
-
9
- ```bash
10
- brainclaw export --format continue-rules --write
11
- ```
12
-
13
- ## MCP configuration
14
-
15
- Continue reads MCP server definitions from `.continue/config.json`. Add brainclaw:
16
-
17
- ```json
18
- {
19
- "mcpServers": [
20
- {
21
- "name": "brainclaw",
22
- "command": "npx",
23
- "args": ["-y", "brainclaw@latest", "mcp"]
24
- }
25
- ]
26
- }
27
- ```
28
-
29
- Per-server YAML configs are also supported in `.continue/mcpServers/*.yaml`.
30
-
31
- ## Permissions
32
-
33
- Continue uses a separate permissions file at `~/.continue/permissions.yaml`. Tool-level control uses `--allow`, `--ask`, and `--exclude` flags on the CLI.
34
-
35
- brainclaw does not yet emit `permissions.yaml` automatically configure manually if running headless.
36
-
37
- ## SKILL.md discovery
38
-
39
- Continue discovers skills from `config.yaml` slashCommands. It does not auto-discover `.agents/skills/` — use explicit config if you need brainclaw skills.
40
-
41
- ## Headless invocation
42
-
43
- ```bash
44
- cn --auto /path/to/project
45
- ```
46
-
47
- Set `CONTINUE_API_KEY` for API-backed headless runs.
48
-
49
- ## Invoke template
50
-
51
- ```bash
52
- cn /path/to/project
53
- ```
54
-
55
- ## Caveats
56
-
57
- - **No hooks**: Continue delegates hook-like behavior to VS Code extensions. No native pre-prompt injection.
58
- - **No auto-approve writer**: brainclaw does not emit `permissions.yaml` yet tool approval must be configured manually.
59
- - **No native subagents**: Continue does not expose subagent orchestration.
60
- - **Windows**: Works via VS Code extension; CLI (`cn`) requires Node.js on PATH.
1
+ # Continue Integration
2
+
3
+ brainclaw integrates with Continue through MCP tools and project-scoped rules, giving Continue access to shared memory, plans, claims, and coordination state.
4
+
5
+ ## Auto-setup
6
+
7
+ `brainclaw init` detects Continue and writes `.continue/rules/brainclaw.md` automatically. Or manually:
8
+
9
+ ```bash
10
+ brainclaw export --format continue --write
11
+ ```
12
+
13
+ ## MCP configuration
14
+
15
+ Continue reads MCP server definitions from `.continue/config.json`. Add brainclaw:
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": [
20
+ {
21
+ "name": "brainclaw",
22
+ "command": "npx",
23
+ "args": ["-y", "brainclaw@latest", "mcp"]
24
+ }
25
+ ]
26
+ }
27
+ ```
28
+
29
+ Per-server YAML configs are also supported in `.continue/mcpServers/*.yaml`.
30
+
31
+ ## Permissions
32
+
33
+ Continue uses a separate permissions file at `~/.continue/permissions.yaml`. Tool-level control uses `--allow`, `--ask`, and `--exclude` flags on the CLI.
34
+
35
+ `brainclaw setup-machine` writes `~/.continue/permissions.yaml` when Continue is selected. Configure it manually only if you need stricter local policy than Brainclaw's generated defaults.
36
+
37
+ ## SKILL.md discovery
38
+
39
+ Continue discovers skills from `config.yaml` slashCommands. It does not auto-discover `.agents/skills/` — use explicit config if you need brainclaw skills.
40
+
41
+ ## Headless invocation
42
+
43
+ ```bash
44
+ cn --auto /path/to/project
45
+ ```
46
+
47
+ Set `CONTINUE_API_KEY` for API-backed headless runs.
48
+
49
+ ## Invoke template
50
+
51
+ ```bash
52
+ cn /path/to/project
53
+ ```
54
+
55
+ ## Caveats
56
+
57
+ - **No hooks**: Continue delegates hook-like behavior to VS Code extensions. No native pre-prompt injection.
58
+ - **Permissions are machine-local**: Brainclaw can write `~/.continue/permissions.yaml`, but it is not committed with the project.
59
+ - **No native subagents**: Continue does not expose subagent orchestration.
60
+ - **Windows**: Works via VS Code extension; CLI (`cn`) requires Node.js on PATH.
@@ -1,80 +1,82 @@
1
- # GitHub Copilot Integration
2
-
3
- brainclaw integrates with GitHub Copilot through MCP tools, instruction files, and lifecycle hooks. Copilot is a Tier A agent — full MCP access, hooks, skills support, and headless CLI spawn capability since CLI 1.0.35.
4
-
5
- ## Auto-setup
6
-
7
- `brainclaw init` detects Copilot (`gh copilot` or `copilot` CLI installed) and writes:
8
-
9
- - `.github/copilot-instructions.md` — instruction file Copilot reads automatically on each prompt
10
- - MCP registration at `~/.copilot/mcp-config.json` (machine-level fallback) and/or project-level `.github/copilot/mcp-config.json`
11
-
12
- Manual regeneration:
13
-
14
- ```bash
15
- brainclaw export --format copilot-instructions --write
16
- brainclaw export --format copilot-instructions --write --include-live
17
- ```
18
-
19
- ## MCP configuration
20
-
21
- Copilot reads MCP servers from `~/.copilot/mcp-config.json`:
22
-
23
- ```json
24
- {
25
- "mcpServers": {
26
- "brainclaw": {
27
- "command": "npx",
28
- "args": ["-y", "brainclaw@latest", "mcp"]
29
- }
30
- }
31
- }
32
- ```
33
-
34
- For per-session overrides (typical when spawning Copilot from a dispatcher), pass `--additional-mcp-config @<path-to-config.json>` on the CLI invocation. This was validated end-to-end during pln#440.
35
-
36
- ## Instruction files
37
-
38
- - `.github/copilot-instructions.md` — Copilot reads this automatically. Keep it lightweight and behavioural.
39
- - `.github/copilot-instructions.live.md` — optional local live companion with current plans, claims, traps, candidates, and handoffs. Write it with `brainclaw export --format copilot-instructions --write --include-live`; it stays gitignored even when the main instruction file is shared/versioned.
40
- - By default, live state flows through MCP. The live companion is parity/backstop context for native-file workflows.
41
-
42
- ## Headless invocation
43
-
44
- Since Copilot CLI 1.0.35 (validated 2026-04-24), Copilot is CLI-spawnable in headless mode. The canonical invoke template is:
45
-
46
- ```bash
47
- copilot -p "{prompt}" --allow-all --no-ask-user
48
- ```
49
-
50
- - `--allow-all` (or equivalent `--yolo`) disables interactive approval prompts (combines `--allow-all-tools --allow-all-paths --allow-all-urls`).
51
- - `--no-ask-user` runs autonomously without pausing for clarifying questions.
52
- - `-p` (or `--prompt`) takes the prompt as the next positional argument. Output is silent unless `-s` is also passed.
53
-
54
- For machine-readable output (JSONL events per line):
55
-
56
- ```bash
57
- copilot -p "{prompt}" --allow-all --no-ask-user --output-format json
58
- ```
59
-
60
- ## Capability profile
61
-
62
- | Field | Value |
63
- |-------|-------|
64
- | Tier | A |
65
- | MCP | yes |
66
- | Hooks | yes |
67
- | Auto-approve | manual (per-call) |
68
- | Skills | yes |
69
- | CLI spawnable | yes (1.0.35+) |
70
- | Max concurrent tasks | 1 |
71
- | Workflow model | interactive |
72
- | MCP config scope | project (project-level config + machine-level fallback) |
73
- | Prompt delivery | `inline_arg` (preferred), `inbox_structured` (fallback) |
74
-
75
- ## Caveats
76
-
77
- - **CLI version**: headless spawn requires Copilot CLI 1.0.35 or later. Earlier versions failed silently when invoked headless and were treated as inbox-only by brainclaw.
78
- - **Quota awareness**: Copilot enforces a per-window credit budget visible in session metadata. The dispatcher uses `max_concurrent_tasks=1` to avoid exhausting it on parallel work.
79
- - **Update cadence**: keep `copilot` updated (`copilot update`) flags and behaviour have moved between releases (`--yolo` was added, `--additional-mcp-config` flag was renamed once).
80
- - **Windows path resolution**: on Windows, `where copilot` may resolve to multiple paths (`.exe`, `.cmd`, npm shim). The brainclaw dispatcher resolves via `where` and prefers the `.exe` form when present.
1
+ # GitHub Copilot Integration
2
+
3
+ brainclaw integrates with GitHub Copilot through MCP tools, instruction files, and lifecycle hooks. Copilot is a Tier A agent — full MCP access, hooks, skills support, and headless CLI spawn capability since CLI 1.0.35.
4
+
5
+ ## Auto-setup
6
+
7
+ `brainclaw init` detects Copilot (`gh copilot` or `copilot` CLI installed) and writes:
8
+
9
+ - `.github/copilot-instructions.md` — instruction file Copilot reads automatically on each prompt
10
+ - `.vscode/settings.json` and `.vscode/mcp.json` — project-level MCP registration used by VS Code/Copilot surfaces
11
+ - `.github/copilot/hooks.json` — session lifecycle hooks where supported
12
+ - `.github/skills/brainclaw-context/SKILL.md` and `.agents/skills/brainclaw/SKILL.md` — Copilot and cross-agent skill discovery
13
+
14
+ Manual regeneration:
15
+
16
+ ```bash
17
+ brainclaw export --format copilot-instructions --write
18
+ brainclaw export --format copilot-instructions --write --include-live
19
+ ```
20
+
21
+ ## MCP configuration
22
+
23
+ VS Code/Copilot reads project MCP configuration from `.vscode/settings.json` and `.vscode/mcp.json`:
24
+
25
+ ```json
26
+ {
27
+ "servers": {
28
+ "brainclaw": {
29
+ "command": "npx",
30
+ "args": ["-y", "brainclaw@latest", "mcp"]
31
+ }
32
+ }
33
+ }
34
+ ```
35
+
36
+ For per-session overrides (typical when spawning Copilot from a dispatcher), pass `--additional-mcp-config @<path-to-config.json>` on the CLI invocation. This was validated end-to-end during pln#440.
37
+
38
+ ## Instruction files
39
+
40
+ - `.github/copilot-instructions.md` Copilot reads this automatically. Keep it lightweight and behavioural.
41
+ - `.github/copilot-instructions.live.md` — optional local live companion with current plans, claims, traps, candidates, and handoffs. Write it with `brainclaw export --format copilot-instructions --write --include-live`; it stays gitignored even when the main instruction file is shared/versioned.
42
+ - By default, live state flows through MCP. The live companion is parity/backstop context for native-file workflows.
43
+
44
+ ## Headless invocation
45
+
46
+ Since Copilot CLI 1.0.35 (validated 2026-04-24), Copilot is CLI-spawnable in headless mode. The canonical invoke template is:
47
+
48
+ ```bash
49
+ copilot -p "{prompt}" --allow-all --no-ask-user
50
+ ```
51
+
52
+ - `--allow-all` (or equivalent `--yolo`) disables interactive approval prompts (combines `--allow-all-tools --allow-all-paths --allow-all-urls`).
53
+ - `--no-ask-user` runs autonomously without pausing for clarifying questions.
54
+ - `-p` (or `--prompt`) takes the prompt as the next positional argument. Output is silent unless `-s` is also passed.
55
+
56
+ For machine-readable output (JSONL events per line):
57
+
58
+ ```bash
59
+ copilot -p "{prompt}" --allow-all --no-ask-user --output-format json
60
+ ```
61
+
62
+ ## Capability profile
63
+
64
+ | Field | Value |
65
+ |-------|-------|
66
+ | Tier | A |
67
+ | MCP | yes |
68
+ | Hooks | yes |
69
+ | Auto-approve | manual (per-call) |
70
+ | Skills | yes |
71
+ | CLI spawnable | yes (1.0.35+) |
72
+ | Max concurrent tasks | 1 |
73
+ | Workflow model | interactive |
74
+ | MCP config scope | project (project-level config + machine-level fallback) |
75
+ | Prompt delivery | `inline_arg` (preferred), `inbox_structured` (fallback) |
76
+
77
+ ## Caveats
78
+
79
+ - **CLI version**: headless spawn requires Copilot CLI 1.0.35 or later. Earlier versions failed silently when invoked headless and were treated as inbox-only by brainclaw.
80
+ - **Quota awareness**: Copilot enforces a per-window credit budget visible in session metadata. The dispatcher uses `max_concurrent_tasks=1` to avoid exhausting it on parallel work.
81
+ - **Update cadence**: keep `copilot` updated (`copilot update`) — flags and behaviour have moved between releases (`--yolo` was added, `--additional-mcp-config` flag was renamed once).
82
+ - **Windows path resolution**: on Windows, `where copilot` may resolve to multiple paths (`.exe`, `.cmd`, npm shim). The brainclaw dispatcher resolves via `where` and prefers the `.exe` form when present.
@@ -1,23 +1,23 @@
1
- # Cursor Integration
2
-
3
- brainclaw works well next to Cursor because Cursor can already operate with project rules and can benefit from explicit workspace context.
4
-
5
- ## Auto-setup
6
-
7
- `brainclaw init` detects Cursor (`CURSOR_TRACE_ID`) and writes `.cursor/rules/brainclaw.md` automatically. Or manually:
8
-
9
- ```bash
10
- brainclaw export --format cursor-rules --write
11
- ```
12
-
13
- ## Recommended approach
14
-
15
- - use MCP as the default dynamic path for context, board state, plans, and claims
16
- - let the generated `.cursor/rules/brainclaw.md` tell Cursor when to consult Brainclaw and how to stay inside the workflow
17
- - use `.brainclaw/project.md` only as readable fallback (derived view, may be stale — run `brainclaw rebuild` to refresh)
18
- - rely on claims and plans when multiple agents or humans are active in the same repo
19
-
20
- ## Key point
21
-
22
- Cursor rules describe behavior.
23
- brainclaw provides the living shared state those rules should point to through MCP.
1
+ # Cursor Integration
2
+
3
+ brainclaw works well next to Cursor because Cursor can already operate with project rules and can benefit from explicit workspace context.
4
+
5
+ ## Auto-setup
6
+
7
+ `brainclaw init` detects Cursor (`CURSOR_TRACE_ID`) and writes `.cursor/rules/brainclaw.md` automatically. Or manually:
8
+
9
+ ```bash
10
+ brainclaw export --format cursor-rules --write
11
+ ```
12
+
13
+ ## Recommended approach
14
+
15
+ - use MCP as the default dynamic path for context, board state, plans, and claims
16
+ - let the generated `.cursor/rules/brainclaw.md` tell Cursor when to consult Brainclaw and how to stay inside the workflow
17
+ - use `.brainclaw/project.md` only as readable fallback (derived view, may be stale — run `brainclaw rebuild` to refresh)
18
+ - rely on claims and plans when multiple agents or humans are active in the same repo
19
+
20
+ ## Key point
21
+
22
+ Cursor rules describe behavior.
23
+ brainclaw provides the living shared state those rules should point to through MCP.
@@ -1,72 +1,72 @@
1
- # Kilo Code Integration
2
-
3
- brainclaw integrates with Kilo Code through MCP tools and instruction files, providing shared memory, plans, and coordination. Kilo Code is a fork of the Cline/Roo family with its own config paths.
4
-
5
- ## Auto-setup
6
-
7
- `brainclaw init` detects Kilo Code and writes `.kilo/rules/brainclaw.md` automatically (per the writer in `src/core/agent-files.ts`). The MCP config at `.kilo/mcp.json` is also generated when applicable.
8
-
9
- ## MCP configuration
10
-
11
- Kilo Code reads MCP servers from `~/.config/kilo/kilo.jsonc` (global) or `kilo.jsonc` (project-scoped):
12
-
13
- ```jsonc
14
- {
15
- "mcpServers": {
16
- "brainclaw": {
17
- "command": "npx",
18
- "args": ["-y", "brainclaw@latest", "mcp"]
19
- }
20
- }
21
- }
22
- ```
23
-
24
- Note: Kilo uses JSONC (JSON with comments), not plain JSON.
25
-
26
- ## Permissions
27
-
28
- Kilo Code supports per-tool permission control and per-server `alwaysAllow`:
29
-
30
- ```jsonc
31
- {
32
- "mcpServers": {
33
- "brainclaw": {
34
- "command": "npx",
35
- "args": ["-y", "brainclaw@latest", "mcp"],
36
- "alwaysAllow": ["bclaw_context", "bclaw_work", "bclaw_find", "bclaw_get"]
37
- }
38
- }
39
- }
40
- ```
41
-
42
- Individual tools can also use `permission: { tool: "allow" | "ask" | "deny" }` syntax.
43
-
44
- ## Instruction files
45
-
46
- - `AGENTS.md` — standard instruction file (shared with Codex, OpenCode)
47
- - `.kilo/rules/brainclaw.md` — Kilo-specific brainclaw rules (auto-written)
48
-
49
- ## SKILL.md discovery
50
-
51
- Kilo Code auto-discovers skills from `.kilocode/skills/`, `.claude/skills/`, and `.agents/skills/`. A single `.agents/skills/brainclaw/SKILL.md` is picked up automatically.
52
-
53
- ## Headless invocation
54
-
55
- ```bash
56
- kilo --auto --json /path/to/project
57
- ```
58
-
59
- The `--auto` flag enables YOLO mode (no approval prompts). `--json` provides structured output.
60
-
61
- ## Invoke template
62
-
63
- ```bash
64
- kilo /path/to/project
65
- ```
66
-
67
- ## Caveats
68
-
69
- - **Cline/Roo family fork**: Config patterns are similar to Cline and Roo but paths differ (`.kilo/` vs `.cline/` vs `.roo/`).
70
- - **JSONC format**: Config files use JSONC (comments allowed), not plain JSON. Parsers must handle this.
71
- - **No hooks**: Hook support is tracked in issue #5827 but not yet public.
72
- - **Windows/Linux**: Works via VS Code extension on all platforms.
1
+ # Kilo Code Integration
2
+
3
+ brainclaw integrates with Kilo Code through MCP tools and instruction files, providing shared memory, plans, and coordination. Kilo Code is a fork of the Cline/Roo family with its own config paths.
4
+
5
+ ## Auto-setup
6
+
7
+ `brainclaw init` detects Kilo Code and writes `.kilo/rules/brainclaw.md` automatically (per the writer in `src/core/agent-files.ts`). The MCP config at `.kilo/mcp.json` is also generated when applicable.
8
+
9
+ ## MCP configuration
10
+
11
+ Kilo Code reads MCP servers from `~/.config/kilo/kilo.jsonc` (global) or `kilo.jsonc` (project-scoped):
12
+
13
+ ```jsonc
14
+ {
15
+ "mcpServers": {
16
+ "brainclaw": {
17
+ "command": "npx",
18
+ "args": ["-y", "brainclaw@latest", "mcp"]
19
+ }
20
+ }
21
+ }
22
+ ```
23
+
24
+ Note: Kilo uses JSONC (JSON with comments), not plain JSON.
25
+
26
+ ## Permissions
27
+
28
+ Kilo Code supports per-tool permission control and per-server `alwaysAllow`:
29
+
30
+ ```jsonc
31
+ {
32
+ "mcpServers": {
33
+ "brainclaw": {
34
+ "command": "npx",
35
+ "args": ["-y", "brainclaw@latest", "mcp"],
36
+ "alwaysAllow": ["bclaw_context", "bclaw_work", "bclaw_find", "bclaw_get"]
37
+ }
38
+ }
39
+ }
40
+ ```
41
+
42
+ Individual tools can also use `permission: { tool: "allow" | "ask" | "deny" }` syntax.
43
+
44
+ ## Instruction files
45
+
46
+ - `AGENTS.md` — standard instruction file (shared with Codex, OpenCode)
47
+ - `.kilo/rules/brainclaw.md` — Kilo-specific brainclaw rules (auto-written)
48
+
49
+ ## SKILL.md discovery
50
+
51
+ Kilo Code auto-discovers skills from `.kilocode/skills/`, `.claude/skills/`, and `.agents/skills/`. A single `.agents/skills/brainclaw/SKILL.md` is picked up automatically.
52
+
53
+ ## Headless invocation
54
+
55
+ ```bash
56
+ kilo --auto --json /path/to/project
57
+ ```
58
+
59
+ The `--auto` flag enables YOLO mode (no approval prompts). `--json` provides structured output.
60
+
61
+ ## Invoke template
62
+
63
+ ```bash
64
+ kilo /path/to/project
65
+ ```
66
+
67
+ ## Caveats
68
+
69
+ - **Cline/Roo family fork**: Config patterns are similar to Cline and Roo but paths differ (`.kilo/` vs `.cline/` vs `.roo/`).
70
+ - **JSONC format**: Config files use JSONC (comments allowed), not plain JSON. Parsers must handle this.
71
+ - **No hooks**: Hook support is tracked in issue #5827 but not yet public.
72
+ - **Windows/Linux**: Works via VS Code extension on all platforms.