मुख्य सामग्री पर जाएँ
Skillpedia
डॉक्यूमेंटेशन31k · #9302

frontmatter-guard

यह क्या करती है

यह स्किल हर ब्रेन पेज के छिपे हुए हेडर भाग की गलतियाँ जांचती है। आपकी पूर्व-दृश्य मंज़ूरी के बाद यह आम गलतियाँ अपने-आप ठीक कर सकती है।

कब इस्तेमाल करें

  • ✓जब कोई ब्रेन पेज सिंक न हो या खोज नतीजे गड़बड़ दिखाए।
  • ✓जब आप बड़े इंपोर्ट से पहले सारे पेजों में हेडर गलतियाँ जांचना चाहें।
  • ✓जब किसी पेज में बंद होने वाली लाइन न हो, नेस्टेड उद्धरण हों, या शीर्षक उसके फ़ाइल नाम से न मेल खाए।

Skill का लिंक

https://github.com/garrytan/gbrain/blob/master/plugin/skills/frontmatter-guard/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/garrytan/gbrain/blob/master/plugin/skills/frontmatter-guard/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे सारे ब्रेन पेज में खराब हेडर विवरण जांचिए, और लागू करने से पहले किसी भी सुधार का पूर्व-दृश्य मुझे दिखाइए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट हर पेज को मानक जांचों से मिलाता है। वह हर समस्या समझाता है, फिर बैकअप लेकर सुधार तभी लागू करता है जब आप पूर्व-दृश्य मंज़ूर करें।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Frontmatter Guard Skill

Convention: see skills/conventions/quality.md for citation rules; this skill is structural validation, not citation auditing.

Contract

This skill guarantees:

  • Every brain page is scanned against the eight canonical frontmatter validation classes
  • Mechanical errors (nested quotes, missing closing ---, null bytes, slug mismatch) are auto-repairable on demand with .bak backups
  • Validation logic is shared with gbrain doctor's frontmatter_integrity subcheck — single source of truth
  • Reports per source (gbrain is multi-source since v0.18.0); never silently audits the wrong root
  • Files sync holds are explained from their hold record (code, reason, key, line, fix) and fixed only through a previewed, hash-bound repair the user approved

Why This Exists

Brain pages pile up over months. Agents write them with malformed frontmatter:

  • Missing closing --- (entity detector bugs)
  • Unstructured YAML in meeting pages (ingestion bugs)
  • Slug mismatches (path renames not propagated)
  • Null bytes (binary corruption from copy-paste accidents)
  • Nested double quotes in titles (title: "Alice "Ace" Example")

Without 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.

Write brain files safely (do this first)

  • Write pages through put_page / capture (MCP or gbrain put). gbrain serializes frontmatter itself, so the file on disk is always valid YAML.

  • A script or agent that writes Markdown files directly must build frontmatter with a YAML serializer (yaml.dump, js-yaml dump), never by string interpolation. title: ${title} breaks as soon as a title contains : , #, quotes or a newline.

  • Check generated content before writing it, without touching disk:

    printf '%s' "$content" | gbrain frontmatter validate --stdin --path notes/2026-10-04-digest.md
    

    Exit 1 means fix it first. The default is the strict producer rule: YAML gbrain could still import by quoting a value fails too, because other tools reject it. --importable answers the narrower question "would sync hold it?".

  • Never write a key gbrain reads for access or identity (visibility, derived_from, slug, type, id, source_id) from untrusted text.

Held files: read them, then fix them

A file sync cannot import without guessing is held: the rest of the source still syncs, a new file has no page yet, and an existing page keeps its last good revision and refuses put_page until the file is repaired (do not retry the write). Where holds show up: sync output (Held <path>: <code> … Next: <command>), gbrain sources status <id> (--json: git_holds.items[]), doctor git_held_files, get_page file_held, and search hits marked stale.

Each hold record carries code, reason, key, line, message (location only, never the value), fix (exact argv) and docs. Act on reason:

Hold What to do
invalid_frontmatter / yaml_parse Preview gbrain repair frontmatter --source <id>; usually needs_review with the exact line to fix by hand.
invalid_frontmatter / needs_interpretation Preview with --include-ambiguous, show the user each per-file diff, apply only what they approve.
invalid_frontmatter / ambiguous_identity_key or ambiguous_protected_key; visibility_noncanonical Never guess. Show the user the line; they decide the one value (visibility decides who can read the page; page privacy reads only visibility: private, lowercase on its own line).
frontmatter_slug_conflict Remove the slug: line or move the file; the repair proposes removing it under --include-ambiguous.
file_too_large The file is over the fixed page limit (24 MiB for Markdown, 5 MB for code); every page under it is searchable, so never split one that fits. Ask the user to add it to sync.exclude, or to split it into files under the limit. A smaller page an MCP transport refused goes by file instead (docs/guides/memory-boundaries.md#large-page-limits).
content_rejected The user chose content_sanity.junk_disposition=reject; ask before changing it.

The fix flow (walkthrough with real output: docs/guides/repair.md#held-files):

gbrain sources status <id>                                  # what is held and why
gbrain repair frontmatter --source <id>                     # pass 1: safe quotin
अक्सर पूछे जाने वाले सवाल

क्या यह बिना पूछे मेरे पेज बदलेगी?

नहीं। सुधार पहले पूर्व-दृश्य में दिखते हैं, और बैकअप रखा जाता है।

यह किस तरह की गलतियाँ पकड़ती है?

बंद होने वाली लाइन की कमी, नेस्टेड उद्धरण, नाम का मेल न खाना, खाली हेडर और खराब अक्षर।

सिंक कुछ फ़ाइलें क्यों छोड़ देता है?

स्किल हर रोक का कारण उसके रिकॉर्ड से समझाती है और उसे केवल मंज़ूर किए गए सुधार से ठीक करती है।

जानकारी

लेखक का मूल विवरण

Validate and auto-repair YAML frontmatter on brain pages. Catches malformed pages before they enter the brain (missing closing ---, nested quotes, slug mismatches, null bytes, empty frontmatter, YAML parse failures), explains files sync holds instead of importing, and drives the previewed `gbrain repair frontmatter` fix. Wraps the `gbrain frontmatter` CLI for agent-driven workflows.

repo: garrytan/gbrain

लोकप्रियता

GitHub स्टार
31k
रैंकिंग में स्थान
#9302
लाइसेंस
MIT
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

gbrain

31k

यह आपके एजेंट को लोगों, प्रोजेक्ट और फ़ैसलों के बारे में तथ्य खोजने के लिए साझा कंपनी ज्ञान ब्रेन में खोजने और उसमें स्थायी नोट सहेजने देती है।

लेखन और डॉक्यूमेंटरिसर्च

brain-ingest-gate

31k

यह आपके एजेंट को नई सामग्री जोड़ने से पहले मौजूदा ज्ञान ब्रेन से जाँचने देती है, ताकि डुप्लिकेट न बनें और नामित इकाइयाँ पहले सुलझें।

लेखन और डॉक्यूमेंटरिसर्च

brain-link-discipline

31k

यह सुनिश्चित करती है कि आपका एजेंट हर उस ब्रेन पेज का काम करने वाला लिंक उसी संदेश में दे, जिसकी वह रिपोर्ट करता है, ताकि आप उसे तुरंत खोल सकें।

लेखन और डॉक्यूमेंटडॉक्यूमेंटेशन

brain-ops

31k

यह आपके एजेंट को ज्ञान ब्रेन की मुख्य दिनचर्या देती है: पहले मौजूदा संदर्भ जाँचना, स्पष्ट नोट उनके स्रोत के साथ सहेजना, और संबंधित पेज जोड़ना।

लेखन और डॉक्यूमेंटरिसर्च

मिलती-जुलती skills