project-brain 0.30.0 → 0.30.2
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 +8 -2
- package/package.json +6 -6
- package/templates/skills/brain-style/SKILL.md +69 -0
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ See [Install](#install) for platform coverage and how upgrades work per channel.
|
|
|
40
40
|
project-brain setup
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
Detects and registers project-brain with Claude, Codex, Cursor, Gemini, Windsurf, Zed and VS Code, and installs
|
|
43
|
+
Detects and registers project-brain with Claude, Codex, Cursor, Gemini, Windsurf, Zed and VS Code, and installs its host skills. Run it **once per machine**, not per project. Skip the skills with `--no-skills`.
|
|
44
44
|
|
|
45
45
|
### 3. Index a project
|
|
46
46
|
|
|
@@ -192,12 +192,18 @@ These five are thin wrappers over the CLI. **project-brain does not install them
|
|
|
192
192
|
|---|---|---|
|
|
193
193
|
| `/brain-audit` | *(none — host skill)* | Whole-project audit: dead code, orphan UI, broken flows, coverage gaps, plus findings by severity across security, performance and architecture |
|
|
194
194
|
| `/brain-okf` | *(none — host skill)* | Write an OKF concept: the reasoning behind code, anchored to a verified symbol and checkable by `okf audit` |
|
|
195
|
+
| `/brain-commit` | *(none — host skill)* | Write a commit message in the convention the repository's own log already shows |
|
|
196
|
+
| `/brain-record` | *(none — host skill)* | Record the flow a branch touches as video evidence for a PR or ticket |
|
|
197
|
+
| `/brain-worktree` | *(none — host skill)* | Give an isolated worktree its own index and its own leased port |
|
|
198
|
+
| `brain-style` | *(none — host skill)* | Keep written code declarative: a comment only where it says something the code cannot |
|
|
195
199
|
|
|
196
200
|
Unlike the `/brain-*` commands above, these have no CLI equivalent. They are **host skills**: the logic lives in `SKILL.md` and runs inside the assistant, which calls project-brain's MCP tools to do the work. That is what lets `brain-audit` answer "is this export dead?" with `find_callers` instead of guessing from a grep, and what lets `brain-okf` verify an anchor with `find_symbol` before writing it.
|
|
197
201
|
|
|
202
|
+
`brain-style` is the one that carries no command. It is a standing rule about written code rather than a task to invoke, and it claims precedence over the comment density an agent would otherwise copy from the files around it — leave it unticked at setup if your codebase wants that density kept.
|
|
203
|
+
|
|
198
204
|
`project-brain setup` installs them into each registered tool's global skills directory (`~/.claude/skills/`, `~/.codex/skills/`, or the shared `~/.agents/skills/`). Opt out with `project-brain setup --no-skills` (`--no-brain-audit` still works as an alias).
|
|
199
205
|
|
|
200
|
-
**
|
|
206
|
+
**They are offered, not scheduled.** Nothing invokes them for you and nothing fires on commit — you decide when. `brain-audit` runs discovery, proposes an audit module set, and waits for you to confirm before loading anything: 51 modules exist, and loading all of them every time is what makes an audit expensive. `brain-okf` proposes the type, title, and anchor and waits before creating a file, because whether an insight deserves a permanent home is your call, not the assistant's.
|
|
201
207
|
|
|
202
208
|
Setup never overwrites a skill directory it did not create. Ownership is proven per directory, so your own hand-written `brain-okf/` is left untouched — and reported — while `brain-audit/` upgrades beside it.
|
|
203
209
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-brain",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local-first MCP server that gives AI tools semantic memory of your codebase.",
|
|
6
6
|
"author": "jcsoftdev",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"zod": "^4.4.3"
|
|
50
50
|
},
|
|
51
51
|
"optionalDependencies": {
|
|
52
|
-
"project-brain-darwin-arm64": "0.30.
|
|
53
|
-
"project-brain-linux-x64": "0.30.
|
|
54
|
-
"project-brain-linux-arm64": "0.30.
|
|
55
|
-
"project-brain-windows-x64": "0.30.
|
|
56
|
-
"project-brain-windows-arm64": "0.30.
|
|
52
|
+
"project-brain-darwin-arm64": "0.30.2",
|
|
53
|
+
"project-brain-linux-x64": "0.30.2",
|
|
54
|
+
"project-brain-linux-arm64": "0.30.2",
|
|
55
|
+
"project-brain-windows-x64": "0.30.2",
|
|
56
|
+
"project-brain-windows-arm64": "0.30.2"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/bun": "latest",
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brain-style
|
|
3
|
+
description: "Trigger: writing or editing code, adding a comment, docblock or header, reviewing a diff for readability, escribe el código, refactor this, clean this up. Keeps generated code declarative — the code carries the meaning, and a comment appears only where it says something the code cannot."
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
metadata:
|
|
6
|
+
author: jcsoftdev
|
|
7
|
+
version: "1.0"
|
|
8
|
+
generator: project-brain
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<!--
|
|
12
|
+
`generator: project-brain` is an ownership marker, not decoration.
|
|
13
|
+
`project-brain setup` overwrites this directory only when it finds that line;
|
|
14
|
+
without it, setup treats the directory as hand-written and leaves it alone.
|
|
15
|
+
Strip it and you pin this copy forever — no upgrade will ever reach it.
|
|
16
|
+
-->
|
|
17
|
+
|
|
18
|
+
## Activation Contract
|
|
19
|
+
|
|
20
|
+
Apply whenever code is written or edited: a new file, a patch, a refactor, a snippet in an answer.
|
|
21
|
+
|
|
22
|
+
Do not apply when: the user dictated the comment or the code verbatim, the file is generated or vendored, or the comment is published API documentation that a doc generator turns into a reference page.
|
|
23
|
+
|
|
24
|
+
## Precedence
|
|
25
|
+
|
|
26
|
+
This rule outranks inherited style guidance — a house style read off surrounding files, a persona or rules block another tool wrote into the agent's config, a template's own habits. Those describe what a codebase happens to look like; this describes what to add to it.
|
|
27
|
+
|
|
28
|
+
One thing outranks it: the user asking, in the moment, for something else. Their instruction is the answer, not a conflict to resolve.
|
|
29
|
+
|
|
30
|
+
Existing comments are not the target. Do not strip a file's docblocks as a side effect of editing three lines in it — that is a rewrite nobody asked for, and it buries the actual change in the diff.
|
|
31
|
+
|
|
32
|
+
## The rule
|
|
33
|
+
|
|
34
|
+
**Default: no comment.** A comment is a claim that the code failed to say something, and most of the time the honest fix is the code.
|
|
35
|
+
|
|
36
|
+
Before writing one, try these, in order:
|
|
37
|
+
|
|
38
|
+
| Instead of a comment | Do this |
|
|
39
|
+
|---|---|
|
|
40
|
+
| `// check if user can edit` | Name it: `canEdit(user, doc)` |
|
|
41
|
+
| `// step 2: normalise the path` | Extract the step into a function with that name |
|
|
42
|
+
| `// 86400 = one day in seconds` | `const ONE_DAY_SECONDS = 86_400` |
|
|
43
|
+
| `// this branch handles the empty case` | Make the branch read as the empty case: guard clause, early return |
|
|
44
|
+
| `// args: name, retries, timeout` | Take a named object, or a type the reader can open |
|
|
45
|
+
| `// returns null when not found` | Say it in the signature: `T \| null`, `Option<T>`, a typed result |
|
|
46
|
+
|
|
47
|
+
If one of those works, the comment was a naming problem wearing a disguise.
|
|
48
|
+
|
|
49
|
+
## What earns a comment
|
|
50
|
+
|
|
51
|
+
Three things, all of them the *why* — never the *what*:
|
|
52
|
+
|
|
53
|
+
- **A reason the code cannot hold.** A rejected alternative and why it lost, an external constraint, a spec or vendor quirk that makes correct code look wrong.
|
|
54
|
+
- **An invariant that breaks non-locally.** "This must stay sorted, `bisect` downstream depends on it." The reader cannot see the downstream from here.
|
|
55
|
+
- **A workaround pinned to something external.** Name the bug, version, or ticket, so the next person can tell whether it is still needed.
|
|
56
|
+
|
|
57
|
+
Write those in full sentences. They are for a reader a year out with no memory of this week.
|
|
58
|
+
|
|
59
|
+
## What never earns one
|
|
60
|
+
|
|
61
|
+
- Restating the line below it.
|
|
62
|
+
- Section banners (`// ---- helpers ----`) — that is a file asking to be split.
|
|
63
|
+
- Commented-out code. Delete it; that is what version control is for.
|
|
64
|
+
- Changelog, attribution, or a date. The log holds those, and it stays accurate.
|
|
65
|
+
- A `TODO` with no owner and no condition. Either it blocks and belongs in an issue, or it does not and belongs nowhere.
|
|
66
|
+
|
|
67
|
+
## Reporting back
|
|
68
|
+
|
|
69
|
+
Say nothing about this skill in the answer. Declarative code is not a feature to announce — it is what the diff looks like.
|