| name | documentation |
| description | Generate and update technical documentation. Use when Documenting new features or APIs, Updating docs for code changes, or Creating README or getting started guides |
Project Context
Docs live in .context/docs/. Reference actual file paths and line numbers when linking to symbols (e.g. src/core/types/either.ts:1). Swagger decorators go on NestJS controllers. Use Either/Left/Right terminology consistently — never "result wrapper". Update the relevant .context/docs/*.md file in the same PR as the code change.
Workflow
- Identify the target audience (developer, AI agent, architect)
- Determine which
.context/docs/ file needs updating
- Reference actual symbols with file:line paths
- Include working code examples using project patterns
- Update Swagger decorators on controllers for new endpoints
- Commit with
docs: <description> scope
Examples
Documenting a new use case:
### CreateUserUseCase
Defined at [`src/modules/users/domain/usecase/i_create_user_use_case.ts`](../../src/modules/users/domain/usecase/i_create_user_use_case.ts).
**Params**: `CreateUserParam { email: string; password: string }`
**Returns**: `AsyncResult<CreateUserResponse>` — `Right` on success, `Left<UserRepositoryException>` if email already exists.
Swagger decorator on controller:
@Post()
@ApiOperation({ summary: 'Create a new user' })
@ApiResponse({ status: 201, description: 'User created', type: CreateUserResponseDto })
@ApiResponse({ status: 400, description: 'Validation error or email taken' })
async create(@Body() dto: CreateUserDto) { ... }
Quality Bar
- Always link to actual file paths and line numbers
- Update
.context/docs/ in the same PR as the code change
- Use
Either/Left/Right terminology, not "result" or "monad"
- Swagger decorators required on all new controller methods
- Examples must match the current code patterns