mealforge
AGENTS.md1 starsChanged 4 months agoMITView on GitHub
You are a software engineer working in this monorepo. Follow the rules below. For app-specific conventions, read the per-app AGENTS.md files — they are hoisted into your context alongside this one. Each app's AGENTS.md describes its layout, run/test commands, and framework-specific rules. TypeScript everywhere, on Node. Not Bun, not Deno. All code is ESM. No CommonJS.
- 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 repository4 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- feature-developmentSkill
- tanstack-router-patternsSkill
- trpc-drizzle-patternsSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
26 rules. About 0 are common, 17 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 16
Always ask for a spec before implementing a feature.
- Distinctive: line 19
If you see implementation before tests exist, stop and ask for the spec.
- Very specific: line 23
Always use nx generate @mealforge/project-plugin:feature --name <name> --apps <apps> before writing feature code.
- Distinctive: line 25
Never create feature directories manually.
- Very specific: line 30
Use nx affected to run only what changed.
- Very specific: line 31
Use nx run <app>:<task> for specific apps.
- Very specific: line 32
Use nx run-many --target=<task> when you need to run across all apps.
- Very specific: line 44
Test files sit next to what they test: userService.test.ts alongside userService.ts
- Distinctive: line 49
Default exports for React components only.
- Distinctive: line 51
Every exported function has an explicit return type annotation.
- Distinctive: line 61
No try/catch blocks in business logic.
- Distinctive: line 70
NEVER: write tests after implementation in the same session.
- Distinctive: line 71
Always write failing tests first, based on the spec/requirements, before touching implementation.
- Distinctive: line 74
No mocking unless the dependency is external (network calls, third-party APIs).
- Distinctive: line 75
Test names describe behavior: "returns 404 when user does not exist" not "calls db.findFirst and throws TRPCError".
- Distinctive: line 88
No obvious comments. Comment WHY, never WHAT.
- Distinctive: line 95
No try/catch in business logic
- Distinctive: line 97
No barrel files in app directories
- Distinctive: line 99
No mocking of internal dependencies in tests
- Very specific: line 104
Do not create index.ts barrel files inside apps/ directories.
- Very specific: line 105
Do not use any type. Use unknown and narrow.
- Very specific: line 106
Do not use require() or CommonJS syntax.
- Distinctive: line 107
Do not mock internal dependencies in tests.
- Distinctive: line 108
Do not write tests that mirror implementation.
- Distinctive: line 109
Do not use try/catch in service/business logic files.
- Very specific: line 110
Do not commit .env files or secrets.
≈ “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
Agent Workflow & Project Conventions
You are a software engineer working in this monorepo. Follow the rules below. For app-specific conventions, read the per-app AGENTS.md files — they are hoisted into your context alongside this one.
Per-app context
apps/api/AGENTS.md— backend conventions (Hono + tRPC + Drizzle + SQLite; also serves the MCP endpoint and the built web app)apps/web/AGENTS.md— web app conventions (React + Vite + TanStack Router + Tailwind)
Each app's AGENTS.md describes its layout, run/test commands, and framework-specific rules.
Spec-Driven Development
- Always ask for a spec before implementing a feature.
- Session 1: Write failing tests from the spec. Do not implement.
- Session 2: Implement the minimum code to make tests pass.
- If you see implementation before tests exist, stop and ask for the spec.
Feature Development
- Always use
nx generate @mealforge/project-plugin:feature --name <name> --apps <apps>before writing feature code. - Feature names are camelCase identifiers (
userProfile, notuser-profile). - Never create feature directories manually.
- The feature generator creates the correct file structure, imports, and wiring — including registering the tRPC router in
apps/api/src/trpc.ts.
Task Execution
- Use
nx affectedto run only what changed. - Use
nx run <app>:<task>for specific apps. - Use
nx run-many --target=<task>when you need to run across all apps.
Language & Runtime
TypeScript everywhere, on Node. Not Bun, not Deno. All code is ESM. No CommonJS.
File Naming
- camelCase for all files:
userService.ts,createPost.ts,authMiddleware.ts - React components use PascalCase:
UserProfile.tsx,DashboardLayout.tsx - Test files sit next to what they test:
userService.test.tsalongsideuserService.ts - No
index.tsbarrel files insideapps/directories. Only at package boundaries (packages/shared/index.ts).
Exports
- Default exports for React components only.
- Named exports for everything else: services, utilities, hooks, types, constants.
- Every exported function has an explicit return type annotation. No exceptions.
Functions
functionkeyword for all top-level and exported functions.- Arrow functions for callbacks, inline handlers, and short expressions only.
Error Handling
- Services throw
TRPCErrorwith the appropriate code. - No try/catch blocks in business logic. Ever. The only try/catch blocks are at entry points: the MCP tool handlers, background task runners, top-level process error handlers.
Validation
- Zod everywhere. Every external input is validated. tRPC procedure inputs and MCP tool inputs use Zod schemas.
- Shared schemas live in
packages/shared/. Feature-specific schemas live in the feature'stypes.ts.
Testing Rules
- NEVER write tests after implementation in the same session.
- Always write failing tests first, based on the spec/requirements, before touching implementation.
- Tests must derive from expected behavior described in task requirements, not from reading the code.
- Vitest for unit/integration tests; Playwright (in
e2e/) runs against the production build. - No mocking unless the dependency is external (network calls, third-party APIs).
- Test names describe behavior: "returns 404 when user does not exist" not "calls db.findFirst and throws TRPCError".
Linting and Formatting
- Biome handles both linting and formatting. No ESLint. No Prettier. Single quotes. Semicolons: yes. Tab width: 2 spaces. Trailing commas: all. Print width: 100.
Git
- Conventional commits:
feat:,fix:,chore:,docs:,test:,refactor: - One logical change per commit.
Comments
- No obvious comments. Comment WHY, never WHAT.
- TODO comments include a brief reason:
// TODO: handle pagination once we have >100 users
Code Review Checklist
- Explicit return types on all exported functions
- External inputs validated with Zod
- No try/catch in business logic
- No
anytypes — useunknownand narrow - No barrel files in app directories
- No CommonJS imports
- No mocking of internal dependencies in tests
- Conventional commit message
What Not To Do
- Do not create
index.tsbarrel files insideapps/directories. - Do not use
anytype. Useunknownand narrow. - Do not use
require()or CommonJS syntax. - Do not mock internal dependencies in tests. Only mock external network calls.
- Do not write tests that mirror implementation. Tests come from specs.
- Do not use try/catch in service/business logic files.
- Do not commit
.envfiles or secrets.
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.

