backend-patterns
Skill3 starsChanged 8 months agoMITView on GitHub
Common backend development patterns for APIs, databases, caching, and service architecture. Language-agnostic principles with examples in Python, TypeScript, and Go.
49 other projects use a version of this.
Adopted by
Most recently taken up by
- Lukk17/agent-standardstheir own version, first seen Oct 5, 2026
- JameMy0001/antigravity-skills-hubtheir own version, first seen Oct 2, 2026
- kensaurus/skillstheir own version, first seen Oct 1, 2026
- productionx-in/Core-Skillstheir own version, first seen Sep 29, 2026
- lintangknitto/agent-skillstheir own version, first seen Sep 23, 2026
- templetongroup/radianttheir own version, first seen Sep 17, 2026
Used with
Projects with it also use configure-ecc, swift-protocol-di-testing and 6 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
saxon-ySkillconfigure-ecc
Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.
Also in 10 projects that use this
InfopibeSkillswift-protocol-di-testing
Protocol-based dependency injection for testable Swift code — mock file system, network, and external APIs using focused protocols and Swift Testing.
Also in 9 projects that use this
InfopibeSkillcontent-hash-cache-pattern
Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.
Also in 9 projects that use this
WorldFlowAISkillclickhouse-io
ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.
Also in 13 projects that use this
joneqianSkillpostgres-patterns
PostgreSQL database patterns for query optimization, schema design, indexing, and security. Based on Supabase best practices.
Also in 20 projects that use this
- +3 more from Infopibe
Other versions49 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 49
- WorldFlowAI/everything-claude-code★ 4ksame name
- xu-xiang/everything-claude-code-zh★ 2ksame name
- loulanyue/awesome-claude-notes★ 272same name
- cloudnative-co/claude-code-starter-kit★ 151same name
- tpavanipradeep/everything-claude-code★ 134same name
- templetongroup/radiant★ 113same name
- hellangleZ/burn-in-cceverywhere-ralph★ 112same name
- Jamkris/everything-gemini-code★ 87same name
- tranhieutt/software_development_department★ 72same name
- codelably/harmony-claude-code★ 43same name
39 more not listed
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.
In this repository72 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- api-designerSkill
- code-reviewerSkill
- debugging-assistantSkill
- golang-testingSkill
- project-guidelines-exampleSkill
- python-testingSkill
- refactoring-guideSkill
- spec-driven-developmentSkill
- tdd-workflowSkill
- verification-loopSkill
- update-docsSkill
- api-docsSkill
- changelog-writerSkill
- readme-generatorSkill
- django-patternsSkill
- django-securitySkill
- django-tddSkill
- django-verificationSkill
- fastapi-patternsSkill
- nextjs-patternsSkill
- react-patternsSkill
- springboot-patternsSkill
- springboot-securitySkill
- springboot-tddSkill
- branch-strategySkill
- changelogSkill
- commit-helperSkill
- pr-creatorSkill
- prSkill
- evolveSkill
- instinct-exportSkill
- instinct-importSkill
- instinct-statusSkill
- cleanupSkill
- lint-fixSkill
- refactor-cleanSkill
- update-depsSkill
- continuous-learningSkill
- continuous-learning-v2Skill
- eval-harnessSkill
- iterative-retrievalSkill
- strategic-compactSkill
- golang-patternsSkill
- python-patternsSkill
- rust-patternsSkill
- typescript-patternsSkill
- accessibility-checkerSkill
- build-fixSkill
- code-reviewSkill
- e2eSkill
- performance-reviewerSkill
- security-auditorSkill
- security-reviewSkill
- test-coverageSkill
- checkpointSkill
- deploySkill
- evalSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 9 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
9
Distinctive
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 77
Add indexes for WHERE, JOIN, and ORDER BY columns
- Distinctive: line 78
Use EXPLAIN to verify query plans
- Distinctive: line 79
Avoid SELECT * — select only needed columns
- Distinctive: line 80
Use pagination for list endpoints (LIMIT/OFFSET or cursor-based)
- Distinctive: line 84
Always make migrations reversible
- Distinctive: line 86
Add columns as nullable first, then backfill, then add constraint
- Distinctive: line 87
Never rename columns — add new, migrate data, remove old
- Distinctive: line 141
Use sliding window algorithm for accuracy
- Distinctive: line 144
Stop accepting new connections
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Backend Development Patterns
API Design
RESTful Conventions
GET /api/users # List (with pagination)
GET /api/users/:id # Read single
POST /api/users # Create
PUT /api/users/:id # Full update
PATCH /api/users/:id # Partial update
DELETE /api/users/:id # DeleteResponse Format
{
"data": { ... },
"meta": {
"page": 1,
"per_page": 20,
"total": 142
}
}Error Response
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input",
"details": [
{ "field": "email", "message": "must be a valid email" }
]
}
}HTTP Status Codes
| Code | Use |
| 200 | Successful read/update |
| 201 | Successful create |
| 204 | Successful delete |
| 400 | Validation error |
| 401 | Not authenticated |
| 403 | Not authorized |
| 404 | Resource not found |
| 409 | Conflict (duplicate) |
| 429 | Rate limited |
| 500 | Server error |
Database Patterns
Repository Pattern
Separate data access from business logic:
Service (business logic) → Repository (data access) → DatabaseQuery Optimization
- Add indexes for WHERE, JOIN, and ORDER BY columns
- Use EXPLAIN to verify query plans
- Avoid SELECT * — select only needed columns
- Use pagination for list endpoints (LIMIT/OFFSET or cursor-based)
- Batch operations instead of N+1 queries
Migration Safety
- Always make migrations reversible
- Use
CREATE INDEX CONCURRENTLY(PostgreSQL) - Add columns as nullable first, then backfill, then add constraint
- Never rename columns — add new, migrate data, remove old
Caching Patterns
Cache-Aside (Lazy Loading)
1. Check cache for key
2. If miss: query database, store in cache, return
3. If hit: return cached value
4. On write: invalidate cacheCache Invalidation
- Time-based: TTL appropriate to data freshness needs
- Event-based: Invalidate on write/update
- Version-based: Include version in cache key
What to Cache
- Database query results (especially aggregations)
- External API responses
- Computed values (rendered templates, transformed data)
- Session data
What NOT to Cache
- Frequently changing data (< 1 second TTL)
- Sensitive data without encryption
- Large blobs that exceed memory budget
Service Architecture
Middleware Pattern
Request → Auth → Rate Limit → Validate → Handler → Response
↓
LoggingHealth Check Endpoint
GET /health
{
"status": "healthy",
"checks": {
"database": "connected",
"cache": "connected",
"disk": "sufficient"
}
}Rate Limiting
- Per-user rate limits for authenticated endpoints
- Per-IP rate limits for public endpoints
- Return
429withRetry-Afterheader - Use sliding window algorithm for accuracy
Graceful Shutdown
- Stop accepting new connections
- Finish processing in-flight requests (with timeout)
- Close database connections
- Close cache connections
- Exit
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.

