Docs Written for AI: Your README Is Being Read as a Manual by Agents
In the agent era, documentation's first reader is no longer human — it's AI. A docs strategy written for AI (CLAUDE.md, SKILL.md, ADRs) halves agent mistakes and makes your project easier to hand over.

A quiet shift has happened: the first reader of your repo's documentation is no longer human — it's AI. Agents read your README, CONTRIBUTING, and comments not to "learn" but to use directly as action instructions. Docs written for humans aim for narrative flow; docs written for AI demand precision, zero ambiguity, and executability — two completely different genres.
Three layers, each with a job
In practice, AI-facing docs work best in three layers.
Layer 1: the project constitution (CLAUDE.md / AGENTS.md). Lives at the repo root; the agent reads it on entry. What goes in? Stack and versions ("use pnpm, not npm"), absolute no-go zones ("don't touch migrations/", "ask me before adding dependencies"), common commands (dev/build/test, one per line). One principle: only include what would go wrong if unwritten — overlong instructions get diminishing compliance.
Layer 2: task skills (SKILL.md). Reusable workflows: "release process," "standard steps for adding an API endpoint," "checklist for writing migration scripts." Unlike the constitution, skills load on demand — the agent reads the release skill only when releasing. The test: if you've dictated a process to an agent more than twice, it should be a skill.
Layer 3: decision records (ADRs). Architecture Decision Records answer "why was it designed this way." The layer vibe coders skip most and long-term value most. Agents have no project memory; seeing context like "why Postgres over SQLite" completely changes the quality of their subsequent decisions. Each ADR can be short: context, decision, consequences — three paragraphs suffice.
Style notes for AI readers
First, use imperatives, not descriptions. "All new files must use TypeScript strict mode; any is forbidden" beats "this project uses TypeScript strict mode." AI obeys "must/forbidden" far better than "we usually."
Second, give counter-examples. Saying what's right isn't enough; show what's wrong. E.g., "Wrong: fetching directly in components; Right: all data requests go through lib/api.ts." Agents are pattern matchers; counter-examples precisely cut off their favorite wrong path.
Third, keep docs in sync with code, or don't write them at all. Stale docs are poison to AI — humans doubt outdated docs, AI follows them literally. Updating docs alongside architecture changes should be a fixed step in your workflow; you can even make the agent do it ("after changing code, update related docs" goes in the constitution).
A lesser-known fact: docs are distribution
When someone else's agent researches "is there an existing library for X," it reads your README and docs. AI-readable docs mean your project gets picked more often in agent-driven evaluations. Clear install steps, explicit scope boundaries, one line saying what it is — these serve humans and agents alike. In that sense, documentation is now your project's API.
Comments (0)
Related articles
Bash 5.2.21, ps from procps-ng 4.0.4, zero packages: 3 sleep jobs start; 2 left after SIGTERM with wait exit code 143, 1 left after SIGKILL with wait exit code 137; timeout cuts a 30-second sleep off after 2 seconds with exit code 124; 0 left at the end.
OpenSSH 9.6p1, zero packages: ed25519 256-bit + RSA 4096-bit keys, private 600, public 644, 1 identity in the agent, config resolving to deploy@192.0.2.10:2222. ssh-copy-id and real login not verified here — no sshd on this machine.
tmux 3.4, zero packages: 1 session, 2 windows, 3 panes; the logs window prints 1 to 5, editor panes report ready. Detach with Ctrl-b d, reattach with tmux attach — the session outlives the connection. Mouse, prefix key and history limit in ~/.tmux.conf included.