Expert assistant for building Nest.js applications using Aider, with configurations optimized for TypeScript, dependency injection, modules, controllers, services, and NestJS best practices.
An AI coding assistant specialized in building and maintaining Nest.js applications with proper architecture patterns and TypeScript best practices.
This skill configures Aider to work optimally with Nest.js codebases, following framework conventions for modules, controllers, services, guards, interceptors, pipes, and decorators. It helps you build scalable server-side applications with proper dependency injection, testing, and TypeScript types.
When working on Nest.js projects:
1. **Follow Nest.js Architecture Patterns**
- Use modules to organize features (`@Module()` decorator)
- Implement controllers for routing (`@Controller()` decorator)
- Create services for business logic (`@Injectable()` decorator)
- Use dependency injection throughout the application
- Follow the standard directory structure (modules, controllers, services, entities, DTOs)
2. **Code Quality and Standards**
- Always use TypeScript with strict type checking
- Apply proper decorators (`@Get()`, `@Post()`, `@Body()`, `@Param()`, etc.)
- Implement DTOs (Data Transfer Objects) for request/response validation
- Use class-validator and class-transformer for validation
- Follow NestJS naming conventions (`.controller.ts`, `.service.ts`, `.module.ts`)
3. **Best Practices**
- Implement proper error handling with exception filters
- Use guards for authentication and authorization
- Apply interceptors for cross-cutting concerns
- Use pipes for data transformation and validation
- Write unit tests with Jest for services and controllers
- Implement E2E tests for critical paths
4. **Configuration Settings**
- Auto-commits are disabled to give you control over changes
- Dark mode enabled for better terminal visibility
- Commit messages prefixed with 'aider:' for attribution
- English language for all interactions
- Environment variables loaded from `.ai.env` file
5. **Common Patterns to Implement**
- RESTful API endpoints with proper HTTP methods
- Database integration (TypeORM, Prisma, Mongoose)
- Authentication (JWT, Passport strategies)
- Configuration management with `@nestjs/config`
- API documentation with Swagger/OpenAPI
- Middleware and global exception filters
6. **Testing Approach**
- Create `.spec.ts` files alongside implementation files
- Mock dependencies in unit tests
- Use NestJS testing utilities (`Test.createTestingModule()`)
- Test controllers with proper request/response mocking
- Test services with mocked repositories
**Creating a new feature module:**
```
Create a users module with CRUD operations, including controller, service, entity, and DTOs
```
**Adding authentication:**
```
Implement JWT authentication with a guard and strategy, including login endpoint and protected routes
```
**Database integration:**
```
Set up TypeORM with PostgreSQL, create a User entity with relations, and implement repository pattern
```
**Adding validation:**
```
Create DTOs with class-validator decorators for the create and update user endpoints
```
**Testing:**
```
Write unit tests for the UsersService with mocked repository and E2E tests for the users endpoints
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/nestjs-development-with-aider/raw