nestjs
Implement and review NestJS modules, dependency injection, request boundaries and service lifecycle behavior.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-11
- Stars
- ★ 10
- Forks
- 1
01 前言 Front Matter
- name
- nestjs
- description
- Implement and review NestJS modules, dependency injection, request boundaries and service lifecycle behavior.
02 资源文件 4
- 参考文档EXAMPLES.md555 B
- 参考文档skill.yaml441 B
- 参考文档TROUBLESHOOTING.md315 B
- 参考文档VALIDATION.json198 B
03 SKILL.md 正文
nestjs
Overview
Implement and review NestJS modules, dependency injection, request boundaries and service lifecycle behavior. Match guidance to the actual task and project; this document does not implement an automatic enforcer.
When to Use
The application actually uses NestJS or a requested change selects it. Preserve its installed version and existing module conventions.
Rules & Patterns
Inspect controllers, providers, modules and the actual validation/auth configuration. Register new dependencies in the real module path rather than producing unused classes.
Use DTOs or another configured runtime schema at the boundary. TypeScript annotations alone do not validate requests. Decide how unknown privilege-bearing fields are rejected and authorize the requested object separately from input parsing.
Keep controller and service responsibilities understandable at the project's scale. Extract reusable or complex business behavior when it helps; do not add layers solely to match a template.
Handle errors, resource cleanup and async work using the framework's supported APIs. Check dependency scope to avoid putting request identity into a shared provider's mutable state.
Code Examples
For a new order route, verify the provider is registered, a denied user cannot read another tenant's order, and invalid runtime input is rejected by the actual configured pipe/schema.
See EXAMPLES.md for scoped scenarios and evidence boundaries.
Validation Checklist
- [ ] Run relevant module/endpoint tests and the project's type/build checks.
- [ ] Exercise validation, authorization and resource/error paths.
Common Mistakes
Assuming a DTO type performs validation by itself; unregistered providers; shared request state; unnecessary abstractions.
Integration Notes
Optional companion guidance: node, typescript, security. Use it only when relevant and available; the skill does not install tools or authorize external actions.
04 同仓库更多 Skills
scoped-frontend
Frontend component design and React guidelines
scoped-backend
Backend service architecture and API endpoints
engineering-workflow
Core software engineering lifecycle workflow
team-auth
ContextOS skill for team-auth
claude
暂无简介
team-order
Team conventions for createOrder and item name normalization in src/order.ts.