brainclaw 0.29.2 → 1.5.3

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 (195) hide show
  1. package/README.md +193 -170
  2. package/dist/brainclaw-vscode.vsix +0 -0
  3. package/dist/cli.js +673 -24
  4. package/dist/commands/accept.js +3 -0
  5. package/dist/commands/add-step.js +11 -26
  6. package/dist/commands/agent-board.js +70 -3
  7. package/dist/commands/audit.js +19 -0
  8. package/dist/commands/check-policy.js +54 -0
  9. package/dist/commands/check-security-mcp.js +145 -0
  10. package/dist/commands/check-security.js +106 -0
  11. package/dist/commands/claim-resource.js +1 -0
  12. package/dist/commands/codev.js +672 -0
  13. package/dist/commands/compact.js +74 -0
  14. package/dist/commands/complete-step.js +16 -26
  15. package/dist/commands/constraint.js +8 -20
  16. package/dist/commands/decision.js +9 -20
  17. package/dist/commands/delete-plan.js +10 -12
  18. package/dist/commands/delete-step.js +16 -0
  19. package/dist/commands/dispatch.js +163 -0
  20. package/dist/commands/doctor.js +1122 -49
  21. package/dist/commands/enable-agent.js +1 -0
  22. package/dist/commands/export.js +280 -22
  23. package/dist/commands/handoff.js +33 -0
  24. package/dist/commands/harvest.js +189 -0
  25. package/dist/commands/hooks.js +82 -25
  26. package/dist/commands/inbox.js +169 -0
  27. package/dist/commands/init.js +38 -31
  28. package/dist/commands/install-hooks.js +71 -44
  29. package/dist/commands/link.js +89 -0
  30. package/dist/commands/list-claims.js +48 -3
  31. package/dist/commands/list-plans.js +129 -25
  32. package/dist/commands/loops-handlers.js +409 -0
  33. package/dist/commands/mcp-read-handlers.js +1628 -0
  34. package/dist/commands/mcp-schemas.generated.js +74 -0
  35. package/dist/commands/mcp.js +4221 -1501
  36. package/dist/commands/plan-resource.js +64 -0
  37. package/dist/commands/plan.js +12 -26
  38. package/dist/commands/prune.js +37 -2
  39. package/dist/commands/reflect.js +20 -7
  40. package/dist/commands/release-claim.js +11 -6
  41. package/dist/commands/release-notes.js +170 -0
  42. package/dist/commands/repair.js +210 -0
  43. package/dist/commands/run-profile.js +57 -0
  44. package/dist/commands/sequence.js +113 -0
  45. package/dist/commands/session-end.js +423 -14
  46. package/dist/commands/session-start.js +214 -41
  47. package/dist/commands/setup-security.js +103 -0
  48. package/dist/commands/setup.js +42 -4
  49. package/dist/commands/stale.js +109 -0
  50. package/dist/commands/switch.js +100 -2
  51. package/dist/commands/trap.js +14 -31
  52. package/dist/commands/update-handoff.js +63 -4
  53. package/dist/commands/update-plan.js +21 -28
  54. package/dist/commands/update-step.js +37 -0
  55. package/dist/commands/upgrade.js +313 -6
  56. package/dist/commands/usage.js +102 -0
  57. package/dist/commands/version.js +20 -0
  58. package/dist/commands/who.js +33 -5
  59. package/dist/commands/worktree.js +105 -0
  60. package/dist/core/actions.js +315 -0
  61. package/dist/core/agent-capability.js +610 -17
  62. package/dist/core/agent-context.js +7 -1
  63. package/dist/core/agent-files.js +1169 -85
  64. package/dist/core/agent-integrations.js +160 -5
  65. package/dist/core/agent-inventory.js +2 -0
  66. package/dist/core/agent-profiles.js +93 -0
  67. package/dist/core/agent-registry.js +162 -30
  68. package/dist/core/agentrun-reconciler.js +345 -0
  69. package/dist/core/agentruns.js +424 -0
  70. package/dist/core/ai-agent-detection.js +31 -10
  71. package/dist/core/archival.js +77 -0
  72. package/dist/core/assignment-sweeper.js +82 -0
  73. package/dist/core/assignments.js +367 -0
  74. package/dist/core/audit.js +30 -0
  75. package/dist/core/brainclaw-version.js +94 -2
  76. package/dist/core/candidates.js +93 -2
  77. package/dist/core/claims.js +419 -0
  78. package/dist/core/codev-metrics.js +77 -0
  79. package/dist/core/codev-personas.js +31 -0
  80. package/dist/core/codev-plan-gen.js +35 -0
  81. package/dist/core/codev-prompts.js +74 -0
  82. package/dist/core/codev-responses.js +62 -0
  83. package/dist/core/codev-rounds.js +218 -0
  84. package/dist/core/config.js +4 -0
  85. package/dist/core/context.js +381 -34
  86. package/dist/core/coordination.js +201 -6
  87. package/dist/core/cross-project.js +230 -16
  88. package/dist/core/default-profiles/doctor.yaml +11 -0
  89. package/dist/core/default-profiles/janitor.yaml +11 -0
  90. package/dist/core/default-profiles/onboarder.yaml +11 -0
  91. package/dist/core/default-profiles/reviewer.yaml +13 -0
  92. package/dist/core/dispatcher.js +1189 -0
  93. package/dist/core/duplicates.js +2 -2
  94. package/dist/core/entity-operations.js +450 -0
  95. package/dist/core/entity-registry.js +344 -0
  96. package/dist/core/events.js +106 -2
  97. package/dist/core/execution-adapters.js +154 -0
  98. package/dist/core/execution-context.js +63 -0
  99. package/dist/core/execution-profile.js +270 -0
  100. package/dist/core/execution.js +255 -0
  101. package/dist/core/facade-schema.js +81 -0
  102. package/dist/core/federation-cloud.js +99 -0
  103. package/dist/core/federation-message.js +52 -0
  104. package/dist/core/federation-transport.js +65 -0
  105. package/dist/core/gc-semantic.js +482 -0
  106. package/dist/core/governance.js +247 -0
  107. package/dist/core/guards.js +19 -0
  108. package/dist/core/ideation.js +72 -0
  109. package/dist/core/identity.js +110 -25
  110. package/dist/core/ids.js +6 -0
  111. package/dist/core/input-validation.js +2 -2
  112. package/dist/core/instruction-templates.js +344 -136
  113. package/dist/core/io.js +90 -11
  114. package/dist/core/lock.js +6 -2
  115. package/dist/core/loops/brief-assembly.js +213 -0
  116. package/dist/core/loops/facade-schema.js +148 -0
  117. package/dist/core/loops/index.js +7 -0
  118. package/dist/core/loops/iteration-engine.js +139 -0
  119. package/dist/core/loops/lock.js +385 -0
  120. package/dist/core/loops/store.js +201 -0
  121. package/dist/core/loops/types.js +403 -0
  122. package/dist/core/loops/verbs.js +534 -0
  123. package/dist/core/markdown.js +15 -3
  124. package/dist/core/memory-compactor.js +432 -0
  125. package/dist/core/memory-git.js +152 -8
  126. package/dist/core/messaging.js +278 -0
  127. package/dist/core/migration.js +32 -1
  128. package/dist/core/mutation-pipeline.js +4 -2
  129. package/dist/core/operations/memory-mutation.js +129 -0
  130. package/dist/core/operations/memory-write.js +78 -0
  131. package/dist/core/operations/plan.js +190 -0
  132. package/dist/core/policy.js +169 -0
  133. package/dist/core/reputation.js +9 -3
  134. package/dist/core/schema.js +491 -6
  135. package/dist/core/search.js +21 -2
  136. package/dist/core/security-cache.js +71 -0
  137. package/dist/core/security-guard.js +152 -0
  138. package/dist/core/security-scoring.js +86 -0
  139. package/dist/core/sequence.js +130 -0
  140. package/dist/core/socket-client.js +113 -0
  141. package/dist/core/staleness.js +246 -0
  142. package/dist/core/state.js +98 -22
  143. package/dist/core/store-resolution.js +43 -11
  144. package/dist/core/toml-writer.js +76 -0
  145. package/dist/core/upgrades/backup.js +232 -0
  146. package/dist/core/upgrades/health-check.js +169 -0
  147. package/dist/core/upgrades/patches/candidate-archive.js +145 -0
  148. package/dist/core/upgrades/patches/handoff-review-strip.js +128 -0
  149. package/dist/core/upgrades/patches/provenance-rollout.js +136 -0
  150. package/dist/core/upgrades/schema-version.js +97 -0
  151. package/dist/core/worktree.js +606 -0
  152. package/dist/facts.js +114 -0
  153. package/dist/facts.json +111 -0
  154. package/docs/architecture/project-refs.md +5 -1
  155. package/docs/cli.md +690 -43
  156. package/docs/concepts/ideation-loop.md +317 -0
  157. package/docs/concepts/loop-engine.md +456 -0
  158. package/docs/concepts/mcp-governance.md +268 -0
  159. package/docs/concepts/memory-staleness.md +122 -0
  160. package/docs/concepts/multi-agent-workflows.md +166 -0
  161. package/docs/concepts/plans-and-claims.md +31 -6
  162. package/docs/concepts/project-md-convention.md +35 -0
  163. package/docs/concepts/troubleshooting.md +220 -0
  164. package/docs/concepts/upgrade-cli.md +202 -0
  165. package/docs/concepts/upgrade-dogfood-procedure.md +114 -0
  166. package/docs/context-format-changelog.md +2 -2
  167. package/docs/context-format.md +2 -2
  168. package/docs/index.md +68 -0
  169. package/docs/integrations/agents.md +15 -16
  170. package/docs/integrations/cline.md +88 -0
  171. package/docs/integrations/codex.md +75 -23
  172. package/docs/integrations/continue.md +60 -0
  173. package/docs/integrations/copilot.md +67 -9
  174. package/docs/integrations/kilocode.md +72 -0
  175. package/docs/integrations/mcp.md +304 -21
  176. package/docs/integrations/mistral-vibe.md +122 -0
  177. package/docs/integrations/opencode.md +84 -0
  178. package/docs/integrations/overview.md +23 -8
  179. package/docs/integrations/roo.md +74 -0
  180. package/docs/integrations/windsurf.md +83 -0
  181. package/docs/mcp-schema-changelog.md +191 -1
  182. package/docs/playbooks/integration/index.md +121 -0
  183. package/docs/playbooks/productivity/index.md +102 -0
  184. package/docs/playbooks/team/index.md +122 -0
  185. package/docs/product/agent-first-model.md +184 -0
  186. package/docs/product/entity-model-audit.md +462 -0
  187. package/docs/quickstart-existing-project.md +135 -0
  188. package/docs/quickstart.md +124 -37
  189. package/docs/release-maintenance.md +79 -0
  190. package/docs/review.md +2 -0
  191. package/docs/server-operations.md +118 -0
  192. package/package.json +20 -12
  193. package/dist/commands/claude-desktop-extension.js +0 -18
  194. package/dist/commands/diff.js +0 -99
  195. package/dist/core/claude-desktop-extension.js +0 -224
@@ -37,16 +37,17 @@ Short and focused:
37
37
  - Active constraints and instructions
38
38
  - Version check reminder
39
39
 
40
- ### For agents with MCP but no hooks (Cursor, Codex, OpenCode, etc.)
40
+ ### For agents with MCP but no hooks (Cursor, Codex, Cline, Copilot, Windsurf, Continue, Kilocode, OpenCode, Roo, Mistral Vibe, Gemini CLI, etc.)
41
41
 
42
42
  More directive:
43
43
  - Same core sections as above, with stronger language ("REQUIRED", "MUST")
44
44
  - The top 5 most critical traps (the agent won't see them otherwise)
45
45
  - Explicit step-by-step protocol with all MCP calls listed
46
+ - For Tier B/C agents that lack hooks, an opt-in `.live.md` companion (regenerated on session-end and handoff) carries plans, claims, traps, candidates, and handoffs as a parity backstop — write with `brainclaw export --include-live --write`
46
47
 
47
- ### For agents without MCP (Copilot, autonomous agents)
48
+ ### For agents without MCP (autonomous agents only)
48
49
 
49
- Full static context via instruction file or SKILL.md:
50
+ Full static context via SKILL.md:
50
51
  - All of the above
51
52
  - Active plans with status and assignees
52
53
  - All shared traps
@@ -90,11 +91,11 @@ brainclaw export --detect --write # auto-detect and write all formats
90
91
  When brainclaw memory changes (new constraints, resolved traps, updated plans), regenerate instruction files:
91
92
 
92
93
  ```bash
93
- brainclaw export --all # all 15 agent formats at once
94
+ brainclaw export --all # all known agent formats at once (17 targets today)
94
95
  brainclaw export --detect --write # only the detected agent
95
96
  ```
96
97
 
97
- For agents without MCP (Copilot), this is especially important — the instruction file is their only source of project context.
98
+ For agents without MCP (autonomous agents), this is especially important — the instruction file or SKILL.md is their only source of project context.
98
99
 
99
100
  ## Generated files are local
100
101
 
@@ -118,10 +119,10 @@ When a workspace contains multiple brainclaw-initialized child projects, agents
118
119
  An operator or agent sets the active project once, and all subsequent commands resolve against it:
119
120
 
120
121
  ```bash
121
- brainclaw switch apps/lodestar # set active project
122
- brainclaw plan list # targets lodestar
123
- bclaw_get_context() # MCP also targets lodestar
124
- brainclaw switch --clear # back to workspace root
122
+ brainclaw switch apps/lodestar # set active project
123
+ brainclaw plan list # targets lodestar
124
+ bclaw_context(kind="memory") # MCP also targets lodestar
125
+ brainclaw switch --clear # back to workspace root
125
126
  ```
126
127
 
127
128
  ### 2. `BRAINCLAW_PROJECT` environment variable
@@ -149,17 +150,15 @@ brainclaw --cwd apps/lodestar plan list
149
150
  ### Starting work
150
151
 
151
152
  ```
152
- bclaw_session_startidentify yourself, see the board
153
- bclaw_get_context(target: "src/auth/") load relevant memory
154
- bclaw_get_execution_context → check for brainclaw updates
153
+ bclaw_work(intent="execute", scope="src/auth/") start session, load context, claim scope in one call
154
+ bclaw_context(kind="execution") check local tooling and brainclaw updates
155
155
  ```
156
156
 
157
157
  ### During work
158
158
 
159
159
  ```
160
- bclaw_claim(scope: "src/auth/") signal what you're editing
161
- bclaw_write_note("Found a race condition in AuthService") record observations
162
- bclaw_create_plan("Fix race condition", estimate: 30) → track work
160
+ bclaw_write_note("Found a race condition in AuthService") record observations
161
+ bclaw_create(entity="plan", data={ text: "Fix race condition", estimated_effort: 30 }) track work
163
162
  ```
164
163
 
165
164
  ### Finishing work
@@ -174,4 +173,4 @@ Always estimate duration in minutes when creating a plan or step. When completin
174
173
 
175
174
  ## Version awareness
176
175
 
177
- Agents should call `bclaw_get_execution_context` at session start. If a newer brainclaw version is available, it tells the agent, who can then inform the developer and suggest updating. Updates may include new features, new MCP tools, and improved coordination.
176
+ Agents should call `bclaw_context(kind="execution")` at session start (or `bclaw_work` which loads it implicitly). If a newer brainclaw version is available, it tells the agent, who can then inform the developer and suggest updating. Updates may include new features, new MCP tools, and improved coordination.
@@ -0,0 +1,88 @@
1
+ # Cline Integration
2
+
3
+ brainclaw integrates with Cline through MCP tools, instruction rules, and lifecycle hooks. Cline is a Tier A agent — full MCP access, hooks, auto-approve support, skills, and CLI spawn capability for parallel lanes.
4
+
5
+ ## Auto-setup
6
+
7
+ `brainclaw init` detects Cline (the VS Code extension and/or the `cline` CLI) and writes:
8
+
9
+ - `.clinerules/brainclaw.md` — Cline-specific instruction rules (auto-discovered by Cline)
10
+ - `.cline/mcp.json` — project-level MCP config registering brainclaw
11
+
12
+ Manual regeneration:
13
+
14
+ ```bash
15
+ brainclaw export --format cline --write
16
+ brainclaw export --format cline --write --include-live
17
+ ```
18
+
19
+ ## MCP configuration
20
+
21
+ Cline reads MCP servers from `.cline/mcp.json` at the project root:
22
+
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "brainclaw": {
27
+ "command": "npx",
28
+ "args": ["-y", "brainclaw@latest", "mcp"]
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ Cline supports per-server `alwaysAllow` for auto-approving specific tools:
35
+
36
+ ```json
37
+ {
38
+ "mcpServers": {
39
+ "brainclaw": {
40
+ "command": "npx",
41
+ "args": ["-y", "brainclaw@latest", "mcp"],
42
+ "alwaysAllow": ["bclaw_context", "bclaw_work", "bclaw_find", "bclaw_get"]
43
+ }
44
+ }
45
+ }
46
+ ```
47
+
48
+ ## Instruction files
49
+
50
+ - `.clinerules/brainclaw.md` — Cline-specific rules (auto-discovered, project-scoped)
51
+ - `.clinerules/live.md` — optional local live companion with current plans, claims, traps, candidates, and handoffs. Write it with `brainclaw export --format cline --write --include-live`; it remains gitignored.
52
+ - Static content stays behavioural and lightweight. By default, live state flows through MCP; the live companion is an optional parity/backstop file.
53
+
54
+ ## SKILL.md discovery
55
+
56
+ Cline auto-discovers skills from `.clinerules/`, `.claude/skills/`, and `.agents/skills/`. brainclaw writes a single `.agents/skills/brainclaw/SKILL.md` that Cline picks up automatically.
57
+
58
+ ## Headless invocation
59
+
60
+ Cline is CLI-spawnable for parallel lanes and dispatched workflows. The canonical invoke template is:
61
+
62
+ ```bash
63
+ cline -y "{prompt}"
64
+ ```
65
+
66
+ The `-y` flag (YOLO mode) disables interactive approval prompts so the spawned worker runs autonomously.
67
+
68
+ ## Capability profile
69
+
70
+ | Field | Value |
71
+ |-------|-------|
72
+ | Tier | A |
73
+ | MCP | yes |
74
+ | Hooks | yes |
75
+ | Auto-approve | yes (`alwaysAllow` per server, `-y` per session) |
76
+ | Skills | yes |
77
+ | CLI spawnable | yes |
78
+ | Max concurrent tasks | 3 |
79
+ | Workflow model | interactive |
80
+ | MCP config scope | project |
81
+ | Prompt delivery | `inline_arg` (preferred, max 8000 chars), `inbox_structured` (fallback) |
82
+
83
+ ## Caveats
84
+
85
+ - **Hook support varies by platform**: Cline hooks are reliable on macOS/Linux but the Windows path is less exercised. brainclaw generates hooks that gracefully degrade when the runtime doesn't honour them — the templateTier stays A regardless.
86
+ - **Cline / Roo / Kilocode family**: Cline shares its config-pattern lineage with Roo Code and Kilocode. The directory names differ (`.clinerules/` vs `.roo/rules/` vs `.kilo/rules/`) but the auto-discovery model is the same.
87
+ - **Project-scoped MCP**: unlike machine-scoped agents (Cursor, Windsurf), Cline's MCP config lives in the repo. Each repo gets its own brainclaw registration.
88
+ - **Long prompts**: inline arg supports up to 8000 chars before falling back to inbox-structured delivery. Briefs longer than that should arrive via inbox.
@@ -1,23 +1,75 @@
1
- # Codex Integration
2
-
3
- brainclaw fits well with Codex-style workflows because Codex can work with project instructions, files, skills, and MCP.
4
-
5
- ## Auto-setup
6
-
7
- `brainclaw init` detects Codex (`~/.codex/` directory) and writes `AGENTS.md` automatically. Or manually:
8
-
9
- ```bash
10
- brainclaw export --format agents-md --write
11
- ```
12
-
13
- ## Recommended approach
14
-
15
- - use MCP as the default runtime path for fresh context, plans, claims, and runtime notes
16
- - keep `AGENTS.md` lightweight and behavioral: it should remind Codex how to use Brainclaw, not duplicate live state
17
- - use `.brainclaw/project.md` only as a readable fallback (derived view, regenerated best-effort — run `brainclaw rebuild` if stale)
18
- - encourage plans, claims, and handoffs during multi-step work
19
-
20
- ## Good role for brainclaw here
21
-
22
- Codex stays the coding agent.
23
- brainclaw provides the live workspace context and coordination layer.
1
+ # Codex Integration
2
+
3
+ brainclaw integrates with OpenAI's Codex CLI through MCP tools and shared instruction files. Codex is a Tier A agent — full MCP access, lifecycle hooks, skills support, and headless CLI spawn capability.
4
+
5
+ ## Auto-setup
6
+
7
+ `brainclaw init` detects Codex (the presence of `~/.codex/`) and writes `AGENTS.md` to the project root. The MCP server is registered machine-wide at `~/.codex/mcp-config.json`. To regenerate manually:
8
+
9
+ ```bash
10
+ brainclaw export --format agents-md --write
11
+ ```
12
+
13
+ ## MCP configuration
14
+
15
+ Codex reads MCP servers from a machine-level config (`~/.codex/mcp-config.json` on most installs). brainclaw is registered as:
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "brainclaw": {
21
+ "command": "npx",
22
+ "args": ["-y", "brainclaw@latest", "mcp"]
23
+ }
24
+ }
25
+ }
26
+ ```
27
+
28
+ Per-session MCP config can also be passed via `--additional-mcp-config @<file>` when invoking Codex.
29
+
30
+ ## Instruction files
31
+
32
+ - `AGENTS.md` — shared instruction file (also read by OpenCode)
33
+ - Static content stays behavioural and lightweight; live state (plans, claims, traps) flows through MCP
34
+
35
+ ## Headless invocation
36
+
37
+ Codex is CLI-spawnable for parallel lanes and dispatched workflows. The canonical invoke template is:
38
+
39
+ ```bash
40
+ codex exec -c approval_policy="never" --sandbox workspace-write "{prompt}"
41
+ ```
42
+
43
+ The `--sandbox workspace-write` setting is required, **not `read-only`** — the read-only sandbox blocks the MCP filesystem writes that brainclaw needs (worktree handoffs, session files, etc.) and forces fallback to GitHub connectors which fail for local-only commits.
44
+
45
+ ### Prompt delivery: stdin_pipe (preferred)
46
+
47
+ Since pln#475 (1.0.10+), Codex spawned as a child process receives its prompt via **stdin** rather than as an inline argument. The reason is Windows-specific: `codex.cmd` resolves through `cmd.exe`, where embedded backticks, `#`, or multi-line content can be mis-parsed and raise `unexpected argument`. Reading from stdin avoids that.
48
+
49
+ When you (or the dispatcher) calls Codex with no positional `[PROMPT]`, Codex reads stdin until EOF — that's where brainclaw pipes the brief. `inline_arg` remains a fallback for short prompts on POSIX.
50
+
51
+ ### Brief-ack handshake
52
+
53
+ Since pln#476 (1.0.13+), spawned Codex workers are marked `delivered_and_started` once the wrapping shell touches a brief-ack sentinel at `.brainclaw/coordination/runtime/ack/<assignmentId>.ack`. This proves the spawn actually executed and decouples the handshake from MCP availability inside the worker — important because Codex spawned in `--sandbox workspace-write` may not have brainclaw MCP wired in its session.
54
+
55
+ ## Capability profile
56
+
57
+ | Field | Value |
58
+ |-------|-------|
59
+ | Tier | A |
60
+ | MCP | yes |
61
+ | Hooks | yes |
62
+ | Auto-approve | manual (per-tool approval) |
63
+ | Skills | yes |
64
+ | CLI spawnable | yes |
65
+ | Max concurrent tasks | 5 |
66
+ | Workflow model | task-based (one-shot exec, not interactive) |
67
+ | MCP config scope | machine |
68
+ | Prompt delivery | `stdin_pipe` (preferred), `inline_arg` (fallback) |
69
+
70
+ ## Caveats
71
+
72
+ - **Sandbox blocks MCP writes**: when running with strict sandbox, the spawned Codex cannot write to `.brainclaw/` directly. Use the brief-ack file plus filesystem-direct candidate writes (the dispatcher harvests them).
73
+ - **Windows quoting**: long prompts containing backticks or `#` fail when passed as inline args through `cmd.exe`. The default stdin_pipe path avoids this.
74
+ - **Sandbox vs review parity**: review runs use the same `workspace-write` sandbox as execution runs (older templates forced `read-only` on reviews; that path blocked PowerShell exec on Windows).
75
+ - **No always-allow**: each MCP tool call still respects per-call approval policy unless explicitly set with `-c approval_policy="never"`.
@@ -0,0 +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,22 +1,80 @@
1
1
  # GitHub Copilot Integration
2
2
 
3
- brainclaw complements Copilot by making shared project context explicit and local.
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
4
 
5
5
  ## Auto-setup
6
6
 
7
- `brainclaw init` detects Copilot and writes `.github/copilot-instructions.md` automatically. Or manually:
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:
8
13
 
9
14
  ```bash
10
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
11
58
  ```
12
59
 
13
- ## Recommended approach
60
+ ## Capability profile
14
61
 
15
- - use MCP whenever the Copilot surface supports it for fresh context and coordination views
16
- - keep `.github/copilot-instructions.md` lightweight and behavioral
17
- - use `.brainclaw/project.md` as readable fallback (derived view, regenerated best-effort — may need `brainclaw rebuild` if stale)
18
- - use plans, claims, and handoffs to reduce ambiguity across sessions
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) |
19
74
 
20
- ## Why this matters
75
+ ## Caveats
21
76
 
22
- Copilot benefits from explicit project memory and shared coordination state instead of relying only on implicit memory features.
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.
@@ -0,0 +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.