brain-sync
Skill2 starsChanged 12 days agoMITView on GitHub
Bring this brain's repo up to date and commit its changes the same way every time: show where it stands, run the checks, commit with a scoped subject, pull with rebase, and push only when asked. After an update, commit the template change on its own and mark answered upstream suggestions. Use when doctor says the brain is behind or has unpushed work, after writing a skill, script or practice, or before long work. Does NOT write the skill, script or practice itself (brain-write-skill, brain-write-script, brain-write-practice), and does NOT touch nested project repos or template-owned files.
- Reads credentials
- Commits and pushes
2 other projects use a version of this.
Adopted by
Most recently taken up by
- wujiajun4/brain-synctheir own version, first seen Oct 9, 2026
- Kashyap-001/second-brain-templatetheir own version, first seen Jul 23, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- wujiajun4/brain-sync★ 1same name
- Kashyap-001/second-brain-template★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- brain-retroSkill
- brain-setupSkill
- brain-upstreamSkill
- brain-write-modSkill
- brain-write-practiceSkill
- brain-write-scriptSkill
- brain-write-skillSkill
- template-intakeSkill
- template-make-brainSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Every change reaches the history the same way: checked, grouped by scope, reviewed, and pushed only when the person says so.
- Very specific: line 61
Read git diff --cached --stat: only this group's files, nothing large, nothing you did not mean to stage.
- Very specific: line 63
Commit with git commit -F - and the subject <scope>: <what changed>, imperative and short, following any commit convention in the brain's …
- Very specific: line 86
Commit any other pending work first, in its own groups, including other docs/UPSTREAM.md edits.
- Distinctive: line 98
If the rebase stops on a conflict, show it to the person and resolve it with them, or git rebase --abort to go back.
- Very specific: line 111
No nested repo path, no .env and no file over max_file_kb was staged.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
brain-sync
Every change reaches the history the same way: checked, grouped by scope, reviewed, and pushed only when the person says so. A history of scoped commits can be read, reverted and compared.
Where this sits
<!-- where:begin — generated by _meta/brain routing sync; do not edit -->Runs after: brain-setup · brain-upstream · brain-write-mod · brain-write-practice · brain-write-script · brain-write-skill
Hand to next: nothing — a person takes it from here.
Reserved output: writing docs/UPSTREAM.md needs this skill to have run.
<!-- where:end -->Call it directly when: a skill, script, practice or log change is ready to commit, an update
has just run, or doctor reports unpushed or uncommitted work; nothing needs to run first.
1. Where it stands
git status --short --branch; with a remote, git fetch, then git log --oneline @{u}.. (not
pushed) and git log --oneline ..@{u} (not pulled). Tell the person briefly what changed, by scope,
and how far ahead or behind it is. A template that is behind is an update, run by brain-setup.
2. Run the checks
_meta/brain lint # skills and the routing map
_meta/brain routing sync --check
_meta/brain practices lint
_meta/brain doctor --quick
<scripts.python> -m unittest discover -s ./scripts/tests -t ./scripts # when scripts/ changed<scripts.python> is brain.json scripts.python. A BROKEN or BLOCK line stops the commit. Fix it
through the skill that owns the file (skills and the map: brain-write-skill; practices:
brain-write-practice; scripts: brain-write-script; a template-owned file: brain-upstream); a
BLOCK about no file (the hook, core.hooksPath, a missing tool, a copy never set up) goes to
brain-setup. Then run the checks again. GAPs and doctor's uncommitted-work warning do not stop it.
3. Commit by scope
| Scope | Holds |
skill(<name>) | one skill's folder, with its node in docs/ROUTING.md and its gate rule in brain.json |
script(<system>) | one system's scripts and tests, with their docs/CAPABILITIES.md rows |
practice(<id>) | one practice file and the regenerated docs/practices/INDEX.md |
docs(<area>) | other docs/ changes: docs(retro) for the two logs, docs(upstream), docs(<folder>) |
meta(brain) | brain.json, README.md, .env.example, .claude/settings.json, CLAUDE.md and .gitignore below the managed blocks; and the template update (section 4) |
For each group, in turn:
- Stage it by path:
git add -- <paths>. Nevergit add -f, never everything at once, never a path inside a nested project repo, and no git command inside one: it is not the brain. Forcing past the allowlist.gitignoreis exactly how a project repo, an asset or a.envgets in. - Read
git diff --cached --stat: only this group's files, nothing large, nothing you did not mean to stage. Unstage the rest withgit restore --staged -- <path>. - Commit with
git commit -F -and the subject<scope>: <what changed>, imperative and short, following any commit convention in the brain'sCLAUDE.md(a trailer, a language).
The pre-commit guard runs on every commit; when it refuses, fix what it names. Never
--no-verify: the guard is the only check between a secret, a private name or a project repo and
a history that may be pushed. A refusal that looks wrong is a privacy setting for the person to
change, or an upstream suggestion; never a bypass.
A change to a template-owned file (_meta/, a brain-* skill, a managed block) outside an update
is a local edit: never commit it, or make one to get a check to pass; hand it to brain-upstream.
A restore to the installed version is the exception: once doctor --quick shows no manifest edit,
commit it alone as meta(brain): restore <file>.
In the template (brain.json role is template and local/ exists), _meta/ and the
brain-* skills are the template's own work, not local edits. Run the test suite as well
(PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s tests -t .), commit under
meta(<area>), skill(<name>), test(<area>) or docs(<area>), and skip section 4.
4. After an update
update writes but never commits. Commit what it changed on its own, so the history shows exactly
what the template brought:
- Commit any other pending work first, in its own groups, including other
docs/UPSTREAM.mdedits. - For each id
updatereported as answered (_meta/brain upstream listshows them with the template's answer), set that entry's line to- status: landed <version>or- status: declined: <reason>, as the template'sCHANGELOG.mdsays. The flips belong to the update's own commit: a separate one leaves a point where an answered suggestion readsopen. - Stage the update's files (the template-owned paths,
_meta/MANIFEST.sha256,brain.json, the managed blocks,.claude/settings.json) anddocs/UPSTREAM.md; read the stat; commitmeta(brain): update template to <version>,<version>beingbrain.jsontemplate.version.
5. Pull, then push only when asked
git pull --rebase when there is a remote (--autostash if the person left changes uncommitted).
If the rebase stops on a conflict, show it to the person and resolve it with them, or
git rebase --abort to go back. Run the checks again if the pull brought skills, map or practices.
Push only when the person asks for it in this conversation: git push. Never --force, and never
rewrite a commit that is already pushed. With no remote, say so, and offer brain-setup's online
backup; whether to have one is the person's call.
Done when
- The checks ran on what was committed, with no BROKEN or BLOCK.
- Each commit holds one scope, its subject starts with that scope, and its staged stat was read.
- A template update is its own
meta(brain): update template to <version>commit, with every answereddocs/UPSTREAM.mdentry flipped in it. - No nested repo path, no
.envand no file overmax_file_kbwas staged; no--no-verify. - In the template, the test suite passed before each commit.
- The branch is rebased on its remote, and pushed only if the person asked.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

