md-document

A tool for turning long Markdown documents—such as specifications, reports, plans, or RFCs (technical proposals)—into one readable HTML file.

In plain words
What is it for?
Use it to publish long technical documents as standalone HTML pages without needing a web framework.
Why use it?
Long Markdown files can be difficult to navigate. It adds a table of contents, section tracking while you scroll, search, and code-copy buttons.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/tmj-90/gaffer/md-document
Any agent
npx skills add tmj-90/gaffer --skill md-document
Clone the repo
git clone --depth 1 https://github.com/tmj-90/gaffer

Made for: Claude Code, Codex.

Per session 101 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 946 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00101 $0.00946
Opus 5 $0.00051 $0.00473
Sonnet 5 $0.00020 $0.00189
Haiku 4.5 $0.00010 $0.00095

Measured 2d ago against content hash 223d9154be1c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

md-document scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

runner/skills/md-document/SKILL.md · 72 lines

How it starts

The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Convert long-form markdown into a readable HTML document

Markdown wins for short content; a well-rendered HTML document wins for long specs and RFCs where navigation matters.

Minimum viable document features: sticky TOC, scrollspy, code-copy buttons, search filter. Single-file output — no framework runtime.

When to use (and when not to)

Input Action
Spec / RFC / report / plan / explainer ≥ 100 lines This skill
Slide deck (clear --- slide boundaries) slides-deck
Code review (diff blocks dominate) Not this skill
< 100 lines Leave as markdown — conversion overhead not worth it

Document structure requirements

The source markdown must have:

  • A single # Title (H1) — becomes the <title> and page heading.
  • ## Section (H2) headings — TOC entries.
  • ### Sub-section (H3) headings — TOC sub-entries (optional).

If the source lacks this hierarchy, impose it before converting — a flat markdown wall produces a flat, unusable HTML document.

Output spec

Single .html file with:

  • Sticky sidebar TOC — generated from H2/H3 headings; highlights current section on scroll (scrollspy).
  • Search filter — filters TOC entries and highlights matching sections; pure JS, no dependencies.
  • Code-copy buttons — on every <pre><code> block.
  • Design tokens — CSS custom properties for brand colour, font, spacing (use the repo's brand skill tokens if available; fall back to neutral defaults).
  • External dependencies — Google Fonts CSS + Prism.js CDN only; no framework runtime.
  • Print style — sidebar hidden; content full-width; page breaks before H2.

Steps

  1. Validate the input. Is it ≥ 100 lines? Does it have a clear H1 + H2 structure? If not, impose structure first.
  2. Check for design tokens. search_lore for brand colours and typography. If found, use them as CSS custom properties. If not, use neutral defaults.
  3. Convert markdown to HTML. Preserve all code blocks with language tags (Prism.js highlights them). Preserve tables, blockquotes, and lists.
  4. Generate the TOC from H2/H3 headings. Give each heading an id attribute (slugified heading text).
  5. Inject interactivity. Sticky TOC CSS; scrollspy JS (IntersectionObserver); search filter (input filters TOC items by text match, highlights matching sections); code-copy buttons.
  6. Inline all CSS. No external stylesheet except Google Fonts (single <link>). Prism.js via CDN <script> at body end.
  7. Verify. Open in browser; confirm TOC navigates correctly; confirm search filters; confirm Prism.js highlights code blocks; record evidence.

Read the full file on GitHub · 72 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 72 lines · 101 tokens per session scan A 223d9154be1c

Subscribe to this mod's changes

md-document is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 8d ago), licensed Apache-2.0. It adds 101 tokens to every session and 946 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

hive.pdf

Read, write, merge, split, rotate, watermark, encrypt, and OCR PDF files using Python (pypdf, pdfplumber, reportlab, pypdfium2) and command-line tools (poppler-utils, qpdf). Use when the user asks to extract text/tables/images from a PDF, create or modify a PDF, combine or split PDFs, OCR a scanned PDF…

aden-hive/hive · 98 tokens

docx

Create and edit Microsoft Word (.docx) documents to a professional standard — reports, proposals, contracts, letters, memos — with custom styles, multi-level lists, styled/merged tables, headers/footers, table of contents, hyperlinks, footnotes, tracked changes and comments. Use when the user asks Brigade to make…

spinabot/brigade · 90 tokens

pdf

Create and edit PDFs to a professional standard — generate from content, draw vector/precise layouts, embed custom (incl. CJK/Unicode) fonts, CREATE and fill AcroForm fields (text/checkbox/radio/dropdown), flatten, merge/split/rotate, stamp/watermark, encrypt, and extract text. Use when the user asks Brigade to make a…

spinabot/brigade · 97 tokens

xlsx

Build and edit professional Excel (.xlsx) spreadsheets, workbooks, and simple financial models — live formulas, number/date/currency formats, cell styling, conditional formatting, data-validation dropdowns, named ranges, frozen panes, merged cells, multi-sheet. Use when the user asks Brigade to make, fill, update…

spinabot/brigade · 79 tokens

notion-tool

Notion integration tool for searching, reading, creating, and updating pages and databases via the API. Use when: editing Notion pages, adding database rows, or searching a workspace.

xuiltul/animaworks · 41 tokens

lov-any2deck

Generate professional slide deck images from content (Markdown, text, URLs). Creates outlines with style instructions, then generates individual slide images. Supports 16 visual styles, CJK/Latin mixed text, branding overlays, and PPTX/PDF export. Use when the user asks to "create slides", "make a presentation"…

lovstudio/skills · 110 tokens