Agent Friendly Code

What to put in an AGENTS.md for a TypeScript repo

The lockfile decides the package manager: package-lock.json for npm, pnpm-lock.yaml for pnpm, yarn.lock for Yarn, bun.lock for Bun. Name it, then give the type check, linter and test runner as the scripts you run through it.

Which commands should it list?

  • npm ciinstalls exactly the lockfile; fails if it disagrees with package.json
  • tsc --noEmittype check only, when a bundler or another tool compiles
  • tsc -bwith project references: plain tsc doesn't build the referenced projects
  • eslint .flat config in eslint.config.js (or .mjs, .cjs, .ts)
  • biome check --write .or Biome: format, lint and safe fixes in one; name the one you run
  • pnpm --filter <pkg> testone workspace package; <pkg>... adds the packages it depends on

Write them as your repo runs them, with its package manager and flags, plus how to run one test.

What layout should it explain?

  • In a monorepo, where the workspace list is (pnpm-workspace.yaml, or workspaces in package.json) and which package holds what.
  • Which tsconfig each package uses, and whether builds go through project references.
  • The test runner (Vitest, Jest, node --test) and how to run one file with it.

What do agents get wrong?

  • Use the repo's package manager for every install and script; another one writes a second lockfile.
  • ESLint takes the nearest eslint.config.* above each file, so a package's own config replaces the root one.
  • Say how strict to be about types: whether any or @ts-expect-error is ever allowed, and with what comment.

From the official docs: docs.npmjs.com/npm-ci (new tab) · typescriptlang.org/tsconfig (new tab) · typescriptlang.org/project-references.html (new tab) · eslint.org/configuration-files (new tab) · biomejs.dev/cli (new tab) · pnpm.io/filtering (new tab) · bun.com/lockfile (new tab). The rest of the file is the same for any project: what goes in an AGENTS.md.

TypeScript repos with an AGENTS.md or CLAUDE.md (64)

64 of the 83 TypeScript repos on the leaderboard have an AGENTS.md or CLAUDE.md at the root, and 59 are long enough to pass the AGENTS.md check in full. Most-starred first; each file name links to the file.

TypeScript repos on the leaderboard with an AGENTS.md or CLAUDE.md
RepoFileLength
openclaw/openclawAGENTS.md 19,602
anomalyco/opencodeAGENTS.md 18,546
n8n-io/n8nAGENTS.md 25,421
firecrawl/firecrawlAGENTS.md 1,480
microsoft/vscodeAGENTS.md 270
anthropics/claude-codeCLAUDE.md 2,217
excalidraw/excalidrawAGENTS.md 372
earendil-works/piAGENTS.md 13,546
immich-app/immichAGENTS.md 2,449
supabase/supabaseAGENTS.md 7,143
microsoft/playwrightAGENTS.md 10,478
OpenHands/OpenHandsAGENTS.md 10,122
modelcontextprotocol/serversAGENTS.md 51,045
storybookjs/storybookAGENTS.md 4,081
grafana/grafanaAGENTS.md 11,087
strapi/strapiAGENTS.md 12,487
cline/clineAGENTS.md 5,432
withastro/astroAGENTS.md 8,944
makeplane/planeAGENTS.md 4,073
nuxt/nuxtAGENTS.md 947
appwrite/appwriteAGENTS.md 29,542
remix-run/react-routerAGENTS.md 7,400
expo/expoAGENTS.md 9,935
tldraw/tldrawAGENTS.md 13,885
chenglou/pretextAGENTS.md 10,211
TanStack/queryAGENTS.md 4,246
calcom/cal.diyAGENTS.md 9,222
prisma/ormAGENTS.md 11,703
payloadcms/payloadAGENTS.md 24,311
jestjs/jestCLAUDE.md 45
colinhacks/zodAGENTS.md 21,940
trpc/trpcAGENTS.md 3,530
chakra-ui/chakra-uiCLAUDE.md 9,339
novuhq/novuAGENTS.md 4,135
mattermost/mattermostAGENTS.md 738
directus/directusAGENTS.md 8,016
medusajs/medusaAGENTS.md 20,082
date-fns/date-fnsAGENTS.md 1,209
supermemoryai/supermemoryAGENTS.md 12,769
statelyai/xstateAGENTS.md 1,598
QwenLM/qwen-codeAGENTS.md 18,294
simstudioai/simAGENTS.md 11,517
mastra-ai/mastraAGENTS.md 1,759
nrwl/nxAGENTS.md 9,808
vercel/aiAGENTS.md 16,215
different-ai/openworkAGENTS.md 6,244
lit/litAGENTS.md 924
vitest-dev/vitestAGENTS.md 18,761
sindresorhus/kyAGENTS.md 621
TanStack/routerAGENTS.md 5,558
millionco/react-doctorAGENTS.md 27,856
electric-sql/electricAGENTS.md 14,447
cloudflare/vinextAGENTS.md 41,619
vercel-labs/deepsecCLAUDE.md 1,855
MoonshotAI/kimi-codeAGENTS.md 17,094
Uniswap/interfaceAGENTS.md 11,442
TanStack/aiAGENTS.md 9,355
TheOrcDev/8bitcn-uiAGENTS.md 9,197
getnao/naoAGENTS.md 3,182
Shopify/cliAGENTS.md 6,340
wormhole-foundation/wormhole-connectCLAUDE.md 1,240
hsnice16/agent-friendly-code(this site's own repo)AGENTS.md 14,670
Doka-NT/TaviraqAGENTS.md 10,691
hsnice16/tula(by this site's author)AGENTS.md 76,825

More examples