[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75K0QXV8RZYYMMFBNHP3FSD":3,"skill-same:01M75K0QXV8RZYYMMFBNHP3FSD":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":14,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":45,"updatedAt":46,"install":47,"resources":59},"01M75K0QXV8RZYYMMFBNHP3FSD","brain-link-discipline",null,"When you report a brain page to the user — created, edited, committed, or\nrelayed from a subagent — a working link is part of the deliverable, in the\nSAME message. Derive the path mechanically (git ls-files --full-name), push\nBEFORE linking, verify the link resolves when a hosted remote exists, and\ndegrade through a defined fallback chain when it doesn't. Inside brain\npages the rule inverts: relative links preserve the link graph; absolute\nURLs are for chat deliverables only.","cheRoma\u002Fgbrain-link-chat","cheRoma","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F265356812?v=4","01M75JVGAJEZK04E1THSDHYVNK","Roman Cherepanov","01M75JVGB5SWY40H959C3QXRAQ",0,"MIT","https:\u002F\u002Fgithub.com\u002FcheRoma\u002Fgbrain-link-chat\u002Fblob\u002Ffeat\u002Flink-chat-distiller\u002Fplugin-variants\u002Fgbrain-coding\u002Fskills\u002Fbrain-link-discipline\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: brain-link-discipline\nversion: 1.0.0\ndescription: |\n  When you report a brain page to the user — created, edited, committed, or\n  relayed from a subagent — a working link is part of the deliverable, in the\n  SAME message. Derive the path mechanically (git ls-files --full-name), push\n  BEFORE linking, verify the link resolves when a hosted remote exists, and\n  degrade through a defined fallback chain when it doesn't. Inside brain\n  pages the rule inverts: relative links preserve the link graph; absolute\n  URLs are for chat deliverables only.\ntriggers:\n  - \"give me the link\"\n  - \"where is the page\"\n  - \"why does this link 404\"\n  - \"brain link discipline\"\n  - \"rewrite subagent paths\"\n  - \"report the pages you created\"\n  - \"send me a clickable link\"\n  - \"link the page in the same message\"\nmutating: true\nwrites_pages: false\nupstream: brain-link-on-commit@fc834ee + brain-link-report@fc834ee\n# brain_first: exempt — this skill governs outbound-message link formatting\n# and performs no entity\u002Ffact lookups. Its only network call is an HTTP\n# existence check against the user's own hosted git remote (link\n# verification, not data retrieval). Declarative opt-out.\nbrain_first: exempt\nwhen_to_use: \"Use when the user asks: \\\"give me the link\\\", \\\"where is the page\\\", \\\"why does this link 404\\\", \\\"brain link discipline\\\", \\\"rewrite subagent paths\\\".\"\n---\n\n# brain-link-discipline — The Link Is Part of the Deliverable\n\n> **Convention:** see [_output-rules.md](..\u002F_output-rules.md) — the\n> Deterministic Links section carries the cross-skill canon (in-page relative\n> vs in-message verified, plus the fallback chain). This skill carries the\n> mechanics: path derivation, push-before-link ordering, verification, the\n> subagent-relay rewrite, and bulk-list formatting.\n>\n> **Convention:** [conventions\u002Fbrain-first.md](..\u002Fconventions\u002Fbrain-first.md)\n> states the one-line principle (\"every brain page reference in output should\n> use a clickable link format appropriate to the deployment\"). This skill is\n> that line's full expansion.\n\nThis is a reporting convention the harness routes brain-page delivery\nmessages through — a standing rule to apply when composing such messages,\nnot a mechanical guarantee enforced by tooling.\n\n## The rule (same message)\n\nIf you commit and push a brain page, the link goes in the SAME message that\nreports the work. Every time. No \"let me commit and push\" without the link\nlanding in that same reply once the push succeeds. The user should never\nhave to ask \"give me the link\" or \"where is the page.\"\n\nThis applies to:\n\n- Any message reporting a created or edited brain page\n- Bulk reports (\"5 pages created\" — every page gets its own link line)\n- Referencing a brain page in normal conversation\n- Relaying subagent results that mention brain paths (rewrite first — see below)\n\nThe most common link bug is committing a brain page and forcing the user to\ngo find it. The link is a deliverable, not a follow-up.\n\n## Scope split: in-message vs in-page (the inversion)\n\nThe two output surfaces take OPPOSITE link forms:\n\n| Surface | Link form | Why |\n|---|---|---|\n| Chat message to the user | Absolute, verified URL (or the fallback chain below) | Repo-relative paths aren't clickable in chat surfaces |\n| Inside a brain page body | RELATIVE markdown link: `[Alice Example](..\u002Fpeople\u002Falice-example.md)` | gbrain's link extraction builds the links\u002Fbacklinks graph — which powers relational retrieval — from filesystem-relative links. An absolute URL between two brain pages is invisible to that graph |\n\n**Never write absolute URLs for page-to-page references inside a brain\npage.** Absolute URLs in a page body are for genuinely external targets\nonly. Frontmatter `related:` \u002F `people:` keys stay bare relative paths\n(machine-parsed, not rendered prose). After a link-heavy write,\n`gbrain check-backlinks check` audits the graph and `gbrain sync --no-pull`\nmakes the pages searchable.\n\n## Deriving the path mechanically\n\nThe repo-relative path a hosted git remote serves is relative to the **git\nrepo root** (`git rev-parse --show-toplevel`), NOT your current working\ndirectory. When the repo root sits above your working directory, hand-\nstripping your cwd prefix silently drops the intermediate directory segment\nand every link you build 404s. Never hand-strip a prefix. Derive:\n\n```bash\n# From anywhere inside the repo, prints the EXACT path the remote serves:\ncd \"$(dirname \u003Cfile>)\" && git ls-files --full-name \"$(basename \u003Cfile>)\"\n# e.g. people\u002Falice-example.md\n```\n\nThen assemble:\n\n```\nhttps:\u002F\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002Fblob\u002F\u003Cbranch>\u002F\u003Cthat-exact-path>\n```\n\n- `\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>` from `git remote get-url origin`\n- `\u003Cbranch>` from `git rev-parse --abbrev-ref HEAD` (or the remote's default branch)\n- `\u002Fblob\u002F` for files, `\u002Ftree\u002F` for directories (GitHub-style hosts)\n\n## Sequence (push BEFORE link)\n\n1. Write\u002Fedit the brain file.\n2. `scripts\u002Fbrain-commit-push.sh \"\u003Cmsg>\" \u003Cfile>` (or\n   `gbrain git commit-push -m \"\u003Cmsg>\" -- \u003Cfile>` when the brain has no helper).\n   It commits only that file under the checkout's writer lock and pushes,\n   merging remote commits without touching other agents' files.\n3. **Verify the push landed** — the command must exit 0 and print\n   `pushed \u003Csha> to origin\u002F\u003Cbranch>` (or `nothing to commit`; a\n   `[gbrain notice]` that the checkout lags is still a landed push). A hosted\n   URL 404s until the push completes. On a non-zero exit, output no link:\n   retry once on `commit_lock_busy`; stop and tell the user on\n   `integrate_conflict` or `writer_coordinator_required`; never fall back to\n   stash, `pull --rebase` or a plain push\n   ([outcomes](https:\u002F\u002Fgithub.com\u002Fgarrytan\u002Fgbrain\u002Fblob\u002Fmaster\u002Fdocs\u002Fguides\u002Fshared-checkout-git.md#outcomes)).\n4. **In the SAME message that reports the commit, output the link** — as a\n   clickable markdown link or bare URL, never a backticked code span.\n\n## Verify before linking (when a hosted remote exists)\n\nBefore including a hosted-remote link in a user-facing message, confirm the\npath exists on the remote. GitHub example (private repos need a token):\n\n```bash\ncurl -sf -o \u002Fdev\u002Fnull -w '%{http_code}' \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  \"https:\u002F\u002Fapi.github.com\u002Frepos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fcontents\u002F\u003Crepo-relative-path>\"\n```\n\nOnly send the link on `200`. If you just pushed and the host API is lagging,\nthe push output proving the ref moved is sufficient evidence — but never\ninvent or guess a URL.\n\n**Send the token only to its issuing host.** The `Authorization: token` header\nabove targets `api.github.com` because the remote is a github.com remote. Never\nsend `$GITHUB_TOKEN` to a host you derived from `git remote get-url origin`\nwithout confirming it is the token's issuing host: a doctored or unexpected\nremote (`origin` pointed at an attacker's host, an enterprise\u002Fself-hosted host\nthe token isn't scoped to) would harvest the credential. For a github.com\nremote, use `api.github.com`. For any other remote, verify UNAUTHENTICATED (a\npublic-repo existence check needs no token) or skip verification and fall back\nto the ref-update evidence from the push. When in doubt, don't send the token.\n\n## Fallback chain (in order)\n\n1. **Hosted git-remote URL (verified).** The brain repo has a remote on a\n   host that renders files → build and verify as above.\n2. **Repo-relative path + scope note.** No hosted remote (the default PGLite\n   brain often has none, or the repo is local-only) → give the repo-relative\n   path (`people\u002Falice-example.md`) and say plainly that it's a local path\n   in the brain repo.\n3. **`gbrain publish` output as an attachable HTML ARTIFACT.** `gbrain\n   publish \u003Cpage-path>` emits a self-contained LOCAL HTML file (its output\n   line is `Published: \u003Clocal-path>`). Offer to attach or send that file —\n   NEVER present it as a URL, because it isn't one. Use `--password` for\n   sensitive content.\n\n## Subagent-relay rewrite rule\n\nSubagents run in local context and return LOCAL paths. Relaying a subagent\ncompletion verbatim is the #1 source of link bugs: the subagent reports\n`media\u002Fbooks\u002Fwidget-co-notes.md` (or an absolute path into the brain\ncheckout) and the relay parrots it. Before converting a subagent completion\ninto a user-facing reply, rewrite every brain-page path through the same\nderivation + fallback chain above.\n\nWhen spawning subagents that will write brain pages, include in their task\nprompt:\n\n> Report brain pages as repo-relative paths from `git ls-files --full-name`.\n> The parent rewrites them into links before relaying.\n\n## Bulk lists\n\nOne link per line, full URL (or fallback form), no backticks:\n\n```\nCreated 3 pages:\n- https:\u002F\u002Fgithub.com\u002F\u003Cowner>\u002F\u003Crepo>\u002Fblob\u002Fmain\u002Fpeople\u002Falice-example.md\n- https:\u002F\u002Fgithub.com\u002F\u003Cowner>\u002F\u003Crepo>\u002Fblob\u002Fmain\u002Fpeople\u002Fcharlie-example.md\n- https:\u002F\u002Fgithub.com\u002F\u003Cowner>\u002F\u003Crepo>\u002Fblob\u002Fmain\u002Fcompanies\u002Facme-example.md\n```\n\n## Scope note: links resolve for repo members only\n\nHosted-remote links into a private brain repo open only for people with\nrepo access. That's fine for the user's own chat surface; it is NOT a\nshareable link for an outside audience. For outside sharing, fall through\nto the `gbrain publish` artifact (step 3 of the fallback chain).\n\n## Contract\n\nThis skill guarantees:\n\n- Every outbound message reporting a brain-page write carries the link (or\n  fallback form) in that same message — the user never has to ask.\n- Links are built mechanically from git data (`git ls-files --full-name`,\n  `git remote get-url origin`), never composed from memory.\n- No hosted URL is sent before the push lands; verification (or ref-update\n  evidence) precedes the link.\n- Subagent relays are rewritten before delivery.\n- In-page cross-references stay relative, preserving the links\u002Fbacklinks\n  graph.\n- Routing matches the canonical triggers in the frontmatter.\n- Privacy contract preserved: no real names, no fork-specific filesystem\n  path literals, no upstream-fork references.\n\n## Output Format\n\nHosted remote (verified):\n\n> Done — pushed.\n> https:\u002F\u002Fgithub.com\u002F\u003Cowner>\u002F\u003Crepo>\u002Fblob\u002Fmain\u002Fconcepts\u002Fwidget-co-pricing.md\n>\n> Changes committed ([abc1234](https:\u002F\u002Fgithub.com\u002F\u003Cowner>\u002F\u003Crepo>\u002Fcommit\u002Fabc1234)):\n> - concepts\u002Fwidget-co-pricing.md (edit) — reworked the pricing section\n\nNo hosted remote (fallback steps 2–3):\n\n> Saved `concepts\u002Fwidget-co-pricing.md` in the brain repo (local path — this\n> brain has no hosted remote). Want a shareable HTML render? I can generate\n> one with `gbrain publish` and attach the file.\n\n## When it fails\n\nFollow the [agent operator protocol](..\u002Fconventions\u002Fagent-operator-protocol.md) for any gbrain error `code`, exit code, `[AGENT]` block or notice block. Specific to this skill:\n\n- A brain-page link would 404 because the page is uncommitted or unsynced: say the link is not live yet and give the repo-relative path; do not invent a hosted URL.\n- `get_page` \u002F `gbrain get` returns `page_not_found` for the slug you meant to link: resolve the real slug (search by title) before linking; never ship a guessed slug.\n- `gbrain publish` fails: give the user the repo-relative path with the scope note instead of a broken share link.\n\n## Anti-Patterns\n\n- ❌ \"Committed and pushed.\" — no link.\n- ❌ \"The page is live at `\u002Fabsolute\u002Flocal\u002Fpath\u002F...`\" — local absolute path\n  instead of a link or repo-relative fallback.\n- ❌ Committing, then waiting for the user to ask for the link.\n- ❌ Relaying a subagent result containing local brain paths verbatim.\n- ❌ Outputting hosted URLs BEFORE the push has landed (they 404 until the\n  push completes — push first, verify the ref moved, then link).\n- ❌ Presenting `gbrain publish` output as a URL. It emits a local HTML file\n  path; offer it as an attachable artifact.\n- ❌ Hand-stripping a cwd prefix to build the repo-relative path. Use\n  `git ls-files --full-name`.\n- ❌ Absolute URLs for page-to-page references INSIDE a brain page — breaks\n  the links\u002Fbacklinks graph that relational retrieval depends on.\n- ❌ Backticked paths in chat where a clickable link was possible.\n- ❌ Guessing or reconstructing a URL from memory.\n\n## Dedup (sharp boundaries)\n\n- `skills\u002Fpublish\u002FSKILL.md` — owns HOW to generate a shareable HTML\n  artifact (stripping, encryption, output options). brain-link-discipline\n  only decides WHEN to fall back to it, and forbids promising its output as\n  a URL.\n- `skills\u002F_output-rules.md` (Deterministic Links) — carries the cross-skill\n  CANON: deterministic construction, the in-page\u002Fin-message scope split, the\n  fallback chain. This skill carries the per-message MECHANICS: derivation,\n  ordering, verification, relay rewriting, bulk formatting.\n- `skills\u002Fconventions\u002Fbrain-first.md` — states the one-line clickable-link\n  principle inside the lookup convention; this skill is its expansion for\n  delivery messages.\n- `skills\u002Fconventions\u002Fsubagent-routing.md` — how to route work to\n  subagents. This skill adds the path-rewrite obligation at the relay\n  boundary; subagent-routing says nothing about link\u002Fpath rewriting.\n- `skills\u002Fcitation-fixer\u002FSKILL.md` — fixes broken citations INSIDE existing\n  brain pages. Not about outbound message links.\n- `skills\u002Freports\u002FSKILL.md` — saves\u002Floads report pages. When a report\n  delivery message references brain pages, that message follows this\n  discipline; the reports skill itself carries no link rules.\n","# brain-link-discipline — The Link Is Part of the Deliverable\n\n> **Convention:** see [_output-rules.md](..\u002F_output-rules.md) — the\n> Deterministic Links section carries the cross-skill canon (in-page relative\n> vs in-message verified, plus the fallback chain). This skill carries the\n> mechanics: path derivation, push-before-link ordering, verification, the\n> subagent-relay rewrite, and bulk-list formatting.\n>\n> **Convention:** [conventions\u002Fbrain-first.md](..\u002Fconventions\u002Fbrain-first.md)\n> states the one-line principle (\"every brain page reference in output should\n> use a clickable link format appropriate to the deployment\"). This skill is\n> that line's full expansion.\n\nThis is a reporting convention the harness routes brain-page delivery\nmessages through — a standing rule to apply when composing such messages,\nnot a mechanical guarantee enforced by tooling.\n\n## The rule (same message)\n\nIf you commit and push a brain page, the link goes in the SAME message that\nreports the work. Every time. No \"let me commit and push\" without the link\nlanding in that same reply once the push succeeds. The user should never\nhave to ask \"give me the link\" or \"where is the page.\"\n\nThis applies to:\n\n- Any message reporting a created or edited brain page\n- Bulk reports (\"5 pages created\" — every page gets its own link line)\n- Referencing a brain page in normal conversation\n- Relaying subagent results that mention brain paths (rewrite first — see below)\n\nThe most common link bug is committing a brain page and forcing the user to\ngo find it. The link is a deliverable, not a follow-up.\n\n## Scope split: in-message vs in-page (the inversion)\n\nThe two output surfaces take OPPOSITE link forms:\n\n| Surface | Link form | Why |\n|---|---|---|\n| Chat message to the user | Absolute, verified URL (or the fallback chain below) | Repo-relative paths aren't clickable in chat surfaces |\n| Inside a brain page body | RELATIVE markdown link: `[Alice Example](..\u002Fpeople\u002Falice-example.md)` | gbrain's link extraction builds the links\u002Fbacklinks graph — which powers relational retrieval — from filesystem-relative links. An absolute URL between two brain pages is invisible to that graph |\n\n**Never write absolute URLs for page-to-page references inside a brain\npage.** Absolute URLs in a page body are for genuinely external targets\nonly. Frontmatter `related:` \u002F `people:` keys stay bare relative paths\n(machine-parsed, not rendered prose). After a link-heavy write,\n`gbrain check-backlinks check` audits the graph and `gbrain sync --no-pull`\nmakes the pages searchable.\n\n## Deriving the path mechanically\n\nThe repo-relative path a hosted git remote serves is relative to the **git\nrepo root** (`git rev-parse --show-toplevel`), NOT your current working\ndirectory. When the repo root sits above your working directory, hand-\nstripping your cwd prefix silently drops the intermediate directory segment\nand every link you build 404s. Never hand-strip a prefix. Derive:\n\n```bash\n# From anywhere inside the repo, prints the EXACT path the remote serves:\ncd \"$(dirname \u003Cfile>)\" && git ls-files --full-name \"$(basename \u003Cfile>)\"\n# e.g. people\u002Falice-example.md\n```\n\nThen assemble:\n\n```\nhttps:\u002F\u002F\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>\u002Fblob\u002F\u003Cbranch>\u002F\u003Cthat-exact-path>\n```\n\n- `\u003Chost>\u002F\u003Cowner>\u002F\u003Crepo>` from `git remote get-url origin`\n- `\u003Cbranch>` from `git rev-parse --abbrev-ref HEAD` (or the remote's default branch)\n- `\u002Fblob\u002F` for files, `\u002Ftree\u002F` for directories (GitHub-style hosts)\n\n## Sequence (push BEFORE link)\n\n1. Write\u002Fedit the brain file.\n2. `scripts\u002Fbrain-commit-push.sh \"\u003Cmsg>\" \u003Cfile>` (or\n   `gbrain git commit-push -m \"\u003Cmsg>\" -- \u003Cfile>` when the brain has no helper).\n   It commits only that file under the checkout's writer lock and pushes,\n   merging remote commits without touching other agents' files.\n3. **Verify the push landed** — the command must exit 0 and print\n   `pushed \u003Csha> to origin\u002F\u003Cbranch>` (or `nothing to commit`; a\n   `[gbrain notice]` that the checkout lags is still a landed push). A hosted\n   URL 404s until the push completes. On a non-zero exit, output no link:\n   retry once on `commit_lock_busy`; stop and tell the user on\n   `integrate_conflict` or `writer_coordinator_required`; never fall back to\n   stash, `pull --rebase` or a plain push\n   ([outcomes](https:\u002F\u002Fgithub.com\u002Fgarrytan\u002Fgbrain\u002Fblob\u002Fmaster\u002Fdocs\u002Fguides\u002Fshared-checkout-git.md#outcomes)).\n4. **In the SAME message that reports the commit, output the link** — as a\n   clickable markdown link or bare URL, never a backticked code span.\n\n## Verify before linking (when a hosted remote exists)\n\nBefore including a hosted-remote link in a user-facing message, confirm the\npath exists on the remote. GitHub example (private repos need a token):\n\n```bash\ncurl -sf -o \u002Fdev\u002Fnull -w '%{http_code}' \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  \"https:\u002F\u002Fapi.github.com\u002Frepos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fcontents\u002F\u003Crepo-relative-path>\"\n```\n\nOnly send the link on `200`. If you just pushed and the host API is lagging,\nthe push output proving the ref moved is sufficient evidence — but never\ninvent or guess a URL.\n\n**Send the token only to its issuing host.** The `Authorization: token` header\nabove targets `api.github.com` because the remote is a github.com remote. Never\nsend `$GITHUB_TOKEN` to a host you derived from `git remote get-url origin`\nwithout confirming it is the token's issuing host: a doctored or unexpected\nremote (`origin` pointed at an attacker's host, an enterprise\u002Fself-hosted host\nthe token isn't scoped to) would harvest the credential. For a github.com\nremote, use `api.github.com`. For any other remote, verify UNAUTHENTICATED (a\npublic-repo existence check needs no token) or skip verification and fall back\nto the ref-update evidence from the push. When in doubt, don't send the token.\n\n## Fallback chain (in order)\n\n1. **Hosted git-remote URL (verified).** The brain repo has a remote on a\n   host that renders files → build and verify as above.\n2. **Repo-relative path + scope note.** No hosted remote (the default PGLite\n   brain often has none, or the repo is local-only) → give the repo-relative\n   path (`people\u002Falice-example.md`) and say plainly that it's a local path\n   in the brain repo.\n3. **`gbrain publish` output as an attachable HTML ARTIFACT.** `gbrain\n   publish \u003Cpage-path>` emits a self-contained LOCAL HTML file (its output\n   line is `Published: \u003Clocal-path>`). Offer to attach or send that file —\n   NEVER present it as a URL, because it isn't one. Use `--password` for\n   sensitive content.\n\n## Subagent-relay rewrite rule\n\nSubagents run in local context and return LOCAL paths. Relaying a subagent\ncompletion verbatim is the #1 source of link bugs: the subagent reports\n`media\u002Fbooks\u002Fwidget-co-notes.md` (or an absolute path into the brain\ncheckout) and the relay parrots it. Before converting a subagent completion\ninto a user-facing reply, rewrite every brain-page path through the same\nderivation + fallback chain above.\n\nWhen spawning subagents that will write brain pages, include in their task\nprompt:\n\n> Report brain pages as repo-relative paths from `git ls-files --full-name`.\n> The parent rewrites them into links before relaying.\n\n## Bulk lists\n\nOne link per line, full URL (or fallback form), no backticks:\n\n```\nCreated 3 pages:\n- https:\u002F\u002Fgithub.com\u002F\u003Cowner>\u002F\u003Crepo>\u002Fblob\u002Fmain\u002Fpeople\u002Falice-example.md\n- https:\u002F\u002Fgithub.com\u002F\u003Cowner>\u002F\u003Crepo>\u002Fblob\u002Fmain\u002Fpeople\u002Fcharlie-example.md\n- https:\u002F\u002Fgithub.com\u002F\u003Cowner>\u002F\u003Crepo>\u002Fblob\u002Fmain\u002Fcompanies\u002Facme-example.md\n```\n\n## Scope note: links resolve for repo members only\n\nHosted-remote links into a private brain repo open only for people with\nrepo access. That's fine for the user's own chat surface; it is NOT a\nshareable link for an outside audience. For outside sharing, fall through\nto the `gbrain publish` artifact (step 3 of the fallback chain).\n\n## Contract\n\nThis skill guarantees:\n\n- Every outbound message reporting a brain-page write carries the link (or\n  fallback form) in that same message — the user never has to ask.\n- Links are built mechanically from git data (`git ls-files --full-name`,\n  `git remote get-url origin`), never composed from memory.\n- No hosted URL is sent before the push lands; verification (or ref-update\n  evidence) precedes the link.\n- Subagent relays are rewritten before delivery.\n- In-page cross-references stay relative, preserving the links\u002Fbacklinks\n  graph.\n- Routing matches the canonical triggers in the frontmatter.\n- Privacy contract preserved: no real names, no fork-specific filesystem\n  path literals, no upstream-fork references.\n\n## Output Format\n\nHosted remote (verified):\n\n> Done — pushed.\n> https:\u002F\u002Fgithub.com\u002F\u003Cowner>\u002F\u003Crepo>\u002Fblob\u002Fmain\u002Fconcepts\u002Fwidget-co-pricing.md\n>\n> Changes committed ([abc1234](https:\u002F\u002Fgithub.com\u002F\u003Cowner>\u002F\u003Crepo>\u002Fcommit\u002Fabc1234)):\n> - concepts\u002Fwidget-co-pricing.md (edit) — reworked the pricing section\n\nNo hosted remote (fallback steps 2–3):\n\n> Saved `concepts\u002Fwidget-co-pricing.md` in the brain repo (local path — this\n> brain has no hosted remote). Want a shareable HTML render? I can generate\n> one with `gbrain publish` and attach the file.\n\n## When it fails\n\nFollow the [agent operator protocol](..\u002Fconventions\u002Fagent-operator-protocol.md) for any gbrain error `code`, exit code, `[AGENT]` block or notice block. Specific to this skill:\n\n- A brain-page link would 404 because the page is uncommitted or unsynced: say the link is not live yet and give the repo-relative path; do not invent a hosted URL.\n- `get_page` \u002F `gbrain get` returns `page_not_found` for the slug you meant to link: resolve the real slug (search by title) before linking; never ship a guessed slug.\n- `gbrain publish` fails: give the user the repo-relative path with the scope note instead of a broken share link.\n\n## Anti-Patterns\n\n- ❌ \"Committed and pushed.\" — no link.\n- ❌ \"The page is live at `\u002Fabsolute\u002Flocal\u002Fpath\u002F...`\" — local absolute path\n  instead of a link or repo-relative fallback.\n- ❌ Committing, then waiting for the user to ask for the link.\n- ❌ Relaying a subagent result containing local brain paths verbatim.\n- ❌ Outputting hosted URLs BEFORE the push has landed (they 404 until the\n  push completes — push first, verify the ref moved, then link).\n- ❌ Presenting `gbrain publish` output as a URL. It emits a local HTML file\n  path; offer it as an attachable artifact.\n- ❌ Hand-stripping a cwd prefix to build the repo-relative path. Use\n  `git ls-files --full-name`.\n- ❌ Absolute URLs for page-to-page references INSIDE a brain page — breaks\n  the links\u002Fbacklinks graph that relational retrieval depends on.\n- ❌ Backticked paths in chat where a clickable link was possible.\n- ❌ Guessing or reconstructing a URL from memory.\n\n## Dedup (sharp boundaries)\n\n- `skills\u002Fpublish\u002FSKILL.md` — owns HOW to generate a shareable HTML\n  artifact (stripping, encryption, output options). brain-link-discipline\n  only decides WHEN to fall back to it, and forbids promising its output as\n  a URL.\n- `skills\u002F_output-rules.md` (Deterministic Links) — carries the cross-skill\n  CANON: deterministic construction, the in-page\u002Fin-message scope split, the\n  fallback chain. This skill carries the per-message MECHANICS: derivation,\n  ordering, verification, relay rewriting, bulk formatting.\n- `skills\u002Fconventions\u002Fbrain-first.md` — states the one-line clickable-link\n  principle inside the lookup convention; this skill is its expansion for\n  delivery messages.\n- `skills\u002Fconventions\u002Fsubagent-routing.md` — how to route work to\n  subagents. This skill adds the path-rewrite obligation at the relay\n  boundary; subagent-routing says nothing about link\u002Fpath rewriting.\n- `skills\u002Fcitation-fixer\u002FSKILL.md` — fixes broken citations INSIDE existing\n  brain pages. Not about outbound message links.\n- `skills\u002Freports\u002FSKILL.md` — saves\u002Floads report pages. When a report\n  delivery message references brain pages, that message follows this\n  discipline; the reports skill itself carries no link rules.\n",{"name":5,"version":24,"mutating":25,"triggers":26,"upstream":35,"brain_first":36,"description":37,"when_to_use":38,"writes_pages":20},"1.0.0",true,[27,28,29,30,31,32,33,34],"give me the link","where is the page","why does this link 404","brain link discipline","rewrite subagent paths","report the pages you created","send me a clickable link","link the page in the same message","brain-link-on-commit@fc834ee + brain-link-report@fc834ee","exempt","When you report a brain page to the user — created, edited, committed, or\nrelayed from a subagent — a working link is part of the deliverable, in the\nSAME message. Derive the path mechanically (git ls-files --full-name), push\nBEFORE linking, verify the link resolves when a hosted remote exists, and\ndegrade through a defined fallback chain when it doesn't. Inside brain\npages the rule inverts: relative links preserve the link graph; absolute\nURLs are for chat deliverables only.\n","Use when the user asks: \"give me the link\", \"where is the page\", \"why does this link 404\", \"brain link discipline\", \"rewrite subagent paths\".","feat\u002Flink-chat-distiller","b7935e119783c2f35d6d182ede452faf32de675c","plugin-variants\u002Fgbrain-coding\u002Fskills\u002Fbrain-link-discipline","https:\u002F\u002Fgithub.com\u002FcheRoma\u002Fgbrain-link-chat","https:\u002F\u002Fgithub.com\u002FcheRoma","https:\u002F\u002Fostov.dev","Engineer and founder of Ostov. Websites, Telegram apps, business automation and ERP\u002FCRM integrations.","2026-11-12 20:40:42",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":25},[49,52,55],{"tool":50,"command":51},"npx","npx skills add cheRoma\u002Fgbrain-link-chat --skill brain-link-discipline",{"tool":53,"command":54},"bunx","bunx skills add cheRoma\u002Fgbrain-link-chat --skill brain-link-discipline",{"tool":56,"command":57},"pnpm","pnpm dlx skills add cheRoma\u002Fgbrain-link-chat --skill brain-link-discipline","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FcheRoma\u002Fgbrain-link-chat\u002Fblob\u002Ffeat\u002Flink-chat-distiller\u002Fplugin-variants\u002Fgbrain-coding\u002Fskills\u002Fbrain-link-discipline\u002FSKILL.md",[60],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"routing-eval.jsonl","OTHER","其他",1269,"https:\u002F\u002Fgithub.com\u002FcheRoma\u002Fgbrain-link-chat\u002Fblob\u002Ffeat\u002Flink-chat-distiller\u002Fplugin-variants\u002Fgbrain-coding\u002Fskills\u002Fbrain-link-discipline\u002Frouting-eval.jsonl",[67,73,79,86,93,100],{"skillNo":68,"name":69,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M75M5HR90P229V66Q4Q1GM0W","query-helper","https:\u002F\u002Fgithub.com\u002FcheRoma\u002Fgbrain-link-chat\u002Fblob\u002Ffeat\u002Flink-chat-distiller\u002Ftest\u002Ffixtures\u002Fskill-catalog\u002Fskills\u002Fquery-helper\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M75M5GZ1WQB7NHR07QV38YB8","broken","https:\u002F\u002Fgithub.com\u002FcheRoma\u002Fgbrain-link-chat\u002Fblob\u002Ffeat\u002Flink-chat-distiller\u002Ftest\u002Ffixtures\u002Fskill-catalog\u002Fskills\u002Fbroken\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M75M5FDJV3M4GP71SKD31P33","brain-ops","Read, enrich, and write brain pages with source attribution.","https:\u002F\u002Fgithub.com\u002FcheRoma\u002Fgbrain-link-chat\u002Fblob\u002Ffeat\u002Flink-chat-distiller\u002Ftest\u002Ffixtures\u002Fskill-catalog\u002Fskills\u002Fbrain-ops\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M75M5DYW3WBGDC6M90YMC843","meeting-prep","Build a briefing before you meet someone, from their recent threads, open loops and what they care about.","https:\u002F\u002Fgithub.com\u002FcheRoma\u002Fgbrain-link-chat\u002Fblob\u002Ffeat\u002Flink-chat-distiller\u002Ftest\u002Ffixtures\u002Fskill-catalog-query\u002Fskills\u002Fmeeting-prep\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M75M5CJZX22MV7XKJQYEMC9Y","inbox-zero","Triage the inbox into replies, delegations and archives.","https:\u002F\u002Fgithub.com\u002FcheRoma\u002Fgbrain-link-chat\u002Fblob\u002Ffeat\u002Flink-chat-distiller\u002Ftest\u002Ffixtures\u002Fskill-catalog-query\u002Fskills\u002Finbox-zero\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M75M5B953478ACM9X3MPAX3P","deal-memo","Draft an investment memo from the deal pages and the founder history already in the brain.","https:\u002F\u002Fgithub.com\u002FcheRoma\u002Fgbrain-link-chat\u002Fblob\u002Ffeat\u002Flink-chat-distiller\u002Ftest\u002Ffixtures\u002Fskill-catalog-query\u002Fskills\u002Fdeal-memo\u002FSKILL.md",[],[]]