backend-development

Use this skill for ANY task in a Node.js/TypeScript or Go backend codebase — adding features, fixing bugs, refactoring, adding flows, modifying handlers, changing business logic, or writing new code. Trigger even when the task is vague like "add the flow to this", "implement this feature", "fix this", or "add X like Y" — if the project has go.mod, nest-cli.json, express routes, or server-side TypeScript, this skill applies. Covers REST APIs, PostgreSQL, Redis, authentication, job queues, events, microservices, Docker, CI/CD, Clean Architecture, SOLID, DRY, and code reuse patterns. When in doubt whether this is backend work, use this skill.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "backend-development" with this command: npx skills add carvalab/k-skills/carvalab-k-skills-backend-development

Backend Development

Backend engineering guidance for Node.js/TypeScript and Go projects. Covers everything from adding a small feature to designing a new microservice — including vague tasks where you need to figure out the right approach from context.

Related Skills:

  • kavak-documentation — for Kavak-specific patterns (kbroker, STS, GitLab CI, Docker)
  • test-driven-development — use for new features and bug fixes (Red-Green-Refactor)
  • Check .claude/CLAUDE.md or .cursor/rules/* for project-specific conventions

MCP: Use kavak-platform/platform_docs_search to query Kavak internal docs and kavak-platform/search_resource for workload/infrastructure info before implementing.

First: Understand the Codebase

Before writing any code, explore the project to understand its structure, patterns, and existing implementations. This matters because the biggest source of wasted effort is reimplementing something that already exists — or writing code that clashes with the project's established patterns.

  1. Read the project structure — identify the architecture, naming conventions, and patterns in use
  2. Search for similar code — extract keywords from your task (verbs, nouns, domain concepts) and search. You're looking for code you can reuse, extend, or extract shared logic from
  3. Document your reuse decision — REUSE (>70% similar), EXTEND (50-70%), EXTRACT (shared helper), or NEW (<30% similar)

Full process, search templates, and decision matrix: references/code-reuse-analysis.md

Core Principles

Architecture: Clean Architecture (4-layer) for new projects → references/architecture.md

  • SOLID — each module does one thing, depends on abstractions not implementations
  • DRY — every piece of business logic has ONE source of truth → references/dry-detection.md
  • YAGNI — only build what the task requires right now, not hypothetical future needs
  • KISS — the simplest solution that works is the right one

Code should be self-documenting. Comments explain "why", not "what". See references/code-quality.md for examples.

Existing Projects Rule

Follow the project's established patterns — if it uses flat structure, keep flat structure. If it uses callbacks, use callbacks. Don't force Clean Architecture on a codebase that doesn't use it. Apply good practices to new code you write, but match the project's conventions.

Clean Architecture applies to: new greenfield projects, new modules (when it fits), or explicit refactoring requests.

Quick Start

LanguageTestLint
Node/TSnpm testnpm run lint
Gogo test ./...golangci-lint run

Technology Selection

NeedChoose
TypeScript APINestJS
High concurrencyGo + Chi
Go databasepgx/v5 + sqlc
Node databaseDrizzle (new), keep existing
Go Redisrueidis (new), keep existing
Go job queueRiver (PostgreSQL-backed)
Node job queuepg-boss (PostgreSQL-backed)
Events (Kavak)kbroker (Kafka-by-REST)
Rate limitingpg-boss throttle / River snooze
TestingVitest (new Node), Jest (existing)
TracingOpenTelemetry + dd-trace

Note: Use kbroker for events between services. Use pg-boss (Node) or River (Go) for job queues.

Common Workflows

New API Endpoint (TDD Approach)

Use test-driven-development skill for Red-Green-Refactor cycle

  1. Write failing test firsttest-driven-development skill
  2. Design endpoint → references/api-design.md
  3. Set up handler → references/go/http-handlers.md or references/node/frameworks.md
  4. Add database access → references/go/database.md or references/node/database.md
  5. Implement auth → references/authentication.md
  6. Refactor with tests passing → references/code-quality.md

Add Similar Feature (DRY-First)

When the task says "do X like Y" or "add similar to existing":

  1. Find the existing implementation first — search for the feature mentioned
  2. >70% similar: inject existing service, call its method (5-10 lines)
  3. 50-70% similar: extract shared helper, refactor both old and new to use it
  4. <50% similar: OK to create new, keep it minimal
  5. Test both old and new paths — ensure refactoring didn't break existing

If your new code exceeds 50 lines, you likely missed a reuse opportunity.

Fix Slow Query

  1. Profile query → references/debugging.md (EXPLAIN ANALYZE)
  2. Add indexes → references/performance.md
  3. Add caching → references/go/redis-queues.md or references/node/database.md

Deploy New Service

  1. Write Dockerfile → references/devops/docker.md
  2. Set up CI/CD → references/devops/ci-cd.md

Debug Production Issue

  1. Check logs/traces → references/debugging.md
  2. Profile if slow → references/debugging.md (pprof/clinic.js)
  3. Check DB queries → references/debugging.md (pg_stat_statements)

References

ReferenceWhen to Use
Go
references/go/http-handlers.mdSet up Chi routes, handlers, middleware
references/go/database.mdImplement pgx/v5, sqlc queries
references/go/patterns.mdApply error handling, validation, testing
references/go/redis-queues.mdAdd rueidis caching, River job queue
Node.js
references/node/frameworks.mdSet up NestJS, Express, Fastify
references/node/database.mdImplement Drizzle, Prisma, caching
references/node/patterns.mdApply validation, errors, testing
DevOps
references/devops/docker.mdWrite Dockerfiles, compose, health checks, DataDog metrics
references/devops/ci-cd.mdConfigure GitLab CI pipelines
Cross-Cutting
references/architecture.mdClean Architecture (4-layer), microservices, events
references/code-quality.mdSOLID, DRY, YAGNI, KISS, design patterns
references/code-reuse-analysis.mdMANDATORY - Code reuse gate, decision matrix
references/dry-detection.mdMANDATORY - DRY detection, code reuse patterns
references/api-design.mdDesign REST endpoints, versioning
references/authentication.mdImplement OAuth 2.1, JWT, RBAC
references/security.mdApply OWASP Top 10, input validation
references/performance.mdOptimize caching, queries, pooling
references/testing.mdWrite unit, integration, E2E tests
references/debugging.mdDebug with logs, profilers, tracing
Kavak
references/kavak/kbroker.mdPublish/subscribe events between services
references/kavak/queues-ratelimit.mdJob queues, rate limiting with River/pg-boss
references/kavak/microservice-auth.mdAuthenticate between services (STS)
references/kavak/gitlab-ci.mdSet up kavak-it/ci-jobs v3 pipelines
references/kavak/docker-images.mdBuild with docker-debian base
references/kavak/workload-config.mdConfigure .kavak/ dir, cron jobs
references/kavak/logging-metrics.mdUse kvklog, kvkmetric SDKs

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

code-review

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

code-simplifier

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

frontend-development

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

test-driven-development

No summary provided by upstream source.

Repository SourceNeeds Review