node-patterns

node-patterns is a skill for Claude Code from jdanigo/hydraia. It costs 65 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 — 51 skills, 15 commands, 26 agents, 4 hooks shipped together

Good fit Use it when creating or reviewing Node.js or TypeScript services, APIs, background…

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 51 skills, 15 commands, 26 agents, 4 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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 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.00065 $0.00636
Opus 5 $0.00032 $0.00318
Sonnet 5 $0.00013 $0.00127
Haiku 4.5 $0.00006 $0.00064

Measured 3d ago against content hash d0252ad8998a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 3d 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. 3d 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 17d ago), licensed MIT. It adds 65 tokens to every session and 636 once invoked, about $0.0003 per session on Opus 5. 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

nestjs-patterns

NestJS architecture patterns for modules, controllers, providers, DTO validation, guards, interceptors, config, and production-grade TypeScript backends.

affaan-m/ECC · 33 tokens

capability

Creates or modifies a capability class in domain/capabilities/ and its corresponding Has interface in domain/tools/contracts.ts. Use when adding a new tool runtime behavior (agents, skills, commands, rules, mcp, hooks, settings, plugins), changing the constructor params of an existing capability class, or wiring a new…

ai-driven-dev/framework · 122 tokens

typescript-expert

Expert-level TypeScript development with modern tooling, advanced types, and best practices. Use this skill for TypeScript projects requiring type-safe code, modern bundling, and comprehensive testing.

personamanagmentlayer/pcl · 40 tokens

nestjs

NestJS enterprise Node.js framework. Covers modules, controllers, services, guards, and dependency injection. Use when building scalable Node.js applications. USE WHEN: user mentions "NestJS", "nest", "@nestjs", "@Module", "@Controller", "@Injectable", asks about "dependency injection in Node.js", "enterprise Node.js…

claude-dev-suite/claude-dev-suite · 157 tokens

react-component-design

Designs or reviews React component APIs. Handles prop drilling decisions, composition patterns, controlled/uncontrolled contracts, and minimal public API surfaces for React 18+ TypeScript components. Invoked when creating new components, refactoring existing ones, or reviewing component contracts.

soulcodex/agentic · 56 tokens

nestjs-expert

Use when building NestJS applications requiring modular architecture, dependency injection, or TypeScript backend development. Invoke for modules, controllers, services, DTOs, guards, interceptors, TypeORM/Prisma.

zacklecon/claude-skills · 45 tokens