agentleFS
a365ngaya365ngay/CogniRouter/skills/senior-nestjs/SKILL.md

senior-nestjs

Skill2 starsChanged 6 days agoMITView on GitHub

Use when designing, implementing, debugging, reviewing, or refactoring NestJS modules, controllers, services, DTOs, validation, guards, interceptors, pipes, persistence, queues, integrations, tests, or observability.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep controllers thin: parse transport concerns, delegate application work, and map response contracts.

    line 20
  2. Very specific:

    Use DTOs with explicit validation and transformation rules.

    line 21
  3. Distinctive:

    Use pipes for input transformation/validation, interceptors for cross-cutting concerns, filters for consistent error mapping, and …

    line 23
  4. Distinctive:

    Use configuration validation and never expose secrets or raw driver errors.

    line 25
  5. Distinctive:

    Run existing unit, integration, end-to-end, lint, type, and build checks relevant to the change.

    line 29

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Senior NestJS

Role

Implement NestJS changes with clear module boundaries, deliberate request-to-domain flow, consistent contracts, secure authorization, and testable dependency composition.

Before Editing

  1. Inspect NestJS version, module graph, controller/service/repository patterns, DTOs, global pipes/filters/interceptors, auth guards, configuration, persistence adapter, tests, and API conventions.
  2. Trace the affected request or job from entry point through validation, authorization, application logic, persistence, external calls, error mapping, and response.
  3. State a focused plan and reuse local conventions. Avoid adding global behavior or a new module layer unless the scope requires it.

Implementation Rules

  • Keep controllers thin: parse transport concerns, delegate application work, and map response contracts. Keep domain or application rules in injectable services; isolate persistence and external clients.
  • Use DTOs with explicit validation and transformation rules. Treat ValidationPipe configuration and whitelist behavior as part of the API contract; reject or handle unknown input intentionally.
  • Enforce authentication and authorization with guards and resource-aware policy checks. Do not rely on controller route hiding or client claims alone.
  • Use pipes for input transformation/validation, interceptors for cross-cutting concerns, filters for consistent error mapping, and middleware only for transport-wide concerns. Do not hide business rules in them.
  • Make provider scope, circular dependencies, async failure, transactions, idempotency, timeout, retries, queues, and background-job error handling explicit when relevant.
  • Use configuration validation and never expose secrets or raw driver errors. Add structured logging, correlation IDs, metrics, or tracing consistent with the project for changed operational paths.

Testing and Verification

Run existing unit, integration, end-to-end, lint, type, and build checks relevant to the change. Cover DTO validation, guard/policy behavior, error mapping, service rules, persistence behavior, and controller contracts at appropriate layers.

Review Checklist

  • Does the module own one coherent capability with clear exports and dependencies?
  • Are validation and authorization enforced before side effects?
  • Are expected failures represented consistently and safely to callers?
  • Is persistence transactionality and external-call retry behavior correct under concurrency?
  • Are changes testable without reaching through internals or creating unrelated abstractions?

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.