[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72YGHQ45KS9T2CJZ8BDVFMM":3,"skill-same:01M72YGHQ45KS9T2CJZ8BDVFMM":60},{"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":35,"commitSha":36,"skillDirectory":37,"forksCount":14,"repositoryHtmlUrl":38,"repositoryHomepageUrl":6,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":40,"install":41,"resources":53},"01M72YGHQ45KS9T2CJZ8BDVFMM","frontmatter-guard",null,"Validate and auto-repair YAML frontmatter on brain pages. Catches malformed\npages before they enter the brain (missing closing ---, nested quotes, slug\nmismatches, null bytes, empty frontmatter, YAML parse failures). Wraps the\n`gbrain frontmatter` CLI for agent-driven workflows.","Morris-UTRUST\u002FGBrain-knowledge","Morris-UTRUST","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F13375437?v=4","01M72YEA3A0GZ2EQY0ZXRVEB7E","陳冠榮","01M72YEA3VYSH6HF42JCT3T7HA",0,"MIT","https:\u002F\u002Fgithub.com\u002FMorris-UTRUST\u002FGBrain-knowledge\u002Fblob\u002Fmain\u002Fskills\u002Ffrontmatter-guard\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: frontmatter-guard\nversion: 1.0.0\ndescription: |\n  Validate and auto-repair YAML frontmatter on brain pages. Catches malformed\n  pages before they enter the brain (missing closing ---, nested quotes, slug\n  mismatches, null bytes, empty frontmatter, YAML parse failures). Wraps the\n  `gbrain frontmatter` CLI for agent-driven workflows.\ntriggers:\n  - \"validate frontmatter\"\n  - \"check frontmatter\"\n  - \"fix frontmatter\"\n  - \"frontmatter audit\"\n  - \"brain lint\"\ntools:\n  - exec\nmutating: true\n---\n\n# Frontmatter Guard Skill\n\n> **Convention:** see `skills\u002Fconventions\u002Fquality.md` for citation rules; this skill is structural validation, not citation auditing.\n\n## Contract\n\nThis skill guarantees:\n- Every brain page is scanned against the seven canonical frontmatter validation classes\n- Mechanical errors (nested quotes, missing closing `---`, null bytes, slug mismatch) are auto-repairable on demand with `.bak` backups\n- Validation logic is shared with `gbrain doctor`'s `frontmatter_integrity` subcheck — single source of truth\n- Reports per source (gbrain is multi-source since v0.18.0); never silently audits the wrong root\n\n## Why This Exists\n\nBrain pages pile up over months. Agents write them with malformed frontmatter:\n- Missing closing `---` (entity detector bugs)\n- Unstructured YAML in meeting pages (ingestion bugs)\n- Slug mismatches (path renames not propagated)\n- Null bytes (binary corruption from copy-paste accidents)\n- Nested double quotes in titles (`title: \"Phil \"Nick\" Last\"`)\n\nWithout a guard, these accumulate silently until `gbrain sync` chokes or search returns garbage. The guard makes the failure visible at audit time and trivially fixable.\n\n## Validation classes\n\n| Code | Meaning | Auto-fixable? |\n|------|---------|---------------|\n| `MISSING_OPEN` | File doesn't start with `---` | No (needs human) |\n| `MISSING_CLOSE` | No closing `---` before first heading | Yes |\n| `YAML_PARSE` | YAML failed to parse | Sometimes (depends on cause) |\n| `SLUG_MISMATCH` | Frontmatter `slug:` differs from path-derived slug | Yes (removes the field) |\n| `NULL_BYTES` | Binary corruption (`\\x00`) | Yes |\n| `NESTED_QUOTES` | `title: \"outer \"inner\" outer\"` shape | Yes |\n| `EMPTY_FRONTMATTER` | Open + close present but nothing between | No (needs human) |\n\n## Phases\n\n### Phase 1: Audit\n\nRun a read-only scan across all registered sources (or one with `--source \u003Cid>`).\n\n```bash\ngbrain frontmatter audit --json\n```\n\nReports:\n- Per-source counts grouped by error code\n- Sample of up to 20 affected pages per source\n- Total count\n- Scan timestamp\n\nOutput is JSON; agents parse `errors_by_code` and `per_source` to decide next steps.\n\n### Phase 2: Validate one path\n\nValidate a single file or directory (does not require source registration):\n\n```bash\ngbrain frontmatter validate \u003Cpath> --json\n```\n\nExit code 0 = clean; 1 = errors found. Use this in CI pipelines or pre-commit hooks.\n\n### Phase 3: Fix\n\nWhen issues are found:\n\n```bash\ngbrain frontmatter validate \u003Cpath> --fix\n```\n\n`--fix` writes `\u003Cfile>.bak` for every modified file before mutating. The backup is the safety contract — works whether the brain is a git repo or a plain directory.\n\n`--dry-run` previews without writing. Use this before applying fixes in batch.\n\n### Phase 4: Pre-commit hook (optional)\n\nFor brain repos that ARE git repos, install the pre-commit hook to block malformed pages from being committed in the first place:\n\n```bash\ngbrain frontmatter install-hook [--source \u003Cid>]\n```\n\nThe hook runs `gbrain frontmatter validate` against staged `.md`\u002F`.mdx` files. Bypass with `git commit --no-verify`.\n\n## Trigger words\n\nWhen the user says any of these, route here:\n- \"validate frontmatter\"\n- \"check frontmatter\"\n- \"fix frontmatter\"\n- \"frontmatter audit\"\n- \"brain lint\"\n\n## Output rules\n\n- Always run `gbrain frontmatter audit --json` first; never assume a brain is clean.\n- Surface counts to the user in plain language; do not dump raw JSON.\n- For `--fix` operations: state how many files will be modified BEFORE running, then confirm.\n- `SLUG_MISMATCH` fixes remove the frontmatter `slug:` field — gbrain derives slug from path. Mention this when the user's title is intentionally renamed.\n- Never auto-fix `MISSING_OPEN` or `EMPTY_FRONTMATTER` without explicit user input — these usually mean a human author started a page and didn't finish.\n\n## Chains with\n\n- `gbrain doctor` — the `frontmatter_integrity` subcheck reports the same counts as `audit`.\n- `skills\u002Fmaintain\u002FSKILL.md` — broader brain health audit; chain after this skill if other classes of issue are suspected.\n- `skills\u002Flint\u002FSKILL.md` (via `gbrain lint`) — overlapping rules for skill-file lint; the `frontmatter-*` rule names in lint output come from this skill's validation surface.\n\n## Output Format\n\nAudit summary (terse, agent-friendly):\n\n```\nFrontmatter audit — 17 issue(s) across 1 source(s)\n\n[default] \u002FUsers\u002Fme\u002Fbrain\n  17 issue(s)\n    MISSING_CLOSE: 8\n    NESTED_QUOTES: 5\n    NULL_BYTES: 4\n  sample:\n    people\u002Fjane.md — MISSING_CLOSE\n    companies\u002Facme.md — NESTED_QUOTES\n    (+ 12 more)\n\nFix with: gbrain frontmatter validate \u002FUsers\u002Fme\u002Fbrain --fix\n```\n\nJSON envelope (when `--json` is passed):\n\n```json\n{\n  \"ok\": false,\n  \"total\": 17,\n  \"errors_by_code\": { \"MISSING_CLOSE\": 8, \"NESTED_QUOTES\": 5, \"NULL_BYTES\": 4 },\n  \"per_source\": [\n    {\n      \"source_id\": \"default\",\n      \"source_path\": \"\u002FUsers\u002Fme\u002Fbrain\",\n      \"total\": 17,\n      \"errors_by_code\": { \"MISSING_CLOSE\": 8, \"NESTED_QUOTES\": 5, \"NULL_BYTES\": 4 },\n      \"sample\": [{ \"path\": \"people\u002Fjane.md\", \"codes\": [\"MISSING_CLOSE\"] }]\n    }\n  ],\n  \"scanned_at\": \"2026-04-25T22:30:00.000Z\"\n}\n```\n\n`gbrain frontmatter validate \u003Cpath> --json` returns a similar envelope keyed on per-file results instead of per-source.\n\n## Anti-Patterns\n\n**Don't auto-fix `MISSING_OPEN` or `EMPTY_FRONTMATTER` without user input.** These usually mean a human author started a page and didn't finish — silently inserting `---` markers around an unfinished draft is wrong.\n\n**Don't use `--fix` to \"make doctor green\" without reading the audit first.** SLUG_MISMATCH cases are surfaced for manual review specifically because gbrain derives the slug from path. A mismatch usually means the user renamed a file intentionally; auto-removing the slug field is the right outcome only when you've confirmed the rename was deliberate.\n\n**Don't skip the `.bak` backups.** The `.bak` is the safety contract for non-git brain repos. If `.bak` files accumulate after a fix run, that's a feature, not a bug — the user can review the diffs and delete the backups when satisfied.\n\n**Don't run `audit` on a brain where sources aren't registered.** The CLI returns \"no registered sources to audit\" gracefully, but the migration emits a `skipped: no_sources` phase result. Don't paper over this with a manual path-walk; the right fix is to register the source via `gbrain sources add`.\n\n**Don't install the pre-commit hook on non-git brain dirs.** The install-hook command skips them automatically with a one-line note. If you see \"skipped — not a git repo\" and want validation at write time anyway, use the `audit` command on a cron schedule.\n","# Frontmatter Guard Skill\n\n> **Convention:** see `skills\u002Fconventions\u002Fquality.md` for citation rules; this skill is structural validation, not citation auditing.\n\n## Contract\n\nThis skill guarantees:\n- Every brain page is scanned against the seven canonical frontmatter validation classes\n- Mechanical errors (nested quotes, missing closing `---`, null bytes, slug mismatch) are auto-repairable on demand with `.bak` backups\n- Validation logic is shared with `gbrain doctor`'s `frontmatter_integrity` subcheck — single source of truth\n- Reports per source (gbrain is multi-source since v0.18.0); never silently audits the wrong root\n\n## Why This Exists\n\nBrain pages pile up over months. Agents write them with malformed frontmatter:\n- Missing closing `---` (entity detector bugs)\n- Unstructured YAML in meeting pages (ingestion bugs)\n- Slug mismatches (path renames not propagated)\n- Null bytes (binary corruption from copy-paste accidents)\n- Nested double quotes in titles (`title: \"Phil \"Nick\" Last\"`)\n\nWithout a guard, these accumulate silently until `gbrain sync` chokes or search returns garbage. The guard makes the failure visible at audit time and trivially fixable.\n\n## Validation classes\n\n| Code | Meaning | Auto-fixable? |\n|------|---------|---------------|\n| `MISSING_OPEN` | File doesn't start with `---` | No (needs human) |\n| `MISSING_CLOSE` | No closing `---` before first heading | Yes |\n| `YAML_PARSE` | YAML failed to parse | Sometimes (depends on cause) |\n| `SLUG_MISMATCH` | Frontmatter `slug:` differs from path-derived slug | Yes (removes the field) |\n| `NULL_BYTES` | Binary corruption (`\\x00`) | Yes |\n| `NESTED_QUOTES` | `title: \"outer \"inner\" outer\"` shape | Yes |\n| `EMPTY_FRONTMATTER` | Open + close present but nothing between | No (needs human) |\n\n## Phases\n\n### Phase 1: Audit\n\nRun a read-only scan across all registered sources (or one with `--source \u003Cid>`).\n\n```bash\ngbrain frontmatter audit --json\n```\n\nReports:\n- Per-source counts grouped by error code\n- Sample of up to 20 affected pages per source\n- Total count\n- Scan timestamp\n\nOutput is JSON; agents parse `errors_by_code` and `per_source` to decide next steps.\n\n### Phase 2: Validate one path\n\nValidate a single file or directory (does not require source registration):\n\n```bash\ngbrain frontmatter validate \u003Cpath> --json\n```\n\nExit code 0 = clean; 1 = errors found. Use this in CI pipelines or pre-commit hooks.\n\n### Phase 3: Fix\n\nWhen issues are found:\n\n```bash\ngbrain frontmatter validate \u003Cpath> --fix\n```\n\n`--fix` writes `\u003Cfile>.bak` for every modified file before mutating. The backup is the safety contract — works whether the brain is a git repo or a plain directory.\n\n`--dry-run` previews without writing. Use this before applying fixes in batch.\n\n### Phase 4: Pre-commit hook (optional)\n\nFor brain repos that ARE git repos, install the pre-commit hook to block malformed pages from being committed in the first place:\n\n```bash\ngbrain frontmatter install-hook [--source \u003Cid>]\n```\n\nThe hook runs `gbrain frontmatter validate` against staged `.md`\u002F`.mdx` files. Bypass with `git commit --no-verify`.\n\n## Trigger words\n\nWhen the user says any of these, route here:\n- \"validate frontmatter\"\n- \"check frontmatter\"\n- \"fix frontmatter\"\n- \"frontmatter audit\"\n- \"brain lint\"\n\n## Output rules\n\n- Always run `gbrain frontmatter audit --json` first; never assume a brain is clean.\n- Surface counts to the user in plain language; do not dump raw JSON.\n- For `--fix` operations: state how many files will be modified BEFORE running, then confirm.\n- `SLUG_MISMATCH` fixes remove the frontmatter `slug:` field — gbrain derives slug from path. Mention this when the user's title is intentionally renamed.\n- Never auto-fix `MISSING_OPEN` or `EMPTY_FRONTMATTER` without explicit user input — these usually mean a human author started a page and didn't finish.\n\n## Chains with\n\n- `gbrain doctor` — the `frontmatter_integrity` subcheck reports the same counts as `audit`.\n- `skills\u002Fmaintain\u002FSKILL.md` — broader brain health audit; chain after this skill if other classes of issue are suspected.\n- `skills\u002Flint\u002FSKILL.md` (via `gbrain lint`) — overlapping rules for skill-file lint; the `frontmatter-*` rule names in lint output come from this skill's validation surface.\n\n## Output Format\n\nAudit summary (terse, agent-friendly):\n\n```\nFrontmatter audit — 17 issue(s) across 1 source(s)\n\n[default] \u002FUsers\u002Fme\u002Fbrain\n  17 issue(s)\n    MISSING_CLOSE: 8\n    NESTED_QUOTES: 5\n    NULL_BYTES: 4\n  sample:\n    people\u002Fjane.md — MISSING_CLOSE\n    companies\u002Facme.md — NESTED_QUOTES\n    (+ 12 more)\n\nFix with: gbrain frontmatter validate \u002FUsers\u002Fme\u002Fbrain --fix\n```\n\nJSON envelope (when `--json` is passed):\n\n```json\n{\n  \"ok\": false,\n  \"total\": 17,\n  \"errors_by_code\": { \"MISSING_CLOSE\": 8, \"NESTED_QUOTES\": 5, \"NULL_BYTES\": 4 },\n  \"per_source\": [\n    {\n      \"source_id\": \"default\",\n      \"source_path\": \"\u002FUsers\u002Fme\u002Fbrain\",\n      \"total\": 17,\n      \"errors_by_code\": { \"MISSING_CLOSE\": 8, \"NESTED_QUOTES\": 5, \"NULL_BYTES\": 4 },\n      \"sample\": [{ \"path\": \"people\u002Fjane.md\", \"codes\": [\"MISSING_CLOSE\"] }]\n    }\n  ],\n  \"scanned_at\": \"2026-04-25T22:30:00.000Z\"\n}\n```\n\n`gbrain frontmatter validate \u003Cpath> --json` returns a similar envelope keyed on per-file results instead of per-source.\n\n## Anti-Patterns\n\n**Don't auto-fix `MISSING_OPEN` or `EMPTY_FRONTMATTER` without user input.** These usually mean a human author started a page and didn't finish — silently inserting `---` markers around an unfinished draft is wrong.\n\n**Don't use `--fix` to \"make doctor green\" without reading the audit first.** SLUG_MISMATCH cases are surfaced for manual review specifically because gbrain derives the slug from path. A mismatch usually means the user renamed a file intentionally; auto-removing the slug field is the right outcome only when you've confirmed the rename was deliberate.\n\n**Don't skip the `.bak` backups.** The `.bak` is the safety contract for non-git brain repos. If `.bak` files accumulate after a fix run, that's a feature, not a bug — the user can review the diffs and delete the backups when satisfied.\n\n**Don't run `audit` on a brain where sources aren't registered.** The CLI returns \"no registered sources to audit\" gracefully, but the migration emits a `skipped: no_sources` phase result. Don't paper over this with a manual path-walk; the right fix is to register the source via `gbrain sources add`.\n\n**Don't install the pre-commit hook on non-git brain dirs.** The install-hook command skips them automatically with a one-line note. If you see \"skipped — not a git repo\" and want validation at write time anyway, use the `audit` command on a cron schedule.\n",{"name":5,"tools":24,"version":26,"mutating":27,"triggers":28,"description":34},[25],"exec","1.0.0",true,[29,30,31,32,33],"validate frontmatter","check frontmatter","fix frontmatter","frontmatter audit","brain lint","Validate and auto-repair YAML frontmatter on brain pages. Catches malformed\npages before they enter the brain (missing closing ---, nested quotes, slug\nmismatches, null bytes, empty frontmatter, YAML parse failures). Wraps the\n`gbrain frontmatter` CLI for agent-driven workflows.\n","main","d5a406455378d589b645b3744f2ceae49d0b6e23","skills\u002Ffrontmatter-guard","https:\u002F\u002Fgithub.com\u002FMorris-UTRUST\u002FGBrain-knowledge","https:\u002F\u002Fgithub.com\u002FMorris-UTRUST","2026-05-17 23:07:15",{"source":8,"skillName":5,"commands":42,"prompt":52,"zipAvailable":27},[43,46,49],{"tool":44,"command":45},"npx","npx skills add Morris-UTRUST\u002FGBrain-knowledge --skill frontmatter-guard",{"tool":47,"command":48},"bunx","bunx skills add Morris-UTRUST\u002FGBrain-knowledge --skill frontmatter-guard",{"tool":50,"command":51},"pnpm","pnpm dlx skills add Morris-UTRUST\u002FGBrain-knowledge --skill frontmatter-guard","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMorris-UTRUST\u002FGBrain-knowledge\u002Fblob\u002Fmain\u002Fskills\u002Ffrontmatter-guard\u002FSKILL.md",[54],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"routing-eval.jsonl","OTHER","其他",673,"https:\u002F\u002Fgithub.com\u002FMorris-UTRUST\u002FGBrain-knowledge\u002Fblob\u002Fmain\u002Fskills\u002Ffrontmatter-guard\u002Frouting-eval.jsonl",[61,68,75,82,89,96],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M72YKMKH4254SNHQZ5PNHDT9","signal-detector","Always-on ambient signal capture for the OpenClaw reference fixture.","https:\u002F\u002Fgithub.com\u002FMorris-UTRUST\u002FGBrain-knowledge\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fopenclaw-reference-minimal\u002Fskills\u002Fsignal-detector\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M72YKJXCNATARDEE5E1GKGV4","query","Look up brain pages in the OpenClaw reference fixture.","https:\u002F\u002Fgithub.com\u002FMorris-UTRUST\u002FGBrain-knowledge\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fopenclaw-reference-minimal\u002Fskills\u002Fquery\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M72YKH458S74JP3C0TVM9VW8","context-now","ALWAYS-ON time-sensitivity discipline for the OpenClaw reference fixture.","https:\u002F\u002Fgithub.com\u002FMorris-UTRUST\u002FGBrain-knowledge\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fopenclaw-reference-minimal\u002Fskills\u002Fcontext-now\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M72YKFAB0TMQ96YB1K1ZSADE","brain-ops","Core read\u002Fwrite cycle for the OpenClaw reference fixture.","https:\u002F\u002Fgithub.com\u002FMorris-UTRUST\u002FGBrain-knowledge\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fopenclaw-reference-minimal\u002Fskills\u002Fbrain-ops\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M72YKC9DHWBE0TPH75KGN55Q","webhook-transforms","Generic framework for converting external events (SMS, meetings, social mentions)\ninto brain-ingestible signals. Define a transform function, register a webhook URL,\nand incoming events get processed through the brain pipeline.","https:\u002F\u002Fgithub.com\u002FMorris-UTRUST\u002FGBrain-knowledge\u002Fblob\u002Fmain\u002Fskills\u002Fwebhook-transforms\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M72YK9J860QDTNRSVKBDA9M6","voice-note-ingest","Ingest a voice note with exact-phrasing preservation (never paraphrased). Routes content to originals\u002F, concepts\u002F, people\u002F, companies\u002F, ideas\u002F, personal\u002F, or voice-notes\u002F based on a decision tree. The user's exact words are the signal.","https:\u002F\u002Fgithub.com\u002FMorris-UTRUST\u002FGBrain-knowledge\u002Fblob\u002Fmain\u002Fskills\u002Fvoice-note-ingest\u002FSKILL.md",[],[]]