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
package/docs/quickstart.md
CHANGED
|
@@ -1,189 +1,85 @@
|
|
|
1
1
|
# Quickstart
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## The fastest way to start
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Ask your coding agent:
|
|
6
6
|
|
|
7
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
14
|
+
npm install -g brainclaw
|
|
31
15
|
brainclaw init
|
|
32
16
|
```
|
|
33
17
|
|
|
34
|
-
`
|
|
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
|
-
|
|
20
|
+
## What happens after init
|
|
37
21
|
|
|
38
|
-
|
|
22
|
+
Once initialized, your agent can:
|
|
39
23
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
##
|
|
29
|
+
## For agents with MCP (most agents)
|
|
55
30
|
|
|
56
|
-
|
|
31
|
+
This is the primary path. The agent calls brainclaw tools directly.
|
|
57
32
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
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
|
-
|
|
43
|
+
## For agents without MCP (Copilot)
|
|
75
44
|
|
|
76
|
-
|
|
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
|
-
|
|
47
|
+
Regenerate the instruction file when project memory changes:
|
|
82
48
|
|
|
83
49
|
```bash
|
|
84
|
-
brainclaw
|
|
85
|
-
brainclaw status
|
|
50
|
+
brainclaw export --detect --write
|
|
86
51
|
```
|
|
87
52
|
|
|
88
|
-
|
|
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
|
-
|
|
55
|
+
If the repo already has code, brainclaw can extract context from it:
|
|
102
56
|
|
|
103
57
|
```bash
|
|
104
|
-
brainclaw
|
|
58
|
+
brainclaw bootstrap --json # see what brainclaw detected
|
|
59
|
+
brainclaw bootstrap --apply # import into memory
|
|
105
60
|
```
|
|
106
61
|
|
|
107
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
73
|
+
This keeps non-code work visible to the project without overloading the active coding agent.
|
|
172
74
|
|
|
173
|
-
##
|
|
75
|
+
## Important: one agent at a time
|
|
174
76
|
|
|
175
|
-
|
|
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
|
|
79
|
+
## Next reads
|
|
184
80
|
|
|
185
|
-
- [integrations/overview.md](integrations/overview.md) —
|
|
186
|
-
- [integrations/mcp.md](integrations/mcp.md) —
|
|
187
|
-
- [
|
|
188
|
-
- [concepts/
|
|
189
|
-
- [
|
|
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
|