an agent skill · APIs, data, auth, async, caching, security & tests

/backend

Ask an agent for an endpoint and it writes plausible handler code from memory — a stale ORM call, an ad-hoc error shape, auth improvised, a job that drops on retry. backend builds the running server behind the contract — APIs, domain logic, OLTP persistence, auth, async work, caching, security controls, integration, and the tests that prove it — retrieval-first against current docs, picking the modal default stack and saying when to deviate, and proving it runs before it calls the job done.

# natural language — no flags, no fixed pipeline /backend build the refund endpoint — validation, idempotent worker & auth, then prove it runs

runs onClaude CodeCodexCursorAntigravityopencodeGrok BuildHermes

The router is the skill. There is no fixed pipeline to run start-to-finish — each job stands alone and enters where your request is. The animation traces one path; the sections below map the whole surface it routes across.

Own the code, not the decision

backend owns the running server — the implementation craft inside the decided shape: the endpoints behind the contract, the domain layer, the OLTP schema and migrations, the auth enforcement, the queues and workers, the caches and the security controls, plus the tests that prove it runs. It consumes architecture's decisions — boundaries, contract shape, NFR budgets, threat model — and builds inside them rather than re-deriving or overriding them, and it recommends the sibling skills by name rather than silently doing their work.

backend owns

the running implementation & the decision record behind it

  • the API — routing, validation, error shape, pagination, versioning-in-code
  • domain + persistence — use-cases, aggregates, schema, migrations, transactions
  • auth enforcement — sessions/JWT, OAuth2/OIDC+PKCE, Argon2id, RBAC/ABAC/ReBAC
  • async + integration — jobs, outbox, saga, idempotency, resilient clients, webhooks
  • security controls — the threat model's controls, implemented & self-audited
  • the proof — unit / integration / contract tests + a run verification loop

hands off to

consume or contribute; own none

  • architecture — upstream: boundaries, contract shape, NFR budget, threat model
  • frontend — the client/SSR building to the same contract
  • data — OLAP, warehouses, pipelines, analytical stores
  • ai — the LLM/agent core; backend serves it, doesn't own it
  • operate — deploy, CI/CD, runtime monitoring & SLO alerting
  • quality — independent load-testing, scanning & the release gate

Implement inside the decision. When compatible upstream artifacts are supplied — a solution-architecture doc, contracts, an NFR budget, a threat model, a handoff.yaml — backend builds against them. When they don't exist (a standalone run), it says so explicitly rather than inventing a contract or threat model to fill the gap.

The faceted router

SKILL.md is a router, not a script. Every request selects the smallest sufficient route: one primary job — the nine below — combined with at most one base surface that reshapes how the job applies to the runtime, plus the additive agentic overlay when the caller is an LLM/agent system. Read the selected references completely; load two or three at most, never the whole pack. Nine jobs and five surfaces compose across the runtime types — from a single-endpoint two-file read to a full service pass — without ever reading all fifteen references at once.

facetoptionsrule
① Primary job api · domain-logic · persistence · auth · async & messaging · caching & performance · server-security · service-integration · backend-testing Exactly one. Pick the single engineering job the request needs; the default entry is api-implementation.
② Base surface rest-crud (default) · serverless / edge · realtime · event-driven microservices At most one. The runtime/system type reshapes how every job applies — it points to the job references, it doesn't redefine them.
③ Agentic overlay surface-agentic — backend serving an LLM/agent system Additive. Stacks on top of the base surface, never replaces it. A serverless agent backend is serverless-edge + agentic.
Retrieval-first before any code. Backend frameworks, ORMs, and databases ship breaking changes fast — Prisma 7, Drizzle 1.0, Go 1.22 routing, Kafka 4.0 KRaft-only, Redis licensing, PG18/19. A route never generates framework/ORM/DB-specific code from memory; it fetches the current official docs and types and version-gates the idioms to the target release first.

The nine primary jobs

Each job is one reference, read fully only when its route is selected — grounded in named canon, producing a running implementation plus the decision record behind it. This is the whole surface, not a headline slice.

I need to…ReadGrounded inProduces
Build endpoints / handlers / resolvers behind a contract · pick REST/GraphQL/gRPC/tRPC · set pagination, versioning, error shape api-implementation.md OpenAPI · Google AIP · MS REST guidelines · cursor pagination Transport pick, request-lifecycle wiring, single-source schema, uniform error shape, cursor pagination, in-code versioning
Add / refactor business logic, a service or use-case layer, or domain models · stop rules leaking into handlers domain-logic.md DDD tactical · clean / hexagonal (Cockburn) · dependency rule Layered domain/application/infra structure, aggregates/entities/VOs, anti-anemic litmus, dependency rule
Design schema / indexes · choose ORM vs raw SQL · write a migration · get transactions / isolation right · size a pool · kill N+1 persistence.md Postgres-for-everything · Drizzle / Prisma · isolation levels · pooling Schema + index + expand/contract migration, isolation decision, pooling matched to runtime, DB-license flag
Add login / sessions · protect a route · add OAuth / SSO / "sign in with X" · store passwords · decide who-can-do-what auth.md OAuth2 / OIDC + PKCE (RFC 9700) · Argon2id · Better-Auth · Zanzibar (OpenFGA / SpiceDB) Session-vs-JWT decision, OAuth2/OIDC+PKCE flow, Argon2id config, RBAC/ABAC/ReBAC model + library pick
Background jobs, queues, workers, event-driven services, pub/sub, CDC, outbox, saga, idempotency, or durable workflows async-and-messaging.md transactional outbox · saga · at-least-once + idempotent consumers · Temporal / Hatchet Broker/queue pick, idempotency-key path, transactional outbox, saga + compensations, delivery stance, durable-execution decision
Add a cache and invalidate it · implement rate limiting · diagnose a slow endpoint / query caching-and-performance.md cache-aside / staleness tolerance · distributed token bucket · measure-first tuning Cache strategy by staleness/loss tolerance, invalidation mechanism, distributed-correct token bucket, measured bottleneck + fix
Secure the API · add security headers · fix CORS · prevent injection · store secrets · add CSRF / mTLS — implement a threat model's controls server-security.md OWASP Top 10:2021 · ASVS · parameterized queries · secret hygiene Uniform OWASP controls table (control→impl→verify) with a self-audit count, mapped to Top 10:2021 / ASVS
Call a third-party API · receive / deliver webhooks · add a gRPC / HTTP client · tune a circuit breaker · integrate payment / AI / email service-integration.md retry + jitter · circuit breaker · idempotent webhooks in/out · signature verify Resilient client wrapper (retry reused from async + circuit breaker), verified idempotent webhooks in and out
Write / run / fix backend tests, or "prove this works" — unit / integration (testcontainers) / producer-contract + a runnable loop backend-testing.md testcontainers · producer-contract (Pact) · test pyramid · real dependencies Layered test suite, real-dependency integration tests, contract-producer check, ✓/✗ verification report

Full router table & invariants: SKILL.md.

Default stack, then deviate

The skill speaks the current modal default per language fluently — so the fast path is fast — but every recommendation is a concrete pick + what NOT to build + the trade-off, weighted by reversibility. Adoption numbers are engagement, not gospel; the fundamentals below are anchored regardless of what is trending. Highlighted chips are the modal defaults.

TypeScript

Hono / tRPCFastifyElysia (Bun)managed PostgresDrizzlePrisma 7Better-Auth

Python

FastAPISQLAlchemy / SQLModelAlembic

Go

net/http (1.22)sqlcpgx

Postgres-for-everything

pgvectorLISTEN / NOTIFYjobs + SKIP LOCKEDfull-text / BM25

Durable execution

TemporalHatchet (Postgres)

Zanzibar authz

OpenFGASpiceDBory-keto

Anchored fundamentals

SQL before ORMmodular-monolith-firstat-least-once + idempotentparameterized queries

DB-license literacy

SSPL · BSL · AGPLsource-availableValkey / OpenSearch escape hatches
Teach the datastore license, not just the API. A distinctive value-add: the skill states the self-host / resale implications of SSPL (MongoDB, Redis-server), BSL (CockroachDB, Timescale-features), AGPL (Redis 8), and source-available tiers — and names the permissive escape hatches (Valkey, OpenSearch, YugabyteDB, Meilisearch-MIT).

Five surface overlays

One base surface, at most, reshapes the job for the runtime type — the same persistence job is bounded differently on a long-running server than on a scale-to-zero edge function. The agentic overlay is additive — it stacks on top of whichever base you picked — and is the first-class differentiator, expanded below.

REST / CRUD surface-rest-crud.md

Standard long-running request/response service (the default): the concern-scoping model pick, an adapter seam that isolates the runtime, per-language idioms, and a 12-factor scaffold.

reshapesscoping model · adapter seam · 12-factor

Serverless / edge surface-serverless-edge.md

Workers / Lambda / Bun-edge: statelessness, the recurring connection-pooling failure mode (a txn-mode pooler or an HTTP-native driver), and the D1 / KV / R2 / Durable-Objects mapping.

reshapesstatelessness · pooling · edge stores

Realtime surface-realtime.md

WebSocket / SSE / pub-sub, stateful connections, presence, rooms: the SSE-vs-WS transport call, actor-per-connection/room, per-message reliability, and fan-out / scaling.

reshapestransport · actor model · fan-out

Event-driven micro surface-event-driven-microservices.md

Independently deployed polyglot services over gRPC + an event backbone: the modular-monolith-first gate, database-per-service consequences (saga / CQRS), inter-service contract evolution, sync-vs-async classification.

reshapesmonolith gate · db-per-service · contracts

Agentic / LLM flagship · additive

Backend serving an LLM/agent system. Durable execution as the default control plane, tool / MCP endpoints, agent-legible typed contracts + errors, RAG plumbing (not the core), agent-scoped short-lived tokens — it stacks on top of the base surface.

reshapescontrol plane · tool/MCP · agent tokens

The agentic flagship

Generic server-building is well covered; the agent-native backend is the 2026 throughline. Every major backend tool now ships an agent interface, and the argument that backends should be agent-legible — typed contracts, legible errors, markdown, token-efficient responses — is the differentiator versus every single-purpose backend skill. When the caller is an agent, the surface stacks additively: it changes the control plane, not just a component.

Durable execution is the default control plane — and the contract is written to be read by a model.

An additive surface, not a new backend

# the base surface stays; agentic stacks on top
base_surface:   serverless-edge   # rest-crud | serverless | realtime | event-driven
control_plane:  durable execution # Temporal / Hatchet — resume, don't retry-from-zero
tool_surface:   MCP + typed tool endpoints
contract:       agent-legible      # typed I/O, legible errors, token-efficient
retrieval:      RAG plumbing       # backend serves it; ai owns the core
tokens:         agent-scoped, short-lived
idempotency:    every tool call keyed  # retries are a given, not an edge case

Why durability is the default here

  • durableworkflow state survives a crash — resume mid-run, the agent default
  • retry-from-zerostateless retry — fine for a pure function, ruinous for a 20-step agent run
  • fire-and-hopeno durability — "Ignoring Durability in Agent Workflows" is a flagged anti-pattern

The backend serves the agent — it isn't the agent

  • tool / MCPtyped, discoverable, individually authorized endpoints
  • RAG plumbingindexing, retrieval, reranking wiring — not the model
  • agent tokensshort-lived, tool-scoped; blast radius before autonomy
The sharp distinction: surface-agentic is additive, never a replacement — a realtime agent backend is surface-realtime + surface-agentic. Backend owns the plumbing that serves the agent (tool endpoints, durable control plane, RAG wiring, scoped tokens); the LLM/agent core — prompts, model choice, the eval set — belongs to ai. Agent-specific concerns are first-class:
durable resumetool-scope over-grantprompt injection via tool I/Otoken / cost runawayidempotent tool calls

The universal invariants

Six rules govern every route, whichever references it loads — the behavioral spine, condensed.

What a pass produces

backend's deliverable is a running implementation plus the decision record behind it. A full pass emits up to five kinds of artifact — plus the fillable checklists that ship in the pack. Each records the decision and options considered, the trade-off accepted, facts/decisions/assumptions distinguished, and — for any framework/ORM/DB code — that current docs were checked for the target version. It closes on the prove-it-works loop, not an assertion.

phase 1linttypes + static checks pass
phase 2migrateexpand/contract applies clean
phase 3testunit + integration + contract
phase 4hit endpointreal request, real response
phase 5diff-review✓/✗ reported per phase

The running service

assets/backend-service-scaffold.md

A 12-factor service scaffold — the implementation, not a plan — wired to the chosen runtime and store.

The contract, as implemented

assets/api-contract-review-checklist.md

The contract backend built to, reviewed against a uniform checklist — the interface frontend codes against.

Zero-downtime migration

assets/migration-template.md

Expand/contract migration with the rollout order — applied and verified, not just written.

Auth & OWASP checklists

auth-implementation · owasp-backend-controls

Argon2id params, cookie flags, OAuth-PKCE, and the OWASP controls table — uniform, with a self-audit count.

Idempotency & outbox recipes

assets/idempotency-and-outbox-recipes.md

The keyed-request path and the transactional outbox — at-least-once made safe for jobs and webhooks.

Tests + verification loop

assets/verification-loop-template.md

The layered suite plus the ✓/✗ report and CI YAML — the proof it runs, distinct from quality's gate.

The handoff seam

backend consumes architecture's artifacts upstream — contracts, NFR budgets, threat model, ADRs — and, when downstream build/verify work is expected, emits a compact handoff.yaml beside the running code: a routing index into the services, contracts-as-built, tests, and telemetry hooks, never a copy of them. Standalone by default; the companion appears only when a consumer will actually read it.

backend builds

skill: backend
status: complete
objective: ""   # only required field
artifacts_created: [service, contract,
  migrations, tests, telemetry-hooks]
decisions: · assumptions: · constraints:
verification: lint/migrate/test/hit ✓
security_border: controls impl'd vs
  quality-verified
recommended_next: operate · quality
  · frontend · data · ai

operate · quality

The running services with telemetry hooks to deploy and monitor, and backend's own tests plus the security-control border for the independent load-test, scan, and release gate.

frontend · data · ai

The contract-as-implemented to code the client against, the OLTP shape that feeds pipelines, and the tool/MCP endpoints plus RAG plumbing that serve the agent core.

Seam discipline. The running code and its tests are the real deliverables; if a consumer needs more than the index gives, the artifact itself is incomplete — the yaml never grows to compensate. When a threat model was consumed, the border between backend-implemented controls and quality-verified controls is stated explicitly. Never silently invoke a build skill; name it in recommended_next.

Start here

Install once. It's a plain SKILL.md router — no flags, no config, no scripts — so it activates on natural-language phrasing ("build the endpoint", "add auth", "write a migration", "set up a job queue", "harden the API", "expose an MCP endpoint") rather than a fixed command.

# skills.sh ecosystem (installs globally to supported clients) npx skills add gabros20/backend-skill -g -y # clone + installer (per-host targets) git clone https://github.com/gabros20/backend-skill && cd backend-skill ./install.sh codex # or: claude | cursor | antigravity | opencode | grok | hermes | agents | all # use — natural language, any host /backend add OAuth login with PKCE and an RBAC check on the admin routes /backend expose our refund flow as an MCP tool on a durable worker # → serverless-edge + agentic /backend write the migration and prove it applies with zero downtime

The same install runs on any Agent Skills host. Codex installs to ${CODEX_HOME:-$HOME/.codex}/skills and triggers with $backend; agents remains a separate cross-agent installation target.

install targets by host
hostinstall targetcommand
Claude Code~/.claude/skills./install.sh claude
Codex${CODEX_HOME:-$HOME/.codex}/skills./install.sh codex
Cross-agent path~/.agents/skills./install.sh agents
Cursor CLI~/.cursor/skills./install.sh cursor
Antigravity (IDE + agy)~/.gemini/…/skills./install.sh antigravity
opencode~/.config/opencode/skills./install.sh opencode
Grok Build~/.grok/skills./install.sh grok
Hermes~/.hermes/skills./install.sh hermes

Prefer npx skills add gabros20/backend-skill -g -y when you have Node — it maps supported clients itself.

what's in the repo
skills/backend/ the skill: SKILL.md (router) + 15 references/ + assets/ docs/ installation · usage · recipes site/ this guide — deploys to backendengskill.vercel.app install.sh installer (claude | codex | cursor | antigravity | opencode | grok | hermes | agents | all) README.md · CHANGELOG.md · LICENSE

More docs: docs/installation.md · docs/usage.md · docs/recipes.md.