brainclaw 0.19.14 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,74 +1,100 @@
1
1
  # Integration Overview
2
2
 
3
- Brainclaw is designed to work with existing coding agents, not replace them.
3
+ Brainclaw works alongside your existing coding agents. It does not replace them — it gives them a shared memory and coordination layer they can all read from and write to.
4
4
 
5
- The key integration rule is simple:
5
+ ## How agents connect to brainclaw
6
6
 
7
- 1. use MCP for dynamic shared state when the agent supports it
8
- 2. use native agent files for local behavioral guidance
9
- 3. use the CLI for setup, operator workflows, scripting, and fallback access
7
+ Brainclaw reaches each agent through multiple surfaces. Not every agent supports every surface, and that's fine — brainclaw adapts what it writes based on what the agent can handle.
10
8
 
11
- ## Current Limitation
9
+ | Surface | What it does | When it activates |
10
+ |---|---|---|
11
+ | **MCP tools** | The agent calls brainclaw directly to read context, create plans, claim files, and coordinate. This is the richest integration. | During every prompt, when the agent decides to call a tool |
12
+ | **Instruction file** | A markdown file in the agent's native format that explains how to use brainclaw and lists active project constraints. | Read once at session start |
13
+ | **Hooks** | Brainclaw injects fresh context into the agent's prompt automatically, without the agent asking. | Every prompt (where supported) |
14
+ | **Auto-approve** | MCP tool calls are pre-approved so the agent doesn't have to ask the developer for permission each time. | Every MCP call (where supported) |
15
+ | **Skills / Commands** | A shortcut the developer can trigger manually to refresh brainclaw context. | On demand |
12
16
 
13
- For now, Brainclaw should be used for sequential multi-agent collaboration, not true parallel editing in the same checkout.
17
+ ## What goes where: core vs run
14
18
 
15
- One agent can hand work to another, and the next agent can recover good project context through shared memory, plans, claims, and handoffs. But without dedicated Git worktrees per agent/session, running several coding agents concurrently on the same project checkout is still risky and can create conflicts or unstable local state.
19
+ Instruction files contain **core** content things that don't change between prompts:
16
20
 
17
- ## Integration Surfaces
21
+ - Why brainclaw matters for this project
22
+ - The session protocol (what to call and when)
23
+ - Active constraints
24
+ - Project instructions
18
25
 
19
- brainclaw can integrate through several surfaces, but they do not have the same role.
26
+ Everything else is **run** content it changes constantly and belongs in the dynamic context delivered through MCP or hooks:
20
27
 
21
- | Surface | Role |
22
- |---|---|
23
- | **MCP tools** | primary dynamic access path for context, plans, claims, board views, and runtime writes |
24
- | **Native agent files** | local guidance in the agent's own surface: `CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, `.cursor/rules/brainclaw.md`, `.windsurfrules`, etc. |
25
- | **Readable files** | fallback readable state such as `.brainclaw/project.md` |
26
- | **CLI commands** | setup, scripting, release, inspection, and fallback workflows |
27
- | **System/project instructions** | static reminders about how Brainclaw should be used in this workspace |
28
+ - Active plans and their status
29
+ - Who is working where (claims)
30
+ - Known traps (scored by relevance to the current file)
31
+ - Handoffs between agents
32
+ - Runtime notes
28
33
 
29
- ## Recommended Pattern
34
+ This separation keeps instruction files clean and focused. The agent gets the stable rules from the file and the live state from MCP.
30
35
 
31
- A good default pattern is:
36
+ ## Three levels of integration
32
37
 
33
- 1. give the agent lightweight static instructions about how to use Brainclaw
34
- 2. let it retrieve fresh workspace state through MCP before significant edits
35
- 3. rely on plans, claims, and handoffs during execution
36
- 4. keep native files and readable project state available as fallback context
37
- 5. use hooks or repeated reminders where the host surface supports them
38
+ Brainclaw adapts its instruction file content based on what each agent can do:
38
39
 
39
- ## Native Files Are Support, Not The Live Source Of Truth
40
+ ### Full integration (MCP + hooks)
40
41
 
41
- Generated files such as `CLAUDE.md` or `.cursor/rules/brainclaw.md` are useful because they keep Brainclaw visible inside the agent surface already in use.
42
+ The agent gets dynamic context injected at every prompt. The instruction file can be lightweight just the protocol and constraints. Everything else comes through hooks and MCP calls.
42
43
 
43
- They are not meant to replace:
44
+ **Today:** Claude Code
44
45
 
45
- - fresh context retrieval
46
- - live board state
47
- - current claims
48
- - recent runtime notes
49
- - current handoffs
46
+ ### Standard integration (MCP, no hooks)
50
47
 
51
- For those, use MCP when available.
48
+ The agent can call brainclaw tools but doesn't get automatic context injection. The instruction file is more directive — it tells the agent it MUST call specific tools before working, and includes the most critical traps statically.
52
49
 
53
- ## Getting The Native File Written Automatically
50
+ **Today:** Cursor, Windsurf, Cline, Roo, Continue, OpenCode, Codex, Antigravity/Gemini CLI
54
51
 
55
- Run `brainclaw init` and Brainclaw will detect the current agent surface and write the appropriate local file automatically.
52
+ ### Limited integration (no MCP)
56
53
 
57
- That includes OpenCode (`AGENTS.md` + `opencode.json`) and Antigravity/Gemini CLI (`GEMINI.md` + machine-local MCP config) when those environments are present.
54
+ The agent cannot call brainclaw tools at all. The instruction file becomes the only source of project context, so it includes everything: constraints, traps, active plans, recent decisions.
58
55
 
59
- Or at any time:
56
+ **Today:** GitHub Copilot (uses skills as a partial workaround)
60
57
 
61
- ```bash
62
- brainclaw export --detect --write
63
- ```
58
+ ## Agent integration matrix
64
59
 
65
- By default, generated workspace files are treated as local setup and added to `.gitignore`. `--shared` should only be used when you intentionally want the main exported instruction file to be versioned.
60
+ | Agent | MCP | Instruction file | Hooks | Auto-approve | Skills |
61
+ |---|---|---|---|---|---|
62
+ | **Claude Code** | ✔ project + global | CLAUDE.md | ✔ pre-prompt + stop | ✔ permissions | ✔ /brainclaw |
63
+ | **Cursor** | ✔ global | .cursor/rules/ + MDC | ◐ alwaysApply MDC | — | — |
64
+ | **Windsurf** | ✔ global | .windsurfrules | ◐ session trigger | — | — |
65
+ | **Cline** | ✔ project | .clinerules/ | — | ✔ autoApprove | — |
66
+ | **Roo** | ✔ project | .roo/rules/ | — | ✔ alwaysAllow | — |
67
+ | **Continue** | ✔ both | .continue/rules/ | — | — | — |
68
+ | **OpenCode** | ✔ project | AGENTS.md | — | — | — |
69
+ | **Codex** | ✔ global | AGENTS.md | — | — | — |
70
+ | **Gemini CLI** | ✔ global | GEMINI.md | — | — | — |
71
+ | **Copilot** | — | .github/copilot-instructions.md | — | — | ✔ brainclaw-context |
66
72
 
67
- ## Choose Your Next Page
73
+ **Legend:** = fully supported, ◐ = partial (static trigger, not dynamic injection), — = not available
68
74
 
69
- - [mcp.md](mcp.md) the nominal path for capable agents
70
- - [agents.md](agents.md) — integration principles that apply to every agent
75
+ ## Why maximum integration by default
76
+
77
+ Without active pressure, agents ignore brainclaw. This is a consistent finding from real usage: if brainclaw only declares an MCP server and doesn't push the agent to use it, the agent never calls it.
78
+
79
+ That's why brainclaw activates **all available surfaces** by default during setup:
80
+
81
+ - The MCP server and instruction file are always configured (non-negotiable)
82
+ - Auto-approve and hooks are enabled where supported (opt-out possible)
83
+ - The instruction file includes a "why this matters" section so the agent understands why it should care
84
+
85
+ The developer can dial back individual surfaces if needed, but the default is full integration because that's what works.
86
+
87
+ ## Sequential collaboration, not parallel editing
88
+
89
+ For now, brainclaw works best when one agent works at a time in a given checkout. The next agent can pick up where the previous one stopped, using shared plans, claims, handoffs, and memory.
90
+
91
+ Running multiple agents in parallel on the same checkout will create conflicts. Git worktree isolation per agent is planned but not yet available.
92
+
93
+ ## Next reads
94
+
95
+ - [mcp.md](mcp.md) — the dynamic runtime path for capable agents
96
+ - [agents.md](agents.md) — integration principles and setup details
71
97
  - [claude-code.md](claude-code.md)
72
- - [codex.md](codex.md)
73
98
  - [cursor.md](cursor.md)
99
+ - [codex.md](codex.md)
74
100
  - [copilot.md](copilot.md)
@@ -1,189 +1,85 @@
1
1
  # Quickstart
2
2
 
3
- This guide is organized by entry path, because Brainclaw serves different surfaces with different roles.
3
+ ## The fastest way to start
4
4
 
5
- Use this rule first:
5
+ Ask your coding agent:
6
6
 
7
- - capable agent with MCP support: prefer MCP for dynamic state
8
- - agent surface driven mainly by local instruction files: use generated native files plus CLI fallback
9
- - human operator or maintainer: use the CLI directly
7
+ > "Install brainclaw and initialize it in this project."
10
8
 
11
- ## Important limitation for now
9
+ The agent will run `brainclaw setup` and `brainclaw init`, detect your environment, write the right config files, and activate MCP. After reloading, brainclaw tools become available.
12
10
 
13
- Do not run multiple coding agents in parallel on the same project checkout yet.
14
-
15
- Brainclaw is already useful for sequential collaboration: one agent can pick up where another stopped, inspect shared context, and continue from explicit plans, claims, traps, and handoffs. But until Brainclaw supports dedicated Git worktrees per agent/session, parallel edits in the same checkout are still likely to create more Git and workspace problems than they solve.
16
-
17
- For now, prefer:
18
-
19
- 1. one active editing agent per checkout
20
- 2. explicit handoffs between agents
21
- 3. claims and context to keep continuity between sessions
22
-
23
- ## Path 1: Agent-First With MCP
24
-
25
- Use this path when the agent can call Brainclaw through MCP.
26
-
27
- ### Operator bootstrap
11
+ If you prefer doing it manually:
28
12
 
29
13
  ```bash
30
- brainclaw setup --yes
14
+ npm install -g brainclaw
31
15
  brainclaw init
32
16
  ```
33
17
 
34
- `setup` installs machine-level prerequisites and agent integrations. `init` creates the workspace state, seeds stable identity, and prepares the project memory structure.
18
+ `init` creates the user store if needed (no separate `setup` step required), initializes the project, detects your agent, and writes all integration files.
35
19
 
36
- ### Agent runtime pattern
20
+ ## What happens after init
37
21
 
38
- After the workspace is initialized, the nominal flow is:
22
+ Once initialized, your agent can:
39
23
 
40
- ```text
41
- bclaw_session_start -> open a session and return current board/context
42
- bclaw_get_execution_context -> inspect local tooling and notice package updates
43
- bclaw_get_context -> fetch fresh prompt-ready context for the target path
44
- bclaw_list_plans -> inspect active work
45
- bclaw_claim -> claim scope before editing
46
- bclaw_write_note -> record runtime observations
47
- bclaw_session_end -> close session cleanly and hand work off
48
- ```
49
-
50
- Use native agent files such as `AGENTS.md`, `CLAUDE.md`, or Cursor rules as local workflow guidance, not as the only source of live state.
51
-
52
- Unless the project overrides `brainclaw_update_source`, `bclaw_get_execution_context` checks the public npm `latest` channel so the agent can notice when a newer Brainclaw release is available.
24
+ 1. **See project context** — constraints, decisions, traps, plans, handoffs
25
+ 2. **Coordinate with other agents** claim files before editing, check who's working where
26
+ 3. **Build shared memory** record observations, create plans, track work
27
+ 4. **Resume across sessions** the next agent (or the same one tomorrow) picks up where you left off
53
28
 
54
- ## Path 2: CLI-Oriented Agent Or Fallback Workflow
29
+ ## For agents with MCP (most agents)
55
30
 
56
- Use this path when the agent does not have a good MCP integration yet, or when a human needs to drive the workflow directly.
31
+ This is the primary path. The agent calls brainclaw tools directly.
57
32
 
58
- ### Bootstrap and inspect
59
-
60
- ```bash
61
- brainclaw setup --yes
62
- brainclaw init
63
- brainclaw export --detect --write
33
+ ```text
34
+ bclaw_session_start → identify yourself, see the board
35
+ bclaw_get_context → load relevant memory for your target scope
36
+ bclaw_claim → signal what you're about to edit
37
+ bclaw_write_note → record observations during work
38
+ bclaw_session_end → clean up claims and update plans
64
39
  ```
65
40
 
66
- ### Record the first important facts
67
-
68
- ```bash
69
- brainclaw memory create decision "OAuth migration now goes through auth-gateway" --tag auth
70
- brainclaw memory create constraint "Payments module frozen until 2026-04-01" --tag payments
71
- brainclaw memory create trap "Checkout E2E tests are flaky on Windows" --severity high --tag tests
72
- ```
41
+ Instruction files like `CLAUDE.md` or `.cursor/rules/brainclaw.md` provide the protocol and constraints. The live state (plans, claims, traps) comes through MCP.
73
42
 
74
- ### Create and claim work
43
+ ## For agents without MCP (Copilot)
75
44
 
76
- ```bash
77
- brainclaw plan create "Coordinate auth rollout" --priority high
78
- brainclaw claim create "Take auth rollout" --scope src/auth/
79
- ```
45
+ The instruction file (`.github/copilot-instructions.md`) contains everything: constraints, active plans, traps, and decisions. Use the brainclaw-context skill to refresh.
80
46
 
81
- ### Refresh context before edits
47
+ Regenerate the instruction file when project memory changes:
82
48
 
83
49
  ```bash
84
- brainclaw context --for src/auth/routes.ts --digest
85
- brainclaw status
50
+ brainclaw export --detect --write
86
51
  ```
87
52
 
88
- Claims reduce collisions, but they are not a substitute for isolated worktrees yet. Use them mainly to coordinate sequential work or human/agent awareness in the same repo.
89
-
90
- ## Path 2.5: Desktop AI Work Surfaces Around The Repo
91
-
92
- Use this path when the active coding agent should stay focused on code, but the project could benefit from another local AI surface on the same machine, such as ChatGPT Desktop or Claude Desktop.
93
-
94
- Typical use cases:
95
-
96
- - visual asset generation
97
- - polished copy or release-note drafting
98
- - synthesis for operators or stakeholders
99
- - side research that should not consume the coding agent's main context window
53
+ ## Onboarding an existing project
100
54
 
101
- ### Discover what is available on the machine
55
+ If the repo already has code, brainclaw can extract context from it:
102
56
 
103
57
  ```bash
104
- brainclaw machine-profile --refresh
58
+ brainclaw bootstrap --json # see what brainclaw detected
59
+ brainclaw bootstrap --apply # import into memory
105
60
  ```
106
61
 
107
- ### Queue work for another local AI surface
62
+ Or let your agent drive the conversation — it can call `bclaw_bootstrap`, review the detected signals, ask you about gaps, and structure the results into brainclaw memory.
108
63
 
109
- ```bash
110
- brainclaw surface-task create "Generate homepage hero visual" \
111
- --target chatgpt \
112
- --kind visual_asset \
113
- --instructions "Create a lightweight product hero visual for the landing page." \
114
- --output assets/hero-home.png \
115
- --path src/pages/Home.tsx
116
- ```
64
+ ## Desktop AI surfaces
117
65
 
118
- ### Review queued work later
66
+ brainclaw can also track work for desktop AI tools on your machine (ChatGPT Desktop, Claude Desktop, Gemini CLI) as a project-scoped task queue:
119
67
 
120
68
  ```bash
69
+ brainclaw surface-task create "Generate hero visual" --target chatgpt --kind visual_asset
121
70
  brainclaw surface-task list
122
- brainclaw surface-task list --all --target chatgpt
123
- ```
124
-
125
- This queue does not automate the target desktop app yet. It gives the project a clean place to stage work that another local AI surface should pick up during its next session.
126
-
127
- ## Path 3: Brownfield Onboarding
128
-
129
- Use this path when you are adopting Brainclaw into an existing workspace and do not want to hand-author all memory from scratch.
130
-
131
- ### Build the initial bootstrap view
132
-
133
- ```bash
134
- brainclaw setup --yes
135
- brainclaw init
136
- brainclaw bootstrap --json
137
- ```
138
-
139
- ### Fill the gaps
140
-
141
- ```bash
142
- brainclaw bootstrap --interview --audience cli
143
- brainclaw bootstrap --interview --audience ide_chat
144
- ```
145
-
146
- Use the returned question IDs to prepare a small JSON answers file when the interview needs to confirm durable memory:
147
-
148
- ```json
149
- [
150
- {
151
- "question_id": "biq_example",
152
- "response_items": ["Use agents sequentially in one checkout."],
153
- "suggestions": []
154
- }
155
- ]
156
- ```
157
-
158
- Preview the enriched import proposal:
159
-
160
- ```bash
161
- brainclaw bootstrap --answers-file ./bootstrap-answers.json --json
162
- ```
163
-
164
- ### Apply or rollback managed imports
165
-
166
- ```bash
167
- brainclaw bootstrap --answers-file ./bootstrap-answers.json --apply
168
- brainclaw bootstrap --uninstall
169
71
  ```
170
72
 
171
- Use this path when the repo already has native instruction files, partial docs, or conventions that Brainclaw should adopt selectively instead of replacing blindly.
73
+ This keeps non-code work visible to the project without overloading the active coding agent.
172
74
 
173
- ## Recommended First Workflow
75
+ ## Important: one agent at a time
174
76
 
175
- 1. initialize the workspace
176
- 2. choose the correct entry path for your surface
177
- 3. record or import 3-5 high-signal facts
178
- 4. create one shared plan
179
- 5. claim scope before editing
180
- 6. refresh context before significant edits
181
- 7. hand off explicitly when switching between agents
77
+ For now, use brainclaw for sequential collaboration. One agent works, finishes, and the next one picks up from shared context. Running multiple agents in parallel on the same checkout will cause conflicts.
182
78
 
183
- ## Next Reads
79
+ ## Next reads
184
80
 
185
- - [integrations/overview.md](integrations/overview.md) — integration model by surface
186
- - [integrations/mcp.md](integrations/mcp.md) — nominal dynamic path for capable agents
187
- - [cli.md](cli.md) — operator and fallback reference
188
- - [concepts/memory.md](concepts/memory.md)
189
- - [concepts/plans-and-claims.md](concepts/plans-and-claims.md)
81
+ - [integrations/overview.md](integrations/overview.md) — how brainclaw adapts to each agent
82
+ - [integrations/mcp.md](integrations/mcp.md) — the dynamic runtime path
83
+ - [concepts/memory.md](concepts/memory.md) — what project memory includes
84
+ - [concepts/plans-and-claims.md](concepts/plans-and-claims.md) — coordination layer
85
+ - [cli.md](cli.md) — full CLI reference
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brainclaw",
3
- "version": "0.19.14",
3
+ "version": "0.20.0",
4
4
  "description": "Shared project memory for humans and coding agents.",
5
5
  "type": "module",
6
6
  "bin": {