frontmatter-guard

Detect and repair YAML frontmatter errors in brain pages.

Updated May 16, 2026
One-click install
npx skills add https://github.com/Morris-UTRUST/GBrain-knowledge --skill frontmatter-guard-morris-utrust
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: frontmatter-guard
Source: https://github.com/Morris-UTRUST/GBrain-knowledge/tree/main/skills/frontmatter-guard
Command: npx skills add https://github.com/Morris-UTRUST/GBrain-knowledge --skill frontmatter-guard-morris-utrust

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

  • Validation classes include: MISSING_OPEN, MISSING_CLOSE, YAML_PARSE, SLUG_MISMATCH, NULL_BYTES, NESTED_QUOTES, EMPTY_FRONTMATTER.
  • Auto-fix with .bak backups on demand; shares logic with gbrain doctor frontmatter_integrity; per-source audit reporting.
  • Use cases include pre-ingestion validation, CI pre-commit checks, and routine brain health audits.

Quick Start

Run the frontmatter audit across brain pages to detect and repair frontmatter issues.

Frequently Asked Questions about frontmatter-guard

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

FAQPage Schema
How do I validate YAML frontmatter in brain pages before ingestion?▼

You can validate YAML frontmatter by running an audit across brain pages to detect missing open/close markers, YAML parse failures, slug mismatches, null bytes, and nested quotes before the content enters the brain.

Can I automatically fix malformed frontmatter without losing the original content?▼

Yes, you can auto-fix malformed frontmatter on demand; the tool creates .bak backups of the original pages before applying any automated repairs to ensure your content is not lost.

What causes a slug mismatch error during a frontmatter audit?▼

A slug mismatch error occurs when the slug field inside the YAML frontmatter does not align with the expected page identifier, which this validation process identifies and optionally repairs automatically.

Do I need the gbrain frontmatter tooling to run frontmatter validation?▼

Yes, running frontmatter validation and auto-repair requires the gbrain frontmatter tooling, as the skill wraps its CLI to provide agent-driven workflows for detecting and fixing malformed pages.

What is the best way to check brain health for YAML parse failures and empty frontmatter?▼

The best way to check brain health is to run a per-source audit report that identifies validation classes like YAML_PARSE, EMPTY_FRONTMATTER, and NULL_BYTES, sharing logic with the gbrain doctor.

Can I use frontmatter validation as a CI pre-commit check?▼

Yes, frontmatter validation is designed for CI pre-commit checks, allowing you to catch malformed pages with missing closing markers or nested quotes before they are ingested into the brain.