--- title: "/cs-md-document — Slash Command for AI Coding Agents" description: "Convert long-form markdown (specs, RFCs, reports, plans, explainers) into a single-file interactive HTML document. Runs the md-document pipeline. Slash command for Claude Code, Codex CLI, Gemini CLI." --- # /cs-md-document
Convert the markdown at **$ARGUMENTS** into a single-file interactive HTML document. ## Pre-flight gates (refuse, never override) 1. **Input < 100 lines** → refuse (markdown wins below the threshold per Shihipar). `wc -l` (vanilla `navigator.clipboard` with `execCommand` fallback)
- Smooth-scroll on TOC link clicks
- Prism.js syntax highlighting (autoloader fetches only the languages this doc uses)
- 12 brand CSS custom properties from the design-system's `derived_palette`
- `@media (prefers-reduced-motion: reduce)` honored
- Print-friendly via the browser's native print stylesheet (no `@page` overrides needed for documents)
## Hard rules
- Output is one `.html` file. No multi-file output, no extracted CSS/JS, no asset folders.
- External CDN: `fonts.googleapis.com` + `cdn.jsdelivr.net` (Prism). Nothing else.
- No JS framework runtime. Vanilla JS + IntersectionObserver only.
- Re-running on the same input writes `doc-{slug}-2.html` etc. (collision suffix).
## Output
Returns: input lines, output path, design style applied, top 3 features used, one forcing question.
## References
See `markdown-html/skills/md-document/references/`:
- `information_density_patterns.md` — Shihipar + Tufte + Wattenberger
- `toc_and_nav_ux.md` — NN/g + WCAG + ARIA
- `single_file_html_discipline.md` — Single-file artifact rationale