agentsclimarketplace

Markdown post frontmatter validation

Skill jacob-balslev/skill-graph/examples/projects/markdown-static-site/skills/markdown-post-frontmatter-validation

Use when authoring or reviewing the frontmatter of a markdown post — checking required fields (title, date, slug, tags), validating against the content schema in `lib/content/schema.ts`, catching ambiguous date formats or tags not in the controlled vocabulary, and ensuring the slug matches the file path. Activate this skill whenever the task touches files under `content/posts/**/*.md`, the `parsePostFrontmatter()` helper, or any code path that reads YAML frontmatter from a content file. Do NOT use for general YAML schema design (use a generic schema-design skill) or for chasing a specific build-time validation failure (use debugging).From its SKILL.md

Install
npx -y skills add jacob-balslev/skill-graph --skill markdown-post-frontmatter-validation

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 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

10.3 KB, 904 tokens by cl100k_base, as published. Nobody here has run it

Markdown Post Frontmatter Validation

Concept of the skill

What it is: The project-specific validation discipline for the YAML frontmatter on markdown posts. Mental model: Frontmatter is a typed interface between content files and the site runtime. Why it exists: Routing, indexes, tags, dates, and previews all depend on frontmatter being complete and unambiguous. What it is NOT: It is not general YAML schema design, parser performance work, or debugging a specific failed build. Adjacent concepts: Content schemas, slug derivation, controlled vocabularies, date normalization. One-line analogy: It is the checklist that makes every post safe for the build to consume. Common misconception: If the markdown renders, the frontmatter is good enough; metadata can break listing pages even when body content renders.

Coverage

  • Required-field enforcement — every post must declare title, date, slug, and tags; missing fields fail the build at parse time
  • Date format discipline — ISO 8601 with explicit timezone (2026-05-06T12:00:00Z); ambiguous formats like 2026-05-06 or 5/6/26 are rejected
  • Slug-to-path consistency — the slug field must match the post's directory name; out-of-sync slugs cause silent route conflicts
  • Controlled-vocabulary tagging — every tag in the post's tags array must appear in lib/content/tag-vocabulary.ts; lowercase, hyphen-separated, no synonyms
  • Schema evolution — when lib/content/schema.ts changes, every post's frontmatter is re-validated; existing posts that violate the new schema are flagged before the next build runs
  • Reserved-field protection — fields like _id, _internal, or any underscore-prefixed key are reserved for the build pipeline and rejected in author-facing frontmatter

Philosophy of the skill

The frontmatter block is the contract every post makes with the site's index, the router, and the renderer. If that contract is loose — if posts can omit fields, use ambiguous dates, or invent ad-hoc tags — the index drifts, routes silently overlap, and the search surface degrades. The cost of catching frontmatter bugs at build time is one re-run; the cost of catching them in production is a broken page or a missing entry in the archive. The rule is: validate at parse time, fail loud, and keep the schema small enough that authors can hold it in their head.

Key Files

FilePurpose
content/posts/_template.mdThe canonical template every new post copies — its frontmatter is the worked example of every required field
lib/content/schema.tsThe TypeScript schema (Zod or equivalent) that runtime validation calls
lib/content/parse-frontmatter.tsThe thin wrapper that reads the YAML block and runs schema.parse() — the failure surface for build-time errors

Verification

Before merging any change to a post's frontmatter or to the schema:

  • Every post has the four required fields: title, date, slug, tags
  • date is ISO 8601 with timezone (no naked YYYY-MM-DD, no locale-formatted dates)
  • slug matches the post's directory name exactly — not derived from title at runtime
  • Every tag in tags is present in lib/content/tag-vocabulary.ts (run npm run check:tags to confirm)
  • No underscore-prefixed fields (_id, _internal, etc.) — those are reserved for the pipeline
  • Schema changes (lib/content/schema.ts) are paired with a npm run validate:posts pass against the entire content/posts/**/*.md set

Do NOT Use When

Use insteadWhen
(a generic schema-design skill)The task is designing a new YAML schema for an unrelated domain
debuggingA specific build is failing and you need to reproduce the validation error from logs
documentationThe task is writing a runbook or contributor doc about the frontmatter format
refactorThe task is restructuring parse-frontmatter.ts without changing the validation contract

What ships with it: 1 file

444 B alongside SKILL.md

Keep looking

Skills are one crate of 326,852. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.