mask
AGENTS.md1 starsChanged 5 months agoMITView on GitHub
Canonical dev guide. Every coding agent reads this: Codex, Cursor, Gemini, Windsurf, Zed, … read AGENTS.md natively; CLAUDE.md imports it via @AGENTS.md. Single source of truth — edit here, not in copies. (mask itself preaches the AGENTS.md standard, so the repo practices it.) This is the mask framework repo (the tool) — not a user's mask library (~/.mask/).
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
One minimal, verifiable commit per change: Keep the tree green between commits.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md 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.
Files
mask — Development guide (for agents working in THIS repo)
Canonical dev guide. Every coding agent reads this: Codex, Cursor, Gemini, Windsurf, Zed, … read
AGENTS.mdnatively;CLAUDE.mdimports it via@AGENTS.md. Single source of truth — edit here, not in copies. (mask itself preaches the AGENTS.md standard, so the repo practices it.)
This is the mask framework repo (the tool) — not a user's mask library (~/.mask/).
What this project is
Distill any source (blog / YouTube / GitHub repo / PDF) into a switchable persona that runs inside the user's own agent. The CLI is a deterministic toolbox; the "intelligence" is borrowed from the user's agent following a Markdown recipe. Full design lives in docs/: read PRD.md -> SPEC.md -> PHASES.md.
Hard rules
- The CLI calls no LLM. Everything under
src/is deterministic (ingest, reduce, compile, git). All "intelligence" is borrowed from the user's agent — never call a model API or key here. The one sanctioned exception ismask scale, which shells out to the user's own headless agent CLI (claude -p/gemini -p/codex exec) — still no API key in our code. - Spec-as-data. A mask is plain files (Markdown + JSON + Git), human-readable and hand-editable.
- Framework and library are separate. This repo never stores a user's working masks; those live in
~/.mask/. The sole exception isexamples/— a small curated reference pack (still evidence-bound) thatmask try <name>copies into the user's library. - Add an agent via an adapter, add a source via an ingest module, the recipe stays put. The three layers are independent.
- Evidence-bound output. Distilled claims trace to a source sample
[src:id]→sources.json; thin coverage is declared, never hidden.
Stack
TypeScript (kept Node-compatible) + Bun. Tests use the built-in bun test. Build: bun run build (single executable; cross-platform targets in package.json build:all).
Layout
src/— CLI (commands/+lib/)ingest/— per-source ingestion (blog,youtube,repo,pdf); each uses an injectable fetcher/provider so tests run offlinerecipes/— extraction recipes (procedures the agent follows, not code):voice,code,blendadapters/— per-agent renderers + orchestrator templates. Two adapters:claude-code(subagents) andagents-md(the universalAGENTS.mdthat 30+ tools read)templates/— skeletons for distilled outputexamples/— curated, evidence-bound reference masks shipped with the framework;mask try <name>installs one. Resolved viaframeworkRoot(), like recipes/templates.site/— the static landing page (deployed to GitHub Pages)docs/— PRD / SPEC / PHASES (English;docs/zh-TW/for Traditional Chinese)
Working in this repo
- One minimal, verifiable commit per change. Keep the tree green between commits.
- Before committing, run:
bun run typecheck(tsc --noEmit) andbun test. For anything touching the compiled binary or embedded assets, alsobun run build. - Determinism: no
Date.now()/Math.random()where output must be reproducible; hash and diff by content. - External tools are injectable. New ingest modules take a fetcher/provider/extractor param defaulting to the real tool (git/yt-dlp/pdftotext), with a fake in tests — never require the real tool to run the suite.
- Subprocesses: route every spawn through
src/lib/proc.ts runCapture(drains stdout+stderr, checks exit) and pass user paths after--to avoid argument injection. - The phase roadmap in
docs/PHASES.mdis complete (Phase 0–3). New work is feature/fix-driven; still follow its discipline (exit criteria, dogfood, coverage honesty).
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
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.

