Frontmatter guard
Audit and carefully repair YAML frontmatter issues reported by gbrain. Use for frontmatter audit, brain lint, malformed YAML, missing delimiters, nested quotes, or gbrain doctor frontmatter warnings.From its SKILL.md
npx -y skills add Walliiee/agent-harness --skill frontmatter-guardAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
5.1 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
Frontmatter Guard
Use this skill to inspect and repair Markdown/YAML frontmatter issues surfaced
by gbrain doctor or gbrain frontmatter. It is conservative by default:
audit first, classify second, and only mutate after the exact target set is
clear.
Environment
Always target the real gbrain home:
GBRAIN_HOME=$HOME gbrain frontmatter ...
Do not run bare gbrain commands from Codex/OpenClaw synthetic HOME.
Default Flow
-
Run the read-only audit:
GBRAIN_HOME=$HOME gbrain frontmatter audit --json -
Summarize counts by source and error code. Do not paste raw JSON unless asked.
-
Separate structural noise from real corruption:
MISSING_OPENon normal root/reference Markdown can be acceptable.EMPTY_FRONTMATTER,YAML_PARSE,NESTED_QUOTES,NULL_BYTES, andMISSING_CLOSEare stronger repair candidates.
-
For one path or a small reviewed set, validate before fixing:
GBRAIN_HOME=$HOME gbrain frontmatter validate <path> --json -
Preview fixes before writing:
GBRAIN_HOME=$HOME gbrain frontmatter validate <path> --fix --dry-run -
Apply
--fixonly after the user has approved the target path/set, or when the requested task explicitly authorizes repair for those files.
Fix Policy
NULL_BYTES,MISSING_CLOSE,NESTED_QUOTES,SLUG_MISMATCH: usually mechanical; still preview first.YAML_PARSE: inspect before fixing; causes vary.MISSING_OPEN: do not auto-fix globally. Many Markdown files are intentionally plain documents, not gbrain entity pages.EMPTY_FRONTMATTER: do not auto-fix without reading the file.
gbrain frontmatter validate --fix writes .bak files. Treat those backups as
expected safety artifacts; do not delete them unless asked.
Canonical-shape check (OpenClaw-specific)
gbrain frontmatter validate only checks YAML structural integrity. It does
NOT enforce OpenClaw's canonical wiki/* frontmatter shape.
Canonical shape: flat top-level, gbrain quartet first (type/title/tags
— what gbrain extracts to dedicated columns per gbrain/src/core/markdown.ts:96-99),
then Claude/QMD hooks (name/description), then dates/source. NO metadata:
nesting.
Use bin/check-canonical-shape.py (sibling script) to enforce:
# Scan all OpenClaw wiki/* dirs across workspaces
${OPENCLAW_HOME}/skills/frontmatter-guard/bin/check-canonical-shape.py --wiki --summary
# Scan one path
${OPENCLAW_HOME}/skills/frontmatter-guard/bin/check-canonical-shape.py ${OPENCLAW_HOME}/workspace/wiki
# Machine-readable for cron / weekly check-invariants
${OPENCLAW_HOME}/skills/frontmatter-guard/bin/check-canonical-shape.py --wiki --json
Error codes emitted:
| Code | Meaning | Fix |
|---|---|---|
CANONICAL_MISSING_TYPE | No top-level type: — gbrain can't extract to pages.type | Add top-level type: matching the folder (e.g. wiki/people/ → type: person) |
CANONICAL_MISSING_TITLE | No top-level title: — gbrain falls back to humanized filename | Add top-level title: matching the body H1 |
CANONICAL_METADATA_NESTING | metadata: block contains type or title (legacy Option A shape) | Promote nested fields to top-level, delete metadata: block |
CANONICAL_SLUG_MISMATCH | name: doesn't equal filename stem | Set name: to the kebab-case filename (no .md) |
CANONICAL_EXPLICIT_SLUG | Has explicit slug: (creates SLUG_MISMATCH trap) | Remove slug: — gbrain auto-derives via inferSlug(filePath) |
Repair pattern for a single file: read it, identify which fields are nested or
missing, rewrite the frontmatter block keeping body unchanged. The transform
script at bin/canonicalize-wiki-frontmatter.py (sibling) is the reusable
batch fixer — point its WIKI_ROOT at the target dir (default is
workspace/wiki/), it walks all .md files and rewrites frontmatter to the
canonical hybrid shape while preserving body content. Used 2026-06-11 to
transform 99 main-workspace wiki files.
Scope Guidance
Prefer source-scoped or directory-scoped work:
GBRAIN_HOME=$HOME gbrain frontmatter audit --source learn --json
GBRAIN_HOME=$HOME gbrain frontmatter validate ${OPENCLAW_HOME}/workspace/wiki --json
Avoid full-workspace repair runs. The current workspace intentionally contains many plain Markdown control files.
Report Format
Frontmatter audit: <total> issue(s)
Top repair candidates: <codes/counts>
Likely acceptable/noise: <codes/counts>
Recommended next path: <path or source>
No files changed.
After a fix:
Fixed: <n> file(s)
Backups: <n> .bak file(s)
Verified: <command/result>
Remaining: <summary>
What ships with it: 2 files
13.3 KB alongside SKILL.md, 2 of them executable
bin/
- canonicalize-wiki-frontmatter.pyruns6.5 KB
- check-canonical-shape.pyruns6.9 KB
Gives 0 of the 12 instructions most quality gates skills give in ~1.2k tokens
Counted across 1,195 of the 2,094 authors here whose files we hold, read 2026-08-07
- Read the output and check the exit codein 54 of 1195, across 14 files
- Verify requirements using a line-by-line checklistin 53 of 1195, across 12 files
- Identify the verification command proving the claimin 51 of 1195, across 12 files
- Run the full verification commandin 50 of 1195, across 11 files
- Verify output confirms the claimin 49 of 1195, across 12 files
- Check version control diff after agent delegationin 46 of 1195, across 6 files
- State claim with evidencein 44 of 1195, across 4 files
- Run the test suitein 33 of 1195, across 26 files
- Keep state in memory by defaultin 27 of 1195, across 6 files
- Make prototype runnable with one commandin 26 of 1195, across 5 files
- Produce a verification reportin 25 of 1195, across 14 files
- Detect the package manager from lockfilesin 24 of 1195, across 5 files
Said here and by no other author read
- target the real gbrain home
- summarize counts by source and error code
- separate structural noise from real corruption
- validate a path before fixing it
- preview fixes before writing
- apply fixes only after user approves the target set
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.