PitchHut logo
agent-nestjs-skills
Master NestJS best practices with comprehensive AI-driven insights.
Pitch

This project offers a comprehensive skillset for mastering NestJS best practices. Containing 37 rules across 10 categories, it provides AI agents with deep insights into architecture patterns, anti-patterns, and production-ready code examples, empowering developers to enhance their NestJS applications effectively.

Description

NestJS Best Practices Skill

The NestJS Best Practices Skill is an essential tool designed to empower AI agents with comprehensive knowledge of best practices in NestJS development. This skillset offers a detailed guide on the optimal use of NestJS by covering various patterns, anti-patterns, and providing production-ready code examples.

Overview

The skill includes 37 rules categorized into 10 different sections, addressing crucial aspects from architectural patterns to deployment strategies. Each rule is meticulously structured with the following components:

  • Impact Assessment: Classified by severity (CRITICAL, HIGH, MEDIUM-HIGH, MEDIUM, LOW-MEDIUM)
  • Incorrect Code Examples: Demonstrating common anti-patterns
  • Correct Code Examples: Offering explanations of best practices
  • References: Links to official documentation for further reading

Categories Covered

SectionCategoryImpactRules
1ArchitectureCRITICAL5
2Dependency InjectionCRITICAL4
3Error HandlingHIGH3
4SecurityHIGH5
5PerformanceHIGH4
6TestingMEDIUM-HIGH3
7Database & ORMMEDIUM-HIGH3
8API DesignMEDIUM4
9MicroservicesMEDIUM3
10DevOps & DeploymentLOW-MEDIUM3

Structure of the Repository

The repository is organized as follows:

nestjs-best-practices-skill/
├── SKILL.md              # Main entry point for Claude Code
├── AGENTS.md             # Consolidated rules document (generated)
├── metadata.json         # Version and metadata
├── rules/                # Individual rule files
│   ├── _sections.md      # Category definitions
│   ├── _template.md      # Template for new rules
│   ├── arch-*.md         # Architecture rules
│   ├── di-*.md           # Dependency Injection rules
│   ├── error-*.md        # Error Handling rules
│   ├── security-*.md     # Security rules
│   ├── perf-*.md         # Performance rules
│   ├── test-*.md         # Testing rules
│   ├── db-*.md           # Database rules
│   ├── api-*.md          # API Design rules
│   ├── micro-*.md        # Microservices rules
│   └── devops-*.md       # DevOps rules
└── scripts/              # Build tools
    ├── build-agents.ts   # AGENTS.md generator
    ├── build.sh          # Shell wrapper
    └── package.json      # NPM config

Workflow

The repository utilizes a prefix-based naming system for files, ensuring clarity:

  • arch-: Architecture patterns
  • di-: Dependency Injection strategies
  • security-: Security best practices
  • perf-: Performance optimizations

The rules are automatically ordered within each section, enhancing accessibility when building the AGENTS.md.

Adding New Rules

To incorporate new rules into the repository, follow these structured steps:

  1. Copy rules/_template.md to a newly created file using the relevant prefix.
  2. Complete the frontmatter and content according to the template.
  3. Execute the build script to regenerate the AGENTS.md file.

Example Rule Structure

Each rule adheres to a defined format:

---
title: Rule Title Here
impact: MEDIUM
impactDescription: Brief description of impact
tags: tag1, tag2, tag3
---

## Rule Title Here

Brief explanation of the rule and its significance.

**Incorrect (description of the problem):**  
```typescript
// Bad code example here

Correct (description of the solution):

// Good code example here

Reference: NestJS Documentation


### Impact Classification

Each rule is classified by impact:

| Level       | Description                                                                                |
|-------------|--------------------------------------------------------------------------------------------|
| CRITICAL    | Violations cause runtime errors, security vulnerabilities, or architectural breakdown       |
| HIGH        | Significant impact on reliability, security, or maintainability                           |
| MEDIUM-HIGH | Notable impact on quality and developer experience                                         |
| MEDIUM      | Moderate impact on code quality and adherence to best practices                           |
| LOW-MEDIUM  | Minor enhancements to consistency and maintainability                                      | 

This skillset serves as a resource for developers seeking to enhance their NestJS capabilities and ensure their applications are built using the most effective practices.
0 comments

No comments yet.

Sign in to be the first to comment.