본문으로 건너뛰기
cccskills
무료GitHub에 공개

nestjs-best-practices

NestJS best practices and architecture patterns for building production-ready applications. This skill should be used when writing, reviewing, or refactoring NestJS code to ensure proper patterns for modules, dependency injection, security, and performance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ever-works/ever-works스타 182(GitHub 182 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(49)

  • SKILL.md4.8 KB
  • AGENTS.md154.2 KB
  • README.md4.7 KB
  • rules/_sections.md2.1 KB
  • rules/_template.md633 B
  • rules/api-use-dto-serialization.md4.2 KB
  • rules/api-use-interceptors.md5.4 KB
  • rules/api-use-pipes.md5.3 KB
  • rules/api-versioning.md4.7 KB
  • rules/arch-avoid-circular-deps.md1.9 KB
  • rules/arch-feature-modules.md2.3 KB
  • rules/arch-module-sharing.md3.7 KB
  • rules/arch-single-responsibility.md2.8 KB
  • rules/arch-use-events.md2.9 KB
  • rules/arch-use-repository-pattern.md2.7 KB
  • rules/db-avoid-n-plus-one.md3.8 KB
  • rules/db-use-migrations.md3.7 KB
  • rules/db-use-transactions.md3.6 KB
  • rules/devops-graceful-shutdown.md5.5 KB
  • rules/devops-use-config-module.md4.2 KB
  • rules/devops-use-logging.md5.1 KB
  • rules/di-avoid-service-locator.md2.8 KB
  • rules/di-interface-segregation.md5.0 KB
  • rules/di-liskov-substitution.md6.8 KB
  • rules/di-prefer-constructor-injection.md2.2 KB
  • rules/di-scope-awareness.md2.5 KB
  • rules/di-use-interfaces-tokens.md2.5 KB
  • rules/error-handle-async-errors.md3.4 KB
  • rules/error-throw-http-exceptions.md3.0 KB
  • rules/error-use-exception-filters.md3.4 KB
  • rules/micro-use-health-checks.md6.1 KB
  • rules/micro-use-patterns.md5.0 KB
  • rules/micro-use-queues.md5.7 KB
  • rules/perf-async-hooks.md2.8 KB
  • rules/perf-lazy-loading.md3.6 KB
  • rules/perf-optimize-database.md3.0 KB
  • rules/perf-use-caching.md3.3 KB
  • rules/security-auth-jwt.md3.8 KB
  • rules/security-rate-limiting.md3.1 KB
  • rules/security-sanitize-output.md3.7 KB
  • rules/security-use-guards.md3.4 KB
  • rules/security-validate-all-input.md3.2 KB
  • rules/test-e2e-supertest.md4.4 KB
  • rules/test-mock-external-services.md4.2 KB
  • rules/test-use-testing-module.md4.1 KB
  • scripts/build-agents.ts8.1 KB
  • scripts/build.sh369 B
  • scripts/package-lock.json7.7 KB
  • scripts/package.json410 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

NestJS Best Practices

Comprehensive best practices guide for NestJS applications. Contains 40 rules across 10 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Writing new NestJS modules, controllers, or services
  • Implementing authentication and authorization
  • Reviewing code for architecture and security issues
  • Refactoring existing NestJS codebases
  • Optimizing performance or database queries
  • Building microservices architectures

Rule Categories by Priority

PriorityCategoryImpactPrefix
1ArchitectureCRITICALarch-
2Dependency InjectionCRITICALdi-
3Error HandlingHIGHerror-
4SecurityHIGHsecurity-
5PerformanceHIGHperf-
6TestingMEDIUM-HIGHtest-
7Database & ORMMEDIUM-HIGHdb-
8API DesignMEDIUMapi-
9MicroservicesMEDIUMmicro-
10DevOps & DeploymentLOW-MEDIUMdevops-

Quick Reference

1. Architecture (CRITICAL)

  • arch-avoid-circular-deps - Avoid circular module dependencies
  • arch-feature-modules - Organize by feature, not technical layer
  • arch-module-sharing - Proper module exports/imports, avoid duplicate providers
  • arch-single-responsibility - Focused services over "god services"
  • arch-use-repository-pattern - Abstract database logic for testability
  • arch-use-events - Event-driven architecture for decoupling

2. Dependency Injection (CRITICAL)

  • di-avoid-service-locator - Avoid service locator anti-pattern
  • di-interface-segregation - Interface Segregation Principle (ISP)
  • di-liskov-substitution - Liskov Substitution Principle (LSP)
  • di-prefer-constructor-injection - Constructor over property injection
  • di-scope-awareness - Understand singleton/request/transient scopes
  • di-use-interfaces-tokens - Use injection tokens for interfaces

3. Error Handling (HIGH)

  • error-use-exception-filters - Centralized exception handling
  • error-throw-http-exceptions - Use NestJS HTTP exceptions
  • error-handle-async-errors - Handle async errors properly

4. Security (HIGH)

  • security-auth-jwt - Secure JWT authentication
  • security-validate-all-input - Validate with class-validator
  • security-use-guards - Authentication and authorization guards
  • security-sanitize-output - Prevent XSS attacks
  • security-rate-limiting - Implement rate limiting

5. Performance (HIGH)

  • perf-async-hooks - Proper async lifecycle hooks
  • perf-use-caching - Implement caching strategies
  • perf-optimize-database - Optimize database queries
  • perf-lazy-loading - Lazy load modules for faster startup

6. Testing (MEDIUM-HIGH)

  • test-use-testing-module - Use NestJS testing utilities
  • test-e2e-supertest - E2E testing with Supertest
  • test-mock-external-services - Mock external dependencies

7. Database & ORM (MEDIUM-HIGH)

  • db-use-transactions - Transaction management
  • db-avoid-n-plus-one - Avoid N+1 query problems
  • db-use-migrations - Use migrations for schema changes

8. API Design (MEDIUM)

  • api-use-dto-serialization - DTO and response serialization
  • api-use-interceptors - Cross-cutting concerns
  • api-versioning - API versioning strategies
  • api-use-pipes - Input transformation with pipes

9. Microservices (MEDIUM)

  • micro-use-patterns - Message and event patterns
  • micro-use-health-checks - Health checks for orchestration
  • micro-use-queues - Background job processing

10. DevOps & Deployment (LOW-MEDIUM)

  • devops-use-config-module - Environment configuration
  • devops-use-logging - Structured logging
  • devops-graceful-shutdown - Zero-downtime deployments

How to Use

Read individual rule files for detailed explanations and code examples:

rules/arch-avoid-circular-deps.md
rules/security-validate-all-input.md
rules/_sections.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Additional context and references

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Audit and improve web accessibility following WCAG 2.2 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ever-works/ever-works1822026년 10월 24일 업데이트

ai-sdk

무료

Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ever-works/ever-works1822026년 10월 24일 업데이트

Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables. Use when users mention Better Auth, betterauth, auth.ts, or need to set up TypeScript authentication with email/password, OAuth, or plugin configuration.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ever-works/ever-works1822026년 10월 24일 업데이트

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ever-works/ever-works1822026년 10월 24일 업데이트

Configure email verification, implement password reset flows, set password policies, and customise hashing algorithms for Better Auth email/password authentication. Use when users need to set up login, sign-in, sign-up, credential authentication, or password security with Better Auth.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ever-works/ever-works1822026년 10월 24일 업데이트

Repo-specific guide to the Ever Works monorepo (ever-works/ever-works) — its pnpm + Turborepo layout, the per-workspace test runners (Jest vs Vitest vs Playwright), file-naming and import-alias conventions, the commit/branch model, and the real build/lint/type-check commands. Use this whenever working anywhere in this repository so changes match the codebase's actual conventions and pass CI.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ever-works/ever-works1822026년 10월 24일 업데이트

ever-works의 스킬 모두 보기

이 스킬의 문제 신고