ARCHITECTURE.md: how it works
ARCHITECTURE.md is a convention, popularised by Aleksey Kladov's 2021 post, for a short document that explains a codebase from above: the main modules, where to find things, how data moves between them, and the invariants that must always hold. It changes less often than code, so it stays accurate. For AI agents it answers the question they most often get wrong: where a change belongs. Agents read it when your CLAUDE.md or AGENTS.md points to it, or when they explore the repo.
Where the file goes
./ARCHITECTURE.mdRepo rootNext to README.md. Link it from CLAUDE.md or AGENTS.md so agents read it before structural changes.
What goes in it
## Codemap - src/app/: routes and pages; no data access here. - src/server/: database queries and Server Actions. - src/lib/: pure helpers, no I/O.
## Invariants - Only src/server/ imports the database client. - Every Server Action validates input with Zod before writing. - src/lib/ has no side effects and no network calls.
Tips
- Describe what changes rarely: module boundaries and rules, not function names.
- Write invariants as checkable statements, such as 'only X imports Y'.
- Keep it short enough to read in a few minutes.
- Reference it from CLAUDE.md or AGENTS.md so agents load it.
ARCHITECTURE.md presets (21)
Each one opens the generator with that file filled in for the stack. Change what you need, then copy or download it.
- Next.js 16 App Router
Frontend
- React 19 & Vite
Frontend
- Python FastAPI & Pydantic v2
Backend
- Supabase & PostgreSQL
Fullstack & DB
- Prisma ORM
Fullstack & DB
- Drizzle ORM
Fullstack & DB
- Go (Golang) & Fiber
Backend
- Rust & Axum
Backend
- Tailwind CSS v4
Frontend
- Vue 3 & Nuxt 4
Frontend
- SvelteKit & Svelte 5
Frontend
- Docker & CI/CD
DevOps & Tooling
- Django 6 & Ninja / DRF
Backend
- Bun & Elysia / Hono
Backend
- React Native & Expo Router
Frontend
- Flutter 3 & Riverpod / Dart
Frontend
- Kubernetes & Helm Charts
DevOps & Tooling
- Terraform & OpenTofu IaC
DevOps & Tooling
- Playwright End-to-End Testing
DevOps & Tooling
- Spring Boot 4 & Java 25
Backend
- .NET 10 & C# 14 Minimal APIs
Backend
Not sure ARCHITECTURE.md is the file you need? Each AI coding tool reads its own file from its own place.
Which file do I need?Frequently asked questions
How is ARCHITECTURE.md different from CLAUDE.md or AGENTS.md?
CLAUDE.md and AGENTS.md tell an agent how to work: commands, conventions and checks. ARCHITECTURE.md explains how the code is organised and which rules must hold, for people and agents alike. Link it from your rules file.
Do AI tools read ARCHITECTURE.md automatically?
Not by default. Point to it from CLAUDE.md (for example with @ARCHITECTURE.md) or from AGENTS.md, so agents read it before structural changes.