yfm

Write and lint YAML front matter for markdown files across multiple dialects.

4.6k|162|Updated Oct 1, 2022
One-click install
npx skills add https://github.com/x-cmd/x-cmd --skill yfm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: yfm
Source: https://github.com/x-cmd/x-cmd/tree/main/mod/skill0/lib/skill0/core/yfm
Command: npx skills add https://github.com/x-cmd/x-cmd --skill yfm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Markdown files used by agents, indexers, and ontology pipelines need consistent YAML front matter, but dialects differ widely (Agent Skills, Obsidian, Jekyll, Hugo), causing tag extraction errors and metadata drift.

Core Features & Use Cases

  • Three-field default convention: Standardizes markdown metadata on tags, description, and memo (an ISO 8601 timestamped revision log), with extensions like issue: for design stories and repo:/number: for GitHub issue bodies.
  • Helper commands: x yfm ls lists YFM blocks, x yfm init writes default blocks into markdown files, and x yfm lint validates blocks against their claimed dialect.
  • Dialect reference guides: Per-dialect extraction rules for Agent Skills, Obsidian, Jekyll, and Hugo, covering separator differences, reserved keys, and tag hierarchy semantics.
  • Use Case: When writing a GitHub issue body or a design story under .x-cmd/story/, generate a conforming front matter block and lint it so the ontology collector can index tags and relations correctly.

Quick Start

Ask the agent to add a standard YAML front matter block with tags, description, and memo to every markdown file in the current project and lint them for dialect conformance.

Frequently Asked Questions about yfm

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

FAQPage Schema
How do I add YAML front matter to markdown files?

Run `x yfm init [path]` to write a default front matter block with tags, description, and memo fields into each markdown file under the path. Use `x yfm ls` to inspect existing blocks before modifying them.

How do I validate YAML front matter in markdown?

Run `x yfm lint [path]` to check that each front matter block is valid YAML and follows the dialect it claims, such as Agent Skills, Obsidian, Jekyll, or Hugo conventions.

What is the difference between Obsidian and Jekyll front matter tags?

Obsidian requires tags as a YAML list with no spaces and supports slash hierarchies like inbox/to-read. Jekyll accepts either a list or a space-separated string, and treats categories separately from tags since categories affect URL paths.

Can Agent Skills front matter include custom top-level fields?

No. The Agent Skills spec defines a closed top-level set: name, description, license, compatibility, metadata, and allowed-tools. Custom fields like version or author must be placed inside the metadata map as string values.

When should I follow the x-cmd default front matter instead of another dialect?

Follow the existing dialect when a file is already governed by one, such as an Obsidian vault or Jekyll site. The x-cmd default of tags, description, and memo applies only when no other dialect governs the document.