From kernel
Implements backend architecture patterns: repository pattern, service layer, caching, N+1 prevention, transactions, and error handling. Useful for structuring server-side code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kernel:backendThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
<skill id="backend">
Identify layer — determine which layer the change touches: handler / service / repository / DB. (gate: layer is named; no logic crosses two layers in a single function)
Repository pattern — abstract all data access behind an interface.
Service layer — business logic only; no HTTP, no DB calls.
req/res objects; no supabase/prisma/drizzle imports)N+1 prevention — before any loop over a result set, check for nested queries.
await repo.findById calls inside a for/forEach/.map)Cache-aside — for read-heavy data: check cache → miss → fetch DB → populate cache.
redis.del(key) after update/delete).Transactions — multi-step mutations must be atomic.
Error handling — typed error hierarchy; never expose stack traces.
Error thrown from service; no stack trace in response body)Retry with backoff — transient failures (network, lock contention) get exponential backoff.
Queue pattern — fire-and-forget or deferred work uses a job queue.
<anti_patterns> Querying in loops. Batch fetch with IN clauses or joins. SELECT * is wasteful. Select only needed columns. Multi-step mutations without transactions. All or nothing. Caching write-heavy data. Cache reads, invalidate on writes. Business logic in HTTP handlers. Use service layer. Stack traces to users. Log details, return generic message. </anti_patterns>
<on_complete> agentdb write-end '{"skill":"backend","patterns_used":["repository","service","cache-aside"],"n_plus_one_fixed":,"cache_keys":[""]}'
Record patterns applied and performance improvements. </on_complete>
npx claudepluginhub ariaxhan/kernel-claude --plugin kernelProvides backend patterns for RESTful API design, repository, service layer, and middleware in Node.js, Express, Next.js API routes, and Supabase. Useful for scalable server-side apps.
Provides backend architecture patterns for REST/GraphQL API design, repository/service layers, database optimization, caching, middleware, and error handling in Node.js, Express, and Next.js API routes.
Guides backend architecture patterns including API design (REST/GraphQL), repository/service layers, database optimization, caching, and middleware for Node.js, Express, and Next.js.