backend-patterns
Skill9 starsChanged 42 days agoMITView on GitHub
Apply backend patterns — queues, caching, rate limits, serverless/edge. Use when "queue jobs", "caching layer", "rate limiting", "server actions", or "edge function". Which architecture to pick → audit-backend-architecture.
88 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- lhbsaa/apex-unifiedtheir own version, first seen Nov 8, 2026
- ahmadvahidi/skill-atlastheir own version, first seen Nov 8, 2026
- Ashfaqbs/ai-coding-agent-toolkittheir own version, first seen Nov 8, 2026
- Lukk17/agent-standardstheir own version, first seen Nov 7, 2026
- XD3an/cc-plustheir own version, first seen Nov 7, 2026
Used with
Projects with it also use everything-claude-code, investor-materials and 10 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.
InfopibeSkilleverything-claude-code
Also in 10 projects that use this
InfopibeSkillinvestor-materials
Create and update pitch decks, one-pagers, investor memos, accelerator applications, financial models, and fundraising materials. Use when the user needs investor-facing documents, projections, use-of-funds tables, milestone plans, or materials that must stay internally consistent across multiple fundraising assets.
Also in 29 projects that use this
niloykumarbarmanSkillagent-sort
Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.
Also in 10 projects that use this
tpavanipradeepSkillbun-runtime
Bun as runtime, package manager, bundler, and test runner. When to choose Bun vs Node, migration notes, and Vercel support.
Also in 21 projects that use this
mryeastcodeSkilleverything-claude-code-conventions
Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.
Also in 8 projects that use this
gongyijie85Skillunified-memory
Share durable, inspectable context and handoffs between Claude, Codex, Hermes, Cursor, OpenCode, and other agents through the local ECC Memory Vault. Use when an agent must save work state, transfer context, resume another agent's task, or search shared project knowledge.
Also in 4 projects that use this
- +1 more from Infopibe
Other versions88 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- kensaurus/skills★ 935% same
Wrote their own version · 87
- affaan-m/ECC★ 246ksame name
- YosemiteCrew/Yosemite-Crew★ 2ksame name
- xu-xiang/everything-claude-code-zh★ 1.9ksame name
- loulanyue/awesome-claude-notes★ 272same name
- cloudnative-co/claude-code-starter-kit★ 153same name
- tpavanipradeep/everything-claude-code★ 104same name
- mturac/everything-openai-codex★ 89same name
- mit-network/everything-claude-code★ 76same name
- tranhieutt/software_development_department★ 71same name
- Fmarzochi/EGC★ 61same name
77 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 repository165 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/approved-plan-execution.mdcCursor rule
- .cursor/rules/skill-workflows.mdcCursor rule
- .cursor/rules/verification-before-completion.mdcCursor rule
- llms.txtllms.txt
- audit-accessibilitySkill
- audit-agent-speedSkill
- audit-analyticsSkill
- audit-auth-flowsSkill
- audit-backend-architectureSkill
- audit-bundle-sizeSkill
- audit-cicdSkill
- audit-codemod-safetySkill
- audit-code-qualitySkill
- audit-code-reviewSkill
- audit-db-schemaSkill
- audit-doctrineSkill
- audit-env-paritySkill
- audit-fe-apiSkill
- audit-gate-logicSkill
- audit-i18nSkill
- audit-infra-costSkill
- audit-langfuse-llmSkill
- audit-llm-securitySkill
- audit-monetization-iapSkill
- audit-payment-systemSkill
- audit-performanceSkill
- audit-realworldSkill
- audit-registry-listingSkill
- audit-resilienceSkill
- audit-responsiveSkill
- audit-securitySkill
- audit-skill-conflictsSkill
- audit-ui-statesSkill
- audit-uiux-design-systemSkill
- audit-ux-journeysSkill
- audit-uxSkill
- backend-db-performanceSkill
- backend-error-handlingSkill
- backend-observabilitySkill
- backend-realtimeSkill
- burndown-fullSkill
- complete-everythingSkill
- data-pipelineSkill
- data-visualizationSkill
- debug-errorSkill
- debug-fe-be-integrationSkill
- debug-sentry-monitorSkill
- deploy-npmSkill
- deploy-verifySkill
- design-apiSkill
- design-canvasSkill
- design-emailSkill
- design-frontendSkill
- design-generative-artSkill
- design-mobile-firstSkill
- design-motionSkill
- design-prdSkill
- design-systemSkill
- design-themeSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.
0
Common
Most of the 26 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 97
Every procedure has a Zod .input().
- Very specific: line 105
Verify the webhook signature against the raw body before parsing JSON.
- Very specific: line 142
Default: Inngest. inngest.createFunction({ id }, { event }, async ({ event, step }) => ...).
- Distinctive: line 175
After implementing backend patterns:
“Common” is measured: kept by at least 6 in 10 of the 26 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 Patterns Skill
Degree of freedom: MIXED. Which pattern to apply [HIGH freedom];
existing-architecture probes and the validation list [LOW freedom — run exactly].
How to reason
- Observe — existing server/api/actions, ORM, queues, cache
- Interpret — missing pattern vs duplicate vs wrong layer
- Classify — reuse / add-queue / add-cache / add-rate-limit / edge-fn
- Severity — unauthenticated mutation outranks a missing cache
Worked example
Observe:
createOrdersends email inline; no Inngest/queue; checkout p95 4s. Interpret: confirmation is post-response work, not request-path. Classify:after()or anorder/createdjob; keep the write transactional. Verify: order row commits; email/inventory run after response; retries do not double-charge.
Self-critique before reporting
- Existing first — searched server/api/actions before adding a second pattern
- Auth + validate — every mutation checks session and Zod
- Idempotent — retries on the new path do not double-apply
- Right owner — which architecture to pick →
audit-backend-architecture
Design scalable, maintainable backend architectures using modern patterns and best practices.
Code examples lean on Next.js App Router + Supabase/Prisma. The patterns are stack-agnostic — adapt ORMs, client libraries, and deploy targets to your detected ecosystem.
Check existing first [LOW freedom — run exactly]
Before implementing ANY backend pattern, verify:
- Check existing architecture:
ls -la src/server/ src/api/ app/api/ supabase/functions/ 2>/dev/null
cat package.json | grep -i "prisma\|drizzle\|supabase\|trpc"- Check existing patterns:
rg "createTRPCRouter|publicProcedure" --type ts -l
rg "'use server'" --type ts -l
ls -la supabase/migrations/*.sql 2>/dev/null | tail -5- Check database setup:
cat prisma/schema.prisma 2>/dev/null | head -50
cat supabase/config.toml 2>/dev/nullWhy: Backend changes have wide impact. Understand existing architecture first.
Server Actions (Next.js 16+) [HIGH freedom]
Next.js 16: Turbopack default; 'use cache' + cacheComponents; reactCompiler: true; middleware.ts → proxy.ts (grep both). Instant navigations → enhance-web-instant-nav.
- Order inside every action: auth check → Zod
safeParse→ execute → map known errors (PrismaP2002) → generic failure message. - Return
ActionResult<T>:{ success: true, data }or{ success: false, error, fieldErrors? }; never throw to the client. revalidatePathafter a successful write.- Post-response work (confirmation email, inventory, notifications) goes in
after()fromnext/server, keeping the write transactional.
'use server'
import { after } from 'next/server'
export async function createOrder(formData: FormData) {
const order = await db.order.create({ data: { /* ... */ } })
after(async () => { // runs after the response is sent
await sendOrderConfirmation(order.id)
await updateInventory(order.items)
})
revalidatePath('/orders')
return { success: true, data: order }
}Full createUser action and the after() example: references/request-patterns.md §Server Actions.
tRPC Setup [HIGH freedom]
publicProcedurefor reads anyone may do;protectedProcedurefor anything that usesctx.session.- Every procedure has a Zod
.input(); mutations stampcreatedByIdfrom the session, not the input. - List endpoints paginate by cursor: fetch
limit + 1, pop the extra row asnextCursor.
Full usersRouter (getById, create, cursor-paginated list): references/request-patterns.md §tRPC router definition.
Supabase Edge Functions [HIGH freedom]
Deno.serve; answerOPTIONSwith the CORS headers first.- Verify the webhook signature against the raw body before parsing JSON;
401on mismatch. - Admin client from
SUPABASE_SERVICE_ROLE_KEYbypasses RLS; use it only inside the function. - Catch everything; log server-side, return a generic
500JSON body with CORS headers.
Full process-webhook function: references/request-patterns.md §Supabase Edge Function.
Database Patterns [HIGH freedom]
- Optimistic locking —
version INTcolumn;UPDATE ... WHERE id = $1 AND version = $2and treat 0 rows as a concurrent update. - Soft deletes — nullable
deletedAtwith an index; every read filtersdeletedAt: null; delete sets the timestamp. - Audit logging —
audit_logs(table_name, record_id, action, old_data, new_data, user_id)filled by aSECURITY DEFINERtrigger usingTG_OP,row_to_json,auth.uid().
UPDATE orders SET status = 'shipped', version = version + 1
WHERE id = $1 AND version = $2; -- 0 rows → concurrent update, retry or surface conflictSoft-delete Prisma model and the full audit trigger: references/data-and-jobs.md §Soft deletes, §Audit logging.
Caching Patterns [HIGH freedom]
- Next.js:
fetch(url, { next: { revalidate, tags } });revalidateTagon demand;unstable_cachearound DB queries with tags. - Redis (Upstash): one
getCachedData(key, fetcher, ttl)helper, cache-aside; key by entity and id (user:${id}). - Pick TTL by staleness tolerance, and always tag so a write can bust the cache.
const getCachedUser = unstable_cache(
async (id: string) => db.user.findUnique({ where: { id } }),
['user'],
{ revalidate: 3600, tags: ['users'] }
)Next.js cache calls and the Redis helper: references/data-and-jobs.md §Next.js cache, §Redis caching.
Background Jobs [HIGH freedom]
- Default: Inngest.
inngest.createFunction({ id }, { event }, async ({ event, step }) => ...); each side effect in its ownstep.runso retries resume, not restart. - Trigger with
inngest.send({ name: 'order/created', data })from the Server Action after the write commits. - Early exit (out of stock) is a
step.run+return { status: 'cancelled' }, not a throw.
export const processOrder = inngest.createFunction(
{ id: 'process-order' }, { event: 'order/created' },
async ({ event, step }) => {
const payment = await step.run('charge-payment', () => chargeCustomer(event.data.paymentMethod))
await step.run('send-confirmation', () => sendOrderConfirmation(event.data.orderId))
return { status: 'completed', paymentId: payment.id }
}
)Full Inngest function and the Trigger.dev scheduled-task alternative: references/data-and-jobs.md §Background jobs, §Alternatives.
Rate Limiting [HIGH freedom]
@upstash/ratelimitwithRatelimit.slidingWindow(10, '10 s')overRedis.fromEnv().- Key by user id (or IP for anonymous); on
!successreturnToo many requestswithretryAfterseconds fromreset.
Full rateLimitedAction: references/request-patterns.md §Rate limiting.
Architecture patterns (distributed systems) [HIGH freedom]
Gateway, BFF, bulkhead, circuit breaker, outbox+CDC, saga, hexagonal, ACL, and strangler-fig →
references/architecture-patterns.md. Pick the pattern for the
topology (no mesh on a monolith; no CQRS unless reads/writes diverge). Timeouts/retries/idempotency
→ audit-resilience; structural gap report → audit-backend-architecture.
Validation [LOW freedom — do not skip]
After implementing backend patterns:
- Error handling → All errors caught, logged, safe response returned
- Auth checks → Every mutation verifies authentication
- Input validation → Zod schema on all inputs
- Rate limiting → Sensitive endpoints protected
- Idempotency → Critical operations handle retries
- Logging → Structured logs without sensitive data
- Testing → Unit tests for business logic, integration for APIs
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.

