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

nestjs-standard

Skill2 starsChanged 6 days agoMITView on GitHub

Standards and workflows for implementing, reviewing, debugging, and refactoring NestJS applications. Use when working on NestJS modules, controllers, services, DTOs, guards, interceptors, pipes, Prisma or TypeORM data access, REST APIs, authentication, validation, tests, migrations, or production hardening. Prefer this skill for NestJS code changes in existing repositories where the agent must follow local architecture and avoid framework-pattern overreach.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 10 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill to make practical, codebase-aware NestJS changes.

    line 8
  2. Distinctive:

    Prefer existing project patterns over new abstractions.

    line 13
  3. Distinctive:

    Keep changes scoped to the requested feature or defect.

    line 14
  4. Very specific:

    Run the narrowest useful verification available: unit tests for service logic, e2e/request tests for API behavior, lint/typecheck/build for …

    line 17
  5. Distinctive:

    Before changing NestJS code, quickly discover:

    line 21
  6. Distinctive:

    Read only the reference files needed for the task:

    line 31
  7. Distinctive:

    Do not read every reference by default.

    line 39
  8. Distinctive:

    Update controller methods only as thin request adapters: parse, validate, authorize, call service, return typed result.

    line 45
  9. Distinctive:

    Put business behavior in services or existing domain classes.

    line 46
  10. Very specific:

    Update module providers/imports/exports only when a dependency boundary requires it.

    line 47
  11. Distinctive:

    Add focused tests for changed behavior, especially authorization, validation, transactions, and error paths.

    line 48
  12. Distinctive:

    Run the repository's existing verification commands and report any command that cannot run.

    line 49

≈ “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

NestJS Standard

Use this skill to make practical, codebase-aware NestJS changes. The goal is not to impose a generic architecture; it is to read the current project, preserve its conventions, and apply NestJS patterns only where they solve the task.

Operating Rules

  1. Inspect the existing app before editing: package manager, NestJS version, module layout, ORM, validation setup, auth setup, test runner, and local naming conventions.
  2. Prefer existing project patterns over new abstractions. Add repositories, injection tokens, interceptors, event buses, or lazy modules only when the local codebase already uses them or the task clearly needs them.
  3. Keep changes scoped to the requested feature or defect. Avoid broad module reshuffles unless the request is explicitly architectural.
  4. Validate inputs at DTO or pipe boundaries, enforce authorization in guards/policies, and keep business rules in services or domain helpers.
  5. Match the detected ORM. Do not introduce TypeORM into Prisma projects, Prisma into TypeORM projects, or a repository layer into simple CRUD code without a concrete benefit.
  6. Run the narrowest useful verification available: unit tests for service logic, e2e/request tests for API behavior, lint/typecheck/build for shared contracts, and migration generation checks for schema work.

Discovery Checklist

Before changing NestJS code, quickly discover:

  • package.json: NestJS version, scripts, ORM, test tools, validation/security packages.
  • Entry points: src/main.ts, root module, global pipes, filters, interceptors, guards, prefix/versioning.
  • Feature shape: whether modules are grouped by feature, layer, bounded context, or generated CRUD.
  • Data access: Prisma service/client, TypeORM repositories, MikroORM, Sequelize, raw SQL, or external API clients.
  • Existing examples: nearest similar module/controller/service/DTO/spec.

Reference Routing

Read only the reference files needed for the task:

  • references/architecture.md: modules, DI, providers, boundaries, circular dependencies, lifecycle hooks.
  • references/api-validation-security.md: controllers, DTOs, pipes, serialization, auth, guards, rate limits, file uploads.
  • references/data-access.md: Prisma, TypeORM, transactions, migrations, N+1 prevention, query placement.
  • references/testing.md: unit, integration, e2e, mocks, test modules, database tests.
  • references/review-refactor.md: code review checklist and safe refactor workflow.

Do not read every reference by default. Load the smallest relevant set, then inspect source files around the change.

Implementation Workflow

  1. Locate the closest existing implementation and mirror its structure.
  2. Define or update DTOs first for API inputs and outputs when request/response contracts change.
  3. Update controller methods only as thin request adapters: parse, validate, authorize, call service, return typed result.
  4. Put business behavior in services or existing domain classes. Keep database calls behind the local data-access pattern.
  5. Update module providers/imports/exports only when a dependency boundary requires it.
  6. Add focused tests for changed behavior, especially authorization, validation, transactions, and error paths.
  7. Run the repository's existing verification commands and report any command that cannot run.

Review Workflow

For NestJS reviews, prioritize findings in this order:

  1. Security and authorization bypasses.
  2. Input validation gaps and unsafe file handling.
  3. Broken DI/module exports, circular dependencies, and request-scope leaks.
  4. Transaction consistency, N+1 queries, and migration risks.
  5. API contract regressions and missing tests for changed behavior.

Give file and line references for findings. Avoid style-only comments unless they hide a maintainability or behavior risk.

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.