frontmatter-guard

Audit and repair malformed Markdown YAML frontmatter with validation before mutation.

Updated Jun 23, 2026
One-click install
npx skills add https://github.com/Walliiee/agent-harness --skill frontmatter-guard-walliiee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontmatter-guard
Source: https://github.com/Walliiee/agent-harness/tree/main/skills/frontmatter-guard
Command: npx skills add https://github.com/Walliiee/agent-harness --skill frontmatter-guard-walliiee

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pyyaml, and includes scripts (resource) components.

What problem does it solve?

This Skill helps you detect, audit, and safely repair malformed YAML frontmatter in Markdown files so downstream tools can read metadata reliably.

Core Features & Use Cases

  • Frontmatter auditing: Scan for missing delimiters, parse errors, nested quotes, null bytes, and other frontmatter problems reported by gbrain.
  • Conservative repair workflow: Validate first, preview fixes, and only apply changes after the target files are clearly identified and approved.
  • Canonical shape enforcement: Check and normalize wiki-style frontmatter so top-level fields like type, title, tags, name, and description are consistent.
  • Use case: A knowledge base or agent workspace starts failing lint checks after a bulk edit; this Skill pinpoints the damaged files and guides a safe correction pass.

Quick Start

Ask the assistant to audit the affected Markdown files for frontmatter issues and propose the smallest safe repair plan.

Frequently Asked Questions about frontmatter-guard

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

FAQPage Schema
How do I fix malformed YAML frontmatter in Markdown files?

You can fix malformed YAML frontmatter by running a validation pass to detect missing delimiters and parse errors, then applying conservative file-by-file remediation to safely repair the metadata blocks.

Why does frontmatter validation fail after a bulk wiki page edit?

Frontmatter validation fails after bulk edits because mass changes often introduce malformed delimiters, nested quote issues, or null bytes that break YAML parsing and block reliable metadata extraction.

How do I normalize frontmatter fields like type, title, and tags for wiki pages?

You normalize wiki-style frontmatter by enforcing a canonical shape, checking that top-level fields like type, title, tags, name, and description are consistent across the Markdown files.

Is it safe to repair frontmatter without altering the Markdown body content?

Yes, safe frontmatter repair requires preserving the body content strictly, validating read-only first, and maintaining backup files created during the mutation to prevent data loss.

Does PyYAML support repairing nested quotes and null bytes in frontmatter?

PyYAML supports parsing YAML structures, but repairing nested quotes and null bytes in frontmatter requires a conservative validation workflow that safely handles these parse errors before applying mutations.

What is the best way to audit frontmatter before it breaks knowledge base retrieval?

The best way to audit frontmatter before it breaks retrieval is to scan Markdown files for missing delimiters and canonical shape mismatches, proposing the smallest safe repair plan before mutating.