open-agents
AGENTS.md1 starsChanged 5 months agoMITView on GitHub
This file provides guidance for AI coding agents working in this repository. This is a living document. When you make a mistake or learn something new about this codebase, add it to Lessons Learned. Authentication uses Better Auth with Vercel OAuth (sign-in) and GitHub OAuth (repo access). Config lives in apps/web/lib/auth/config.ts. Sessions are managed by better-auth's built-in session system — there is no manual JWE/encryption layer. Key env vars: BETTER_AUTH_SECRET (session signing), NEXT_PUBLIC_VERCEL_APP_CLIENT_ID + VERCEL_APP_CLIENT_SECRET (Vercel OAuth), plus GitHub App…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,700 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 repository22 other files it gives its agents.
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-browserSkill
- ai-sdkSkill
- baseline-uiSkill
- chat-sdkSkill
- claude-tenderly-auditorSkill
- code-reviewSkill
- codex-adversarial-review-tenderly-testnetSkill
- codex-adversarial-tenderly-auditorSkill
- deploy-open-harnessSkill
- emil-design-engSkill
- frontend-designSkill
- gateman-analysisSkill
- plan-modeSkill
- raj-demand-driven-contextSkill
- remove-demo-limitsSkill
- tenderly-proSkill
- tenderly-testnetSkill
- vercel-react-best-practicesSkill
- web-animation-designSkill
- workflowSkill
The file
We split this AGENTS.md into the rules it gives an agent
11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
This is a living document: When you make a mistake or learn something new about this codebase, add it to Lessons Learned.
- Very specific: line 29
Commit the generated .sql file alongside the schema change.
- Very specific: line 64
Run project checks through package scripts (for example bun run ci, bun run --cwd apps/web db:check).
- Very specific: line 65
Prefer bun run <script> over invoking tool binaries directly so local runs match CI behavior.
- Very specific: line 69
Branch sync preference: When bringing in origin/main, prefer a normal merge (git fetch origin main then git merge origin/main) instead of …
- Distinctive: line 92
Do not append new functionality to the bottom of an existing file by default.
- Distinctive: line 93
Before adding code, decide whether the behavior is a separate concern that should live in its own file.
- Distinctive: line 94
Prefer creating a new colocated file for distinct concerns (components, hooks, utilities, schemas, data-access helpers, etc.).
- Distinctive: line 95
If a file is already large or handling multiple responsibilities, extract the new logic (and related helpers/types) into focused modules …
- Distinctive: line 97
If a change introduces a distinct cluster of state, effects, handlers, API calls, or derived UI labels for one feature, treat that as a …
- Distinctive: line 98
Keep each file focused on one primary responsibility.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
AGENTS.md
This file provides guidance for AI coding agents working in this repository.
This is a living document. When you make a mistake or learn something new about this codebase, add it to Lessons Learned.
Quick Links
- Architecture & Workspace Structure
- Code Style & Patterns
- Lessons Learned
Authentication
Authentication uses Better Auth with Vercel OAuth (sign-in) and GitHub OAuth (repo access). Config lives in apps/web/lib/auth/config.ts. Sessions are managed by better-auth's built-in session system — there is no manual JWE/encryption layer.
Key env vars: BETTER_AUTH_SECRET (session signing), NEXT_PUBLIC_VERCEL_APP_CLIENT_ID + VERCEL_APP_CLIENT_SECRET (Vercel OAuth), plus GitHub App credentials for repo access. See apps/web/.env.example for the full list.
Database & Migrations
Schema lives in apps/web/lib/db/schema.ts. Migrations are managed by Drizzle Kit.
After modifying schema.ts, always generate a migration:
bun run --cwd apps/web db:generate # Creates a new .sql migration fileCommit the generated .sql file alongside the schema change. Do not use db:push except for local throwaway databases.
Migrations run automatically during pnpm build (via lib/db/migrate.ts), so every Vercel deploy — both preview and production — applies pending migrations to its own database.
Environment isolation
Neon database branching is enabled in the Vercel project settings. Every preview deployment automatically gets its own isolated database branch forked from production. This means preview deployments never read or write production data. Production deployments use the main Neon database.
Commands
# Development
bun run web # Run web app
# Quality checks (REQUIRED after making any changes)
bun run ci # Required: run format check, lint, typecheck, and tests
turbo typecheck # Type check all packages
# Linting and formatting (Ultracite - oxlint + oxfmt, run from root)
bun run check # Lint and format check all files
bun run fix # Lint fix and format all files
# Filter by package (use --filter)
turbo typecheck --filter=web # Type check web app only
# Testing
bun test # Run all tests
bun test path/to/file.test.ts # Run single test file
bun test --watch # Watch mode
bun run test:verbose # Run tests with JUnit reporter streamed to stdout (useful in non-interactive shells)
bun run test:verbose path/to/file.test.ts # Same verbose output for a single test fileCI/script execution rules:
- Run project checks through package scripts (for example
bun run ci,bun run --cwd apps/web db:check). - Prefer
bun run <script>over invoking tool binaries directly so local runs match CI behavior.
Git Commands
- Branch sync preference: When bringing in
origin/main, prefer a normal merge (git fetch origin mainthengit merge origin/main) instead of rebasing, unless explicitly requested otherwise.
Quote paths with special characters: File paths containing brackets (like Next.js dynamic routes [id], [slug]) are interpreted as glob patterns by zsh. Always quote these paths in git commands:
# Wrong - zsh interprets [id] as a glob pattern
git add apps/web/app/tasks/[id]/page.tsx
# Error: no matches found: apps/web/app/tasks/[id]/page.tsx
# Correct - quote the path
git add "apps/web/app/tasks/[id]/page.tsx"Architecture (Summary)
Web -> Agent (packages/agent) -> Sandbox (packages/sandbox)See Architecture & Workspace Structure for details.
File Organization & Separation of Concerns
- Do not append new functionality to the bottom of an existing file by default.
- Before adding code, decide whether the behavior is a separate concern that should live in its own file.
- Prefer creating a new colocated file for distinct concerns (components, hooks, utilities, schemas, data-access helpers, etc.).
- If a file is already large or handling multiple responsibilities, extract the new logic (and related helpers/types) into focused modules and import them.
- For large page/view/client components, default to adding new feature behavior in colocated hooks and colocated child components instead of growing the main file.
- If a change introduces a distinct cluster of state, effects, handlers, API calls, or derived UI labels for one feature, treat that as a strong signal to extract it.
- Keep each file focused on one primary responsibility; avoid mixing unrelated UI, business logic, and data-access code in the same file.
Code Style (Summary)
- Bun exclusively for dependency management and scripts; use Node 24 for utility scripts and Bun for tests
- Files: kebab-case, Types: PascalCase, Functions: camelCase
- Never use
any-- useunknownand narrow with type guards - No
.jsextensions in imports - Ultracite (oxlint + oxfmt) for linting and formatting (double quotes, 2-space indent)
- Zod schemas for validation, derive types with
z.infer
See Code Style & Patterns for full conventions, tool implementation patterns, and dependency patterns.
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.

