Guide · Agent skill
How to use the Brain Link Discipline agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
Brain Link Discipline is an agent skill for git-backed knowledge bases, which gbrain calls a 'brain'. When your agent creates or edits a page, the skill tells it to commit and push the change and then include a clickable link to that page in the same reply, so you never have to ask where it is. This guide explains what the skill does, how to install it, how to trigger it, and what it needs before it can work.
Quick start
- 1Download and unzip the skill. Download the ZIP from this page and unzip it so SKILL.md sits in a brain-link-discipline folder under ~/.claude/skills/ or a project's .claude/skills/.
- 2Confirm git and a brain remote. Make sure your brain repository is a git checkout with a remote named origin, since the path and push steps depend on it.
- 3Optionally set GITHUB_TOKEN. If your brain is a private GitHub repo and you want verified links, set GITHUB_TOKEN in your environment. Skip it if you do not need verification.
- 4Ask the agent to write or edit a page. Make a normal request for a brain page change, such as adding a person or note to your knowledge base.
- 5Check the push and link. Confirm the push output shows the commit landed, and expect the clickable link in the same reply.
What the skill makes the agent do
The skill governs how an agent reports brain pages. When it creates, edits, or commits a page, or relays a subagent result that mentions a brain path, the link must appear in the same message as the report. The skill also tells the agent how to build the correct path from the git repository root, and, when a hosted remote exists, to check the link resolves before sending it.
Inside brain pages the rule reverses. The skill asks for relative links such as [Alice Example](../people/alice-example.md), because gbrain builds its link and backlink graph from filesystem-relative links. Absolute URLs are for chat messages only.
- Pushes the page before linking, so the URL does not 404.
- Derives the exact repo-relative path with git ls-files --full-name instead of guessing.
- Verifies the link on a hosted remote when possible, and falls back to a repo-relative path or an HTML artifact when it is not.
Install the skill (ZIP download or Claude apps upload)
Download the ZIP from the skill's page on this directory and unzip it. The skill's files include SKILL.md. For a personal install, unzip into ~/.claude/skills/. For a single project, unzip into that project's .claude/skills/ folder.
You can also upload the skill in the Claude apps by going to Settings → Capabilities → Skills and adding the ZIP there.
- Personal install: ~/.claude/skills/
- Project install: the project's .claude/skills/ folder
- Claude apps: Settings → Capabilities → Skills
Trigger the skill with natural requests
You do not need a special command. The skill is triggered by requests that match its listed phrases. Asking in ordinary language works, as long as the request is about getting a link to a brain page.
- "Give me the link"
- "Where is the page?"
- "Why does this link 404?"
- "Send me a clickable link"
- "Report the pages you created"
- "Rewrite subagent paths"
Set up the brain repository and optional token
The skill needs git and a brain repository with a git remote. The source names gbrain's checkout and scripts/brain-commit-push.sh, or the gbrain CLI, as examples. Without a git-backed brain there is nothing for the path and push steps to act on.
A GITHUB_TOKEN environment variable is optional. It lets the skill verify links on private GitHub repositories. Without it, verification of private repos will fail and the fallback chain applies. Network access to the hosted git host is also optional and is only needed for link verification.
- Required: git and a brain repo with a git remote
- Optional: GITHUB_TOKEN for verifying links on private GitHub repos
- Optional: network access to the git host for verification
Example: a page is created and reported with a link
Suppose you ask your agent to write a page about a person. The agent writes the file, then commits and pushes only that file with scripts/brain-commit-push.sh. It derives the path with git ls-files --full-name and assembles the URL from the remote and branch. Once the push output confirms it landed, the agent puts the clickable link in the same reply.
If the push fails with a non-zero exit, the skill says to output no link. It retries once on commit_lock_busy, and stops and tells you on integrate_conflict or writer_coordinator_required.
scripts/brain-commit-push.sh "add alice example page" people/alice-example.mdSafety notes: scripts and network access
This skill runs scripts and uses the network. The verification step makes an HTTP request to the remote host. The source says the Authorization token header targets api.github.com for github.com remotes and must never be sent to any other host derived from git remote get-url origin without confirming it is the token's issuing host.
For a non-GitHub remote, the skill says to verify unauthenticated or skip verification and rely on the push output. When in doubt, the skill says not to send the token. The skill is also a reporting convention, not an enforced guarantee, so review the agent's output if links matter.
- Only send GITHUB_TOKEN to api.github.com for github.com remotes.
- Check the remote host before trusting origin.
- Treat the skill as guidance the agent follows, not a tool-enforced rule.
Tips for reliable links
Always derive paths from the git repo root, not from your working directory, because stripping the cwd prefix by hand drops segments and causes 404s. Use /blob/ for files and /tree/ for directories on GitHub-style hosts. Inside brain pages, keep page-to-page links relative.
If the brain has no hosted remote, expect the repo-relative path plus a note that it is local. For sensitive content, the gbrain publish command can produce a local HTML file; the source says to use --password for that.
- Use git rev-parse --show-toplevel to confirm the repo root.
- Link files with /blob/ and directories with /tree/.
- For sensitive pages, use gbrain publish with --password.
What people use it for
- Asking an agent to write a page and getting its link in the same reply.
- Bulk reports where each created page gets its own link line.
- Relaying subagent results that mention brain paths, rewritten to local-verified links.
- Diagnosing a 404 on a page the agent wrote by re-deriving its repo-relative path.
Frequently asked questions
How do I install the brain-link-discipline skill?
Download the ZIP from this skill's page and unzip it into ~/.claude/skills/ for a personal install, or into a project's .claude/skills/ folder. You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.
What does brain-link-discipline require?
It requires git and a brain repository with a git remote, such as gbrain's checkout. A GITHUB_TOKEN and network access to the git host are optional and only used for verifying links.
Is brain-link-discipline free and what is its licence?
The item is listed under the MIT licence. The source does not mention pricing, so check the listing for any terms beyond the licence.
Why does my link from the agent return a 404?
The most likely cause is that the path was guessed by stripping the working directory instead of taken from the git repo root. The skill fixes this by deriving the path with git ls-files --full-name and only linking after the push succeeds.
What if my brain has no hosted remote?
The skill falls back to the repo-relative path, such as people/alice-example.md, with a note that it is a local path. It can also produce a local HTML file via gbrain publish, which you can attach rather than open as a URL.
Does this skill work for any knowledge base?
It is designed for git-backed knowledge bases, including gbrain or similar. It has nothing to act on without a git-backed brain repository, so it is not useful for notes stored outside git.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you run gbrain or a similar git-backed knowledge base with a hosted remote such as GitHub, especially if several agents write to the same checkout and you keep getting broken links. Pick something else if your notes are not in a git repo, or if you need enforced behaviour, since this file is a reporting convention the agent follows rather than a tool-enforced guarantee.
Download the skill