Why this exists

TL;DR

Most LLM-generated docs are flat markdown. No navigation, no structure, no editorial judgment. This skill fixes that — it decides what format each idea deserves before writing one line of HTML.

The problem isn't the render. It's the lack of editorial judgment before rendering. A causal relationship deserves a flowchart, not a bullet list. A named law deserves a structured card. An anti-pattern deserves symptom + cost + fix. docs-generator — README.md

Paste any essay, analysis, guide, or reference doc. The skill runs a 6-phase editorial process — parse, classify, compress, structure, render, deliver — and produces a single self-contained HTML file that opens in your browser instantly.

No build step. No npm. No server. Just a file that works.

What you get

01
3-column layout
Left nav for page switching. Main content centered. Right TOC with scroll-spy. Max-width 1440px.
02
Mermaid diagrams
Rendered on demand. Zoom + pan controls. Hidden pages don't break SVG sizing.
03
Light + dark theme
OKLCH design tokens. prefers-color-scheme aware. Both themes look intentional.
04
Self-contained HTML
Single file. All CSS inline. Fonts + libraries via CDN. Opens anywhere.

The 6 phases

TL;DR

Parse → decide format per section → compress → structure navigation → render using template → deliver. Never start writing HTML before Phases 1–3 are done.

flowchart LR
  P1["Phase 1\nParse & Inventory"] --> P2["Phase 2\nFormat Decision"]
  P2 --> P3["Phase 3\nCompression"]
  P3 --> P4["Phase 4\nNavigation"]
  P4 --> P5["Phase 5\nRender"]
  P5 --> P6["Phase 6\nDeliver"]

  classDef core fill:#7a2e0e18,stroke:#7a2e0e,stroke-width:1.5px,color:#7a2e0e
  classDef support fill:#0e3a2e14,stroke:#0e3a2e,stroke-width:1px,color:#0e3a2e
  class P2,P3 core
  class P1,P4,P5,P6 support
          

Phase 1 — Parse & Inventory. Read the full source. Detect macro-sections. Classify each: concept, law, pattern, anti-pattern, sequence, comparison, checklist. Flag redundancies and high-density sections that need compression.

Phase 2 — Format Decision. The core step. For each section, pick the rendering format that fits the content type. Not everything is a diagram. Not everything is a table. See the decision table below.

Format decision table

Content typeBest format
Cause → effect relationshipMermaid flowchart
Step-by-step processMermaid flowchart or numbered steps
Good vs bad practiceDoDont card
Spatial / layout conceptPatternVisual (HTML/CSS)
Named law + implication + actionLawBlock card
Set of operating principlesRuleCard grid
Failure modeAntiPattern card (symptom + cost + fix)
Abstract concept + definitionProse + TL;DR + applied example
Actionable checklistChecklist component
Closing compressionCompressionSummary

The rule: if it scans better than it reads → visual. If it needs nuance or argument → prose. If it has tabular structure → table. Never force visual where a precise sentence covers it better.

Compression rules

TL;DR

This is not caveman speak. It's editorial compression: precise, technical, scannable. Filler out. Vocabulary intact. One strong idea per sentence.

One idea per block Core rule

Each paragraph, card, or list item carries exactly one idea. If it can be split, split it. If it can be cut, cut it. If the reader can stop after the first sentence and have the key insight, the block is correct.

Specific rules
  • Sentences over 25 words can be split — do it
  • Remove: "cabe destacar que", "it's worth noting", "in this sense", "as we can see"
  • Pattern: noun + verb + impact — no padding before or after
  • Technical vocabulary stays intact — never simplify at the cost of precision
Apply Every section gets a 2–4 line TL;DR before the body. Write it last, after the section is compressed.

Before and after

Don't
The user rarely reads in a linear and sequential way; rather, they scan aggressively in search of semantic anchors that allow them to orient themselves within the content and decide whether it merits further attention.
44 words. One idea buried at the end. The reader has to work to find it.
Do
Users scan. They don't read.
They hunt for semantic anchors.
Visual hierarchy decides what survives the first glance.
19 words across 3 sentences. Same information. 3× faster to read.
Don't
It is important to mention that the format decision phase, which is the most critical step in the entire workflow, should be performed before any HTML generation begins.
Filler opener, passive construction, buried emphasis.
Do
Format decision is Phase 2 — the most important step. Never start writing HTML before it's done.
Direct. Emphasis up front. Action clear.

In short

Compression rules
  • One idea per block. Split anything over 25 words.
  • Kill filler openers. Start with the noun that matters.
  • Technical vocabulary is untouchable. Precision stays.
  • Write the TL;DR last — it forces you to know what the section is actually about.
  • If the reader can stop at the first sentence and have the key insight, you're done.

Available components

TL;DR

13 components. Each maps to a content type. Using the wrong component for a content type is an anti-pattern, not a stylistic choice.

TL;DR
Section opener
2–4 line compressed summary. Goes at the start of every section. Write it last.
LawBlock
Named principle
For named laws or frameworks. Includes definition, implications, and concrete action.
DoDont
Comparison
Good vs bad practice side by side. Needs a concrete why for each column.
RuleCard
Principles
3–6 operating principles in a scannable grid. Each card is self-contained.
AntiPattern
Failure mode
Symptom + cost + fix. Red left border signals a warning.
Mermaid
Flow / sequence
For causal chains, processes, and hierarchies. Always with zoom controls.
Table
Comparison rows
For structured data with 3+ rows. Law → implication → action format.
QuoteBlock
Anchor idea
One strong standalone idea. If you need to explain the quote, the quote is wrong.
Checklist
Actionable items
Binary verifiable conditions. Each item done or not done — no ambiguity.
Summary
Section closer
CompressionSummary — dense bullet list at section end. The section distilled.

Format mistakes

TL;DR

The most common failure is forcing a visual where prose is more precise. The second most common is decorating without information. Both come from skipping Phase 2.

Everything becomes a Mermaid diagram
Symptom Simple 3-item list rendered as a flowchart. Mermaid used for things that are just enumerations.
Cost Visual complexity without information gain. Slower to read than a list. Mermaid rendering overhead.
Fix Mermaid only for causal relationships, sequences, or hierarchies. If there's no directed connection between nodes, it's a list — render it as a list.
Decorative visuals with no semantic function
Symptom PatternVisual or diagram added to break up text. The visual doesn't add information — it just fills space.
Cost Reader learns to ignore visuals. The signal-to-noise ratio drops. Heavy pages load slower.
Fix Every visual must earn its place. Ask: does this convey something that prose cannot? If no, cut it.
Table for 2-column × 3-row data
Symptom A table with 2 columns and 3 rows — information that fits in two sentences.
Cost Visual overhead for minimal data. Table borders and headers add noise without aiding comprehension.
Fix Inline it. "X does Y. Z does W." Tables earn their place at 4+ rows or 3+ columns.
Skipping the TL;DR
Symptom Sections start with context or background prose instead of the key idea.
Cost Scanners miss the section entirely. The reader has to read to know if they should read — that's a failure state.
Fix Every section gets a TL;DR. Write it after compressing the section — it forces clarity on what the section is actually about.

Install

git clone --depth 1 https://github.com/franciscobeccaria/docs-generator.git /tmp/docs-generator
cp -r /tmp/docs-generator ~/.claude/skills/docs-generator
rm -rf /tmp/docs-generator

Usage

/docs-generator [paste your text here]
/docs-generator --file ~/path/to/document.md
/docs-generator --file ~/notes/analysis.txt --name my-guide

Output is written to ~/.agent/docs/{topic}.html and opened in your browser automatically.

Pre-ship checklist

  • Phase 2 (format decision) done before writing any HTML
  • Every section has a TL;DR
  • No walls of text — every block under 5 sentences
  • Every visual earns its place (removes it → information lost)
  • Mermaid diagrams have zoom controls
  • Light and dark themes both look intentional
  • No overflow at narrow widths (min-width: 0 on flex/grid children)
The core idea
  • The value is Phase 2 — format decision per section, not template filling.
  • Compression before render. One idea per block. TL;DR every section.
  • Visual only when it conveys something prose cannot. Otherwise: prose.
  • Output is self-contained HTML. No build, no server, opens anywhere.
  • The squint test: hierarchy visible without reading. If not, revise.