# Split Markdown front matter and body before docs migrations, metadata audits, or static-site transforms

> Use gray-matter when an agent needs to open Markdown or content files, extract structured front matter, and pass clean body text plus metadata into the next step. This skill is for parsing and rewriting front matter safely, not for running a full CMS or static site generator.

- Skill: `agentskillexchange/split-markdown-front-matter-and-body-before-docs-migrations-` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agentskillexchange/split-markdown-front-matter-and-body-before-docs-migrations-`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agentskillexchange/split-markdown-front-matter-and-body-before-docs-migrations-/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: agentskillexchange (https://skillmd.com/u/agentskillexchange)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/agentskillexchange/split-markdown-front-matter-and-body-before-docs-migrations-

---


# Split Markdown front matter and body before docs migrations, metadata audits, or static-site transforms

Use gray-matter when an agent needs to open Markdown or content files, extract structured front matter, and pass clean body text plus metadata into the next step. This skill is for parsing and rewriting front matter safely, not for running a full CMS or static site generator.

## Prerequisites

Node.js, npm

## Installation

Use the upstream install or setup path that matches your environment:
- $ npm install --save gray-matter
- $ git clone https://github.com/jonschlinkert/gray-matter my-project

Requirements and caveats from upstream:
- Add the HTML in the following example to example.html, then add the following code to example.js and run $ node example (without the $):
- const fs = require('fs');
- const matter = require('gray-matter');

Basic usage or getting-started notes:
- sh
- ## Heads up!
- Please see the [changelog](CHANGELOG.md) to learn about breaking changes that were made in v3.0.

- Source: https://github.com/jonschlinkert/gray-matter
- Extracted from upstream docs: https://raw.githubusercontent.com/jonschlinkert/gray-matter/HEAD/README.md

## Documentation

- https://github.com/jonschlinkert/gray-matter

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/split-markdown-front-matter-and-body-before-docs-migrations-metadata-audits-or-static-site-transforms/)

