create-subdomain

An orchestration skill for building a NestJS bounded context across domain, application, infrastructure, and presentation layers. It gathers requirements, dispatches specialized agents, and supports GSD phases and test-driven development, where tests are written before implementation.

In plain words
What is it for?
Use it to create a complete NestJS bounded context with domain models, use cases or CQRS handlers, persistence, HTTP endpoints, tests, and optional real-time or cross-module integrations.
Why use it?
It removes the need to coordinate each architectural layer and agent manually. It provides a defined sequence for deciding entities, events, modules, access rules, and integrations.

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/create-subdomain
Any agent
npx skills add Softtor/nestjs-hexagonal --skill create-subdomain
Clone the repo
git clone --depth 1 https://github.com/Softtor/nestjs-hexagonal

Made for: Claude Code, Codex.

Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,845 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.00078 $0.01845
Opus 5 $0.00039 $0.00923
Sonnet 5 $0.00016 $0.00369
Haiku 4.5 $0.00008 $0.00185

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

Security

Grade A, and why

create-subdomain 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/create-subdomain/SKILL.md · 227 lines

How it starts

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

create-subdomain

Orchestrator that dispatches specialized agents per architectural layer. Each agent loads its corresponding skill and follows TDD.

Agent Dispatch: The dispatch blocks below are conceptual templates. In Claude Code, dispatch agents using the Agent tool with a prompt string that includes "Load skill nestjs-hexagonal: for patterns." The agent's model and tools are defined in the agent .md file frontmatter, not in the tool call.

Compatible with GSD: each phase maps to a GSD execution step.


Phase 1 — Requirements Gathering (inline)

Ask the user via AskUserQuestion. Collect all answers before dispatching agents.

  1. Bounded context name and business purpose?
  2. Main entities? Which is the aggregate root?
  3. Value objects needed? (money, status, email, document, etc.)
  4. Domain events? (created, updated, status-changed, cancelled)
  5. Multi-tenant? Field name? (organizationId or companyId)
  6. CQRS pattern? (A: plain UseCase, B: Command/Query, C: Handler as Orchestrator)
  7. RBAC guards on endpoints?
  8. Sub-modules? (e.g., subscription -> plans, payments, core)
  9. Cross-module ports needed? (which existing modules to communicate with)
  10. Read model projection in Redis? (CQRS R/W separation)

After answers, create the directory structure:

<context>/
├── domain/
│   ├── entities/__tests__/
│   ├── value-objects/__tests__/
│   ├── events/
│   ├── repositories/
│   ├── services/
│   └── testing/helpers/
├── application/
│   ├── dtos/
│   ├── commands/          # Pattern B/C
│   ├── queries/           # Pattern B/C
│   ├── usecases/          # Pattern A/C
│   └── ports/
└── infrastructure/
    ├── <context>.module.ts
    ├── controllers/dtos/
    ├── database/prisma/repositories/
    ├── database/prisma/models/
    ├── database/in-memory/repositories/
    ├── adapters/
    └── listeners/

Phase 2 — Domain Layer via domain-agent (Claude Opus 5)

Dispatch the domain-agent with context from Phase 1:

Agent tool:
  subagent_type: "nestjs-hexagonal:domain-agent"
  model: claude-opus-5
  prompt: |
    Create domain layer for "<context>" at "<path>".
    Entity: <name>, Props: <list>
    VOs: <list>, Events: <list>
    Multi-tenant: <field>
    TDD: tests first. Load skill nestjs-hexagonal:domain.

Read the full file on GitHub · 227 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 227 lines · 78 tokens per session scan A 3eaa439383d5

Subscribe to this mod's changes

create-subdomain is a skill published in the GitHub repository Softtor/nestjs-hexagonal (5 stars, last pushed 22d ago), licensed MIT. It adds 78 tokens to every session and 1,845 once invoked, about $0.0004 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