agentleFS
dkadtsdkadts/landing-kit-building/.claude/skills/typography/SKILL.md

typography

Skill2 starsChanged 3 months agoMITView on GitHub

Print-quality typography enforcement for English text. Prevents widows, orphans, and hanging short words (articles, prepositions, conjunctions, dashes) at line ends. Rewrites HTML text nodes to insert   ties. Also serves as the canonical short-word list used by /build and /audit.

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use graphic-design and ui-design.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • travisjneumanSkill

    graphic-design

    Professional graphic design principles for digital and print media. Use when creating visual designs, choosing color palettes, typography, layouts, or providing design feedback.

    Also in 3 projects that use this

  • SentrySkill

    ui-design

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 0 are common, 7 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After /build writes a new section — /build calls this automatically as its pass 4b.

    line 16
  2. Very specific:

    After any copy edit in inbox/texts/ that triggered a rebuild of a section.

    line 17
  3. Very specific:

    Before /audit as a safety pass.

    line 19
  4. Very specific:

    If a <p> or <blockquote> spans a column break (rare on landing pages, but happens in multi-column footer or blog-style sections), the first …

    line 68
  5. Distinctive:

    If a file path was provided, load it.

    line 74
  6. Distinctive:

    Do NOT rewrite text inside:

    line 92
  7. Very specific:

    Before writing, diff the file.

    line 100
  8. Very specific:

    If run inside /build, no report — silent success.

    line 115
  9. Distinctive:

    English only: Do not attempt to guess other languages' rules.

    line 123
  10. Distinctive:

    Rewrite text nodes only: Never touch attributes, script, style, or verbatim elements.

    line 124
  11. Distinctive:

    No visual changes beyond typography: Never move elements, never add wrappers, never touch CSS.

    line 126
  12. Distinctive:

    Do not attempt to detect actual rendered line breaks (would require a headless browser.

    line 130
  13. Very specific:

    Do not modify the short-word list per project.

    line 131
  14. Distinctive:

    Do not run on non-English copy.

    line 132

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “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

/typography

Standalone skill. Takes a completed section (or the full site/index.html) and enforces print typography rules on all English text. Callable anytime — before /audit, after copy edits, whenever the source text changed.

Also the single source of truth for the short-word list that /build (pre-save pass) and /audit (post-build check) both reference.

Language scope: English only. Do not run on any other language.

When to use

  • After /build writes a new section — /build calls this automatically as its pass 4b.
  • After any copy edit in inbox/texts/ that triggered a rebuild of a section.
  • Standalone: user says "fix the typography on the hero" or "re-run typography on the whole site".
  • Before /audit as a safety pass.

Requirements

  • site/index.html exists (or a specific section HTML file was provided).
  • Content is English. If the copy is in another language, refuse and report which language was detected.

The rules

Rule 1 — Hanging short words at line end

A rendered line MUST NOT end on any of these words. Tie the word to the following word using &nbsp; so they wrap together.

Canonical short-word list (English):

# Articles
a, an, the

# Coordinating conjunctions
and, or, but, nor, for, so, yet

# Subordinating conjunctions & connectors
if, as, at, by, in, on, of, to, up, via, with, into, onto, from, than, then, when, where, while, before, after

# Auxiliary and short verbs
is, am, are, was, were, be, do, does, did, has, have, had, can, will, would, could, should

# Pronouns (short)
I, we, he, she, it, you, they, my, our, his, her, its, your, their, this, that

# Negations & quantifiers (short)
no, not, all, any

Case-insensitive matching, but preserve the original case when rewriting.

Rule 2 — Dashes never end a line

-, –, — must attach to the following word: text&nbsp;— word (nbsp before the dash, regular space after). This is opposite direction from Rule 1 — dash pulls the next word up.

Rule 3 — No orphans

Last line of a heading or a paragraph must contain at least 2 words. If the natural break would leave a single word on the last line, tie the last two words together: ... together with&nbsp;us.

Detection heuristic: for each <h1>, <h2>, <h3>, <p>, <li>, take the last 2-3 words and tie the last two with &nbsp; regardless of length. Cheap, prevents 95% of orphans.

Rule 4 — No widows (advisory)

If a <p> or <blockquote> spans a column break (rare on landing pages, but happens in multi-column footer or blog-style sections), the first line on the new column must contain ≥ 2 lines of the paragraph. This is difficult to detect statically — flag rather than fix.

Process

Step 1. Read input.

  • If a file path was provided, load it.
  • Otherwise load site/index.html and every section CSS to know which classes are text vs decorative.

Step 2. Detect language.

Sample ~200 chars from the largest <p> and the first <h1>. If the character set is not predominantly ASCII English, stop and report. Example refusal: Detected language: Russian. This skill runs on English only. Aborting.

Step 3. Walk text nodes.

For each text node inside a semantic text element (<h1>-<h6>, <p>, <li>, <blockquote>, <figcaption>, <button>, <a> if the anchor's text is a full phrase, <label>):

  1. Tokenize into words + whitespace runs.
  2. Rule 1 pass. Scan word-by-word. If word W is in the short-word list AND the following whitespace is a regular space AND the next word W+1 exists — replace the space with &nbsp;.
  3. Rule 2 pass. Scan for standalone -, –, — surrounded by spaces. Replace the space before the dash with &nbsp;.
  4. Rule 3 pass. Take the last two words of the text node. Ensure they are joined by &nbsp;, not a regular space.

Step 4. Skip zones.

Do NOT rewrite text inside:

  • <code>, <pre>, <kbd>, <samp>, <var> — verbatim by contract.
  • <script>, <style> — not text content.
  • Any element with class="no-typo" — user escape hatch.
  • Attributes (alt=, title=, placeholder=, aria-label=) — these do not line-wrap in visible layout in the same way.

Step 5. Idempotency check.

Before writing, diff the file. Existing &nbsp; from prior passes must not be duplicated (a&nbsp;&nbsp;the — bug). Collapse &nbsp;{2,} to a single &nbsp;.

Step 6. Save + report.

Save the file. Print a compact report:

typography pass — site/index.html
  ties inserted:        47
  dashes rewritten:      3
  orphans prevented:    12
  skipped (code/pre):    5 nodes
  no-typo opt-outs:      1 node

If run inside /build, no report — silent success. If run standalone, always report.

Escape hatch

class="no-typo" on any element skips it entirely. Use for stylized headings where the designer wants specific manual breaks (e.g. <h1 class="no-typo">Ship<br>fast.</h1>).

Rules of behavior

  • English only. Do not attempt to guess other languages' rules.
  • Rewrite text nodes only. Never touch attributes, script, style, or verbatim elements.
  • Idempotent. Running twice produces the same output as running once.
  • No visual changes beyond typography. Never move elements, never add wrappers, never touch CSS.

What NOT to do

  • Do not attempt to detect actual rendered line breaks (would require a headless browser; too expensive per pass). Use the word-level heuristics defined above.
  • Do not modify the short-word list per project. It's the canonical English list. If the user wants a variant, they can override in a project-local typography-overrides.md (not currently supported — flag as an enhancement request).
  • Do not run on non-English copy. Refuse.

Next

  • /audit — will grep for violations (hanging words, unfixed dashes) as part of category A.
  • /build — calls this automatically after each section HTML is written.

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.