Expert guidance for NestJS monorepo projects with TypeORM, GraphQL, RabbitMQ, and microservices. Helps navigate architecture, run workflows, and maintain code conventions while ensuring accuracy against actual codebase.
An AI coding assistant specialized for NestJS monorepo projects using TypeORM, GraphQL, RabbitMQ, and microservices architecture. This skill helps you navigate the codebase, understand architectural patterns, execute developer workflows, and maintain code quality standards.
This skill provides expert assistance for working with NestJS monorepo projects by:
**BEFORE making any code changes or creating documentation:**
**Key integrations to be aware of:**
**Always use the established path alias patterns:**
**Provide correct commands for common tasks:**
```bash
npm install # Install dependencies
npm run start:dev # Local development with watch mode
npm run build # Build for production
npm run start:prod # Run production build
docker compose up -d # Start services
npm run migration:generate -- <Name> # Generate TypeORM migration
npm run migration:run # Run migrations (dev)
npm run migration:run:prod # Run migrations (production)
npm run seed # Run database seeds (dev)
npm run seed:prod # Run database seeds (production)
npm run test # Unit tests
npm run test:watch # Unit tests in watch mode
npm run test:e2e # End-to-end tests
npm run lint # Run linter
npm run format # Format code
```
**NEVER add properties, methods, or enums that don't exist in the actual codebase.**
**Before creating any diagram, documentation, or code changes:**
1. **Read the actual source files:**
- For entities: Check `libs/database/src/entities/` for actual properties and relationships
- For enums: Check `libs/shared/src/enums/` for exact enum values
- For services: Check `apps/api-gateway/src/services/` for actual methods
- For DTOs: Check `libs/shared/src/dtos/` for actual validation rules and fields
- For resolvers: Check `apps/api-gateway/src/resolvers/` for GraphQL schema
- For controllers: Check `apps/api-gateway/src/controllers/` for REST endpoints
2. **Use ONLY what actually exists:**
- Don't invent enum values (e.g., `CourseLearningFormat.HYBRID` if only INDIVIDUAL and GROUP exist)
- Don't add non-existent entity fields (e.g., `maxCapacity` if not in the entity)
- Don't reference methods that aren't implemented in services
- Don't assume status values (e.g., check actual `EnrollmentStatus` enum values)
3. **If proposing new features:**
- Clearly mark proposed additions as "NEW - not yet in codebase"
- Distinguish between what exists and what you're proposing
- Cross-reference with actual usage in services and controllers
**Exception Handling:**
**Logging:**
**Validation:**
**GraphQL:**
**Microservices:**
**Adding new API endpoints or GraphQL resolvers:**
**Adding shared utilities or DTOs:**
**Database changes:**
**Configuration changes:**
**Adding new libraries to monorepo:**
**Before submitting code changes:**
1. **Build verification:**
- Run `npm run build` to ensure TypeScript compiles
- Fix any compilation errors
2. **Testing:**
- Run `npm run test` for unit tests
- Run `npm run test:e2e` for integration tests where applicable
- Ensure new code has appropriate test coverage
3. **Database changes:**
- Include generated TypeORM migration files
- Verify `npm run migration:generate` is reproducible
- Test migration with `npm run migration:run` in development
4. **Code quality:**
- Run `npm run lint` and fix any linting issues
- Run `npm run format` to ensure consistent formatting
5. **Codebase accuracy:**
- Verify all referenced entities, enums, and methods actually exist
- Ensure imports use correct `@app/*` aliases
- Follow established patterns from existing code
**Steps:**
1. Read existing resolvers in `apps/api-gateway/src/resolvers` to understand patterns
2. Create new resolver file following established naming conventions
3. Use `@app/shared` for DTOs and `@app/database` for entities
4. Implement resolver methods with proper error handling using `CustomRpcException`
5. Register resolver in `AppModule` at `apps/api-gateway/src/app.module.ts`
6. Run `npm run test` and `npm run build` to verify
**Steps:**
1. Create entity class in `libs/database/src/entities`
2. Use TypeORM decorators following patterns from existing entities
3. Read `libs/shared/src/enums` to use only existing enum values
4. Generate migration: `npm run migration:generate -- AddNewEntity`
5. Review generated migration file in `libs/database/src/migrations`
6. Test migration: `npm run migration:run`
7. Update any affected DTOs in `libs/shared/src/dtos`
**Before creating documentation:**
1. Read actual entity file: `libs/database/src/entities/session.entity.ts`
2. Verify actual enum values: `libs/shared/src/enums/enrollment-status.enum.ts`
3. Check service implementation: `apps/api-gateway/src/services/enrollment.service.ts`
4. Use ONLY properties and methods that exist in these files
5. Mark any proposed additions clearly as "NEW - not yet in codebase"
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/nestjs-monorepo-architecture-assistant/raw