darknecrocities/skillbuilder/backend

Claude Code and agent skill by darknecrocities/skillbuilder

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Architect, implement, and maintain resilient backend services, clean architecture, REST/gRPC API contracts, strict schema validation, authentication, rate-limiting, and error handling.

Install

npx vskill@latest install darknecrocities/skillbuilder/backend

SKILL.md

The same SKILL.md was published earlier as darknecrocities/skillbuilder/backend.

Backend Systems Engineering (/backend)

Role: Principal Backend & Distributed Systems Architect
Philosophy: Domain logic in the core. Validate at the boundaries. Enforce idempotency. Never make unbounded calls. Drain connections gracefully.

This skill establishes backend engineering discipline across microservices, REST APIs, GraphQL, and gRPC systems. It enforces clean architecture separation, strict runtime schema validation (Zod, Pydantic v2), defense-in-depth authentication, and structured RFC 7807 error handling.


1. Quick Navigation & Progressive Disclosure

Resource TypeDocumentDescription
Referencereferences/api-design-and-contracts.mdRESTful conventions, route verbs, cursor pagination, OpenAPI 3.1.
Referencereferences/validation-and-type-safety.mdZod / Pydantic v2 boundary validation, custom coercions, fail-fast rules.
Referencereferences/auth-and-access-control.mdJWT rotation, secure cookies, refresh tokens, RBAC, OAuth2/OIDC.
Referencereferences/resilience-and-middleware.mdIdempotency keys, rate limiters, timeout deadlines, circuit breakers.
Referencereferences/backend-error-catalog.mdBackend error catalog: unhandled rejections, race conditions, timeouts.
Templatetemplates/api_route_template.tsProduction TypeScript API route with Zod validation and error boundary.
Templatetemplates/domain_service_template.pyClean architecture Python service layer with domain exceptions.
Utilityscripts/verify_api_contracts.pyCLI auditor verifying validation schemas and status code compliance.

2. Clean Architecture Layer Hierarchy

mermaid
flowchart TD
subgraph Transport["1. Transport & Controller Layer"]
A["HTTP / gRPC Handlers"]
B["Zod / Pydantic Request Validation"]
C["RFC 7807 Problem Serialization"]
end
subgraph Application["2. Application & Service Layer"]
D["Transaction Coordinator"]
E["Idempotency Filter (Redis)"]
F["Domain Event Publisher"]
end
subgraph Core["3. Core Domain Layer (Zero Frameworks)"]
G["Domain Entities & Aggregates"]
H["Domain Exceptions & Business Invariants"]
end
subgraph Infrastructure["4. Infrastructure & Persistence"]
I["PostgreSQL / SQLite Connection Pools"]
J["External Clients (Timeout + Retries)"]
end
Transport --> Application
Application --> Core
Application --> Infrastructure
Layer Rules:
  1. Core Domain: Contains zero framework dependencies (no Express, Fastify, Next.js, or SQLAlchemy imports). Pure typed classes and pure business logic.
  2. Service Layer: Manages unit of work, database transactions, idempotency checks, and domain events.
  3. Transport Layer: Parses requests, validates inputs via schemas (fail-fast), and maps domain results or domain exceptions to HTTP status codes.

3. RFC 7807 Problem Details Standard

All error responses across all backend services must strictly adhere to RFC 7807 JSON:

json
{
"type": "https://api.example.com/errors/invalid-parameters",
"title": "Invalid Request Parameters",
"status": 400,
"detail": "Field 'email' must be a valid email address.",
"instance": "/api/v1/users",
"code": "ERR_INVALID_EMAIL",
"invalid_params": [
{ "name": "email", "reason": "malformed email address" }
]
}
Standard Status Code Mapping:
  • 200 OK: Successful read or in-place update.
  • 201 Created: Resource successfully created (must return Location header or resource ID).
  • 204 No Content: Successful deletion or action with no return body.
  • 400 Bad Request: Schema validation failure (malformed payload).
  • 401 Unauthorized: Missing or expired authentication token.
  • 403 Forbidden: Authenticated user lacks permission (RBAC).
  • 404 Not Found: Target entity does not exist.
  • 409 Conflict: Unique constraint violation or state conflict.
  • 422 Unprocessable Entity: Semantic business rule violation.
  • 429 Too Many Requests: Rate limit exceeded (must include Retry-After).
  • 500 Internal Server Error: Unhandled crash (never leak stack trace to client).

4. Idempotency & Concurrency Control

4.1 Idempotency Key Middleware

Critical mutations (POST /payments, POST /orders) must accept an Idempotency-Key header:

  1. Check Redis for key idemp:<key>.
  2. If state is PENDING, return 409 Conflict (request already processing).
  3. If state is COMPLETED, return the cached response payload immediately.
  4. If missing, acquire lock with 60s TTL, process transaction, save result with 24h TTL.
4.2 Optimistic Concurrency Control

Protect concurrent updates against lost updates using version numbers:

sql
UPDATE accounts
SET balance = balance - 100, version = version + 1
WHERE id = :id AND version = :expected_version;

If rows affected == 0, throw ConcurrencyConflictException and prompt retry.


5. Graceful Process Shutdown

Every backend server process must catch termination signals (SIGTERM, SIGINT), stop accepting new traffic, drain pending connections within a timeout, and close database pools:

typescript
// Production Graceful Shutdown Handler
function registerGracefulShutdown(server: any, dbPool: any) {
const shutdown = async (signal: string) => {
console.info(`Received ${signal}. Starting graceful shutdown...`);
server.close(async () => {
console.info("HTTP server closed. Draining database connection pool...");
await dbPool.end();
console.info("Database pool closed. Exiting process.");
process.exit(0);
});
// Hard timeout fallback
setTimeout(() => {
console.error("Graceful shutdown timeout exceeded. Forcefully killing process.");
process.exit(1);
}, 15000).unref();
};
process.on("SIGTERM", () => shutdown("SIGTERM"));
process.on("SIGINT", () => shutdown("SIGINT"));
}

6. Automation Tool: API Contract Verifier

Audit backend route files for validation schemas and status code compliance:

bash
python3 skills/backend/scripts/verify_api_contracts.py --path src/routes/

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
13
Repository forks
2
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/darknecrocities/skillbuilder/backend/badge)](https://verified-skill.com/skills/darknecrocities/skillbuilder/backend)

Something wrong with this skill or its page? Tell us.