Aider configuration for serverless CQRS applications with NestJS on AWS. Enforces event sourcing patterns, multi-tenant isolation, and TypeScript conventions for scalable serverless architectures.
Development assistant for serverless applications using CQRS pattern with NestJS and AWS infrastructure.
This skill configures Aider to work with CQRS (Command Query Responsibility Segregation) serverless architectures, maintaining event sourcing patterns, multi-tenant data isolation, and strict TypeScript conventions.
When working on this codebase:
1. **Read-Only Context Files**
- Always reference these files for context (never edit):
- `CLAUDE.md` - Project guidelines
- `AGENTS.md` - Agent configurations
- `llms.txt` - LLM-specific instructions
- `README.md` - Project documentation
- `CONTRIBUTING.md` - Contribution guidelines
- `docs/architecture/system-overview.md` - Architecture overview
- `docs/architecture/cqrs-flow.md` - CQRS pattern documentation
- `packages/core/README.md` - Core package documentation
2. **Ignore Patterns**
- Never edit or include in context:
- `node_modules/`, `dist/`, `coverage/` - Build artifacts
- `*.log` - Log files
- `.git/` - Git internals
- `package-lock.json` - Dependency lock file
3. **Code Quality**
- After making changes, run: `npm run lint`
- Before committing, run: `npm test`
- Manual commits only (no auto-commits)
- No dirty commits allowed
4. **Naming Conventions**
- **Commands**: `CreateResourceCommand`, `UpdateResourceCommand`, `DeleteResourceCommand`
- **Events**: `ResourceCreatedEvent`, `ResourceUpdatedEvent`, `ResourceDeletedEvent`
- **Handlers**: `CreateResourceHandler`, `GetResourceHandler`
- **DTOs**: `CreateResourceDto`, `ResourceResponseDto`
5. **DynamoDB Key Structure**
- **PK (Partition Key)**: `{tenantCode}#RESOURCE_TYPE`
- **SK (Sort Key)**: `RESOURCE_TYPE#{id}`
- Always prefix keys with tenant code for multi-tenant isolation
6. **CQRS Pattern**
- **Commands**: Handle write operations (create, update, delete)
- **Queries**: Handle read operations (get, list, search)
- Commands emit events for event sourcing
- Queries read from materialized views or event store
7. **Module Structure**
- Organize modules consistently:
```
src/module/
├── commands/ # Command classes
├── queries/ # Query classes
├── dto/ # Data transfer objects
├── entities/ # Domain entities
├── controllers/ # API controllers
└── module.ts # Module definition
```
8. **Testing Strategy**
- Use Jest with `aws-sdk-client-mock` for AWS service mocking
- Write unit tests for all handlers and services
- Write E2E tests for controllers
- Test multi-tenant isolation scenarios
- Test event emission and handling
9. **TypeScript**
- Use strict mode (`strict: true`)
- All code and comments in English
- Explicit types (avoid `any`)
- Use interfaces for DTOs and entities
10. **Event Sourcing**
- All state changes must emit events
- Store events in DynamoDB with timestamp
- Events are immutable once stored
- Support event replay for rebuilding state
**Creating a new CQRS module:**
```bash
aider "Create a Product module with CQRS pattern including CreateProduct command, ProductCreated event, GetProduct query, and multi-tenant key structure"
```
**Adding event sourcing:**
```bash
aider "Add event sourcing to Order module: store OrderCreatedEvent and OrderUpdatedEvent in DynamoDB, ensure multi-tenant isolation"
```
**Writing tests:**
```bash
aider "Write unit tests for CreateUserHandler using aws-sdk-client-mock, test tenant isolation and event emission"
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/mbc-cqrs-serverless-development/raw