node-patterns

node-patterns is a skill for Claude Code from jdanigo/hydraia. It costs 0 tokens per session (636 once invoked), scanned A, original, MIT.

A set of patterns for building Node.js and TypeScript backend services, APIs, and workers with frameworks such as Express, Fastify, or NestJS. It covers project structure, asynchronous code, configuration, errors, and testing.

In plain words
What is it for?
Use it when creating or reviewing Node.js or TypeScript services, APIs, background workers, and their tests.
Why use it?
It helps prevent unhandled promises, blocking request handlers, invalid configuration, unclear errors, and scattered backend logic.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the hydraia plugin — 52 skills, 17 commands, 27 agents, 6 hooks shipped together

Good fit Use it when creating or reviewing Node.js or TypeScript services, APIs, background workers, and their tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jdanigo/hydraia/node-patterns
Install

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.

Any agent
npx skills add jdanigo/hydraia --skill node-patterns
Clone the repo
git clone --depth 1 https://github.com/jdanigo/hydraia

Made for: Claude Code.

Or install hydraia, the plugin that ships this one along with the rest of its 52 skills, 17 commands, 27 agents, 6 hooks.

Wrote 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.

agentmods badge for node-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/jdanigo/hydraia/node-patterns/github.svg)](https://agentmods.dev/skills/jdanigo/hydraia/node-patterns)
Your own site
<a href="https://agentmods.dev/skills/jdanigo/hydraia/node-patterns"><img src="https://agentmods.dev/badge/skills/jdanigo/hydraia/node-patterns/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.

agentmods 80×15 button for node-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/jdanigo/hydraia/node-patterns"><img src="https://agentmods.dev/badge/skills/jdanigo/hydraia/node-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 636 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00636
Opus 5.5 $0.00000 $0.00254
Sonnet 5.5 $0.00000 $0.00127
Haiku 4.5 $0.00000 $0.00064

Measured 1mo ago against content hash d0252ad8998a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

node-patterns scanned grade A with 1 finding 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 1mo 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- No sync I/O (`readFileSync`, `execSync`) on request paths — boot time only.
skills/node-patterns/SKILL.md · 48 lines

How it starts

The opening of the file, as written. The whole thing — 48 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Node/TypeScript Backend Patterns

Project layout

  • Feature folders over layer folders: src/orders/{orders.router,orders.service,orders.repo,orders.test}.ts beats src/{routes,services,repos}/orders.ts scattered three places.
  • One composition root (src/app.ts) wires everything; entry (src/main.ts) only boots. Handlers stay thin — parse/validate → service call → shape response.

Async discipline

  • No floating promises: every promise is awaited, returned, or explicitly void-ed with a comment. Unhandled rejection = crash in modern Node.
  • Propagate AbortSignal through request-scoped work (fetch, DB timeouts); cancel on client disconnect for expensive handlers.
  • No sync I/O (readFileSync, execSync) on request paths — boot time only.
  • Concurrency with intent: Promise.all for independent work, for…of await when order matters, a limiter (p-limit) when fan-out is unbounded.

Config

  • Typed and validated at boot (zod or equivalent): missing/invalid env kills the process at startup with a clear message — never process.env.X! scattered through the codebase.
  • One config.ts exports the parsed object; nothing else reads process.env.

Errors

  • Central error taxonomy: AppError subtypes with status + code (NotFound, Validation, Conflict, Upstream). Handlers throw domain errors; ONE error middleware maps them to responses (problem+json shape).
  • Never catch (e) {} — swallow nothing; wrap-and-rethrow with context or let it propagate.

DI boundaries

  • NestJS: providers with explicit scopes; beware request-scoped bleeding into singletons.
  • Express/Fastify: manual factories — services take dependencies as constructor/args, never import singletons directly. Makes the testing shape below possible.

ESM/CJS pitfalls

  • Pick ONE module system per package and align "type", tsconfig module, and tooling. Mixed default/named interop errors are config bugs, not code bugs.
  • __dirname does not exist in ESM — import.meta.url + fileURLToPath.

Read the full file on GitHub · 48 lines

Changes

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.

  1. 1mo ago First seen · 48 lines · 0 tokens per session scan A d0252ad8998a

Subscribe to this mod's changes

node-patterns is a skill published in the GitHub repository jdanigo/hydraia (8 stars, last pushed 29d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 636 tokens. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

ia-nodejs-backend

Node.js backend patterns: layered architecture, TypeScript, validation, error handling, security, observability, logging, metrics, deployment. Use when building REST APIs, REST endpoints, middleware, Express/Fastify/Hono/NestJS/Koa servers, tRPC procedures, Bun servers, or server-side TypeScript.

iliaal/whetstone · 70 tokens

better-auth

Skill for integrating Better Auth - comprehensive TypeScript authentication framework for Cloudflare D1, Next.js, Nuxt, and 15+ frameworks. Use when adding auth, encountering D1 adapter errors, or implementing OAuth/2FA/RBAC features.

secondsky/claude-skills · 53 tokens

python-services

Python patterns for CLI tools, async parallelism, and backend services. Use when building CLI apps, async/parallel Python, FastAPI services, background jobs, or configuring Python project tooling (uv, ruff, ty).

iliaal/whetstone · 48 tokens

react-frontend

React, TypeScript, and Next.js patterns for frontend development. Use when building React components, managing state, fetching data, optimizing performance, or working with Next.js App Router. Covers React 18-19, hooks, Server Components, and type-safe patterns.

iliaal/whetstone · 57 tokens

php-laravel

Modern PHP 8.2+ and Laravel patterns: architecture, Eloquent, queues, Pest testing. Use when asked to "write PHP", "build a Laravel app", "fix Eloquent query", "add a queue job", "write a Pest test", or mentions PHP, Laravel, Eloquent, Blade, artisan, or migrations.

iliaal/whetstone · 74 tokens

ia-php-laravel

Modern PHP 8.4 and Laravel patterns: architecture, Eloquent, migrations, queues, testing. Use when working with Laravel, Eloquent, Blade, artisan, or building/testing a framework-based PHP app. Not for php-src internals, standalone PHP libraries, or general PHP language discussion.

iliaal/whetstone · 67 tokens