ms-business
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.zipInstalls 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.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
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):
- Controller — solo HTTP: parámetros, body, delegación al service.
- Service — reglas de negocio, repositorios, transformación a DTO de respuesta.
- DTO — entrada (
create-*,update-*,base-*) y salida (response-*, listas conitems+meta). - 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)
- Entidad en
entities/*.entity.ts(relaciones TypeORM). base-*.dto.ts→create-*.dto.ts→update-*.dto.ts(PartialType).response-*.dto.tsyresponse-*-list.dto.tssi aplica paginación.- Métodos en
*.service.ts(validar FKs, reglas, mapear respuesta). - Rutas en
*.controller.ts+ decoradores Swagger (@ApiTags,@ApiOperation). - Registrar módulo en
app.module.tssi es dominio nuevo. - Migración TypeORM si cambia el esquema (
synchronize: false).
Patrones DTO: references/dto-patterns.md.
Autenticación
- No validar JWT localmente: usar
JwtValidationService→POST {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/driverrequiere rolDRIVER.
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_EMAILosupervisorEmailen 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: trueen producción. - Duplicar lógica de firma/parseo JWT (solo ms-security).
- Omitir
ValidationPipeglobal (ya configurado enmain.ts: whitelist, transform).
Referencias
| Archivo | Contenido |
|---|---|
| api-catalog.md | Rutas HTTP |
| domains-and-modules.md | Entidades y reglas |
| auth-and-roles.md | JWT y guards |
| dto-patterns.md | Convenciones DTO |
| migrations.md | TypeORM migrations |
| env-vars.md | Variables 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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| ms-business (this skill) | 0 | 2mo | Review | Advanced |
| senior-backend | 14 | 8mo | Review | Advanced |
| database-migration | 3 | 2mo | No flags | Advanced |
| prisma-connection-pool-exhaustion | 1 | 7mo | Review | Intermediate |
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.
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.
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.
pagination
dadbodgeoff
Implement cursor-based and offset pagination for APIs. Covers efficient database queries, stable sorting, and pagination metadata.
moai-domain-backend
modu-ai
Backend development specialist covering API design, database integration, microservices architecture, and modern backend patterns.
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