brain-link-discipline
하는 일
이 스킬은 지식 브레인의 페이지를 만들거나 편집할 때 AI 에이전트가 따를 보고 규칙을 설정합니다. 에이전트가 언급한 페이지를 열어 봐야 하는 사람을 위한 스킬입니다.
사용하는 경우
- ✓에이전트가 브레인 페이지를 만들거나 편집하고 결과를 알려 줄 때.
- ✓에이전트가 여러 페이지를 한 번에 보고하고 각 페이지에 링크가 필요할 때.
- ✓하위 에이전트의 결과에 열어 봐야 하는 브레인 페이지가 언급될 때.
스킬 링크
https://github.com/garrytan/gbrain/blob/master/plugin-variants/gbrain-coding/skills/brain-link-discipline/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“브레인의 온보딩 페이지를 업데이트했나요? 그 링크를 보내 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 페이지 경로를 확인하고, 링크를 달기 전에 변경 사항을 푸시하며, 링크가 열리는지 확인하고, 실패하면 명시된 대안을 씁니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
brain-link-discipline — The Link Is Part of the Deliverable
Convention: see _output-rules.md — the Deterministic Links section carries the cross-skill canon (in-page relative vs in-message verified, plus the fallback chain). This skill carries the mechanics: path derivation, push-before-link ordering, verification, the subagent-relay rewrite, and bulk-list formatting.
Convention: conventions/brain-first.md states the one-line principle ("every brain page reference in output should use a clickable link format appropriate to the deployment"). This skill is that line's full expansion.
This is a reporting convention the harness routes brain-page delivery messages through — a standing rule to apply when composing such messages, not a mechanical guarantee enforced by tooling.
The rule (same message)
If you commit and push a brain page, the link goes in the SAME message that reports the work. Every time. No "let me commit and push" without the link landing in that same reply once the push succeeds. The user should never have to ask "give me the link" or "where is the page."
This applies to:
- Any message reporting a created or edited brain page
- Bulk reports ("5 pages created" — every page gets its own link line)
- Referencing a brain page in normal conversation
- Relaying subagent results that mention brain paths (rewrite first — see below)
The most common link bug is committing a brain page and forcing the user to go find it. The link is a deliverable, not a follow-up.
Scope split: in-message vs in-page (the inversion)
The two output surfaces take OPPOSITE link forms:
| Surface | Link form | Why |
|---|---|---|
| Chat message to the user | Absolute, verified URL (or the fallback chain below) | Repo-relative paths aren't clickable in chat surfaces |
| Inside a brain page body | RELATIVE markdown link: [Alice Example](../people/alice-example.md) |
gbrain's link extraction builds the links/backlinks graph — which powers relational retrieval — from filesystem-relative links. An absolute URL between two brain pages is invisible to that graph |
Never write absolute URLs for page-to-page references inside a brain
page. Absolute URLs in a page body are for genuinely external targets
only. Frontmatter related: / people: keys stay bare relative paths
(machine-parsed, not rendered prose). After a link-heavy write,
gbrain check-backlinks check audits the graph and gbrain sync --no-pull
makes the pages searchable.
Deriving the path mechanically
The repo-relative path a hosted git remote serves is relative to the git
repo root (git rev-parse --show-toplevel), NOT your current working
directory. When the repo root sits above your working directory, hand-
stripping your cwd prefix silently drops the intermediate directory segment
and every link you build 404s. Never hand-strip a prefix. Derive:
# From anywhere inside the repo, prints the EXACT path the remote serves:
cd "$(dirname <file>)" && git ls-files --full-name "$(basename <file>)"
# e.g. people/alice-example.md
Then assemble:
https://<host>/<owner>/<repo>/blob/<branch>/<that-exact-path>
<host>/<owner>/<repo>fromgit remote get-url origin<branch>fromgit rev-parse --abbrev-ref HEAD(or the remote's default branch)/blob/for files,/tree/for directories (GitHub-style hosts)
Sequence (push BEFORE link)
- Write/edit the brain file.
scripts/brain-commit-push.sh "<msg>" <file>(orgbrain git commit-push -m "<msg>" -- <file>when the brain has no helper). It commits only that file under the checkout's writer lock and pushes, merging remote commits without touching other agents' files.- Verify the push landed — the command must exit 0 and print
pushed <sha> to origin/<branch>(ornothing to commit; a[gbrain notice]that the checkout lags is still a landed push). A hosted URL 404s until the push completes. On a non-zero exit, output no link: retry once oncommit_lock_busy; stop and tell the user onintegrate_conflictorwriter_coordinator_required; never fall back to stash,pull --rebaseor a plain push (outcomes). - In the SAME message that reports the commit, output the link — as a clickable markdown link or bare URL, never a backticked code span.
자주 묻는 질문
왜 링크 전에 푸시하나요?
링크는 온라인에 존재하는 콘텐츠를 가리켜야 하므로, 푸시가 먼저입니다.
호스팅된 원격 저장소가 없으면 어떻게 하나요?
스킬은 그 경우를 위한 대체 순서를 설명하므로, 그래도 쓸 수 있는 참조를 받을 수 있습니다.
페이지 안에서도 적용되나요?
스킬은 페이지 안에서는 상대 링크를 쓰므로 규칙이 다르게 적용된다고 말합니다.
상세 정보
작성자의 원본 설명
When you report a brain page to the user — created, edited, committed, or relayed from a subagent — a working link is part of the deliverable, in the SAME message. Derive the path mechanically (git ls-files --full-name), push BEFORE linking, verify the link resolves when a hosted remote exists, and degrade through a defined fallback chain when it doesn't. Inside brain pages the rule inverts: relative links preserve the link graph; absolute URLs are for chat deliverables only.
repo: garrytan/gbrain
인기도
- GitHub 스타
- 31k
- 순위
- #9249
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
gbrain
31k에이전트가 공유 회사 지식 브레인에서 사람, 프로젝트, 결정에 관한 사실을 검색하고, 지속적인 메모를 저장하도록 돕습니다.
brain-ingest-gate
31k새 콘텐츠를 지식 브레인에 추가하기 전에 기존 내용과 비교해 중복을 막고, 고유 명칭을 먼저 확인합니다.
brain-ops
31k지식 브레인의 기본 루틴을 제공합니다. 먼저 기존 맥락을 확인하고, 메모는 출처와 함께 저장하며, 관련 페이지를 연결합니다.
concept-synthesis
31k흩어진 많은 개념 페이지를 중복을 줄인 계층형 아이디어 지도로 정리하고, 각 아이디어가 시간에 따라 어떻게 바뀌었는지 보여 줍니다.
비슷한 스킬
technical-documentation
394k에이전트가 명확한 기술 문서와 에이전트 지침 파일을 작성하고 검토하도록 도와, 사람과 AI 도구가 쉽게 따를 수 있게 합니다.
architecture-decision-records
280k에이전트가 프로젝트 구조에 관한 중요한 결정을 기록하도록 합니다. 선택의 이유를 이해하고 변경 이력을 명확히 유지하는 데 도움이 됩니다.
code-tour
280k에이전트가 정확한 파일과 줄 번호를 참조하는 단계별 코드 안내를 만들도록 합니다. 소개, 설명, 리뷰에 유용합니다.