Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add dkmqflx/nestjs-best-practices-plugin --skill nestjs-guards-authgit clone --depth 1 https://github.com/dkmqflx/nestjs-best-practices-pluginWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-guards-auth)<a href="https://agentmods.dev/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-guards-auth"><img src="https://agentmods.dev/badge/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-guards-auth/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-guards-auth"><img src="https://agentmods.dev/badge/skills/dkmqflx/nestjs-best-practices-plugin/nestjs-guards-auth.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00061 | $0.00747 |
| Opus 5 | $0.00030 | $0.00374 |
| Sonnet 5 | $0.00012 | $0.00149 |
| Haiku 4.5 | $0.00006 | $0.00075 |
Grade A, and why
nestjs-guards-auth scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 61 lines — stays where its author put it; the contents beside it link to each section on GitHub.
NestJS Guards, Auth & Authorization
Best practices for securing NestJS applications with guards, Passport-based JWT authentication, and role-based authorization. Verified against the current NestJS v10/v11 documentation (guards, authentication, authorization, and the Passport recipe).
The core mental model: authentication (authn) answers "who are you?" and
runs as a guard that validates a credential and attaches a typed user to the
request. Authorization (authz) answers "are you allowed?" and runs as a
separate guard that reads route metadata via Reflector and compares it against
that user. Keep these two concerns in distinct guards, declare a strong JWT
config from the environment, and never leak whether a credential was valid.
When to Apply
Reference these rules when:
- Implementing login / token issuance or protecting routes in NestJS
- Writing or reviewing a
CanActivateguard,AuthGuard, orJwtStrategy - Setting up Passport (
@nestjs/passport+passport-jwt) - Adding role-based access control (
@Roles,RolesGuard) - Registering a global auth guard with per-route opt-out (
@Public) - Reviewing how
req.useris typed, how secrets are configured, or how auth failures are surfaced to clients
Rules
| Rule | Impact | Summary |
|---|---|---|
| separate-authn-from-authz | HIGH | Keep identity verification and permission checks in distinct guards |
| passport-jwt-strategy | HIGH | Use @nestjs/passport + a passport-jwt strategy class for JWT auth |
| global-auth-guard-with-public | HIGH | Register a global auth guard and opt out via @Public() metadata |
| roles-guard-rbac | HIGH | Drive RBAC with @Roles() metadata read by a RolesGuard via Reflector |
| hash-passwords | CRITICAL | Never store plaintext; hash with bcrypt/argon2 + salt |
| type-the-request-user | MEDIUM | Strongly type req.user; never trust an unvalidated payload |
| dont-leak-auth-details | HIGH | Return generic 401/403; don't reveal whether a user exists |
| validate-jwt-config | CRITICAL | Load a strong secret from config/env with sane expiry; verify signature and expiration |
What ships with it
8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- rules/dont-leak-auth-details.md 1.7 KB
- rules/global-auth-guard-with-public.md 1.8 KB
- rules/hash-passwords.md 1.7 KB
- rules/passport-jwt-strategy.md 2.2 KB
- rules/roles-guard-rbac.md 2.0 KB
- rules/separate-authn-from-authz.md 2.2 KB
- rules/type-the-request-user.md 1.4 KB
- rules/validate-jwt-config.md 1.7 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago First seen · 61 lines · 61 tokens per session scan A 61380f288f9b
nestjs-guards-auth is a skill published in the GitHub repository dkmqflx/nestjs-best-practices-plugin (1 stars, last pushed 2mo ago), licensed MIT. It adds 61 tokens to every session and 747 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
lov-optimize-tauri-backend
Optimize Tauri backend architecture and development ergonomics for Tauri 2 apps, especially Rust restart pain, oversized src-tauri/src/lib.rs files, excessive #[tauri::command] surfaces, stringly invoke APIs, long IPC streams, and dev-state recovery. Use when the user asks about Tauri hot reload, Rust-side restarts…
lov-cli2anything
A tool for turning authorized observations of a website’s API into an OpenAPI description, Swagger interface, JavaScript SDK, or local command-line tool. OpenAPI is a machine-readable description of how an API can be called.
lov-init-auth
A React authentication setup tool for Supabase, a hosted service that provides user accounts and data features. It adds account access, recovery, email confirmation, and desktop-browser OAuth, where OAuth lets users sign in through another provider.
lov-install-zenmux-api
A backend integration tool for connecting an application to the ZenMux API through a server-side proxy. It keeps API keys on the server instead of exposing them in browser code.
lov-refactor-api
A backend API refactoring workflow that finds duplicate endpoints and consolidates their implementation while keeping existing callers working. It checks inputs, outputs, permissions, and known callers before changing code.
domain-modeling
Build or sharpen a project's domain language and durable decisions. Use when terminology is fuzzy or contradictory, relationships need scenario testing, the code disagrees with the stated model, or a glossary or ADR-class decision must be updated; do not trigger merely to read existing context.