typography-audit logo

typography-audit

typography audit

SKILL.md

Full skill instructions

Typography Audit

90 rules in 10 categories for web typography. Every finding names file, rule, and fix.

  • IS: typography only: punctuation, font loading, sizing, spacing, OpenType features, hierarchy, text layout, typeface pairing, brand type, display type.
  • IS NOT: broad UI review (accessibility, forms, navigation: use ui-audit), or a redesign (new typefaces, scales: use ui-design).

Audit Workflow

Track this checklist:

Audit progress:
- [ ] Step 1: Scope. List changed files (or full sweep), map signals to categories
- [ ] Step 2: Run CRITICAL rules in scope (punct-, font-)
- [ ] Step 3: Run HIGH rules in scope (size-, spacing-)
- [ ] Step 4: Run remaining in-scope categories by descending priority
- [ ] Step 5: Report per the contract; every finding has file:line, rule ID, fix
  1. Scope to changed files unless a full sweep is requested. For a PR: git diff --name-only filtered to .css, .scss, .html, .tsx/.jsx, and template files.
  2. Map code to categories via the signal table; skip categories with no signal.
  3. Load rule files progressively by prefix (rules/punct-*.md, etc.). Never preload all 90.
  4. Run categories in priority order so CRITICAL findings surface even if the audit is cut short.
  5. After fixes, re-run only the rules that produced findings, then finalize the report.

Scoping Signals → Categories

Signal in codeCategories to load
Copy in HTML/JSX (headings, paragraphs, labels)punct-
@font-face, font-family, font files, variable fontsfont-
font-size, clamp(), media-query type changes, max-width on textsize-
line-height, letter-spacing, margin on text, text-transform: uppercasespacing-
font-feature-settings, font-variant-*, figures/fractions in copyopentype-
Heading elements, type scale tokens, --text-* propertieshierarchy-
text-align, lists, blockquotes, multi-column textlayout-
Two or more distinct font-family valuespairing-
Logo/wordmark styles, brand tokens, license commentsbrand-
Hero/display sizes, drop caps, initial-letterdisplay-

Rule Categories by Priority

PriorityCategoryImpactPrefixRules
1Punctuation & Special CharactersCRITICALpunct-12
2Font Selection & WeightsCRITICALfont-11
3Sizing & MeasureHIGHsize-7
4Spacing & RhythmHIGHspacing-10
5OpenType FeaturesMEDIUM-HIGHopentype-8
6Hierarchy & ScaleMEDIUM-HIGHhierarchy-8
7Alignment & LayoutMEDIUMlayout-8
8Typeface PairingMEDIUMpairing-10
9Brand & IdentityLOW-MEDIUMbrand-8
10Display & HeadlinesLOW-MEDIUMdisplay-8

Category map and impact rationale: rules/_sections.md. Each rule file gives why it matters plus an incorrect and a correct example. Report findings with the rule's own frontmatter impact, which may differ from its category (e.g., font-rendering is MEDIUM inside the CRITICAL font- category).

Review Output Contract

Report findings as:

## Typography Audit Findings

### path/to/file.css
- [CRITICAL] `punct-smart-quotes` (file.css:42): Straight quotes in heading copy.
  - Fix: Replace `"` with `“`/`”` (or UTF-8 curly quotes).
- [HIGH] `size-line-height` (file.css:18): `line-height: 20px`, a fixed value that breaks at larger font sizes.
  - Fix: Use unitless `line-height: 1.5`.

### path/to/clean-file.css
- ✓ pass
  • Group by file; order by impact within file.
  • Every finding: impact tag, rule ID, file:line, one-line issue, fix.
  • Include clean files as ✓ pass so coverage is visible.
  • End with a summary: counts per impact level.

Gotchas

  • Don't preload all 90 rule files (~90 KB before the audit starts). Load only the prefixes the signal table selects.
  • Punctuation rules apply to rendered copy only. Flagging straight quotes or -- inside <code>, <pre>, or JS/TS string literals is a false positive; "fixing" them breaks the code.
  • Don't flag missing OpenType features without confirming the loaded font ships them. Browsers silently ignore unsupported font-feature-settings tags, so the fix does nothing.
  • Every finding needs file:line and a concrete fix; an unactionable finding forces a redo.
  • An audit is not a redesign. Proposing new pairings or scales turns a 10-minute review into a design project; flag the issue and route redesign asks to ui-design.
  • Don't equalize priorities. A LOW-MEDIUM display- nit above a CRITICAL faux-bold finding buries what actually looks broken.

Related Skills

  • ui-audit: broad frontend quality (accessibility, forms, navigation, motion); its typography coverage is shallower.
  • ui-design: choosing typefaces, scales, and visual direction from scratch; run when a finding becomes a redesign request.