agskills.dev
MARKETPLACE

software-backend

Production-grade backend service development across Node.js (Express/Fastify/NestJS/Hono), Bun, Python (FastAPI), Go, and Rust (Axum), with PostgreSQL and common ORMs (Prisma/Drizzle/SQLAlchemy/GORM/SeaORM). Use for REST/GraphQL/tRPC APIs, auth (OIDC/OAuth), caching, background jobs, observability (OpenTelemetry), testing, deployment readiness, and zero-trust defaults.

vasilyu1983329

미리보기

SKILL.md
Metadata
name
software-backend
description
Production-grade backend service development across Node.js (Express/Fastify/NestJS/Hono), Bun, Python (FastAPI), Go, and Rust (Axum), with PostgreSQL and common ORMs (Prisma/Drizzle/SQLAlchemy/GORM/SeaORM). Use for REST/GraphQL/tRPC APIs, auth (OIDC/OAuth), caching, background jobs, observability (OpenTelemetry), testing, deployment readiness, and zero-trust defaults.

Software Backend Engineering

Use this skill to design, implement, and review production-grade backend services: API boundaries, data layer, auth, caching, observability, error handling, testing, and deployment.

Defaults to bias toward: type-safe boundaries (validation at the edge), OpenTelemetry for observability, zero-trust assumptions, idempotency for retries, RFC 9457 errors, Postgres + pooling, structured logs, timeouts, and rate limiting.


Quick Reference

TaskDefault PicksNotes
REST APIFastify / Express / NestJSPrefer typed boundaries + explicit timeouts
Edge APIHono / platform-native handlersKeep work stateless, CPU-light
Type-Safe APItRPCPrefer for TS monorepos and internal APIs
GraphQL APIApollo Server / PothosPrefer for complex client-driven queries
DatabasePostgreSQLUse pooling + migrations + query budgets
ORM / Query LayerPrisma / Drizzle / SQLAlchemy / GORM / SeaORMPrefer explicit transactions
AuthenticationOIDC/OAuth + sessions/JWTPrefer httpOnly cookies for browsers
ValidationZod / Pydantic / validator libsValidate at the boundary, not deep inside
CachingRedis (or managed)Use TTLs + invalidation strategy
Background JobsBullMQ / platform queuesMake jobs idempotent + retry-safe
TestingUnit + integration + contract/E2EKeep most tests below the UI layer
ObservabilityStructured logs + OpenTelemetryCorrelation IDs end-to-end

Scope

Use this skill to:

  • Design and implement REST/GraphQL/tRPC APIs
  • Model data schemas and run safe migrations
  • Implement authentication/authorization (OIDC/OAuth, sessions/JWT)
  • Add validation, error handling, rate limiting, caching, and background jobs
  • Ship production readiness (timeouts, observability, deploy/runbooks)

When NOT to Use This Skill

Use a different skill when:

Decision Tree: Backend Technology Selection

Backend project needs: [API Type] - REST API? - Simple CRUD -> Express/Fastify + Prisma/Drizzle - Enterprise features -> NestJS (DI, modules) - High performance -> Fastify (tight request lifecycle) - Edge/Serverless -> Hono (Cloudflare Workers, Vercel Edge) - Type-Safe API? - Full-stack TypeScript monorepo -> tRPC (no schema, no codegen) - Public API with docs -> REST + OpenAPI - Flexible data fetching -> GraphQL + Pothos/Apollo - GraphQL API? - Code-first -> Pothos GraphQL (TypeScript) - Schema-first -> Apollo Server + GraphQL Codegen - Runtime Selection? - Enterprise stable -> Node.js (current LTS) - Performance-critical -> Bun (verify runtime constraints) - Security-focused -> Deno (verify platform support) - Authentication Strategy? - Browser sessions -> httpOnly cookies + server-side session store - OAuth/Social -> OIDC/OAuth library (or platform auth) - Service-to-service -> short-lived JWT + mTLS where possible - Database Layer? - Type-safe ORM -> Prisma (migrations, Studio) - SQL-first/perf -> Drizzle (SQL-like API) - Raw SQL -> driver + query builder (Kysely/sqlc/SQLx) - Edge-compatible -> driver/ORM + Neon/Turso/D1 - Caching Strategy? - Distributed cache -> Redis (multi-server) - Serverless cache -> managed Redis (e.g., Upstash) - In-memory cache -> process memory (single instance only) - Edge Deployment? - Global low-latency -> Cloudflare Workers - Next.js integration -> Vercel Edge Functions - AWS ecosystem -> Lambda@Edge - Background Jobs? - Complex workflows -> BullMQ (Redis-backed, retries) - Serverless workflows -> AWS Step Functions - Simple scheduling -> cron + durable storage

Runtime & Language Alternatives:

  • Node.js (current LTS) (Express/Fastify/NestJS + Prisma/Drizzle): default for broad ecosystem + mature tooling
  • Bun (Hono/Elysia + Drizzle): consider for perf-sensitive workloads (verify runtime constraints)
  • Python (FastAPI + SQLAlchemy): strong for data-heavy services and ML integration
  • Go (Fiber/Gin + GORM/sqlc): strong for concurrency and simple deploys
  • Rust (Axum + SeaORM/SQLx): strong for safety/performance-critical services

See assets/ for language-specific starter templates and references/edge-deployment-guide.md for edge computing patterns.


API Design Patterns (Dec 2025)

Idempotency Patterns

All mutating operations MUST support idempotency for retry safety.

Implementation:

// Idempotency key header const idempotencyKey = request.headers['idempotency-key']; const cached = await redis.get(`idem:${idempotencyKey}`); if (cached) return JSON.parse(cached); const result = await processOperation(); await redis.set(`idem:${idempotencyKey}`, JSON.stringify(result), 'EX', 86400); return result;
DoAvoid
Store idempotency keys with TTL (24h typical)Processing duplicate requests
Return cached response for duplicate keysDifferent responses for same key
Use client-generated UUIDsServer-generated keys

Pagination Patterns

PatternUse WhenExample
Cursor-basedLarge datasets, real-time data?cursor=abc123&limit=20
Offset-basedSmall datasets, random access?page=3&per_page=20
KeysetSorted data, high performance?after_id=1000&limit=20

Prefer cursor-based pagination for APIs with frequent inserts.

Error Response Standard (Problem Details)

Use a consistent machine-readable error format (RFC 9457 Problem Details): https://www.rfc-editor.org/rfc/rfc9457

{ "type": "https://example.com/problems/invalid-request", "title": "Invalid request", "status": 400, "detail": "email is required", "instance": "/v1/users" }

Health Check Patterns

// Liveness: Is the process running? app.get('/health/live', (req, res) => { res.status(200).json({ status: 'ok' }); }); // Readiness: Can the service handle traffic? app.get('/health/ready', async (req, res) => { const dbOk = await checkDatabase(); const cacheOk = await checkRedis(); if (dbOk && cacheOk) { res.status(200).json({ status: 'ready', db: 'ok', cache: 'ok' }); } else { res.status(503).json({ status: 'not ready', db: dbOk, cache: cacheOk }); } });

Migration Rollback Strategies

StrategyDescriptionUse When
Backward-compatibleNew code works with old schemaZero-downtime deployments
Expand-contractAdd new, migrate, remove oldSchema changes
Shadow tablesWrite to both during transitionHigh-risk migrations

Common Backend Mistakes to Avoid

FAIL AvoidPASS InsteadWhy
Storing sessions in memoryUse Redis/UpstashMemory lost on restart, no horizontal scaling
Synchronous file I/OUse fs.promises or streamsBlocks event loop, kills throughput
Unbounded queriesAlways use LIMIT + cursor paginationMemory exhaustion, slow responses
Trusting client inputValidate with Zod at API boundariesInjection attacks, type coercion bugs
Hardcoded secretsUse env vars + secret manager (Vault, AWS SM)Security breach on repo exposure
N+1 database queriesUse include/select or DataLoader10-100x performance degradation
console.log in productionUse structured logging (Pino/Winston)No correlation IDs, unqueryable logs
Catching errors silentlyLog + rethrow or handle explicitlyHidden failures, debugging nightmares
Missing connection poolingUse Prisma connection pool or PgBouncerConnection exhaustion under load
No request timeoutsSet timeouts on HTTP clients and DB queriesResource leaks, cascading failures

Security anti-patterns:

  • FAIL Don't use MD5/SHA1 for passwords -> Use Argon2id
  • FAIL Don't store JWTs in localStorage -> Use httpOnly cookies
  • FAIL Don't trust X-Forwarded-For without validation -> Configure trusted proxies
  • FAIL Don't skip rate limiting -> Use sliding window (Redis) or token bucket
  • FAIL Don't log sensitive data -> Redact PII, tokens, passwords

Optional: AI/Automation Extensions

Note: AI-assisted backend patterns. Skip if not using AI tooling.

AI-Assisted Code Generation

ToolUse Case
GitHub CopilotInline suggestions, boilerplate
CursorAI-first IDE, context-aware
Claude CodeCLI-based development

Review requirements for AI-generated code:

  • All imports verified against package.json
  • Type checker passes (strict mode)
  • Security scan passes
  • Tests cover generated code

Infrastructure Economics and Business Impact

Why this matters: Backend decisions directly impact revenue. A 100ms latency increase can reduce conversions by 7%. A poorly chosen architecture can cost 10x more in cloud spend. Performance SLAs are revenue commitments.

Cost Modeling Quick Reference

DecisionCost ImpactRevenue Impact
Edge vs. Origin60-80% latency reduction+2-5% conversion rate
Serverless vs. ContainersVariable cost, scales to zeroBetter unit economics at low scale
Reserved vs. On-Demand30-60% cost savingsPredictable COGS
Connection pooling50-70% fewer DB connectionsLower database costs
Caching layer80-95% fewer origin requestsReduced compute costs

Performance SLA -> Revenue Mapping

SLA Target -> Business Metric P50 latency < 100ms -> Baseline user experience P95 latency < 500ms -> 95% users satisfied P99 latency < 1000ms -> Enterprise SLA compliance Uptime 99.9% (43.8m downtime/month) -> Standard SLA tier Uptime 99.99% (4.4m downtime/month) -> Enterprise tier ($$$)

Unit Economics Checklist

Before deploying any backend service, calculate:

  • Cost per request: Total infra cost / monthly requests
  • Cost per user: Total infra cost / MAU
  • Gross margin impact: How does infra cost affect product margin?
  • Scale economics: At 10x traffic, does cost scale linearly or worse?
  • Break-even point: At what traffic level does this architecture pay for itself?

Architecture Decision -> Business Impact

Architecture ChoiceTechnical BenefitBusiness Impact
CDN + Edge cachingLower latencyHigher conversion, better SEO
Read replicasScale readsHandle traffic spikes without degradation
Queue-based processingDecouple servicesSmoother UX during high load
Multi-region deploymentFault toleranceEnterprise SLA compliance
Auto-scalingRight-sized infraLower COGS, better margins

FinOps Practices for Backend Teams

  1. Tag all resources - Every resource tagged with team, service, environment
  2. Set billing alerts - Alert at 50%, 80%, 100% of budget
  3. Review weekly - 15-minute weekly cost review meeting
  4. Right-size monthly - Check CPU/memory utilization, downsize overprovisioned
  5. Spot/Preemptible for non-prod - 60-90% savings on dev/staging

See references/infrastructure-economics.md for detailed cost modeling, cloud provider comparisons, and ROI calculators.


Navigation

Resources

Shared Utilities (Centralized patterns - extract, don't duplicate)

Templates

Related Skills


Freshness Protocol

When users ask version-sensitive recommendation questions, do a quick freshness check before asserting "best" choices or quoting versions.

Trigger Conditions

  • "What's the best backend framework for [use case]?"
  • "What should I use for [API design/auth/database]?"
  • "What's the latest in Node.js/Go/Rust?"
  • "Current best practices for [REST/GraphQL/tRPC]?"
  • "Is [framework/runtime] still relevant in 2026?"
  • "[Express] vs [Fastify] vs [Hono]?"
  • "Best ORM for [database/use case]?"

How to Freshness-Check

  1. Start from data/sources.json (official docs, release notes, support policies).
  2. Run a targeted web search for the specific component and open release notes/support policy pages.
  3. Prefer official sources over blogs for versions and support windows.

What to Report

  • Current landscape: what is stable and widely used now
  • Emerging trends: what is gaining traction (and why)
  • Deprecated/declining: what is falling out of favor (and why)
  • Recommendation: default choice + 1-2 alternatives, with trade-offs

Example Topics (verify with fresh search)

  • Node.js LTS support window and major changes
  • Bun vs Deno vs Node.js
  • Hono, Elysia, and edge-first frameworks
  • Drizzle vs Prisma for TypeScript
  • tRPC and end-to-end type safety
  • Edge computing and serverless patterns

Operational Playbooks