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.
SkillScore100Maintained
Automatic
◆Coding pack
Last verified 8/20/2026
What it changes
Passed 23 of 23 test cases with the skill, and 22 of 23 without it.
Without skill96%
With skill100%
Checks it passed that the model alone missed
Recommend injecting PaymentService directly into the controller constructor instead of using ModuleRef as a service locator.
1 fixed22 passed either way0 still failing0 broke
Pass-rate lift
+4 pp
Tokens
+40%
Agent turns
0%
Response time
-14%
Model gemini-3.6-flashMeasured 8/20/2026v1 · latest is v223 of 23 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
This benchmark measured an earlier version of the skill.
See it in action
A test case the skill fixed. Same model, same prompt, with and without the skill.
Prompt
In a NestJS route handler, a developer injected ModuleRef into the controller and called this.moduleRef.get(PaymentService) inside the checkout method to dynamically retrieve the service. How should PaymentService be provided to the controller?
What was checked, without and with the skill
Checked
Without skill
With skill
Recommend injecting PaymentService directly into the controller constructor instead of using ModuleRef as a service locator.
Missed
Passed
case-05 · gemini-3.6-flash · 8/20/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md151 lines2 files
NestJS Best Practices
This repository (Asymmetric-al/core)
These repo-owned sections are intentionally kept on top of the vendored NestJS
skill. If upstream refreshes replace this file, reconcile this overlay
before running bun run skills:sync. Core is a Bun + Next.js monorepo, not a NestJS application. Do not introduce NestJS modules, controllers, TypeORM, or
a Nest runtime into this repository.
Triggers
Reviewing NestJS patterns in third-party or vendored NestJS code.
Explicit NestJS architecture, DI, or security questions.
Workflow
Confirm the files under edit are actually NestJS, not Core Next.js / packages/api.
Prefer docs/ai/rules/backend.md and the data-access boundary for product work.
Use this skill only as NestJS reference; do not restyle Core around NestJS examples.
Checklist
Confirmed the task is NestJS reference, not a Core stack change.
Did not add NestJS, TypeORM, or Nest modules to this monorepo.
Kept tenant, auth, and data-access rules authoritative for product code.
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
Verify Next.js runtime behavior after editing app code. Use this skill to confirm a change actually works in a running app — not just that it compiles or type-checks. Combines /_next/mcp (Next.js's view) with agent-browser (the browser's view). Requires a running `next dev`.