brainclaw 0.19.14 → 0.21.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.
- package/README.md +27 -11
- package/dist/cli.js +11 -0
- package/dist/commands/context.js +3 -1
- package/dist/commands/export.js +44 -0
- package/dist/commands/init.js +7 -6
- package/dist/commands/mcp.js +86 -5
- package/dist/commands/setup.js +1 -0
- package/dist/commands/uninstall.js +145 -0
- package/dist/core/agent-capability.js +196 -0
- package/dist/core/agent-context.js +24 -6
- package/dist/core/agent-integrations.js +3 -0
- package/dist/core/ai-agent-detection.js +34 -19
- package/dist/core/bootstrap.js +177 -0
- package/dist/core/context.js +47 -24
- package/dist/core/instruction-templates.js +308 -0
- package/dist/core/schema.js +10 -0
- package/dist/core/setup-flow.js +191 -0
- package/dist/core/setup-state.js +30 -1
- package/dist/core/store-resolution.js +58 -0
- package/docs/architecture/project-refs.md +305 -0
- package/docs/cli.md +2 -1
- package/docs/integrations/agents.md +102 -150
- package/docs/integrations/openclaw.md +98 -0
- package/docs/integrations/overview.md +73 -45
- package/docs/quickstart.md +43 -147
- package/package.json +1 -1
|
@@ -1,182 +1,134 @@
|
|
|
1
|
-
# Agent Integration
|
|
2
|
-
|
|
3
|
-
## Core reality
|
|
4
|
-
|
|
5
|
-
No agent should be assumed to obey a single instruction perfectly every time.
|
|
6
|
-
|
|
7
|
-
That means brainclaw integration should not rely on only one mechanism such as:
|
|
8
|
-
|
|
9
|
-
- a single instruction file
|
|
10
|
-
- a single skill
|
|
11
|
-
- a single startup command
|
|
12
|
-
|
|
13
|
-
## Better approach
|
|
14
|
-
|
|
15
|
-
Use multiple points of contact:
|
|
16
|
-
|
|
17
|
-
- lightweight system instructions
|
|
18
|
-
- project-specific context retrieval through MCP when available
|
|
19
|
-
- prompt-ready generated context
|
|
20
|
-
- native agent files for local reminders
|
|
21
|
-
- MCP tools for dynamic state
|
|
22
|
-
- board and status views
|
|
23
|
-
- workflow reminders around plans, claims, and handoffs
|
|
24
|
-
|
|
25
|
-
## Surface hierarchy
|
|
26
|
-
|
|
27
|
-
The default order is:
|
|
28
|
-
|
|
29
|
-
1. MCP for live state
|
|
30
|
-
2. native agent files for local workflow guidance
|
|
31
|
-
3. readable files as fallback
|
|
32
|
-
4. CLI for setup, operator tasks, scripting, and fallback workflows
|
|
33
|
-
|
|
34
|
-
This keeps dynamic state dynamic instead of trying to encode it permanently into static instructions.
|
|
35
|
-
|
|
36
|
-
## System instructions vs project instructions
|
|
37
|
-
|
|
38
|
-
Keep these separate.
|
|
39
|
-
|
|
40
|
-
### System instructions
|
|
41
|
-
How the agent should use brainclaw.
|
|
42
|
-
|
|
43
|
-
Examples:
|
|
44
|
-
|
|
45
|
-
- check workspace memory before significant changes
|
|
46
|
-
- prefer MCP over manual CLI calls when MCP is available
|
|
47
|
-
- bootstrap if the workspace is not initialized and the workflow allows it
|
|
48
|
-
- respect file claims
|
|
49
|
-
- update shared plan status when appropriate
|
|
50
|
-
|
|
51
|
-
### Project instructions
|
|
52
|
-
What is true for the current workspace.
|
|
53
|
-
|
|
54
|
-
Examples:
|
|
55
|
-
|
|
56
|
-
- active constraints
|
|
57
|
-
- recent decisions
|
|
58
|
-
- known traps
|
|
59
|
-
- current handoffs
|
|
60
|
-
- relevant plan context
|
|
1
|
+
# Agent Integration
|
|
61
2
|
|
|
62
|
-
##
|
|
3
|
+
## The problem brainclaw solves for agents
|
|
63
4
|
|
|
64
|
-
|
|
5
|
+
Coding agents are stateless. Each session starts from zero. They don't know:
|
|
65
6
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
`setup` and `init` write the appropriate local agent config files for the detected integrations. Workspace-local generated files are also added to `.gitignore` automatically so agent-specific config does not pollute Git status.
|
|
7
|
+
- what other agents have been working on
|
|
8
|
+
- what files are being actively edited by someone else
|
|
9
|
+
- what decisions were made last week and why
|
|
10
|
+
- what traps to avoid in a specific part of the codebase
|
|
71
11
|
|
|
72
|
-
|
|
12
|
+
Brainclaw gives every agent access to this shared context through a combination of surfaces adapted to what each agent can handle.
|
|
73
13
|
|
|
74
|
-
|
|
75
|
-
brainclaw enable-agent claude-code
|
|
76
|
-
brainclaw enable-agent cursor
|
|
77
|
-
brainclaw enable-agent windsurf
|
|
78
|
-
brainclaw enable-agent opencode
|
|
79
|
-
brainclaw enable-agent antigravity
|
|
80
|
-
```
|
|
14
|
+
## Multiple points of contact
|
|
81
15
|
|
|
82
|
-
|
|
16
|
+
No single mechanism is enough. Agents don't always obey a single instruction file. They sometimes skip MCP calls. They forget between prompts.
|
|
83
17
|
|
|
84
|
-
|
|
85
|
-
brainclaw export --format claude-md --write
|
|
86
|
-
brainclaw export --format cursor-rules --write
|
|
87
|
-
brainclaw export --format agents-md --write # Codex, OpenCode
|
|
88
|
-
brainclaw export --format gemini-md --write # Antigravity / Gemini CLI
|
|
89
|
-
brainclaw export --format claude-md --write --shared # only if you want the main instruction file versioned
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
`--detect` auto-selects formats based on files found in the workspace:
|
|
18
|
+
That's why brainclaw uses every available surface:
|
|
93
19
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
If a repo already contains tracked local agent files from an older setup, `brainclaw session-start` warns at the beginning of work and `brainclaw doctor --fix-agent-ignore` can repair the missing `.gitignore` entries. Tracked files still need to be untracked manually with Git after the ignore rules are in place.
|
|
20
|
+
1. **Instruction files** set the frame — "this project uses brainclaw, here's how"
|
|
21
|
+
2. **Hooks** inject context automatically — the agent sees plans and claims without asking
|
|
22
|
+
3. **MCP tools** provide on-demand access — the agent calls brainclaw when it needs more detail
|
|
23
|
+
4. **Auto-approve** removes friction — no popup confirmation for each tool call
|
|
24
|
+
5. **Skills/commands** give the developer a manual override — force a context refresh when needed
|
|
101
25
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
The brainclaw MCP server exposes the dynamic Brainclaw workflow directly. For capable agents, this is the nominal runtime path.
|
|
26
|
+
The more surfaces are active, the more reliably the agent uses brainclaw.
|
|
105
27
|
|
|
106
|
-
|
|
28
|
+
## What the instruction file contains
|
|
107
29
|
|
|
108
|
-
|
|
109
|
-
brainclaw mcp
|
|
110
|
-
```
|
|
30
|
+
The instruction file (CLAUDE.md, .cursor/rules/, AGENTS.md, etc.) is the agent's first contact with brainclaw. Its content depends on the agent's capabilities:
|
|
111
31
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
### Available MCP tools
|
|
115
|
-
|
|
116
|
-
| Tool | Description |
|
|
117
|
-
|------|-------------|
|
|
118
|
-
| `bclaw_get_context` | Full workspace context (constraints, decisions, traps, plans, handoffs) |
|
|
119
|
-
| `bclaw_get_agent_board` | Live plan + claim board |
|
|
120
|
-
| `bclaw_session_start` | Start an agent session (registers identity) |
|
|
121
|
-
| `bclaw_session_end` | End session, optionally auto-release claims |
|
|
122
|
-
| `bclaw_claim` | Claim a file scope |
|
|
123
|
-
| `bclaw_release_claim` | Release a claim |
|
|
124
|
-
| `bclaw_create_candidate` | Create a plan item |
|
|
125
|
-
| `bclaw_accept` / `bclaw_reject` | Accept or reject a plan candidate |
|
|
126
|
-
| `bclaw_write_note` | Write a runtime note |
|
|
127
|
-
| `bclaw_search` | Search memory entries |
|
|
128
|
-
| `bclaw_read_handoff` | Read a handoff document |
|
|
129
|
-
| `bclaw_bootstrap` | Initialize the workspace if not already done |
|
|
130
|
-
| `bclaw_get_execution_context` | Get execution context (identity, claims, active plans) |
|
|
131
|
-
|
|
132
|
-
## Session lifecycle
|
|
133
|
-
|
|
134
|
-
### Starting a session
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
brainclaw session-start --agent my-agent --model claude-opus-4-5
|
|
138
|
-
```
|
|
32
|
+
### For agents with MCP and hooks (Claude Code)
|
|
139
33
|
|
|
140
|
-
|
|
34
|
+
Short and focused:
|
|
35
|
+
- Why brainclaw matters for this project
|
|
36
|
+
- The session protocol (hooks handle the rest)
|
|
37
|
+
- Active constraints and instructions
|
|
38
|
+
- Version check reminder
|
|
141
39
|
|
|
142
|
-
###
|
|
143
|
-
|
|
144
|
-
For MCP-capable agents, prefer the MCP equivalents of these actions. The CLI examples below are the operator and fallback form of the same lifecycle.
|
|
40
|
+
### For agents with MCP but no hooks (Cursor, Codex, OpenCode, etc.)
|
|
145
41
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
42
|
+
More directive:
|
|
43
|
+
- Same core sections as above, with stronger language ("REQUIRED", "MUST")
|
|
44
|
+
- The top 5 most critical traps (the agent won't see them otherwise)
|
|
45
|
+
- Explicit step-by-step protocol with all MCP calls listed
|
|
46
|
+
|
|
47
|
+
### For agents without MCP (Copilot)
|
|
48
|
+
|
|
49
|
+
Full static context:
|
|
50
|
+
- All of the above
|
|
51
|
+
- Active plans with status and assignees
|
|
52
|
+
- All shared traps
|
|
53
|
+
- Recent architectural decisions
|
|
54
|
+
|
|
55
|
+
## Setting up agent integration
|
|
153
56
|
|
|
154
|
-
###
|
|
57
|
+
### Automatic (recommended)
|
|
155
58
|
|
|
156
59
|
```bash
|
|
157
|
-
brainclaw
|
|
60
|
+
brainclaw setup # machine-level: detects agents, creates global configs
|
|
61
|
+
brainclaw init # project-level: creates .brainclaw/, writes agent files
|
|
158
62
|
```
|
|
159
63
|
|
|
160
|
-
|
|
64
|
+
Or ask your coding agent to do it:
|
|
161
65
|
|
|
162
|
-
|
|
66
|
+
```
|
|
67
|
+
"Install and initialize brainclaw in this project"
|
|
68
|
+
```
|
|
163
69
|
|
|
164
|
-
|
|
70
|
+
The agent can use `bclaw_setup` to walk through the process interactively.
|
|
165
71
|
|
|
166
|
-
|
|
72
|
+
### Per-agent manual setup
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
brainclaw enable-agent claude-code
|
|
76
|
+
brainclaw enable-agent cursor
|
|
77
|
+
brainclaw export --format claude-md --write
|
|
78
|
+
brainclaw export --detect --write # auto-detect and write all formats
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Regenerating after changes
|
|
82
|
+
|
|
83
|
+
When brainclaw memory changes (new constraints, resolved traps, updated plans), regenerate instruction files:
|
|
167
84
|
|
|
168
85
|
```bash
|
|
169
86
|
brainclaw export --detect --write
|
|
170
87
|
```
|
|
171
88
|
|
|
89
|
+
For agents without MCP (Copilot), this is especially important — the instruction file is their only source of project context.
|
|
90
|
+
|
|
91
|
+
## Generated files are local
|
|
92
|
+
|
|
93
|
+
Agent config files generated by brainclaw are **not committed to Git**. Each developer regenerates them locally from the shared `.brainclaw/` store.
|
|
94
|
+
|
|
172
95
|
This ensures:
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
-
|
|
96
|
+
- No machine-specific traps leak into the shared repo
|
|
97
|
+
- Each developer's agent sees instructions tailored to their setup
|
|
98
|
+
- Instructions stay in sync with current memory, not a stale committed version
|
|
99
|
+
|
|
100
|
+
brainclaw adds all generated files to `.gitignore` automatically during init.
|
|
101
|
+
|
|
102
|
+
Exception: use `--shared` if you intentionally want the main instruction file (e.g., CLAUDE.md) versioned for the whole team.
|
|
103
|
+
|
|
104
|
+
## Session lifecycle
|
|
105
|
+
|
|
106
|
+
### Starting work
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
bclaw_session_start → identify yourself, see the board
|
|
110
|
+
bclaw_get_context(target: "src/auth/") → load relevant memory
|
|
111
|
+
bclaw_get_execution_context → check for brainclaw updates
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### During work
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
bclaw_claim(scope: "src/auth/") → signal what you're editing
|
|
118
|
+
bclaw_write_note("Found a race condition in AuthService") → record observations
|
|
119
|
+
bclaw_create_plan("Fix race condition", estimate: 30) → track work
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Finishing work
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
bclaw_session_end(auto_release: true) → release claims, update plans
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Plans and estimation
|
|
176
129
|
|
|
177
|
-
|
|
130
|
+
Always estimate duration in minutes when creating a plan or step. When completing, report actual effort. This builds a calibration history that helps improve future estimates — agents are typically poor at estimation, and this feedback loop helps.
|
|
178
131
|
|
|
179
|
-
##
|
|
132
|
+
## Version awareness
|
|
180
133
|
|
|
181
|
-
|
|
182
|
-
The goal is to make brainclaw the natural path for fresh workspace context and coordination.
|
|
134
|
+
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.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# OpenClaw Integration
|
|
2
|
+
|
|
3
|
+
## Why brainclaw for OpenClaw users
|
|
4
|
+
|
|
5
|
+
OpenClaw's built-in memory (`MEMORY.md` + daily logs) is great for personal notes and preferences, but it doesn't distinguish between different types of project knowledge. After many conversations, constraints get buried, decisions lose their reasoning, and the agent drifts from its original instructions.
|
|
6
|
+
|
|
7
|
+
brainclaw adds a structured memory layer on top:
|
|
8
|
+
|
|
9
|
+
| Problem | OpenClaw alone | With brainclaw |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| "Don't deploy on Friday" gets forgotten | Buried in MEMORY.md after 50 conversations | Stored as a constraint, always visible |
|
|
12
|
+
| Agent repeats a known mistake | No trap system | Traps scored by relevance to current scope |
|
|
13
|
+
| Two agents work on same file | No coordination | Claims prevent collisions |
|
|
14
|
+
| Decision reasoning is lost | Mixed with daily notes | Preserved as typed decisions, searchable |
|
|
15
|
+
|
|
16
|
+
## How it works
|
|
17
|
+
|
|
18
|
+
brainclaw integrates as an OpenClaw **skill**. The skill instructs the agent to:
|
|
19
|
+
|
|
20
|
+
1. Load brainclaw project context before any coding work
|
|
21
|
+
2. Record constraints, traps, and decisions in brainclaw (not MEMORY.md)
|
|
22
|
+
3. Keep MEMORY.md for personal preferences and daily observations
|
|
23
|
+
4. Coordinate with other agents through plans and claims
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
### Prerequisites
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install -g brainclaw
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Install the skill
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
brainclaw enable-agent openclaw
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
This copies the brainclaw skill to `~/.openclaw/workspace/skills/brainclaw/`.
|
|
40
|
+
|
|
41
|
+
Or manually:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
mkdir -p ~/.openclaw/workspace/skills/brainclaw
|
|
45
|
+
cp "$(npm root -g)/brainclaw/skills/openclaw/SKILL.md" ~/.openclaw/workspace/skills/brainclaw/
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Initialize a project
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
cd /path/to/your/project
|
|
52
|
+
brainclaw init
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Restart OpenClaw
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
/new
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
or restart the Gateway. The brainclaw skill will be loaded automatically.
|
|
62
|
+
|
|
63
|
+
## What the agent sees
|
|
64
|
+
|
|
65
|
+
After installation, your OpenClaw agent will:
|
|
66
|
+
|
|
67
|
+
- Run `brainclaw context` before project work to load constraints, traps, and plans
|
|
68
|
+
- Record rules you give it as brainclaw constraints (not just MEMORY.md entries)
|
|
69
|
+
- Record problems it discovers as traps (with severity)
|
|
70
|
+
- Log architectural decisions with their reasoning
|
|
71
|
+
- Clean up with `brainclaw session-end` when finished
|
|
72
|
+
|
|
73
|
+
## Memory split
|
|
74
|
+
|
|
75
|
+
The brainclaw skill establishes a clear split:
|
|
76
|
+
|
|
77
|
+
- **MEMORY.md** — your preferences, habits, personal context (OpenClaw manages this)
|
|
78
|
+
- **brainclaw** — project constraints, traps, decisions, plans (shared with all agents)
|
|
79
|
+
|
|
80
|
+
This means if you switch from OpenClaw to Claude Code or Codex for coding, the project memory follows — it's in `.brainclaw/`, not in `~/.openclaw/`.
|
|
81
|
+
|
|
82
|
+
## Multi-agent coordination
|
|
83
|
+
|
|
84
|
+
If you use both OpenClaw and a coding agent (Claude Code, Cursor, etc.) on the same project, brainclaw coordinates between them:
|
|
85
|
+
|
|
86
|
+
- OpenClaw records a constraint → Claude Code sees it at next session
|
|
87
|
+
- Claude Code claims a file scope → OpenClaw knows not to edit there
|
|
88
|
+
- Either agent creates a plan → both see it in their context
|
|
89
|
+
|
|
90
|
+
## Profile
|
|
91
|
+
|
|
92
|
+
When loading context for OpenClaw, use the `openclaw` profile for optimized scoring:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
brainclaw context --profile openclaw
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
This boosts constraints, handoffs, and runtime notes — the items most relevant to an agent that might not be editing code directly but needs to understand the project state.
|
|
@@ -1,74 +1,102 @@
|
|
|
1
1
|
# Integration Overview
|
|
2
2
|
|
|
3
|
-
Brainclaw
|
|
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
|
-
|
|
5
|
+
## How agents connect to brainclaw
|
|
6
6
|
|
|
7
|
-
|
|
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
|
-
|
|
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
|
-
|
|
17
|
+
## What goes where: core vs run
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
Instruction files contain **core** content — things that don't change between prompts:
|
|
16
20
|
|
|
17
|
-
|
|
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
|
-
|
|
26
|
+
Everything else is **run** content — it changes constantly and belongs in the dynamic context delivered through MCP or hooks:
|
|
20
27
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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
|
-
|
|
36
|
+
## Three levels of integration
|
|
32
37
|
|
|
33
|
-
|
|
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
|
-
|
|
40
|
+
### Full integration (MCP + hooks)
|
|
40
41
|
|
|
41
|
-
|
|
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
|
-
|
|
44
|
+
**Today:** Claude Code
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
- live board state
|
|
47
|
-
- current claims
|
|
48
|
-
- recent runtime notes
|
|
49
|
-
- current handoffs
|
|
46
|
+
### Standard integration (MCP, no hooks)
|
|
50
47
|
|
|
51
|
-
|
|
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
|
-
|
|
50
|
+
**Today:** Cursor, Windsurf, Cline, Roo, Continue, OpenCode, Codex, Antigravity/Gemini CLI
|
|
54
51
|
|
|
55
|
-
|
|
52
|
+
### Limited integration (no MCP)
|
|
56
53
|
|
|
57
|
-
|
|
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
|
-
|
|
56
|
+
**Today:** GitHub Copilot (uses skills as a partial workaround)
|
|
60
57
|
|
|
61
|
-
|
|
62
|
-
brainclaw export --detect --write
|
|
63
|
-
```
|
|
58
|
+
## Agent integration matrix
|
|
64
59
|
|
|
65
|
-
|
|
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 |
|
|
72
|
+
| **OpenClaw** | — | — | — | — | ✔ brainclaw skill |
|
|
66
73
|
|
|
67
|
-
|
|
74
|
+
**Legend:** ✔ = fully supported, ◐ = partial (static trigger, not dynamic injection), — = not available
|
|
68
75
|
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
## Why maximum integration by default
|
|
77
|
+
|
|
78
|
+
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.
|
|
79
|
+
|
|
80
|
+
That's why brainclaw activates **all available surfaces** by default during setup:
|
|
81
|
+
|
|
82
|
+
- The MCP server and instruction file are always configured (non-negotiable)
|
|
83
|
+
- Auto-approve and hooks are enabled where supported (opt-out possible)
|
|
84
|
+
- The instruction file includes a "why this matters" section so the agent understands why it should care
|
|
85
|
+
|
|
86
|
+
The developer can dial back individual surfaces if needed, but the default is full integration because that's what works.
|
|
87
|
+
|
|
88
|
+
## Sequential collaboration, not parallel editing
|
|
89
|
+
|
|
90
|
+
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.
|
|
91
|
+
|
|
92
|
+
Running multiple agents in parallel on the same checkout will create conflicts. Git worktree isolation per agent is planned but not yet available.
|
|
93
|
+
|
|
94
|
+
## Next reads
|
|
95
|
+
|
|
96
|
+
- [mcp.md](mcp.md) — the dynamic runtime path for capable agents
|
|
97
|
+
- [agents.md](agents.md) — integration principles and setup details
|
|
71
98
|
- [claude-code.md](claude-code.md)
|
|
72
|
-
- [codex.md](codex.md)
|
|
73
99
|
- [cursor.md](cursor.md)
|
|
100
|
+
- [codex.md](codex.md)
|
|
74
101
|
- [copilot.md](copilot.md)
|
|
102
|
+
- [openclaw.md](openclaw.md)
|