Nestjs performance

From HoangNguyen0403/agent-skills-standard · View interactive version

Nestjs performance is an AI agent skill from the GitHub repository HoangNguyen0403/agent-skills-standard. Optimize NestJS throughput with Fastify adapter, singleton scope enforcement, compression, and query projections. Use when switching to Fastify, diagnosing request-scoped bottlenecks, or profiling API overhead.

How to use this skill

Skill file

Performance Tuning

**Priority: P1 (HIGH)**

Workflow: Performance Audit

  1. Switch to Fastify — Replace Express with FastifyAdapter for ~2x throughput.
  2. Enable compression — Add Gzip/Brotli middleware.
  3. Audit provider scopes — Ensure no unintended REQUEST scope chains.
  4. Add query projections — Use select: [] on all repository queries.
  5. Profile overhead — Benchmark Total Duration, DB Execution, and API Overhead.

Fastify + Compression Setup

See implementation examples

Scope & Dependency Injection

Caching Strategy

Queues & Async Processing

Serialization

Database Tuning

Profiling & Scaling

Anti-Patterns

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.