Supports NestJS development for transportation microservices using domain-driven design and TypeORM.

Install

mkdir -p .claude/skills/ms-business && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15084" && unzip -o skill.zip -d .claude/skills/ms-business && rm skill.zip

Installs to .claude/skills/ms-business

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.

Microservicio NestJS de dominio de transporte (rutas, paradas, tickets, incidentes, conductores). Patrones controller/service/DTO, TypeORM PostgreSQL, validación JWT vía ms-security. Usar al editar ms-business/, crear endpoints, migraciones, módulos NestJS o integrar auth/Supabase/incidentes.
293 charsno explicit “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Define entities with TypeORM relations
  • Create DTOs for input and output
  • Implement service methods for business rules and mapping
  • Configure routes in controllers with Swagger decorators
  • Manage TypeORM migrations for schema changes
  • Integrate authentication using `JwtValidationService`

How it works

The skill guides the creation of new endpoints in a NestJS microservice by defining entities, DTOs, service methods, and controller routes. It also covers TypeORM migrations and authentication integration.

Inputs & outputs

You give it
A request to create an endpoint, migration, or NestJS module in ms-business
You get back
Implemented endpoint with entities, DTOs, service methods, controller routes, and potentially a TypeORM migration

When to use ms-business

  • Creating a new transportation API endpoint
  • Generating TypeORM migrations
  • Integrating AuthModule with business logic

About this skill

ms-business

NestJS 11 + TypeORM + PostgreSQL. Puerto por defecto 3000. Swagger en /docs.

Arquitectura por dominio

Regla del proyecto (detalle en ms-business/docs/ARCHITECTURE.md):

  1. Controller — solo HTTP: parámetros, body, delegación al service.
  2. Service — reglas de negocio, repositorios, transformación a DTO de respuesta.
  3. DTO — entrada (create-*, update-*, base-*) y salida (response-*, listas con items + meta).
  4. Entity — TypeORM; no exponer directamente en la API.

Módulos registrados

AuthModule, RouteModule, StopModule, NodeModule, AddressModule, CitizenModule, TicketModule, HistoryModule, BusModule, SchedulerModule, PaymentMethodModule, PaymentMethodCitizenModule, EnterpriseModule, DriverModule, TurnModule, IncidentModule, SharedModule.

Catálogo por dominio: references/domains-and-modules.md.

Crear un endpoint nuevo (workflow)

  1. Entidad en entities/*.entity.ts (relaciones TypeORM).
  2. base-*.dto.tscreate-*.dto.tsupdate-*.dto.ts (PartialType).
  3. response-*.dto.ts y response-*-list.dto.ts si aplica paginación.
  4. Métodos en *.service.ts (validar FKs, reglas, mapear respuesta).
  5. Rutas en *.controller.ts + decoradores Swagger (@ApiTags, @ApiOperation).
  6. Registrar módulo en app.module.ts si es dominio nuevo.
  7. Migración TypeORM si cambia el esquema (synchronize: false).

Patrones DTO: references/dto-patterns.md.

Autenticación

  • No validar JWT localmente: usar JwtValidationServicePOST {MS_SECURITY_URL}/api/public/security/validate-token.
  • Guards esperados en src/auth/guards/ (jwt.guard.ts, roles.guard.ts).
  • Decoradores: @CurrentUser(), @Roles('DRIVER'), @UseGuards(JwtAuthGuard, RolesGuard).
  • Ejemplo protegido: POST /incident-reports/driver requiere rol DRIVER.

Detalle: references/auth-and-roles.md.

Migraciones

  • Config: typeorm.config.ts, entidades auto-cargadas desde **/entities/*.ts.
  • Carpeta: src/migrations/.
  • Generar/ejecutar con CLI TypeORM apuntando a AppDataSource (ver references/migrations.md).

Incidentes y almacenamiento

  • Fotos: Supabase Storage (SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY, SUPABASE_INCIDENT_BUCKET).
  • Email supervisor: MS_NOTIFICATION_URL, INCIDENT_SUPERVISOR_EMAIL o supervisorEmail en enterprise.

Comandos

cd ms-business
pnpm install
pnpm run start:dev      # desarrollo
pnpm run lint
pnpm test
pnpm run build

Scripts: scripts/dev.sh, scripts/test.sh, scripts/check-env.sh.

Anti-patrones

  • Devolver entidades TypeORM sin mapear a response DTO.
  • Activar synchronize: true en producción.
  • Duplicar lógica de firma/parseo JWT (solo ms-security).
  • Omitir ValidationPipe global (ya configurado en main.ts: whitelist, transform).

Referencias

ArchivoContenido
api-catalog.mdRutas HTTP
domains-and-modules.mdEntidades y reglas
auth-and-roles.mdJWT y guards
dto-patterns.mdConvenciones DTO
migrations.mdTypeORM migrations
env-vars.mdVariables de entorno

Integración monorepo: skill monorepo-overview.

When not to use it

  • When returning TypeORM entities directly without mapping to response DTOs
  • When activating `synchronize: true` in production
  • When duplicating JWT signature/parsing logic locally

Limitations

  • The skill is specific to the `ms-business` microservice.
  • Authentication relies on `ms-security` for JWT validation.
  • TypeORM entities should not be exposed directly in the API.

How it compares

This skill provides a structured workflow for developing NestJS microservices following specific architectural patterns (Controller/Service/DTO, TypeORM) and authentication practices, which is more guided than generic NestJS development.

Compared to similar skills

ms-business side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
ms-business (this skill)02moReviewAdvanced
senior-backend148moReviewAdvanced
database-migration32moNo flagsAdvanced
prisma-connection-pool-exhaustion17moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

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

prisma-connection-pool-exhaustion

blader

Fix Prisma "Too many connections" and connection pool exhaustion errors in serverless environments (Vercel, AWS Lambda, Netlify). Use when: (1) Error "P2024: Timed out fetching a new connection from the pool", (2) PostgreSQL "too many connections for role", (3) Database works locally but fails in production serverless, (4) Intermittent database timeouts under load.

14

pagination

dadbodgeoff

Implement cursor-based and offset pagination for APIs. Covers efficient database queries, stable sorting, and pagination metadata.

13

moai-domain-backend

modu-ai

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

10

hiddenroom-supabase

cuvo1903-ctrl

Hidden Room Supabase backend skill for migrations, generated database types, Edge Functions, RLS policies, auth/profile sync, storage buckets, Stripe integration, cloud_jobs, and database documentation. Use when editing supabase/migrations, supabase/functions, database.types.ts, or Supabase-backed f

00

Search skills

Search the agent skills registry