slopgate / rules
Cursor rule1 starsChanged 51 days agoMITView on GitHub
Backend API coding standards with clean architecture (Router/Service/Repository pattern)
- Reads credentials
We split this backend.mdc into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
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
Explicit ORM loading strategy: do not rely on default relation loading when query shape matters
- Distinctive: line 22
Safe ORM lifecycle: do not share mutable ORM session/entity manager across concurrent work unless ORM explicitly supports it
- Distinctive: line 24
Stateless services: no in-memory session or user state between requests — use external stores
- Distinctive: line 37
Dependency Inversion: Use your framework's DI mechanism
- Distinctive: line 38
KISS: Keep it simple and clear
≈ “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: "Backend API coding standards with clean architecture (Router/Service/Repository pattern)" globs: alwaysApply: false --- <!-- Generated by oh-my-agent. Source: .agents/rules/backend.md --> # Backend Coding Standards ## Core Rules 1. **Clean architecture**: router -> service -> repository -> models 2. **No business logic in route handlers** 3. **All inputs validated** with your stack's validation library 4. **Parameterized queries only** (never string interpolation) 5. **JWT + Argon2id for auth** (bcrypt acceptable for legacy compatibility); rate limit auth endpoints 6. **Async where supported**; type annotations on all signatures 7. **Custom exceptions** via centralized error module (not raw HTTP exceptions) 8. **Explicit ORM loading strategy**: do not rely on default relation loading when query shape matters 9. **Explicit transaction boundaries**: group one business operation into one request/service-scoped unit of work 10. **Safe ORM lifecycle**: do not share mutable ORM session/entity manager across concurrent work unless ORM explicitly supports it 11. **Config from environment, with graceful fallback**: DB URLs, API keys, secrets from env vars or secret managers, never hardcode. When integrating a third-party API (OpenAI, Anthropic, Stripe, etc.), write BOTH paths: (a) real call when `process.env.<KEY>` is present, (b) deterministic local fallback when absent. Mark the deferred branch with `// TODO(oma-deferred): integrate <vendor> when key is provisioned`. Shipping only the fallback (no env-conditional branch) leaves the spec unmet; shipping only the real call without fallback breaks demos when the key is missing. 12. **Stateless services**: no in-memory session or user state between requests — use external stores 13. **Backing services as resources**: DB, queue, cache are swappable resources connected via config ## Architecture ``` Router (HTTP) → Service (Business Logic) → Repository (Data Access) → Models ``` ## Principles - **DRY**: Business logic in Service, data access in Repository - **Single Responsibility**: Classes and functions should have one responsibility - **Dependency Inversion**: Use your framework's DI mechanism - **KISS**: Keep it simple and clear
Other versions1 project uses a version of this.
Word for word · 1
- first-fluke/fullstack-starter★ 223100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
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 repository115 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/commit.mdcCursor rule
- .cursor/rules/database.mdcCursor rule
- .cursor/rules/debug.mdcCursor rule
- .cursor/rules/design.mdcCursor rule
- .cursor/rules/dev-workflow.mdcCursor rule
- .cursor/rules/frontend.mdcCursor rule
- .cursor/rules/i18n-arb.mdcCursor rule
- .cursor/rules/i18n-guide.mdcCursor rule
- .cursor/rules/infrastructure.mdcCursor rule
- .cursor/rules/market.mdcCursor rule
- .cursor/rules/mobile.mdcCursor rule
- .cursor/rules/quality.mdcCursor rule
- beadsSkill
- gitnexus-area-adaptersSkill
- gitnexus-area-cliSkill
- gitnexus-area-contextSkill
- gitnexus-area-dashboardSkill
- gitnexus-area-detectorsSkill
- gitnexus-area-engineSkill
- gitnexus-area-enrichmentSkill
- gitnexus-area-hooksSkill
- gitnexus-area-installerSkill
- gitnexus-area-integrationSkill
- gitnexus-area-lintSkill
- gitnexus-area-payloadsSkill
- gitnexus-area-project-indexSkill
- gitnexus-area-resourcesSkill
- gitnexus-area-rules-2Skill
- gitnexus-area-rulesSkill
- gitnexus-area-scriptsSkill
- gitnexus-area-test-smellsSkill
- gitnexus-area-testsSkill
- gitnexus-area-uiSkill
- gitnexus-cliSkill
- gitnexus-debuggingSkill
- gitnexus-exploringSkill
- gitnexus-guideSkill
- gitnexus-impact-analysisSkill
- gitnexus-refactoringSkill
- impeccableSkill
- oma-academic-writingSkill
- oma-architectureSkill
- oma-backendSkill
- oma-brainstormSkill
- oma-coordinationSkill
- oma-dbSkill
- oma-debugSkill
- oma-deepsecSkill
- oma-designSkill
- oma-dev-workflowSkill
- oma-docsSkill
- oma-explanationSkill
- oma-frontendSkill
- oma-hwpSkill
- oma-imageSkill
- oma-marketSkill
- oma-mobileSkill
- oma-observabilitySkill
- The first 60 shown.
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.

