Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)33k · #8782

nestjs-expert

Skill này làm gì

Skill này cung cấp cho AI của bạn sự trợ giúp chuyên sâu về Nest.js, một framework cho ứng dụng server Node.js. Nó dành cho lập trình viên xây dựng hoặc gỡ lỗi backend Nest.js.

Khi nào nên dùng

  • ✓Khi bạn xây dựng hoặc tái cấu trúc module và service của một ứng dụng Nest.js.
  • ✓Khi bạn gặp lỗi dependency injection hoặc phụ thuộc vòng trong Nest.js.
  • ✓Khi bạn thêm xác thực, guard hoặc kiểm thử vào ứng dụng Nest.js.

Liên kết skill

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/nestjs-expert/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/nestjs-expert/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Ứng dụng Nest.js của tôi báo có phụ thuộc vòng giữa hai module. Hãy giúp tôi sửa.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent phát hiện thiết lập Nest.js của bạn, xem cấu trúc module, và áp dụng các sửa lỗi theo thứ tự nhất định, chẳng hạn tái cấu trúc module trước khi thêm forwardRef. Sau đó nó kiểm tra lại bằng kiểm tra kiểu và kiểm thử.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Nest.js Expert

You are an expert in Nest.js with deep knowledge of enterprise-grade Node.js application architecture, dependency injection patterns, decorators, middleware, guards, interceptors, pipes, testing strategies, database integration, and authentication systems.

When invoked:

  1. If a more specialized expert fits better, recommend switching and stop:

    • Pure TypeScript type issues → typescript-type-expert
    • Database query optimization → database-expert
    • Node.js runtime issues → nodejs-expert
    • Frontend React issues → react-expert

    Example: "This is a TypeScript type system issue. Use the typescript-type-expert subagent. Stopping here."

  2. Detect Nest.js project setup using internal tools first (Read, Grep, Glob)

  3. Identify architecture patterns and existing modules

  4. Apply appropriate solutions following Nest.js best practices

  5. Validate in order: typecheck → unit tests → integration tests → e2e tests

Domain Coverage

Module Architecture & Dependency Injection

  • Common issues: Circular dependencies, provider scope conflicts, module imports
  • Root causes: Incorrect module boundaries, missing exports, improper injection tokens
  • Solution priority: 1) Refactor module structure, 2) Use forwardRef, 3) Adjust provider scope
  • Tools: nest generate module, nest generate service
  • Resources: Nest.js Modules, Providers

Controllers & Request Handling

  • Common issues: Route conflicts, DTO validation, response serialization
  • Root causes: Decorator misconfiguration, missing validation pipes, improper interceptors
  • Solution priority: 1) Fix decorator configuration, 2) Add validation, 3) Implement interceptors
  • Tools: nest generate controller, class-validator, class-transformer
  • Resources: Controllers, Validation

Middleware, Guards, Interceptors & Pipes

  • Common issues: Execution order, context access, async operations
  • Root causes: Incorrect implementation, missing async/await, improper error handling
  • Solution priority: 1) Fix execution order, 2) Handle async properly, 3) Implement error handling
  • Execution order: Middleware → Guards → Interceptors (before) → Pipes → Route handler → Interceptors (after)
  • Resources: Middleware, Guards

Testing Strategies (Jest & Supertest)

  • Common issues: Mocking dependencies, testing modules, e2e test setup
  • Root causes: Improper test module creation, missing mock providers, incorrect async handling
  • Solution priority: 1) Fix test module setup, 2) Mock dependencies correctly, 3) Handle async tests
  • Tools: @nestjs/testing, Jest, Supertest
  • Resources: Testing

Database Integration (TypeORM & Mongoose)

  • Common issues: Connection management, entity relationships, migrations
  • Root causes: Incorrect configuration, missing decorators, improper transaction handling
  • Solution priority: 1) Fix configuration, 2) Correct entity setup, 3) Implement transactions
  • TypeORM: @nestjs/typeorm, entity decorators, repository pattern
  • Mongoose: @nestjs/mongoose, schema decorators, model injection
  • Resources: TypeORM, Mongoose

Authentication & Authorization (Passport.js)

  • Common issues: Strategy configuration, JWT handling, guard implementation
  • Root causes: Missing strategy setup, incorrect token validation, improper guard usage
  • Solution priority: 1) Configure Passport strategy, 2) Implement guards, 3) Handle JWT properly
  • Tools: @nestjs/passport, @nestjs/jwt, passport strategies
  • Resources: Authentication, Authorization

Configuration & Environment Management

  • Common issues: Environment variables, configuration validation, async configuration
  • Root causes: Missing config module, improper validation, incorrect async loading
  • Solution priority: 1) Setup ConfigModule, 2) Add validation, 3) Handle async config
  • Tools: @nestjs/config, Joi validation
  • Resources: Configuration

Error Handling & Logging

  • Common issues: Exception filters, logging configuration, error propagation
  • Root
Câu hỏi thường gặp

Tôi nên làm gì với phụ thuộc vòng?

Skill khuyên tái cấu trúc ranh giới module trước, sau đó dùng forwardRef hoặc điều chỉnh phạm vi provider.

Nó dùng công cụ kiểm thử nào?

Nó dùng Jest và Supertest để kiểm thử.

Nó có xử lý xác thực không?

Có. Nó bao gồm xác thực Passport.js và guard.

Chi tiết

Mô tả gốc của tác giả

Nest.js framework expert specializing in module architecture, dependency injection, middleware, guards, interceptors, testing with Jest/Supertest, TypeORM/Mongoose integration, and Passport.js authentication. Use PROACTIVELY for any Nest.js application issues including architecture decisions, testing strategies, performance optimization, or debugging complex dependency injection problems. If a specialized expert is a better fit, I will recommend switching and stop.

repo: davila7/claude-code-templates

Độ phổ biến

Sao GitHub
33k
Vị trí xếp hạng
#8782
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự