agentleFS
loursCreatifloursCreatif/ours-stack/layout-html/SKILL.md

layout-html

Skill1 starsChanged 4 months agoMITView on GitHub

Turn one finished text — deep-research report.md, study notes.md, any .md/.txt file, or pasted content — into a single self-contained HTML page: editorial typography plus inline SVG figures built only from data already present in the text. No new research, no invented numbers, no external dependency; the page opens offline from file://. Use when the user says "layout", "mise en page", "HTML version", "rends ça lisible", "turn this into a page", or runs /layout-html.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every figure traces back to a sentence of the source text.

    line 24
  2. Distinctive:

    Figures are quotations: Every SVG visualizes data that exists in the source.

    line 32
  3. Very specific:

    Fidelity over beauty: Never alter a claim, drop a caveat, soften a hedge, or reorder an argument.

    line 34
  4. Distinctive:

    Never ask about colors, fonts, or spacing — that is the skill's job, not the user's.

    line 79
  5. Distinctive:

    Run against the finished HTML string — fix, never ship warnings:

    line 131

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Layout HTML

One text in, one .html file out. The page must survive three tests:

  1. It opens from file://, network unplugged, and looks finished.
  2. Every figure traces back to a sentence of the source text.
  3. A reader who never sees the original loses no claim, no caveat, no number.

Time budget: one reading pass, one question, one file. No research detours.

Hard rules

  • No new research. The source text is the entire knowledge base. Never WebFetch, never fill a gap from memory. Missing context stays missing (see Failure modes).
  • Figures are quotations. Every SVG visualizes data that exists in the source. A number absent from the text never appears in a figure. No numbers in the text → structure figures only (flow, timeline, hierarchy) or none. Never a decorative fake chart.
  • Self-contained or nothing. One file: inline CSS, inline SVG, system font stack. No CDN, no webfont, no <script src>, no external image. The only outbound links are sources the text already cites.
  • Fidelity over beauty. Never alter a claim, drop a caveat, soften a hedge, or reorder an argument. Abridge only with a visible [abridged — full text in source] marker.
  • Zero JavaScript by default. CSS does the layout. Single exception: Magazine mode may embed ≤30 lines of vanilla JS for a collapsible TOC.
  • AskUserQuestion: one question per call; title Layout — {label}.

Step 0: Locate the text

First match wins:

InputSource readOutput (AGENTS.md contract)
Study slug named or inferablestudies/<slug>/notes.md (default)studies/<slug>/report.html
Research slugresearch/<slug>/report.mdresearch/<slug>/report.html
Explicit file path (.md/.txt)that fileoutput/layout/<slug>/article.html
Pasted textthe pasteoutput/layout/<slug>/article.html
  • Study has several layoutable texts (notes.md, council.md, research.md) → one AskUserQuestion (Layout — Source) listing them; never guess.
  • Ad-hoc slug: derive from title, lowercase-hyphens (AGENTS.md slug rules); if output/layout/<slug>/ exists, ask before overwriting.
  • Source under ~300 words → warn: typography-only card, no figures (a figure needs material).

Step 1: Figure ledger

One reading pass. While reading, hunt figure candidates:

Pattern in the textCandidate figure
Two+ numbers compared (A vs B, before/after)Bar pair / slope
Values over timeTimeline / sparkline
Parts of a wholeStacked proportion bar
Process, pipeline, causalityFlow diagram
Taxonomy, options, trade-offsMatrix or tree
One striking numberStat callout
One striking sentencePull-quote card

For each candidate, record in a working ledger (in conversation, not a file): the exact source sentence, its section, the figure type. Then cut hard: keep 3–7, ranked by "would the reader remember this tomorrow?". Fewer than 2 solid candidates → the page is typography-only; say so rather than forcing weak figures.

The ledger is the traceability contract: at delivery, every figure cites its ledger line.

Step 2: Art direction — one question

AskUserQuestion — title Layout — Direction:

  • Éditorial (recommended) — calm single column (68ch), strong typographic hierarchy, figures interleaved at their reference point. For reading and rereading.
  • Magazine — full-bleed header, standfirst, pull quotes, denser figure rhythm, collapsible TOC (the one JS exception). For sharing and skimming.
  • other

Never ask about colors, fonts, or spacing — that is the skill's job, not the user's.

Step 3: Design tokens

The <style> block starts with tokens; every later rule uses tokens only:

:root {
  --paper: …;  --ink: …;          /* base pair, contrast ≥ 7:1 */
  --accent: …;                    /* ONE hue, chosen from content mood */
  --muted: …;                     /* captions, meta — ≥ 4.5:1 on paper */
  --step--1 … --step-3: …;        /* type scale, ratio 1.25 */
  --space: 8px;                   /* all gaps are multiples */
  --measure: 68ch;
}
@media (prefers-color-scheme: dark) { /* swap paper/ink, re-check accent */ }
  • One accent hue. Two is a design failure.
  • Fonts: system stack only (ui-serif headings / ui-sans-serif body, or the inverse per mood). No downloads.
  • Accent choice comes from the content (biology → green family, hardware → steel blue…) — decide once, state it in the delivery note.

Step 4: Page skeleton

Semantic HTML5, in order:

  1. <header> — <h1> (source title), standfirst (the source's own one-line thesis — quoted, not invented), meta line (source path, date, "layout only — no new research").
  2. <nav> TOC — only if the source has >4 ## sections; anchor links; collapsible in Magazine mode.
  3. <main> — sections mirror the source structure 1:1 (same order, same hierarchy). Body text in the --measure column, line-height: 1.6.
  4. Each figure: <figure> + <figcaption>, placed at the point where the source discusses it — never grouped in an annex.
  5. <footer> — provenance: source file, generation date, /layout-html mention, and the source's own bibliography/links if present.

Step 5: SVG recipes

Every figure obeys:

  • viewBox set, width: 100%, no fixed pixel height in the HTML.
  • role="img" + <title> + <desc> (the desc is the ledger sentence).
  • Text inside the SVG ≥ 12px at base scale; colors from tokens only (currentColor, var(--accent)).
  • <figcaption> = one factual line + (§ section name) for traceability.
  • Geometry hand-coded — no chart library, no generator.
RecipeGeometry
Bar pair2–5 horizontal bars, labels left, values right
Timelinehorizontal axis, dated ticks, one-line labels alternating above/below
Flowboxes + arrows, left→right, max 6 nodes; wrap to two rows beyond
Proportionone stacked horizontal bar, ≤5 segments, direct labels (no legend)
Stat calloutthe number at --step-3, unit small, source sentence underneath
Pull quotethe sentence at --step-1 italic, thick --accent left border
Matrix2×2 grid, axis labels on the edges, ≤2 words per cell

Step 6: Self-check (before Write)

Run against the finished HTML string — fix, never ship warnings:

  • <script count → 0 (Éditorial) or exactly 1 inline TOC block (Magazine)
  • http matches only inside the sources/footer section
  • every <svg has viewBox, <title>, <desc>
  • every number appearing in a figure re-greps in the source text
  • every source caveat/hedge sentence is present in the page
  • [abridged] markers everywhere content was cut
  • single <h1>; heading levels never skip
  • file ≤ 200 KB

Step 7: Deliver

  1. Write the file to the Step 0 contract path.
  2. In chat, ≤6 lines, no theater:
    • the path + "double-clique le fichier pour l'ouvrir"
    • figures shipped: N figures — bar pair (§2), timeline (§3), …
    • what was abridged, or "rien coupé"
    • accent hue chosen and why (3 words)

Failure modes

SituationResponse
No layoutable text foundSay so; route: /dense-read (study) or /deep-research (standalone)
Text < 300 wordsTypography-only card; note "trop court pour des figures"
User asks to add context/research mid-layoutRefuse; finish the layout, suggest /deep-research then re-run
Output path existsAsk before overwrite; offer a -v2 slug
Source has zero structure (wall of text)Derive sections from paragraph topics; mark [structure added by layout] in the footer

What this skill never does

  • Research, fact-fill, or "improve" claims
  • Decorative charts with invented data
  • Multi-file output, external assets, JS frameworks
  • Summary theater in the delivery message

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.