Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
40 prioritized NestJS best practices across architecture, DI, security, performance, testing, and microservices.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
README.md
1# NestJS Best Practices23📖 [For Humans <3](https://kadajett.github.io/agent-nestjs-skills/)45A structured repository for creating and maintaining NestJS Best Practices optimized for agents and LLMs.67## Installation89Install this skill using [skills](https://github.com/vercel-labs/skills):1011```bash12# GitHub shorthand13npx skills add Kadajett/agent-nestjs-skills1415# Install globally (available across all projects)16npx skills add Kadajett/agent-nestjs-skills --global1718# Install for specific agents19npx skills add Kadajett/agent-nestjs-skills -a claude-code -a cursor20```2122### Supported Agents2324- Claude Code25- OpenCode26- Codex27- Cursor28- Antigravity29- Roo Code3031## Structure3233- `rules/` - Individual rule files (one per rule)34- `_sections.md` - Section metadata (titles, impacts, descriptions)35- `_template.md` - Template for creating new rules36- `area-description.md` - Individual rule files37- `scripts/` - Build scripts and utilities38- `metadata.json` - Document metadata (version, organization, abstract)39- __`AGENTS.md`__ - Compiled output (generated)4041## Getting Started42431. Install dependencies:44```bash45cd scripts && npm install46```47482. Build AGENTS.md from rules:49```bash50npm run build51# or52./scripts/build.sh53```5455## Creating a New Rule56571. Copy `rules/_template.md` to `rules/area-description.md`582. Choose the appropriate area prefix:59- `arch-` for Architecture (Section 1)60- `di-` for Dependency Injection (Section 2)61- `error-` for Error Handling (Section 3)62- `security-` for Security (Section 4)63- `perf-` for Performance (Section 5)64- `test-` for Testing (Section 6)65- `db-` for Database & ORM (Section 7)66- `api-` for API Design (Section 8)67- `micro-` for Microservices (Section 9)68- `devops-` for DevOps & Deployment (Section 10)693. Fill in the frontmatter and content704. Ensure you have clear examples with explanations715. Run the build script to regenerate AGENTS.md7273## Rule File Structure7475Each rule file should follow this structure:7677```markdown78---79title: Rule Title Here80impact: MEDIUM81impactDescription: Optional description82tags: tag1, tag2, tag383---8485## Rule Title Here8687Brief explanation of the rule and why it matters.8889**Incorrect (description of what's wrong):**9091```typescript92// Bad code example93```9495**Correct (description of what's right):**9697```typescript98// Good code example99```100101Optional explanatory text after examples.102103Reference: [NestJS Documentation](https://docs.nestjs.com)104105106## File Naming Convention107108- Files starting with `_` are special (excluded from build)109- Rule files: `area-description.md` (e.g., `arch-avoid-circular-deps.md`)110- Section is automatically inferred from filename prefix111- Rules are sorted alphabetically by title within each section112- IDs (e.g., 1.1, 1.2) are auto-generated during build113114## Impact Levels115116| Level | Description |117|-------|-------------|118| CRITICAL | Violations cause runtime errors, security vulnerabilities, or architectural breakdown |119| HIGH | Significant impact on reliability, security, or maintainability |120| MEDIUM-HIGH | Notable impact on quality and developer experience |121| MEDIUM | Moderate impact on code quality and best practices |122| LOW-MEDIUM | Minor improvements for consistency and maintainability |123124## Scripts125126- `npm run build` (in scripts/) - Compile rules into AGENTS.md127128## Contributing129130When adding or modifying rules:1311321. Use the correct filename prefix for your section1332. Follow the `_template.md` structure1343. Include clear bad/good examples with explanations1354. Add appropriate tags1365. Run the build script to regenerate AGENTS.md1376. Rules are automatically sorted by title - no need to manage numbers!138139## Documentation Website140141The documentation website source code lives on the [`docs` branch](https://github.com/Kadajett/agent-nestjs-skills/tree/docs/website). This separation keeps the skill installation lightweight while maintaining the full documentation site.142143To contribute to the website:144145```bash146git checkout docs147cd website148npm install149npm run dev150```151152## Acknowledgments153154- Inspired by the [Vercel React Best Practices](https://github.com/vercel-labs/agent-skills) skill structure155- Compatible with [skills](https://github.com/vercel-labs/skills) for easy installation across coding agents156157## Compatible Agents158159These NestJS skills work with:160161- [Claude Code](https://claude.ai/code) - Anthropic's official CLI162- [AdaL](https://sylph.ai/adal) - Self-evolving AI coding agent with MCP support163164