Agent skill
NestJS
Align all NestJS services, modules, and controllers with these conventions.
Install this agent skill to your Project
npx add-skill https://github.com/hivellm/rulebook/tree/main/templates/skills/frameworks/nestjs
SKILL.md
NestJS Framework Rules
CRITICAL: Align all NestJS services, modules, and controllers with these conventions.
Project Structure
- Maintain feature-first modules under
src/<feature>/ - Keep global providers in
src/common/ - Register new modules in
AppModuleand ensure dependency injection consistency - Prefer
@nestjs/configfor environment configuration
Quality Gates
- Lint:
npm run lint - Unit tests:
npm run test - e2e tests:
npm run test:e2e - Build validation:
npm run build - Coverage threshold: 80%+ for service and controller layers
Implementation Guidelines
- Use DTOs with
class-validatorandclass-transformer - Encapsulate database access in providers (avoid direct repository use in controllers)
- Document routes with
@nestjs/swaggerwhen OpenAPI is enabled - Keep asynchronous logic wrapped with
try/catchand map errors to HTTP exceptions
Scripts to Run Before Commit
npm run lint
npm run test
npm run test:e2e
npm run build
Additional Checks
- Ensure Circular Dependency detection is clean (
npm run lint -- --max-warnings=0) - Synchronize
.env.examplewith actual required variables - Maintain aligned versions for Nest core packages (
@nestjs/*)
Documentation
- Update
/docs/architecture.mdwith new modules and providers - Keep OpenAPI spec regenerated via
npm run swagger:generate - Log breaking changes in
CHANGELOG.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
SAS
Execute these commands after EVERY implementation (see AGENT_AUTOMATION module for full workflow).
kirby-plugin-development
Builds or extends Kirby plugins using hooks, extensions, blocks, KirbyTags, and shared templates/controllers. Use when creating reusable features or integrating Panel customizations.
uloop-focus-window
Bring Unity Editor window to front via uloop CLI. Use when you need to: (1) Focus Unity Editor before capturing screenshots, (2) Ensure Unity window is visible for visual checks, (3) Bring Unity to foreground for user interaction.
uloop-launch
Launch Unity project with matching Editor version via uloop CLI. Use when you need to: (1) Open a Unity project with the correct Editor version, (2) Restart Unity to apply changes, (3) Switch build target when launching.
youtube-transcript
Extract transcripts from YouTube videos. Use when the user asks for a transcript, subtitles, or captions of a YouTube video and provides a YouTube URL (youtube.com/watch?v=, youtu.be/, or similar). Supports output with or without timestamps.
xiaohongshu
生成小红书文案和配图。当用户需要写小红书、生成社交媒体文案、小红书运营内容时使用
Didn't find tool you were looking for?