Audit how readable — and how comfortable to read — a website really is.
Contrast, typography, line length, clarity, structure, accessibility. Measured in a real browser.
Install · Recipes · Commands · For AI agents · Methodology
Give your AI agent a reader's eye. One tool call opens the page in a real browser, measures what a reader actually meets, and returns each problem with its evidence and a fix.
| Your agent can check | What is measured | Selector |
|---|---|---|
| ◐ Contrast | WCAG 2.2 ratio and APCA Lc (WCAG 3 draft), resolved through the real background, per size and weight | --only contrast |
| Aa Typography | body size, text below 16px, line height, paragraph spacing, capitals, justification, type scale | --only typography |
| ↔ Line length | characters per line from real line boxes, desktop and phone | --only measure |
| ▯ Mobile | body size and line length at 390px, sideways scrolling | --only mobile |
| ▣ Layout | sticky headers, cookie walls and chat bubbles covering the first screen, layout shift | --only layout |
| ¶ Clarity | LIX, Flesch per language, Fog, SMOG, sentence length, passive voice, filler, rare words | --only clarity |
| ☰ Structure | heading density, walls of text, paragraph length, links, title and meta description | --only structure |
| ♿ Accessibility | declared vs detected language, alt text, heading order, link text, acronyms, text scaling | --only access |
Each check runs alone in seconds, or all together across a whole site.
readability page https://site.com --only contrast --format json # what your agent runs{"key": "apca_fail", "severity": "medium", "title": "3 text blocks are perceptually thin",
"fix": "Raise the contrast or the font size for these blocks.",
"evidence": [{"text": "Une installation, zéro config…", "color": "rgb(107, 100, 87)",
"background": "rgb(238, 232, 220)", "ratio": 4.8, "apca_abs": 66.0,
8000
"apca_required": 92.5, "font_px": 15.5}]}pip install readability-audit playwright && playwright install chromium
git clone https://github.com/pi-infected/readability
cp -r readability/skills/readability ~/.claude/skills/ # Claude Code; other agents: AGENTS.mdThen ask: "Is my pricing page easy to read? Fix what you find." The agent picks the checks it needs, fixes the CSS or the text the evidence points to, and re-measures.
- Measured, not guessed. Most readability tools stop at a Flesch score, which cannot see
12px body text, a 2.6:1 contrast, a 140-character line or a page declaring
lang="en"over French prose. readability reads computed styles and line boxes in headless Chromium. - Narrow and fast. Measure only what you ask for. A selection that needs no browser skips it: a text-only audit of 8 pages runs in about 4 seconds.
- Honest. A page with no readable text scores
n/a, not a made-up number. Terminal demos and JSON blobs are not scored as prose. Targets are calibrated against a reference set of well-typeset sites and validated on 107 labelled difficulty pairs (methodology). - Agent-ready.
--format jsoneverywhere, stable exit codes, evidence and a fix on every finding, and a ready-made skill.
pip install readability-audit
pip install playwright && playwright install chromium # once, for the rendered pass
readability metrics # check it works: lists everything you can measureFrom source: git clone https://github.com/pi-infected/readability && cd readability && pip install -e .
Without Playwright, readability still runs every text, structure and accessibility metric — only the rendered comfort metrics (contrast, typography, layout) need the browser.
A full audit renders every page twice (desktop + mobile) and runs ~40 metrics. Most of the time you want one thing. Select it, and readability does only the work that thing needs.
| You want | Command | Browser |
|---|---|---|
| Contrast of one page (WCAG + APCA) | readability page URL --only contrast |
desktop only |
| Typography without the phone pass | readability page URL --only typography --skip mobile |
desktop only |
| Is my mobile layout readable? | readability page URL --only mobile |
both |
| How hard is my writing? | readability page URL --only clarity |
none |
| Just the classic formulas | readability text draft.md --only readability |
none |
| Whole blog, text only, fast | readability audit https://site.com --include '/blog/' --pages 100 --only clarity,structure |
none |
| Everything except SEO nits | readability audit https://site.com --skip seo |
both |
| One page of each kind (blog index, post, docs, legal…) | readability audit https://site.com --per-section 1 |
both |
| Check a few exact pages | readability page URL1 URL2 URL3 |
both |
| Accessibility, minus the browser | readability page URL --only access --skip rem_scaling |
none |
Selectors are pillars, groups or single metrics, comma-separated and repeatable.
readability metrics prints them all.
- Pillars:
clarity·structure·comfort·access - Groups:
readability·style·contrast·typography·layout·mobile·headings·links·seo·images - Metrics:
lix,flesch,asl,passive,font_size,line_height,measure,contrast,apca,occlusion,cls,alt_coverage,rem_scaling… (40 in all)
readability urls https://site.com --pages 200 # dry run: what would be audited
readability audit https://site.com --per-section 1 --pages 30 # one page of each template, fast
readability audit https://site.com --pages 50 \
--include '/en/' --exclude '/tag/' --exclude '/page/[0-9]+' # repeatable regexes
readability audit https://site.com --url-list https://site.com/a https://site.com/b
readability audit https://site.com --no-sitemap --depth 1 # links from the home page onlyDiscovery reads sitemap.xml first, then crawls same-origin links. robots.txt is
respected, responses are cached on disk, duplicates (redirects, canonicals, identical
bodies) are analysed once.
| Command | What it does |
|---|---|
readability page URL… |
Analyse one or more pages, no crawl. Prints metrics, findings and evidence. |
readability audit URL |
Crawl a site, score every page, write JSON / CSV / HTML / PDF reports. |
readability text FILE |
Analyse a local Markdown, text or HTML file (- for stdin). JSON out. |
readability urls URL |
List the pages an audit would visit, without analysing them. |
readability metrics |
List every pillar, group and metric you can pass to --only / --skip. |
readability diff A.json B.json |
What changed between two audits: score delta, resolved and new findings. |
readability benchmark URL URL… |
Audit several sites the same way and rank them. |
selection --only SEL measure only these pillars / groups / metrics
--skip SEL leave these out
--no-render never start the browser
pages --pages N page budget (audit 10, urls 50)
--include RE URL must match one of these (repeatable)
--exclude RE URL must not match any (repeatable)
--url-list A B C exactly these URLs, no crawl
--per-section N N pages per site section, index and detail apart
--depth N link-crawl depth (default 2)
--no-sitemap crawl links only
--delay S politeness delay (default 0.4s)
--ignore-robots only for sites you own
targets --audience A general · technical · academic · children
--lang fr force the language of the linguistic metrics
--config FILE TOML/JSON: bands, weights, only/skip (see below)
output --format json machine-readable result on stdout
--out DIR readability.{json,csv,html,pdf} in DIR
--json/--csv/--html/--pdf PATH
--report-lang en fr reports in one or more languages, one crawl
--pdf-detail N pages detailed in the PDF, worst first (default 40, 0 = all)
--screenshots desktop screenshot per page in the report
--evidence N evidence lines per finding (page, default 2)
--fail-under N exit 2 below this score (CI gate)
speed --concurrency N pages rendered at once, clamped to free RAM
--no-cache always refetch
readability audit https://site.com --pages 30 --out report/ --report-lang en fr --screenshotswrites readability.json (the single source of truth: every value, its target, its evidence,
the methodology and coverage), readability.csv (one row per page), and an HTML + PDF report
per language — all from the same crawl. readability diff before.json after.json closes the
loop when you ship a fix.
The bands are data, not code (examples/readability.toml):
only = ["comfort", "access"] # same selectors as --only / --skip
skip = ["seo"]
disable = ["meta_description"]
[bands.measure] # our column is deliberately narrow
ideal = [45, 72]
tolerable = [35, 88]
[weights]
contrast = 2.5
[pillar_weights]
comfort = 0.35readability is built to be driven by coding agents (Claude Code, Codex, Cursor, Copilot…):
--format jsonon every command: result on stdout, progress on stderr.- Narrow first.
--onlykeeps the payload small and the run fast;readability metrics --format jsonlists every valid selector. - Exit codes:
0ok ·1(page) a URL could not be fetched or parsed ·2below--fail-under·64bad selector. - Every finding carries
key,severity,pillar,detail,fixandevidence(the text, its colours, size, ratio, APCA level), so the agent can go straight to the CSS or the sentence.
readability page https://site.com/pricing --only contrast,typography --format json \
| jq '.findings[] | {key, severity, fix, evidence: .evidence[:2]}'Install the skill so your agent knows when and how to use it:
mkdir -p ~/.claude/skills && cp -r skills/readability ~/.claude/skills/ # Claude CodeOther agents: point them at AGENTS.md.
How each number is produced, calibrated and validated: docs/METHODOLOGY.md.
Playwright (rendering) · trafilatura and readability-lxml (content extraction) · textstat (cross-check) · wordfreq (vocabulary rarity) · pyphen and syllapy (syllables) · WeasyPrint (PDF) · WCAG 2.2 contrast and APCA implemented from the specifications.
pip install -e . pytest && python -m pytest -q # browser tests need Chromium
python -m pytest -q -m "not render" # offline subsetIssues and pull requests welcome.
Licensed under either of Apache License, Version 2.0 or
MIT license, at your option (MIT OR Apache-2.0).