Claude
Skills
Sign in
Back

richdoc

Included with Lifetime
$97 forever

This skill should be used when the user asks to "write a research report", "create a plan document for review", "produce a polished design doc", "draft a comparison sheet", "generate a richdoc", "make a one-pager", "write a status report", "produce an executive summary", "create a decision document", "build a dashboard page", or any other rich HTML deliverable intended for human review in a browser. Authors plain .html files using a small fixed vocabulary of rd-* web components for layout and rich blocks. Includes a CLI for scaffolding, asset installation, schema introspection, and validation.

Designassets

What this skill does


# richdoc

richdoc is for **AI-authored, human-read HTML documents**. The agent writes a normal `.html` file using a closed vocabulary of `rd-*` custom elements. Two shipped assets (`richdoc.css`, `richdoc.js`) give every component its editorial look and behavior. No build step on the consumer side; the file opens in any browser, with or without a server.

## When to use richdoc

Plans, research reports, design docs, status one-pagers, decision memos, comparisons, postmortems, dashboards — anything where the reader is a person in a browser. Use markdown only when the renderer might be anything else (GitHub, chat, CLI). Anywhere else, richdoc is the better default.

## Authoring rules

When writing a richdoc, the agent **must**:

1. Produce a complete HTML5 document with exactly one `<rd-page>` directly inside `<body>`. Link `richdoc.css` and `richdoc.js` from `<head>`.
2. Use **only** the `rd-*` tags listed below. Inventing new ones causes lint errors and renders as empty boxes.
3. For prose, use plain semantic HTML — `<p>`, `<ul>`, `<ol>`, `<li>`, `<a>`, `<strong>`, `<em>`, `<code>`, `<pre>`, `<h1>`–`<h6>`, `<blockquote>`, `<hr>`, `<img>`, `<table>`. These are styled automatically.
4. Prefer `<rd-callout>` over bold-italic emphasis for asides longer than a few words.
5. Use `<rd-cols>` for genuinely parallel content (cards, stats, comparisons). Do not use it to force a two-column paragraph layout.
6. Put code in `<rd-code lang="…">`, diffs in `<rd-diff lang="…">`, math in `<rd-math>`, diagrams in `<rd-diagram lang="…">`. Don't fall back to `<pre>`.
7. **Never self-close custom elements.** Write `<rd-foo ...></rd-foo>`, not `<rd-foo ... />` — HTML5 ignores the slash on non-void custom elements and the tag silently absorbs the following siblings. `richdoc lint` catches this as `self-closing-custom-element`.
8. Run `richdoc lint <file>` before declaring the doc done.

## CLI

Path: `./richdoc-cli/richdoc` (relative to this SKILL.md). Requires [`uv`](https://docs.astral.sh/uv/); the first call provisions the Python environment.

| Command | Description |
| --- | --- |
| `richdoc new <output> [-t <template>]` | Scaffold a new `.html` from a template. |
| `richdoc init [dir]` | Copy `richdoc.css` and `richdoc.js` into a directory. |
| `richdoc update [dir] [--apply]` | Refresh stale shipped assets. |
| `richdoc lint <file-or-dir> [--fix]` | Validate against the rd-* schema and book-mode authoring rules. `--fix` autofixes `hero-nav-redundant`. |
| `richdoc components [--tag <name>]` | Print the vocabulary from the live schema. |
| `richdoc export md\|docx <file>` | Export to markdown or DOCX. (HTML is the source format — no export needed.) See [references/export.md](references/export.md). |
| `richdoc export confluence <file-or-dir>` | Build an offline Confluence storage bundle (storage XML + attachments + manifest). Runs `richdoc lint` first. The bundle is published by the separate `confluence` skill, never by `richdoc` itself. See [references/export.md](references/export.md). |

Templates: `plan`, `research`, `comparison`, `onepager`, `adr`, `runbook`, `book-index`, `book-chapter`.

## Minimal example

```html
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>My plan</title>
  <link rel="stylesheet" href="./richdoc.css">
  <script src="./richdoc.js" defer></script>
</head>
<body>
<rd-page>
  <rd-hero title="My plan" eyebrow="Design doc"></rd-hero>

  <rd-callout type="tldr">
    <p>Two-sentence summary of what changes and why it matters.</p>
  </rd-callout>

  <rd-section title="Problem">
    <p>Plain prose, lists, and links work as usual.</p>
  </rd-section>

  <rd-section title="Options">
    <rd-cols n="2">
      <rd-card title="Option A" accent="success">Pros, cons.</rd-card>
      <rd-card title="Option B" accent="warn">Pros, cons.</rd-card>
    </rd-cols>
  </rd-section>
</rd-page>
</body>
</html>
```

## Element index

One line per tag, grouped by purpose. For attributes, run `richdoc components --tag rd-xxx` or see [references/elements.md](references/elements.md).

### Structure
- `<rd-page>` — outer container. Exactly one per doc, directly under `<body>`. Supports `theme`, `mode`, `width`, `toc`, `prefs`, `diagram-endpoint`.
- `<rd-hero>` — magazine title block.
- `<rd-section>` — titled section with eyebrow numeral.
- `<rd-cols>` — multi-column grid (`n="2|3|4"` or `template="2fr 1fr"`).
- `<rd-card>` — bordered block with optional accent.

### Information
- `<rd-callout>` — `info|success|warn|danger|note|tldr` aside.
- `<rd-kv>` / `<rd-row>` — spec block (`layout="inline"`) or glossary (`layout="stacked"`).
- `<rd-badge>` — inline status tag.
- `<rd-stat>` — big-number tile, optional sparkline slot.
- `<rd-progress>` — capacity bar.
- `<rd-update>` — dated changelog entry (`release|change|note`).

### Code, math, diagrams
- `<rd-code lang="…">` — fenced code with syntax highlighting.
- `<rd-diff lang="…">` — unified diff.
- `<rd-shell>` / `<rd-prompt>` / `<rd-output>` — terminal session.
- `<rd-math>` — KaTeX math.
- `<rd-diagram lang="…">` — Kroki diagram. See [Diagrams](#diagrams).
- `<rd-chart>` — Observable Plot chart or sparkline.

### Comparison, decision, planning
- `<rd-compare>` / `<rd-row-cells>` / `<rd-cell>` — decision matrix.
- `<rd-rubric>` / `<rd-criterion>` / `<rd-score>` — weighted scoring grid.
- `<rd-pros-cons>` / `<rd-pro>` / `<rd-con>` — ✓/✗ evaluation.
- `<rd-decision>` — ADR-style record (`proposed|accepted|superseded|rejected`).

### Sequenced & interactive
- `<rd-steps>` / `<rd-step>` — numbered procedure.
- `<rd-timeline>` / `<rd-event>` — vertical timeline.
- `<rd-checklist>` / `<rd-task>` — task list.
- `<rd-detail>` — collapsible (`panel|hairline|question|reveal`).
- `<rd-tabs>` / `<rd-tab>` — tabbed content (specialist; usually a section is clearer).

### Reference & navigation
- `<rd-api>` / `<rd-param>` / `<rd-response>` — single-endpoint API doc.
- `<rd-references>` / `<rd-ref>` / `<rd-cite>` — bibliography + inline citations.
- `<rd-toc>` / `<rd-chapter>` — auto TOC; book-mode for multi-file docs. See [references/multi-file-books.md](references/multi-file-books.md).
- `<rd-icon>` — Lucide icon (~1,900 names; see [ICONS.md](ICONS.md)).
- `<rd-figure>` — captioned media wrapper.
- `<rd-banner>` — doc-status ribbon (`draft|frozen|archived|confidential|info`).

## Pick the right element

| You want to … | Use |
| --- | --- |
| Show a side-by-side options matrix with headers | `<rd-compare>` |
| Score options on weighted criteria | `<rd-rubric>` |
| List ✓ / ✗ trade-offs for one or more options | `<rd-pros-cons>` |
| Show a key / value spec block at the top | `<rd-kv>` (inline) |
| Define terms in a glossary | `<rd-kv layout="stacked">` |
| Show a fenced code sample | `<rd-code>` |
| Show a terminal session with commands and output | `<rd-shell>` (NOT `<rd-code>`) |
| Show a diff between two versions | `<rd-diff>` |
| Highlight a single number with trend | `<rd-stat>` |
| Show progress / capacity / utilisation | `<rd-progress>` |
| Show a trend over time | `<rd-chart kind="line">` or sparkline in `<rd-stat>` |
| Mark a doc as draft / frozen / confidential | `<rd-banner>` (top of page) |
| Status-tag a row of content inline | `<rd-badge>` |
| Aside or "callout" of any length | `<rd-callout>` (not bold/italic emphasis) |
| Render a flow / sequence / state / class diagram | `<rd-diagram lang="…">` |
| Pull-quote, epigraph | native `<blockquote>` (auto-styled) |
| Cite a source inline | `<rd-cite key="…">` paired with `<rd-ref>` |

## Recipes

Each recipe lists the 5–10 tags you'll actually need. Reach beyond the list only with reason.

**Status one-pager** — `rd-page`, `rd-hero`, `rd-kv`, `rd-stat`, `rd-progress`, `rd-callout`, `rd-update`, `rd-checklist`.

**Plan / design doc** — `rd-page`, `rd-hero`, `rd-callout` (tldr + problem), `rd-section`, `rd-pros-cons`, `rd-steps`, `rd-detail` (open questions).

**Research report
Files: 242
Size: 1666.9 KB
Complexity: 79/100
Category: Design

Related in Design