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

senior-nodejs

Skill2 starsChanged 5 days agoMITView on GitHub

Use when designing, implementing, debugging, reviewing, or refactoring Node.js backends and tooling with Express, Fastify, Koa, or Hono in JavaScript or TypeScript, including middleware, validation, async error handling, streams, workers, ORMs (Prisma, Drizzle, TypeORM, Sequelize), package management, tests, or performance. For NestJS use senior-nestjs.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Follow existing structure.

    line 16
  2. Very specific:

    Do not block the event loop: avoid sync fs/crypto in request paths, large JSON.parse on hot paths, and CPU-heavy work without worker …

    line 21
  3. Distinctive:

    Use parameterized queries or the ORM's safe APIs.

    line 23
  4. Very specific:

    Read configuration from validated environment at startup.

    line 25
  5. Distinctive:

    Use structured logging with request IDs.

    line 26
  6. Very specific:

    Run type check, lint, unit tests, and API tests (supertest or framework inject).

    line 30

≈ “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 Node.js

Role

Build Node.js services that never block the event loop, handle every async failure, validate input at the edge, and shut down cleanly.

Before Editing

  1. Inspect Node version, module system (ESM/CommonJS), TypeScript config, framework, middleware order, validation library (zod, joi, ajv, TypeBox), ORM, logging (pino, winston), package manager and lockfile, and test runner (Vitest, Jest, node:test).
  2. Trace the request from route through middleware, validation, auth, handler, data access, external calls, and error handler.
  3. Follow existing structure; do not add a framework, DI container, or new ORM for one change.

Implementation Rules

  • Handle async errors on every path: await promises, forward errors to the framework's error handler (Express 4 needs next(err) or a wrapper), and never leave floating promises.
  • Do not block the event loop: avoid sync fs/crypto in request paths, large JSON.parse on hot paths, and CPU-heavy work without worker threads or a queue.
  • Validate and type request input with a schema at the boundary; never trust req.body, query, or headers.
  • Use parameterized queries or the ORM's safe APIs; avoid N+1 queries and unbounded result sets.
  • Set timeouts on outbound HTTP (AbortSignal.timeout), limit body sizes, apply rate limiting and security headers where the service is exposed.
  • Read configuration from validated environment at startup; never commit secrets. Handle SIGTERM with graceful shutdown that drains connections.
  • Use structured logging with request IDs; never log tokens, passwords, or personal data.

Testing and Verification

Run type check, lint, unit tests, and API tests (supertest or framework inject). Use npm audit or the project's dependency check for changed dependencies. Measure with --cpu-prof or clinic for performance changes.

Review Checklist

  • Is every promise awaited or deliberately handled, with errors reaching the error handler?
  • Can any request block the event loop?
  • Is input validated and output shaped before leaving the service?
  • Are dependencies, lockfile, and module format changes intentional?

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.