generate-markdown
Installation
SKILL.md
Populate the markdown field (type: 'code', language: 'markdown') on a page or blog.post document, via the Sanity MCP connector only. This field is served verbatim at <slug>.md (src/app/(frontend)/api/md/[...slug]/route.ts) and gates whether the document appears in /llms.txt (src/app/llms.txt/route.ts requires length(markdown.code) > 0). Nothing generates it automatically — it's hand-curated, and this skill is that curation step.
Step 1 — Load the schema and document
- Confirm the Sanity MCP connector is available (
whoami/list_projects); confirm project id + dataset (default datasetproduction). - Fetch the target document with
get_document(orquery_documentsif you only have a slug, not an id). - Check
_type— the source field differs:blog.post→ convert thecontentfield (a Portable Text array).page→ convert themodulesfield (an array of heterogeneous module objects — see Step 4).
- If a module or field shape is unfamiliar, read its schema at
src/modules/<module-name>/schema.tsrather than guessing.
Step 2 — Convert Portable Text to Markdown
Walk the block array in order. Transcribe verbatim — no paraphrasing, no reordering, no dropped sentences.