The case for .md files in your repo
Scroll to see why specs in the repo change everything.
The problem
What AI sees
src/
app/
lib/
components/
package.json
tsconfig.json
AI knows: what exists
AI doesn't know: why, what's next, or how
src/
app/
lib/
components/
CLAUDE.md
docs/auth-prd.md
docs/adr-007-redis.md
help/sso-setup.md
package.json
AI knows: what, why, how, what's next, and what not to do
The result
That's the entire prompt.
What changes
No copy-pasting from Linear into a chat window. No describing the context. The AI reads the file directly.
Before
Build a login page. We use Supabase for auth with GitHub OAuth. The callback URL is /auth/callback. Sessions use cookies, not localStorage. Put it in src/app/login/page.tsx. Use the existing Button component from src/components/ui/button.tsx. Follow the same patterns as...
After
Build what's in docs/auth-prd.md
What each file does for AI
AI output comparison
No specs
Creating /pages/login.js...
Using localStorage for sessions...
No auth library detected.
Guessing route structure...
2 of 3 files won't compile.
With specs
Reading auth-prd.md ✓
Reading CLAUDE.md ✓
Using Supabase Auth + GitHub OAuth
Route: /app/login/page.tsx
4 files. All compile. All match spec.
The loop
Pull Request #142
Atomic
The reviewer sees the full picture. The spec updates with the code. Not in a separate tool, days later, if someone remembers.
Longevity
Tickets get archived. The spec that described whyyou built something disappears into the backlog. In the repo, it's there forever.
Linear
AUTH-234 Closed
AUTH-189 Archived
AUTH-167 Done
Where's the spec?
Repo
auth-prd.md
updated 3d ago
47 commits
git blame works
Who benefits
Claude Code
Generates code from specs
Cursor
Autocomplete with full context
Copilot
Suggestions that match your patterns
Your PM
Edits specs, opens PRs directly
New engineers
Onboard from the repo, not Notion
Support
Help docs that reference real code
CI agents
Validate code against specs
Future you
Understands why decisions were made