frontmatter-guard

Detects and repairs invalid YAML frontmatter in brain pages.

1|Updated May 12, 2026
One-click install
npx skills add https://github.com/ltdrew/Agent-brain-2 --skill frontmatter-guard-ltdrew
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontmatter-guard
Source: https://github.com/ltdrew/Agent-brain-2/tree/main/skills/frontmatter-guard
Command: npx skills add https://github.com/ltdrew/Agent-brain-2 --skill frontmatter-guard-ltdrew

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

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). Wraps the gbrain frontmatter CLI for agent-driven workflows.

Core Features & Use Cases

  • Audits brain pages against seven canonical frontmatter validation classes to surface issues early.
  • Auto-fixes common problems (with backups) and records changes for traceability.
  • Enforces consistency with shared frontmatter integrity logic used by gbrain doctor to ensure a single source of truth.
  • Produces per-source reports to avoid silent audits and misapplied checks across repositories.

Quick Start

Run the frontmatter audit across your brain to identify issues, then run gbrain frontmatter validate <path> --fix to automatically repair them with backups.

Frequently Asked Questions about frontmatter-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate and fix malformed YAML frontmatter in markdown pages?

YAML frontmatter validation audits brain pages against seven canonical validation classes to catch malformed structures, YAML parse failures, and empty frontmatter before ingestion. It wraps the gbrain frontmatter CLI for automated agent-driven workflows.

Why does my markdown file fail to parse due to invalid frontmatter?

Frontmatter parsing fails when pages contain missing closing delimiters, nested quotes, slug mismatches, null bytes, or empty metadata blocks. Running an automated frontmatter audit surfaces these exact validation issues before page ingestion.

What's the best way to automatically repair slug mismatches and missing delimiters in frontmatter?

To automatically repair slug mismatches and missing delimiters, run an automated frontmatter audit with a fix flag. This repairs malformed YAML structures while creating optional backups and recording changes for traceability.

Can I audit frontmatter consistency across multiple content repositories before ingestion?

Yes, you can audit frontmatter consistency across multiple repositories. The validation process generates per-source reports to prevent silent audits and misapplied checks across repositories before multi-source brain content ingestion.

Does the frontmatter validation logic share rules with gbrain doctor?

Yes, the validation logic shares a single source of truth with gbrain doctor's frontmatter_integrity checks. This ensures consistent integrity validation rules across both the automated audit workflows and the gbrain doctor environment.