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.
npx skills add jdanigo/hydraia --skill node-patternsgit clone --depth 1 https://github.com/jdanigo/hydraiaWrote 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.
[](https://agentmods.dev/skills/jdanigo/hydraia/node-patterns)<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>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.
| Model | Per session | Once 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 |
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. 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}.tsbeatssrc/{routes,services,repos}/orders.tsscattered 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
AbortSignalthrough 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.allfor independent work,for…of awaitwhen 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.tsexports the parsed object; nothing else readsprocess.env.
Errors
- Central error taxonomy:
AppErrorsubtypes 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",tsconfigmodule, and tooling. Mixed default/named interop errors are config bugs, not code bugs. __dirnamedoes not exist in ESM —import.meta.url+fileURLToPath.
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.
- 3d ago First seen · 48 lines · 0 tokens per session scan A d0252ad8998a
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.
Other skills, from other repositories
nestjs-patterns
NestJS architecture patterns for modules, controllers, providers, DTO validation, guards, interceptors, config, and production-grade TypeScript backends.
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…
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.
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…
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.
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.