ai-backends / rules
Cursor rule146 starsChanged 14 months agoApache-2.0View on GitHub
This document provides guidelines for organizing code in the AI Backends project.
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 4,157 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 repository2 other files it gives its agents.
- .cursor/rules/coding-standards.mdcCursor rule
- .cursor/rules/project-structure.mdcCursor rule
The file
We split this folder-guidelines.mdc into the rules it gives an agent
12 rules. About 0 are common, 12 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
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 20
Call appropriate services to process business logic
- Distinctive: line 22
Keep controllers thin, move business logic to services
- Distinctive: line 26
Create reusable middleware functions
- Distinctive: line 28
Keep middleware focused on a single responsibility
- Distinctive: line 33
Create interfaces for database entities if applicable
- Distinctive: line 41
Use descriptive names that reflect the resource being accessed
- Distinctive: line 52
Create reusable utility functions
- Distinctive: line 53
Keep functions pure when possible
- Distinctive: line 59
Create reusable schema components
- Distinctive: line 60
Keep schemas aligned with OpenAPI documentation
- Distinctive: line 64
Create comprehensive test coverage
- Distinctive: line 67
Use fixtures for test data
≈ “Common” is an estimate: at least 1 in 5 of the 6,668 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: globs: alwaysApply: true --- # Folder Organization Guidelines This document provides guidelines for organizing code in the AI Backends project. ## src/config/ - Store environment variables, app settings, and configuration values - Export constants for API keys, server settings, etc. - Configuration should be loaded from environment variables when possible ## src/controllers/ - Controllers should handle HTTP request/response cycle - Extract request data and validate it - Call appropriate services to process business logic - Format and return responses - Keep controllers thin, move business logic to services ## src/middlewares/ - Create reusable middleware functions - Handle cross-cutting concerns like authentication, logging, error handling - Keep middleware focused on a single responsibility ## src/models/ - Define data structures and types - Create interfaces for database entities if applicable - Define schemas for data validation ## src/routes/ - Define API routes and endpoints - Connect routes to controllers - Group related routes in separate files - Use descriptive names that reflect the resource being accessed ## src/services/ - Implement core business logic - Handle external API calls - Maintain separation of concerns - Services should be testable in isolation ## src/utils/ - Create reusable utility functions - Keep functions pure when possible - Group related utilities in separate files ## src/schemas/ - Define validation schemas using Zod - Create reusable schema components - Keep schemas aligned with OpenAPI documentation ## tests/ - Create comprehensive test coverage - Unit tests should focus on individual functions - Integration tests should test API endpoints - Use fixtures for test data
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.

