adhd-md
v0.1.2One bookmark. Pick up in your reader or agent.

Open-source agent skill · six hosts

Read at your pace.
Keep your place.

Turn long documents into Markdown you can scan, or read one short section at a time. Take the same bookmark between your offline reader and your agent when you’re ready to continue.

npx github:tsonglew/adhd-md

Install in your existing agent · runs locally

Session preview md-cache.md

Viewing now02 / 04

Defaults and expiration

The cache directory defaults to .cache/md, and you can change it with the MD_CACHE_DIR environment variable. The default entry limit is 500, changeable via the maxEntries option. The default TTL is 7 days, changeable via the ttl option in milliseconds. Setting it to 0 means never expire, but the disk grows forever, which production environments should avoid.

Continue fromLimits to know before you use it
03
Look back without losing your place. Skipped sections stay on your list.
A place to return toSee how bookmarks travel

Rearrange information. Never delete it.

  • Organize long docs
  • Read in sections
  • Resume with a bookmark

Already have a document? Read it at your pace

The same md-cache document, one short section at a time. Read on your own, or ask your agent to explain where you get stuck.

Try it · focused reading

md-cache

Purpose and setup

Original excerpt

md-cache is a Markdown rendering cache middleware that stores render results on disk keyed by content hash, and returns them directly on hit so nothing renders twice. It requires Node 18+, and its only dependency is lru-cache. Once installed, wrap your rendering pipeline with withCache.

Defaults and expiration

Original excerpt

The cache directory defaults to .cache/md, and you can change it with the MD_CACHE_DIR environment variable. The default entry limit is 500, changeable via the maxEntries option. The default TTL is 7 days, changeable via the ttl option in milliseconds. Setting it to 0 means never expire, but the disk grows forever, which production environments should avoid.

Limits to know before you use it

Original excerpt

If your render function has side effects, don't use this middleware, because on a cache hit the render function never runs. If your Markdown embeds timestamps or random values, the output gets frozen by the cache and looks like it never refreshes. That's not a bug.

Results reported in this sample

Original excerpt

Measured on a site with 1,200 documents: cold build 42 seconds, second build 3.1 seconds. Thirteen times faster.

View the complete original
# md-cache

md-cache is a Markdown rendering cache middleware that stores render results on disk keyed by content hash, and returns them directly on hit so nothing renders twice. It requires Node 18+, and its only dependency is lru-cache. Once installed, wrap your rendering pipeline with withCache.

The cache directory defaults to .cache/md, and you can change it with the MD_CACHE_DIR environment variable. The default entry limit is 500, changeable via the maxEntries option. The default TTL is 7 days, changeable via the ttl option in milliseconds. Setting it to 0 means never expire, but the disk grows forever, which production environments should avoid.

If your render function has side effects, don't use this middleware, because on a cache hit the render function never runs. If your Markdown embeds timestamps or random values, the output gets frozen by the cache and looks like it never refreshes. That's not a bug.

Measured on a site with 1,200 documents: cold build 42 seconds, second build 3.1 seconds. Thirteen times faster.

This preview only demonstrates reading in sections. The full reader offers working bookmark import and export, a skipped-sections list, type size and spacing controls, and locally saved progress.

Open the full reader

Standalone reader controls are currently in Chinese.

v0.1.2 · Reading sessions

Pause here. Pick up anywhere you read.

The reader and guided chat share a JSON bookmark with your current view, resume position, skipped sections, and open questions. Take the source text and bookmark with you when you switch.

Current view
The section you are looking at now. Looking back updates this position and preserves your original resume point.
Resume position
Where to continue next. Shown does not mean understood, and ending a session does not mean you finished the whole document.
Skipped sections
Skipped content stays on a separate list. After revisiting it, choose Next or End session to confirm reading and remove it from the list.

One source file. One bookmark.

Save the downloaded continuation source as source.md and the bookmark as bookmark.json. After validation, your agent uses the returned session and section positions to update the bookmark, without inventing hashes or offsets.

  1. Take the text and bookmark

    In the full reader, download the continuation source (下载续读正文), then copy or download the JSON bookmark. An unchanged local source file also works.

  2. Continue with your agent

    Give the text and bookmark.json to an agent that can run commands. Use read --session bookmark.json --json to check the source and get section data before continuing.

  3. Bring the updated bookmark back

    When you pause, ask your agent for the updated JSON bookmark. Paste or import it into the reader, or generate a new page that starts from the bookmark.

Validate the bookmark for your agent

npx github:tsonglew/adhd-md read source.md --session bookmark.json --json

Returns section data and a normalized session. No HTML is generated.

Generate a reader with your bookmark

npx github:tsonglew/adhd-md read source.md --session bookmark.json --open -o resumed.reader.html

Tries to open the browser after writing the HTML. Existing output files are not overwritten; choose a new filename.

Same document, not a single word changed

This is real corpus material. scope=format only touches markup, whitespace, and block order — the word sequence stays verbatim. Compare the two sides.

Before 87.8

md-cache

md-cache is a Markdown rendering cache middleware that stores render results on disk keyed by content hash, and returns them directly on hit so nothing renders twice. It requires Node 18+, and its only dependency is lru-cache. Once installed, wrap your rendering pipeline with withCache. The cache directory defaults to .cache/md, and you can change it with the MD_CACHE_DIR environment variable. The default entry limit is 500, changeable via the maxEntries option. The default TTL is 7 days, changeable via the ttl option in milliseconds. Setting it to 0 means never expire, but the disk grows forever, which production environments should avoid.

If your render function has side effects, don't use this middleware, because on a cache hit the render function never runs. If your Markdown embeds timestamps or random values, the output gets frozen by the cache and looks like it never refreshes. That's not a bug.

Measured on a site with 1,200 documents: cold build 42 seconds, second build 3.1 seconds. Thirteen times faster.

After 100

md-cache

Measured on a site with 1,200 documents: cold build 42 seconds, second build 3.1 seconds. Thirteen times faster.

md-cache is a Markdown rendering cache middleware that stores render results on disk keyed by content hash, and returns them directly on hit so nothing renders twice.

It requires Node 18+, and its only dependency is lru-cache. Once installed, wrap your rendering pipeline with withCache.

  • The cache directory defaults to .cache/md, changeable via the MD_CACHE_DIR environment variable.
  • The default entry limit is 500, changeable via the maxEntries option.
  • The default TTL is 7 days, changeable via the ttl option, in milliseconds.
  • Setting it to 0 means never expire, but the disk grows forever. Avoid in production.

If your render function has side effects, don't use this middleware, because on a cache hit the render function never runs.

If your Markdown embeds timestamps or random values, the output gets frozen by the cache and looks like it never refreshes. That's not a bug.

Conclusion first
Chunking
Scannability
Sentence load
Actionability
Consistency
Human voice

Changed: moved the conclusion up, split one blob into four paragraphs, turned four config sentences into a list, wrapped bare identifiers in code. Words added: 0. Words deleted: 0.

Notice what the fixed version doesn't do: no heading above the config list. The word “Configuration” isn't in the original — adding it would be new wording, which crosses into content. You can restructure everything, but you can't touch a single word. That's the ceiling of format mode, and it's the point.

Format only, content only, or both

One line draws the boundary. Moving an existing block is format. Writing a new sentence is content.

format

Exact unique blocks can move; sentence-order changes, repeated-block ambiguity, or unsupported syntax return unknown.

Can do

Split paragraphs at existing sentence breaks · turn parallel sentences into lists (reusing the words) · bold existing terms · reorder blocks · add code fence language tags · collapse sections · fix CJK spacing and punctuation

Can't do

Change a single word · write a new TL;DR · reword headings

Prose tokens + original code, links, and technical literals; stop if uncertain

content

Only wording and information structure change. Layout stays untouched.

Can do

Split long sentences · passive to active · write a TL;DR · conclusion-style headings · add time estimates and next steps · explain terms on first use · cut filler

Can't do

Touch layout · delete constraints, units, versions, or edge cases in the name of “tightening”

Checks original code, links, options, paths, and permissions

bothdefault

Content first, then format; run the available checks and review the result.

The other axis

light makes only small edits for specs and API docs; review the diff before writing back. standard splits, lists, retitles, writes a TL;DR, and adds time estimates. deep rebuilds the whole skeleton, for meeting notes and messy drafts.

How to use it

Just say it in plain words: “Make README.md ADHD-friendly, format only”

86 rule definitions: 78 primary rules + 8 anti-patterns

Deleted words fail; sentence reordering needs review

The verifier handles a declared Markdown subset. It compares prose token counts, original code block bodies and counts, link destinations, and technical literals. Number or unit changes fail or warn by scope; metadata follows the same scope policy. Unsupported structures return unknown (CLI exit code 4). pass means the declared checks passed, not that meaning is equivalent.

Too long? Collapse it or move it to an appendix. Unsupported syntax or word-order changes return unknown.

The script handles checks with clear limits

Audit, format fixes, and selected invariant checks live in one pure-stdlib Python file. The same input runs the same checks; anything outside their scope still needs human review.

Scores don't inflate themselves

At the default standard + both settings, 75 rules apply: 23 need model judgment and 7 are advisory-only. audit scores all applicable axes in the document; unjudged rules are not passes, and hints carry no points.

Unreadable docs are usually a layout problem

The same information, unreadable as a blob, readable once it's cut up. Nothing in the content changes.

md-cache is a Markdown rendering cache middleware that stores render results on disk keyed by content hash, and returns them directly on hit so nothing renders twice. It requires Node 18+, and its only dependency is lru-cache. Once installed, wrap your rendering pipeline with withCache. The cache directory defaults to .cache/md, and you can change it with the MD_CACHE_DIR environment variable. The default entry limit is 500, changeable via the maxEntries option. The default TTL is 7 days, changeable via the ttl option in milliseconds. Setting it to 0 means never expire, but the disk grows forever, which production environments should avoid.

  • Back-references“As mentioned above” makes your eyes go back, relocate, and return. One full working-memory reset, for free
  • Buried conclusionReaders decide in the first 15 lines whether to stay. A conclusion on line 40 might as well not exist
  • No next stepYou know the theory but not what to type. Startup friction becomes abandonment
  • AI slop“It's not X, it's Y” makes readers load a misconception they never had, then unload it
While it's here, it also strips AI slop

Model-written Chinese has a fixed set of routines. Each one costs the reader an extra bit of attention, so they belong to this skill.

RoutineAttention the reader pays
It's not X. It's Y.Load a misconception you never had, then unload it. One working-memory reset, for free
The core is:Announces importance before delivering the goods — the sentence says itself twice
It's worth notingPromises depth, delivers none. One attention unit, stolen
Completed an optimization of…The verb hides inside a noun. One extra parse to find out who did what
leverage, synergy, end-to-endPlain words carry the same information, minus the translation step
Time will keep the detailsNo subject to hold accountable. Nothing to verify
extensive tests, various scenariosQuantities without numbers carry no information
significantly better, fully solvesNo number, nothing to verify

Em dashes aren't banned. Their density is.

An — is a normal piece of punctuation, fine for a parenthetical. The tell is using it as a rhythm crutch. Hand-written tech docs average about 5 per 1,000 characters; model output often runs above 15. Threshold: 8. And only prose counts — item — owner — due inside list items is field separation, not rhythm.

What a regex can't tell, a model judges

Three flags in parallel is good writing. “Why we left, why we failed, why we still try” is what needs fixing. A regex can't tell them apart, so anaphora and metaphor are flagged for review, not docked points. git repo is literal; “a repository of memories” is packaging.

Real-agent eval: the new rules run — and don't run wild

Codex 0.36.0 + gpt-5.6-sol, four docs, each through the full scope=both workflow (audit → rewrite → verify → report). This is a historical 2026-08 eval; the current verifier records pass, fail, and unknown separately.

DoclevelScript scoreH4 behavior
Chinese READMEstandard87.8 → 100Added “about 1 minute” — reasonable
English API referencelight83.9 → 89.2Not added — light excludes H4
Chinese meeting notesdeep76.2 → 100Added “about 2 minutes” + takeaway — reasonable
English runbookstandard72.8 → 100Missed at first; after rule examples, gave a “four-step response”

No overuse

Zero per-section time labels, zero invented durations; the light run correctly added none.

Judge rules get skipped without examples

The runbook missed H4 on the first two runs. After adding worked examples to rules.md, the third run produced Step 1 of 4, per-step expected output, and split compound actions.

Full evaluation, the three iterations, and how to reproduce

One skill, six agents

All six hosts natively support the same SKILL.md directory format, so there's nothing to adapt. The canonical skill lives in ~/.agents/skills/, each host gets a symlink — change it once, it changes everywhere.

  • Claude Code ~/.claude/skills/ tested at runtime
  • Codex ~/.codex/skills/ tested at runtime
  • Grok Build ~/.grok/skills/ tested for loading
  • Gemini CLI ~/.gemini/skills/ tested for loading
  • Cursor ~/.cursor/skills/ tested for loading
  • opencode ~/.config/opencode/skills/ tested for loading

Codex ran the whole workflow headless, noticed the target file had uncommitted changes, and wrote to a side file instead of overwriting it — exactly what step 0 of the skill says. A historical human review found both outputs fit the format rules: it merged two warnings into one blockquote; I turned the config into a list. Both scored 100 and changed zero words. The current three-state verifier does not auto-pass reordered blocks.

The other four hosts are only verified to load the skill, not to run it well. Verification notes list what's been checked, what hasn't, and the known limits.

Start with the document in front of you

Install in your agent

Install. Any of the three ways works — the script detects which agents you have and only touches those hosts.

With Node

npx github:tsonglew/adhd-md
Other installation options

Without Node

curl -fsSL https://tsonglew.github.io/adhd-md/install.sh | bash

To hack on the source

git clone https://github.com/tsonglew/adhd-md && cd adhd-md bash scripts/install.sh

The git-clone install is a symlink — git pull updates it. The npx and curl installs copy the skill — rerun to update.

No command execution available

Web-chat LLMs can paste the self-contained adhd-md.standalone.md, with editing and guided reading rules. Editing reports must state that machine checks were unavailable; guided reading can start directly.

Generate a reader and open it

Use the same read command for Markdown, a web link, or a PDF. Add --open to try opening the generated page in your default browser.

npx github:tsonglew/adhd-md read your-doc.md --open npx github:tsonglew/adhd-md read "https://example.com/article" --open -o article.reader.html npx github:tsonglew/adhd-md read your-doc.pdf --open

--open launches the browser only after the HTML is written successfully. If opening fails, the file remains and its path is shown so you can open it manually. It cannot be combined with --json. The reader offers full text, type size and spacing controls, local progress, and bookmark import and export. Source files stay unchanged; web and PDF readers show extracted text, its source, and known gaps.

Read the documents you already have

Read one short section at a time in chat and ask about what feels unclear. Pause whenever you need to; a bookmark keeps your place for next time.

Read this document with me, one short section at a time. Keep the original unchanged.
Organize and audit documents

Audit something first and see the score and the findings list.

npx github:tsonglew/adhd-md audit your-doc.md

Then just say it in plain words to any agent.

Make README.md ADHD-friendly, format only

CI

adhd_md.py fmt --check docs/*.md adhd_md.py audit --min-score 70 docs/*.md
Set up PDF and scan support

Web pages and local HTML need no extra dependencies. PDFs need Poppler; scanned pages use local OCR with Tesseract and language data. Install once for your system.

macOS (Homebrew)

brew install poppler tesseract tesseract-lang

Ubuntu / Debian

sudo apt install poppler-utils tesseract-ocr tesseract-ocr-chi-sim

Extracted text keeps page references. Check tables, formulas, and images against the original PDF. Login and dynamic pages need your agent’s browser tools.

For a text file only: npx github:tsonglew/adhd-md extract your-doc.pdf