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

  1. Confirm the Sanity MCP connector is available (whoami / list_projects); confirm project id + dataset (default dataset production).
  2. Fetch the target document with get_document (or query_documents if you only have a slug, not an id).
  3. Check _type — the source field differs:
    • blog.post → convert the content field (a Portable Text array).
    • page → convert the modules field (an array of heterogeneous module objects — see Step 4).
  4. If a module or field shape is unfamiliar, read its schema at src/modules/<module-name>/schema.ts rather than guessing.

Step 2 — Convert Portable Text to Markdown

Walk the block array in order. Transcribe verbatim — no paraphrasing, no reordering, no dropped sentences.

Installs
9
First Seen
Jul 7, 2026
generate-markdown — sanitypress/skills