backend-nestjs
- Repo stars 14
- Author repo rhm
NestJS Backend Development
When to Use This Skill
Use when developing backend code in a NestJS project with TypeScript.
Recommended Project Structure
src/
├── core/
│ ├── config/ # Configuration (env validation)
│ ├── database/ # Database connections, migrations
│ ├── guards/ # Auth guards
│ ├── interceptors/ # Request/response interceptors
│ ├── filters/ # Exception filters
│ └── decorators/ # Custom decorators
├── modules/
│ └── <domain>/
│ ├── application/ # Use cases / services
│ ├── domain/ # Entities, value objects, interfaces
│ ├── infrastructure/ # Repositories, external services
│ ├── presentation/ # Controllers, DTOs, validators
│ └── <domain>.module.ts
├── shared/
│ ├── utils/
│ ├── types/
│ └── constants/
└── main.ts
Conventions
- One use case per file in
application/ - DTOs with class-validator decorators in
presentation/ - Repository pattern for data access in
infrastructure/ - Module-scoped providers; export only what's needed
Testing
- Stack: Vitest (preferred) or Jest
- Unit test use cases with mocked dependencies
- Test file next to source:
*.spec.ts - All tests in English
- Naming: "should do X when Y"
Commands
pnpm dev # Development with hot reload
pnpm build # Production build
pnpm lint # ESLint
pnpm test # Run tests
pnpm test:cov # Coverage report
Error Handling
- Use NestJS built-in exceptions (BadRequestException, NotFoundException, etc.)
- Custom exceptions extend HttpException
- Global exception filter for unhandled errors
Database
- Use query builder or repository pattern
- Always use transactions for multi-table writes
- Add indexes for frequently queried columns
- Use database MCPs to inspect schema before writing queries
Pre-commit Checklist
- Build passes? (
pnpm build) - Lint passes? (
pnpm lint) - Tests pass? (
pnpm test) - DTOs have proper validation?
- Error cases handled?
- Fluxly category
- Engineering
- Author-declared agents
- No explicit declaration found; this is not inferred or tested compatibility
- Static check
- 88 / 100 · heuristic scan, not runtime safety proof
- Author / version / license
- @arvoreeducacao · no license declared
- Fluxly token estimate
- Lean
- Fluxly setup estimate
- Plug-and-play
- External API key
- No requirement detected
- Detected OS requirements
- Unspecified
- Runtime requirements
- Unspecified
- Detected file/system behavior
-
- Read-only
- Detected network behavior
- Local-only
- Install commands
- None (reference only)
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
The current SKILL.md does not define a fixed output example. Use when developing backend code in a NestJS project with TypeScript.
Recommended Project Structure
One use case per file in application/ DTOs with class-validator decorators in presentation/ Repository pattern for data access in infrastructure/
Stack: Vitest (preferred) or Jest Unit test use cases with mocked dependencies Test file next to source: .spec.ts
Commands
Use NestJS built-in exceptions (BadRequestException, NotFoundException, etc.) Custom exceptions extend HttpException Global exception filter for unhandled errors
# NestJS Backend Development
## When to Use This Skill
Use when developing backend code in a NestJS project with TypeScript.
## Recommended Project Structure
```
src/
├── core/
│ ├── config/ # Configuration (env validation)
│ ├── database/ # Database connections, migrations
│ ├── guards/ # Auth guards
│ ├── interceptors/ # Request/response interceptors
│ ├── filters/ # Exception filters
│ └── decorators/ # Custom decorators
├── modules/
│ └── <domain>/
│ ├── application/ # Use cases / services
│ ├── domain/ # Entities, value objects, interfaces
│ ├── infrastructure/ # Repositories, external services
│ ├── presentation/ # Controllers, DTOs, validators
│ └── <domain>.module.ts
├── shared/
│ ├── utils/
│ ├── types/
│ └── constants/
└── main.ts
```
## Conventions
- One use case per file in `application/`
- DTOs with class-validator decorators in `presentation/`
- Repository pattern for data access in `infrastructure/`
- Module-scoped providers; export only what's needed
## Testing
- Stack: Vitest (preferred) or Jest
- Unit test use cases with mocked dependencies
- Test file next to source: `*.spec.ts`
- All tests in English
- Naming: "should do X when Y"
## Commands
```bash
pnpm dev # Development with hot reload
pnpm build # Production build
pnpm lint # ESLint
pnpm test # Run tests
pnpm test:cov # Coverage report
```
## Error Handling
- Use NestJS built-in exceptions (BadRequestException, NotFoundException, etc.)
- Custom exceptions extend HttpException
- Global exception filter for unhandled errors
## Database
- Use query builder or repository pattern
… Author text anchors workflow facts; Fluxly only indexes current sections, terms, files, and commands.
sections -> When to Use This Skill → Recommended Project Structure → Conventions → Testing → Commands → Error Handling
terms -> Use when developing backend code in a NestJS project with TypeScript. · - Build passes?
files/cmd -> application/ · presentation/ · infrastructure/ · .spec.ts · pnpm build · pnpm lint · pnpm test
body sha256 -> 7f5de08730d6
Decide Fit First
Design Intent
How To Use It
Boundaries And Review