node-express-boilerplate / rules
Cursor rule36 starsChanged 4 months agoMITView on GitHub
Architecture overview and file-structure rules for every new resource
We split this architecture.mdc into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Every new resource requires exactly these five files, in this order:
- Distinctive: line 21
After creating those files:
≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule 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
--- description: Architecture overview and file-structure rules for every new resource globs: ["src/**/*.ts"] alwaysApply: true --- # Layered Architecture Routes → Controllers → Services → Repositories → Prisma (PostgreSQL). Every new resource requires exactly these five files, in this order: | File | Purpose | |------|---------| | `src/validations/<name>.validation.ts` | Zod v4 schemas + `RequestHandler` exports | | `src/repository/<name>.repository.ts` | `I<Name>Repository` interface + class extending `BaseRepository` | | `src/services/<name>.service.ts` | `I<Name>Service` interface + class | | `src/controllers/<name>.controller.ts` | `I<Name>Controller` interface + class extending `BaseController` | | `src/routes/<name>.route.ts` | class extending `BaseRoute`, exports router instance | After creating those files: 1. Register repository, service, and controller in `src/container/index.ts` following the existing init pattern. 2. Mount the route in `src/app.ts` at `/api/v1/<name>`. 3. Export all interfaces and classes from the barrel files (`src/repository/index.ts`, `src/services/index.ts`, `src/controllers/index.ts`). # DI Container `Container` (singleton in `src/container/index.ts`) is the only place where `new Repository/Service/Controller()` is called. Access instances in routes via `this.container.get<Name>Controller()`. # Entry Points - `src/index.ts` — binds the port only (import `app` in tests without binding) - `src/app.ts` — all middleware and route mounting
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 3,978 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 repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/conventions.mdcCursor rule
- add-middlewareSkill
- add-openapi-docsSkill
- add-testSkill
- api-design-principlesSkill
- find-skillsSkill
- improveSkill
- multi-stage-dockerfileSkill
- new-resourceSkill
- nodejs-best-practicesSkill
- prisma-client-apiSkill
- prisma-database-setupSkill
- prisma-postgresSkill
- security-auditSkill
- typescript-magicianSkill
- update-schemaSkill
- vitestSkill
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.

