skills/nestjs/nestjs-performance/SKILL.md
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.
npx skillsauth add hoangnguyen0403/agent-skills-standard nestjs-performanceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
FastifyAdapter for ~2x throughput.REQUEST scope chains.select: [] on all repository queries.See implementation examples
http.Agent keep-alive settings to reuse TCP connections for upstream services.SINGLETON scope (default).REQUEST scope unless absolutely necessary.durable: true) for multi-tenancy.LazyModuleLoader for heavyweight modules (e.g., Admin panels).@nestjs/cache-manager for computation results.Cache-Control headers for client-side caching (CDN/Browser).@nestjs/bull (BullMQ) or RabbitMQ (@nestjs/microservices).class-transformer CPU expensive.fast-json-stringify (built-in fastify serialization) instead of interceptors.select: [] to fetch only needed columns.relations carefully or DataLoader for Graph/Field resolvers.pool: { min: 2, max: 10 }) in config to match DB limits.Total Duration, DB Execution Time, and API Overhead.worker_threads.ClusterModule to utilize all CPU cores. In K8s, prefer ReplicaSets.worker_threads or BullMQ.select: [] needed columns to avoid serializing unused data.development
Standardize SRS and FRS specifications for technical behavior, interfaces, data contracts, quality constraints, and verification mapping. Use when writing SRS, functional specification, system behavior requirements, API/data contracts, or non-functional thresholds.
development
Standardize BRD and BRD-lite discovery for business goals, stakeholder impact, current-to-future state, and measurable value outcomes. Use when creating BRD, business case, project justification, ROI narrative, or AS-IS to TO-BE scope.
development
Implements a strict Red-Green-Refactor loop to ensure zero production code is written without a prior failing test. Use when: creating new features, fixing bugs, or expanding test coverage.
testing
Standardize PRD discovery and drafting for product scope, user outcomes, requirement IDs, and acceptance criteria. Use when creating PRD, product requirements, feature specification, or acceptance criteria plan.