Setup
28.9kConfigura GBrain con auto-aprovisionamiento de Supabase o PGLite, inyección en AGENTS.md y primera importación.
- Costo de contexto al activarse
- 7.4k tok
- Tamaño del paquete
- 1 archivo
- Última actualización
- hace 4 días
Cuando reportas una página de brain, el enlace que funciona debe ir en el mismo mensaje: ruta derivada de git, push antes de enlazar, verificación del enlace y una cadena de fallback si no hay remoto.
en todo el repo
0–100, la ruta de este skill
último commit aquí
últimos 90 días
121 tok en reposo
13 KB
Funciona con cualquier agente que lea SKILL.md
npx -y skills add garrytan/gbrain --skill brain-link-discipline --agent claude-codeSe instala solo en este repositorio.
Este skill makes network requests, needs API credentials.
Di cualquiera de estas frases y el agente debería cargar este skill.
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.
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:
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.
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.
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> from git remote get-url origin<branch> from git rev-parse --abbrev-ref HEAD (or the remote's default branch)/blob/ for files, /tree/ for directories (GitHub-style hosts)git add <file> && git commit -m "..." && git pushabc123..def456 main -> main). A hosted URL 404s until the push
completes.Before including a hosted-remote link in a user-facing message, confirm the path exists on the remote. GitHub example (private repos need a token):
curl -sf -o /dev/null -w '%{http_code}' \
-H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/<owner>/<repo>/contents/<repo-relative-path>"
Only send the link on 200. If you just pushed and the host API is lagging,
the push output proving the ref moved is sufficient evidence — but never
invent or guess a URL.
Send the token only to its issuing host. The Authorization: token header
above targets api.github.com because the remote is a github.com remote. Never
send $GITHUB_TOKEN to a host you derived from git remote get-url origin
without confirming it is the token's issuing host: a doctored or unexpected
remote (origin pointed at an attacker's host, an enterprise/self-hosted host
the token isn't scoped to) would harvest the credential. For a github.com
remote, use api.github.com. For any other remote, verify UNAUTHENTICATED (a
public-repo existence check needs no token) or skip verification and fall back
to the ref-update evidence from the push. When in doubt, don't send the token.
people/alice-example.md) and say plainly that it's a local path
in the brain repo.gbrain publish output as an attachable HTML ARTIFACT. gbrain publish <page-path> emits a self-contained LOCAL HTML file (its output
line is Published: <local-path>). Offer to attach or send that file —
NEVER present it as a URL, because it isn't one. Use --password for
sensitive content.Subagents run in local context and return LOCAL paths. Relaying a subagent
completion verbatim is the #1 source of link bugs: the subagent reports
media/books/widget-co-notes.md (or an absolute path into the brain
checkout) and the relay parrots it. Before converting a subagent completion
into a user-facing reply, rewrite every brain-page path through the same
derivation + fallback chain above.
When spawning subagents that will write brain pages, include in their task prompt:
Report brain pages as repo-relative paths from
git ls-files --full-name. The parent rewrites them into links before relaying.
One link per line, full URL (or fallback form), no backticks:
Created 3 pages:
- https://github.com/<owner>/<repo>/blob/main/people/alice-example.md
- https://github.com/<owner>/<repo>/blob/main/people/charlie-example.md
- https://github.com/<owner>/<repo>/blob/main/companies/acme-example.md
Hosted-remote links into a private brain repo open only for people with
repo access. That's fine for the user's own chat surface; it is NOT a
shareable link for an outside audience. For outside sharing, fall through
to the gbrain publish artifact (step 3 of the fallback chain).
This skill guarantees:
git ls-files --full-name,
git remote get-url origin), never composed from memory.Hosted remote (verified):
Done — pushed. https://github.com///blob/main/concepts/widget-co-pricing.md
Changes committed (abc1234):
- concepts/widget-co-pricing.md (edit) — reworked the pricing section
No hosted remote (fallback steps 2–3):
Saved
concepts/widget-co-pricing.mdin the brain repo (local path — this brain has no hosted remote). Want a shareable HTML render? I can generate one withgbrain publishand attach the file.
/absolute/local/path/..." — local absolute path
instead of a link or repo-relative fallback.git push has landed (they 404 until the
push completes — push first, verify the ref moved, then link).gbrain publish output as a URL. It emits a local HTML file
path; offer it as an attachable artifact.git ls-files --full-name.skills/publish/SKILL.md — owns HOW to generate a shareable HTML
artifact (stripping, encryption, output options). brain-link-discipline
only decides WHEN to fall back to it, and forbids promising its output as
a URL.skills/_output-rules.md (Deterministic Links) — carries the cross-skill
CANON: deterministic construction, the in-page/in-message scope split, the
fallback chain. This skill carries the per-message MECHANICS: derivation,
ordering, verification, relay rewriting, bulk formatting.skills/conventions/brain-first.md — states the one-line clickable-link
principle inside the lookup convention; this skill is its expansion for
delivery messages.skills/conventions/subagent-routing.md — how to route work to
subagents. This skill adds the path-rewrite obligation at the relay
boundary; subagent-routing says nothing about link/path rewriting.skills/citation-fixer/SKILL.md — fixes broken citations INSIDE existing
brain pages. Not about outbound message links.skills/reports/SKILL.md — saves/loads report pages. When a report
delivery message references brain pages, that message follows this
discipline; the reports skill itself carries no link rules.Reproducido de garrytan/gbrain bajo licencia MIT. Leer esta página en markdown.
2 archivos en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.
Requiere un repo git con remoto (opcionalmente GITHUB_TOKEN para verificar rutas privadas) o gbrain publish para el fallback sin remoto.
Necesita en el PATH:curlgit
Variables de entorno:GITHUB_TOKEN
Este repo incluye 75 skills. Si instalas uno, normalmente ya tienes los demás.
Configura GBrain con auto-aprovisionamiento de Supabase o PGLite, inyección en AGENTS.md y primera importación.
Chequeos de salud del brain: aplicación de back-links, auditoría de citas, validación de filing, detección de info obsoleta, páginas huérfanas y benchmarks.
Migra un brain de gbrain-base a la taxonomía de 14 tipos canónicos de gbrain-base-v2 usando gbrain onboard --check y el handler Minion unify-types.
Cuándo y qué recuperar: abre la página del brain de una entidad relevante antes de responder desde memoria.
Operaciones del brain: búsqueda primero, ciclo leer-enriquecer-escribir, atribución de fuentes, enriquecimiento ambiental y back-linking. Leer antes de cualquier interacción con el brain.
Importa exports de ChatGPT, Claude y Perplexity y transcripciones de sesiones como páginas fechadas en conversations/, valida y extrae hechos, y mantiene el archivo sin huecos con detección y backfill.
Auditoría de higiene de tokens del stack siempre cargado (CLAUDE.md, AGENTS.md, MEMORY.md, SOUL.md, etc.): detecta redundancia, contradicciones y candidatos a compresión. Solo informa, nunca edita archivos.
Valida y repara automáticamente el frontmatter YAML de las páginas del brain antes de que entren corruptas, envolviendo la CLI `gbrain frontmatter`.”
Comprime el archivo de routing de un agente (RESOLVER.md o AGENTS.md) convirtiendo tablas por skill en dispatchers por área funcional, con cláusula "(dispatcher for: ...)".