NE

Provides a consistent structure for adding new features to the backend API.

Install

mkdir -p .claude/skills/new-domain && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10244" && unzip -o skill.zip -d .claude/skills/new-domain && rm skill.zip

Installs to .claude/skills/new-domain

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Scaffold a new backend domain (feature module) in the GitGazer AWS Lambda API under apps/api/src/domains/. Use when adding a new REST resource, feature area, or set of API endpoints. Covers the routes/controller/middleware/test file layout, registering the router in the app, the AWS Powertools Router + middleware chain, role-based access with requireRole, RLS-scoped data access via withRlsTransaction, and the @/ and @gitgazer/db/* import conventions.
454 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Scaffold REST resources
  • Create feature modules
  • Register API routes

How it works

It creates a self-contained feature folder with routes, controllers, and tests following project conventions.

Inputs & outputs

You give it
Domain name
You get back
Scaffolded domain folder

When to use new-domain

  • Add new rest resource
  • Create new backend feature module
  • Add api endpoints

About this skill

New Backend Domain — GitGazer

Scaffold a new feature module in the Lambda API following the project's controller-centric domain layout. Each domain is a self-contained folder under apps/lambdas/api/src/domains/.

When to Use

  • Adding a new REST resource or feature area (e.g. /api/<thing>)
  • Grouping a set of related endpoints + business logic + tests

Not for: a single extra route on an existing resource (just add it to that domain's *.routes.ts).

File Layout

Create apps/lambdas/api/src/domains/<domain>/ with:

FilePurposeTemplate
<domain>.routes.tsHTTP endpoints on an AWS Powertools Routerassets/domain.routes.template.ts
<domain>.controller.tsBusiness logic + RLS-scoped DB accessassets/domain.controller.template.ts
<domain>.controller.test.tsVitest unit tests (AWS + DB mocked)assets/domain.controller.test.template.ts
<domain>.middleware.tsOptional — only if the domain needs request-context middlewaresee integrations.middleware.ts

Reference implementation to copy patterns from: apps/lambdas/api/src/domains/integrations/.

Procedure

  1. Create the folder and files from the templates above. Rename things / Thing to your resource.

  2. Register the router in apps/lambdas/api/src/shared/router/index.ts:

    import thingsRoutes from '@/domains/things/things.routes';
    // ...inside createApp(), with the other includeRouter calls:
    app.includeRouter(thingsRoutes);
    

    The global middleware chain (compresscorsauthenticateoriginCheck) is applied by createApp — do not re-add it per domain.

  3. Write controllers that wrap every tenant-scoped query in withRlsTransaction (see the refactor skill for the boundary rules). Default role is reader; pass userName: gitgazerWriter.name for writes.

  4. Add tests colocated as *.test.ts. Mock @gitgazer/db/client and all AWS clients — never hit real services.

  5. Verify: cd apps/lambdas/api && pnpm run test:unit && pnpm run lint.

Conventions (enforced — see backend.instructions.md)

  • Imports: @/ for apps/lambdas/api/src, @gitgazer/db/* for the shared package. Never ../../../.
  • Auth context: handlers receive AppRequestContext; use the addUserIntegrationsToCtx middleware to populate reqCtx.appContext.integrations / integrationRoles.
  • Authorization: gate state-changing routes with requireRole('admin' | 'owner' | ...) from @/shared/middleware/require-role.
  • Responses: return a Response with JSON.stringify(...) and an HttpStatusCodes status; throw BadRequestError / UnauthorizedError / etc. from @aws-lambda-powertools/event-handler/http for errors.
  • Logging: getLogger() from @gitgazer/backend-core/logger (AWS Powertools structured logging).
  • AWS clients: import pre-configured clients from @/shared/clients/ — never instantiate SDK clients in a controller.

Checklist

  • <domain>.routes.ts exports default a Router and is registered via app.includeRouter(...)
  • All tenant-scoped DB access goes through withRlsTransaction with the correct role
  • State-changing routes protected with requireRole(...)
  • Inputs validated; errors thrown as Powertools HTTP errors
  • Colocated *.test.ts with @gitgazer/db/client + AWS mocked
  • pnpm run test:unit and pnpm run lint pass

When not to use it

  • Single route additions

Prerequisites

GitGazer API structure

Limitations

  • Requires adherence to project conventions

How it compares

It enforces standardized domain layout and middleware chains.

Compared to similar skills

new-domain side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
new-domain (this skill)02moNo flagsIntermediate
moai-domain-backend13moReviewAdvanced
web-server-architecture03moNo flagsIntermediate
bullmq-specialist256moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

moai-domain-backend

modu-ai

Backend development specialist covering API design, database integration, microservices architecture, and modern backend patterns.

10

web-server-architecture

develsvai

`web/src/server/**`의 router, service, 공통 계층을 건드릴 때 사용하는 스킬이다. tRPC router와 service 책임 분리, 도메인 구조, Prisma 사용 경계를 맞춘다.

00

bullmq-specialist

davila7

BullMQ expert for Redis-backed job queues, background processing, and reliable async execution in Node.js/TypeScript applications. Use when: bullmq, bull queue, redis queue, background job, job queue.

2595

agentdb-advanced-features

ruvnet

Master advanced AgentDB features including QUIC synchronization, multi-database management, custom distance metrics, hybrid search, and distributed systems integration. Use when building distributed AI systems, multi-agent coordination, or advanced vector search applications.

798

senior-backend

davila7

Comprehensive backend development skill for building scalable backend systems using NodeJS, Express, Go, Python, Postgres, GraphQL, REST APIs. Includes API scaffolding, database optimization, security implementation, and performance tuning. Use when designing APIs, optimizing database queries, implementing business logic, handling authentication/authorization, or reviewing backend code.

1446

database-migration

wshobson

Execute database migrations across ORMs and platforms with zero-downtime strategies, data transformation, and rollback procedures. Use when migrating databases, changing schemas, performing data transformations, or implementing zero-downtime deployment strategies.

324

Search skills

Search the agent skills registry