using-nestjs-hexagonal

A routing guide for NestJS projects using hexagonal architecture, domain-driven design, or CQRS. NestJS is a Node.js framework; these approaches separate business rules from application and infrastructure code.

In plain words
What is it for?
Use it when creating or changing domains, entities, value objects, repositories, commands, queries, event handlers, WebSocket events, or other parts of a structured NestJS application.
Why use it?
It helps choose the appropriate specialist or development guide for architectural work instead of handling every NestJS task the same way.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/softtor/nestjs-hexagonal/using-nestjs-hexagonal
Any agent
npx skills add Softtor/nestjs-hexagonal --skill using-nestjs-hexagonal
Clone the repo
git clone --depth 1 https://github.com/Softtor/nestjs-hexagonal

Made for: Claude Code, Codex.

Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,921 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00093 $0.01921
Opus 5 $0.00046 $0.00960
Sonnet 5 $0.00019 $0.00384
Haiku 4.5 $0.00009 $0.00192

Measured 2d ago against content hash 6c5ed6210e96, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

using-nestjs-hexagonal scanned grade A with 0 findings 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/using-nestjs-hexagonal/SKILL.md · 158 lines

How it starts

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

Using NestJS Hexagonal

This is a routing skill. When working in a NestJS project that follows hexagonal architecture, check this skill FIRST to find the right tool for the job.


Detection — When Does This Plugin Apply?

This plugin applies when ANY of these are true:

  • Project has @nestjs/core and @nestjs/cqrs in dependencies
  • Project structure has domain/, application/, infrastructure/ layers
  • Files contain AggregateRoot, @EventsHandler, @CommandHandler, @QueryHandler
  • User mentions: entity, value object, bounded context, CQRS, hexagonal, DDD, aggregate
  • CLAUDE.md references nestjs-hexagonal skills

If detected, route ALL architectural tasks through this plugin's skills and agents.


Routing Table — What Are You Doing?

Creating or Modifying Code

Task Route to Type
Create new bounded context / module nestjs-hexagonal:create-subdomain Skill (orchestrator)
Create entity (AggregateRoot) nestjs-hexagonal:domain-agent Agent (Opus 5)
Create value object nestjs-hexagonal:domain Skill
Create domain event nestjs-hexagonal:domain Skill
Create repository interface nestjs-hexagonal:domain Skill
Create data builder (testing) nestjs-hexagonal:domain Skill
Create use case nestjs-hexagonal:application Skill
Create CQRS command/query handler nestjs-hexagonal:application Skill
Create DTO nestjs-hexagonal:application Skill
Create port (cross-module interface) nestjs-hexagonal:application Skill
Create Prisma repository nestjs-hexagonal:infrastructure Skill
Wire NestJS module nestjs-hexagonal:infrastructure Skill
Create adapter (port implementation) nestjs-hexagonal:infrastructure Skill
Create controller nestjs-hexagonal:presentation Skill
Create request DTO (class-validator) nestjs-hexagonal:presentation Skill
Create event listener (same-BC) nestjs-hexagonal:event-listeners Skill
Create event listener (cross-BC) nestjs-hexagonal:event-listeners Skill
Create WebSocket broadcast nestjs-hexagonal:websocket-broadcasting Skill
Create WS gateway nestjs-hexagonal:websocket-broadcasting Skill
Create frontend event consumer nestjs-hexagonal:broadcasting-agent Agent (Sonnet 5)

Read the full file on GitHub · 158 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. 2d ago First seen · 158 lines · 93 tokens per session scan A 6c5ed6210e96

Subscribe to this mod's changes

using-nestjs-hexagonal is a skill published in the GitHub repository Softtor/nestjs-hexagonal (5 stars, last pushed 22d ago), licensed MIT. It adds 93 tokens to every session and 1,921 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

design-patterns

Full-spectrum Design Patterns skill: Detect anti-patterns in existing codebases, diagnose architectural debt, propose optimal patterns (GoF, SOLID, DDD, CQRS, Microservices, Cloud), and generate production-ready boilerplate code. Optimized for Next.js, FastAPI, NestJS, Django, Express, and Go.

VoDaiLocz/Design-Patterns · 71 tokens

clean-architecture

Implement Clean Architecture combined with CQRS for scalable NestJS applications.

agency-skills/agency-skills-b · 16 tokens

new-skill

Scaffold a new brooks-lint analysis skill so it passes npm run validate and npm run evals on the first try — generates skills/{name}/SKILL.md (with the mandatory "Do NOT trigger for:" clause and a Process section citing guide step ranges) plus skills/{name}/{name}-guide.md (sequentially numbered steps), then appends…

hyhmrright/brooks-lint · 145 tokens

brooks-sweep

Full-sweep mode: runs a unified analysis across all quality dimensions — code decay, architecture, tech debt, and test quality — then applies fixes directly to the codebase. Safe changes are auto-applied; risky changes are confirmed before execution. Drawing on twelve classic engineering books. Triggers when: user…

hyhmrright/brooks-lint · 178 tokens

brooks-test

Test quality review drawing on twelve classic engineering books — with primary focus on xUnit Test Patterns, The Art of Unit Testing, How Google Tests Software, and Working Effectively with Legacy Code — that diagnoses structural problems in an existing test suite: brittleness, mock abuse, coverage illusions, slow…

hyhmrright/brooks-lint · 161 tokens

frontend-conventions

Frontend convention reference (SvelteKit / Svelte 5). Auto-injected into frontend-aware agents - not user-invocable.

fpindej/netrock · 27 tokens