project-brain 0.13.0 → 0.15.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 +31 -11
- package/package.json +10 -6
- package/templates/model-routing.claude.md +9 -0
package/README.md
CHANGED
|
@@ -86,20 +86,24 @@ Once connected over MCP, AI assistants get these tools. The server also injects
|
|
|
86
86
|
|
|
87
87
|
### Lexical (keyword — no embeddings needed)
|
|
88
88
|
|
|
89
|
-
| Tool | What it does |
|
|
90
|
-
|
|
91
|
-
| `search_code` | Exact/keyword full-text search (BM25) over indexed code — identifiers, error strings, exact phrases. Works offline without Ollama. Not regex. |
|
|
89
|
+
| Tool | CLI | What it does |
|
|
90
|
+
|---|---|---|
|
|
91
|
+
| `search_code` | `project-brain code "<query>" [--limit N]` | Exact/keyword full-text search (BM25) over indexed code — identifiers, error strings, exact phrases. Works offline without Ollama. Not regex. |
|
|
92
92
|
|
|
93
93
|
### Structural (AST graph — exact, no embeddings needed)
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
|
98
|
-
|
|
99
|
-
| `
|
|
100
|
-
| `
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
95
|
+
Every structural tool is also a native CLI command — reusable without an MCP client, and even more offline than the MCP path (no Ollama probe, reads the local `graph.db` directly):
|
|
96
|
+
|
|
97
|
+
| Tool | CLI | What it does |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| `find_symbol` | `project-brain find <name>` | Exact symbol definition(s) by name: path, line range, kind, signature. Use when you know the name. |
|
|
100
|
+
| `find_callers` | `project-brain callers <name>` | Every symbol that calls the named symbol (who depends on X). |
|
|
101
|
+
| `find_callees` | `project-brain callees <name>` | Every symbol the named symbol calls (what X depends on). |
|
|
102
|
+
| `impact` | `project-brain impact <name> [--max-depth N]` | Blast radius — all symbols transitively affected if the named symbol changes (reverse call graph, bounded by `maxDepth`, default 6, max 20). |
|
|
103
|
+
| `trace_path` | `project-brain trace <from> <to> [--max-depth N]` | Shortest call path between two symbols (how does A reach B) — ordered caller→callee chain (default depth 8, max 20). |
|
|
104
|
+
| `repo_map` | `project-brain map [--budget N] [--focus a,b,c]` | Token-budgeted overview of the most important symbols in the codebase, ranked by PageRank over the call graph. Use for repo orientation / where to start reading. |
|
|
105
|
+
|
|
106
|
+
The CLI commands exit 0 for any executed query — including legitimate empty results (symbol not found, no callers, no path within depth). They exit 1 only for usage errors or an unindexed/unsynced project (`project-brain init`/`sync` first).
|
|
103
107
|
|
|
104
108
|
### Modules & knowledge
|
|
105
109
|
|
|
@@ -149,6 +153,8 @@ One-time global setup. Detects your environment and registers project-brain with
|
|
|
149
153
|
project-brain setup
|
|
150
154
|
```
|
|
151
155
|
|
|
156
|
+
On Claude Code, an interactive prompt (skipped outside a TTY/CI) offers to add opt-in model-routing guidance to `CLAUDE.md` — which model (`haiku`/`sonnet`/`opus`) to pass when spawning sub-agents. Force the answer non-interactively with `--model-routing` / `--no-model-routing`.
|
|
157
|
+
|
|
152
158
|
### `init`
|
|
153
159
|
|
|
154
160
|
Initialize a project. Detects the stack, writes a `CLAUDE.md` with MCP instructions, installs a git hook, scaffolds module stubs in `docs/modules/`, and indexes the project.
|
|
@@ -198,6 +204,20 @@ project-brain search "how does auth work"
|
|
|
198
204
|
echo "how does auth work" | project-brain search --stdin
|
|
199
205
|
```
|
|
200
206
|
|
|
207
|
+
### Structural & lexical commands (`find`, `callers`, `callees`, `impact`, `trace`, `map`, `code`)
|
|
208
|
+
|
|
209
|
+
Native CLI equivalents of the structural/lexical MCP tools — see the [Structural](#structural-ast-graph--exact-no-embeddings-needed) and [Lexical](#lexical-keyword--no-embeddings-needed) tables above for the full CLI ↔ MCP tool mapping. All read the local index directly (no Ollama probe), so they work fully offline once `project-brain sync` has run.
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
project-brain find GraphStore
|
|
213
|
+
project-brain callers runSync
|
|
214
|
+
project-brain callees runSync
|
|
215
|
+
project-brain impact parseConfig --max-depth 3
|
|
216
|
+
project-brain trace handleSearch runSync
|
|
217
|
+
project-brain map --budget 2000 --focus createServer,runSync
|
|
218
|
+
project-brain code "chargeCard" --limit 5
|
|
219
|
+
```
|
|
220
|
+
|
|
201
221
|
### `update`
|
|
202
222
|
|
|
203
223
|
Update project-brain to the latest published version, using whichever install manager (bun, pnpm, yarn, or npm) it was originally installed with.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-brain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local-first MCP server that gives AI tools semantic memory of your codebase.",
|
|
6
6
|
"author": "jcsoftdev",
|
|
@@ -37,18 +37,22 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@anthropic-ai/sdk": "^0.111.0",
|
|
40
|
+
"@clack/prompts": "^1.7.0",
|
|
40
41
|
"@lancedb/lancedb": "^0.30.0",
|
|
41
42
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
43
|
+
"exceljs": "^4.4.0",
|
|
44
|
+
"mammoth": "^1.11.0",
|
|
42
45
|
"ollama": "^0.6.3",
|
|
46
|
+
"unpdf": "^1.4.0",
|
|
43
47
|
"web-tree-sitter": "^0.25.10",
|
|
44
48
|
"zod": "^4.4.3"
|
|
45
49
|
},
|
|
46
50
|
"optionalDependencies": {
|
|
47
|
-
"project-brain-darwin-arm64": "0.
|
|
48
|
-
"project-brain-linux-x64": "0.
|
|
49
|
-
"project-brain-linux-arm64": "0.
|
|
50
|
-
"project-brain-windows-x64": "0.
|
|
51
|
-
"project-brain-windows-arm64": "0.
|
|
51
|
+
"project-brain-darwin-arm64": "0.15.0",
|
|
52
|
+
"project-brain-linux-x64": "0.15.0",
|
|
53
|
+
"project-brain-linux-arm64": "0.15.0",
|
|
54
|
+
"project-brain-windows-x64": "0.15.0",
|
|
55
|
+
"project-brain-windows-arm64": "0.15.0"
|
|
52
56
|
},
|
|
53
57
|
"devDependencies": {
|
|
54
58
|
"@types/bun": "latest",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
## Model routing for delegated agents
|
|
2
|
+
|
|
3
|
+
When spawning a sub-agent (Agent tool, Task tool, or workflow step), pick its model explicitly — don't leave it on the default for every call.
|
|
4
|
+
|
|
5
|
+
{{modelRoutingTable}}
|
|
6
|
+
|
|
7
|
+
Shortcut: sub-agent output is yes/no or a list → haiku. Output is code or synthesis → sonnet. Output is "which approach is better" → opus.
|
|
8
|
+
|
|
9
|
+
Pass the choice via the `model` param on the delegation call. Omit it only to inherit the current session's model.
|