infrastructure-agent

infrastructure-agent is an agent for Claude Code from Softtor/nestjs-hexagonal. It costs 61 tokens per session (988 once invoked), scanned A, original, MIT.

A coding agent for the infrastructure layer of a NestJS bounded context, meaning the part that connects business code to databases, frameworks, and outside systems. It creates repositories, data mappings, module wiring, adapters, and event handlers.

In plain words
What is it for?
Use it to create Prisma or in-memory repositories, model mappers, NestJS module configuration, adapters, and infrastructure event handlers.
Why use it?
It removes repetitive work when connecting a domain model to Prisma, tests, NestJS modules, or event-driven infrastructure. It keeps persistence and external connections separated from business rules.

Agent for Claude Code

Written for Claude Code: SubagentStop hook event. Also seen: model in frontmatter.

Part of the nestjs-hexagonal plugin — 12 skills, 9 agents, 4 hooks shipped together

Good fit Use it to create Prisma or in-memory repositories, model mappers, NestJS module configuration, adapters, and infrastructure event handlers.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/softtor/nestjs-hexagonal/infrastructure-agent
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.

Clone the repo
git clone --depth 1 https://github.com/Softtor/nestjs-hexagonal

Made for: Claude Code.

Or install nestjs-hexagonal, the plugin that ships this one along with the rest of its 12 skills, 9 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 infrastructure-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/softtor/nestjs-hexagonal/infrastructure-agent/github.svg)](https://agentmods.dev/agents/softtor/nestjs-hexagonal/infrastructure-agent)
Your own site
<a href="https://agentmods.dev/agents/softtor/nestjs-hexagonal/infrastructure-agent"><img src="https://agentmods.dev/badge/agents/softtor/nestjs-hexagonal/infrastructure-agent/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 infrastructure-agent

Your own site · 80×15
<a href="https://agentmods.dev/agents/softtor/nestjs-hexagonal/infrastructure-agent"><img src="https://agentmods.dev/badge/agents/softtor/nestjs-hexagonal/infrastructure-agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 988 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00061 $0.00988
Opus 5.5 $0.00024 $0.00395
Sonnet 5.5 $0.00012 $0.00198
Haiku 4.5 $0.00006 $0.00099

Measured 12d ago against content hash 3206c65450f8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

infrastructure-agent 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 12d 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.

agents/infrastructure-agent.md · 76 lines

How it starts

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

You are an Infrastructure Layer agent. You create infrastructure artifacts following Hexagonal Architecture + Ports & Adapters patterns.

Where the rules come from

  • Rulebook slice (authoritative). When the project opted in (.claude/rulebook.yaml), the SubagentStart hook of this plugin injects the slice of the composed rulebook for the infrastructure and presentation layer(s) as additional context: rule ids, titles, severity and the fix of every FAIL rule. Treat that slice as the contract for this run; it already reflects the project's own rules and overrides. Without a slice (project not opted in), the rules in this file and in the skill still apply.
  • Layer skill (patterns and references). Load nestjs-hexagonal:infrastructure for the code patterns, templates and references. The skill shows how to write the code; the rulebook decides what is accepted.

Your Responsibilities

  1. Create Prisma repository (pure persistence — save, find, search, delete)
  2. Create model mapper (static toEntity() using Entity.restore(), toModel())
  3. Create in-memory repository for unit tests
  4. Wire NestJS module (providers, useFactory, exports ONLY Port tokens)
  5. Create adapters implementing port interfaces
  6. Create @EventsHandler for event-driven side effects (projections, notifications)
  7. Write integration tests with real database (if applicable)

Critical Rules

  • Repository is PURE persistence — NO event dispatch, NO knowledge of events
  • Events are committed by the Handler via await events.from(entity).publish(), NEVER by repository
  • Module exports ONLY Port tokens — never use cases, never repositories
  • Adapters use { provide: TOKEN, useExisting: AdapterClass }
  • Use useFactory + inject for use case/handler registration
  • Entity.restore() in mapper — never Entity.create() (avoids event emission)

When the SubagentStop hook blocks

The SubagentStop hook runs the full static rulebook over the files you touched. If it blocks your stop, its reason lists files, rule ids, evidence and the fix text.

Read the full file on GitHub · 76 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. 12d ago Changed · +4 lines 3206c65450f8
  2. 1mo ago Changed · +20 lines 82474d3af473
  3. 1mo ago First seen · 52 lines · 61 tokens per session scan A ef4156239f5c

Subscribe to this mod's changes

infrastructure-agent is an agent published in the GitHub repository Softtor/nestjs-hexagonal (5 stars, last pushed 12d ago), licensed MIT. It adds 61 tokens to every session and 988 once invoked, about $0.0002 per session on Opus 5.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 agents, from other repositories

genpage-entity-builder

Creates Dataverse entities (tables, columns, relationships, choices) specified in genpage-plan.md using the plugin's Node.js Web API scripts. Handles dependency ordering, propagation delays, sample data creation (with $batch bulk), and solution membership. Called by the genpage skill when new entities need creating …

microsoft/power-platform-skills · 122 tokens

api-platform-builder

Creates and configures API Platform resources with operations, DTOs, state providers, processors, and security. Handles full resource scaffolding from entity to tested API endpoint. Use for building APIs, creating resources, or configuring API Platform.

dev-toolings/superpowers-symfony · 50 tokens

doctrine-architect

Designs Doctrine entity schemas, relationships, and migration strategies. Analyzes existing entities, proposes schema changes, and plans migration paths before implementation. Use for entity design, relationship modeling, or migration planning.

dev-toolings/superpowers-symfony · 46 tokens

symfony-engineer

Implements Symfony application code following framework best practices, drawing on the superpowers-symfony skill library. Use for general Symfony coding — controllers, services, dependency injection, value objects/DTOs, forms, Twig components, configuration — when no more specialized agent (api-platform-builder…

dev-toolings/superpowers-symfony · 76 tokens

doctrine-performance-optimizer

Read-only performance audit of Doctrine usage: N+1 queries, fetch modes, batch processing, missing indexes, and caching opportunities. Use proactively after adding entities, relations, repository queries, or when a page/endpoint is reported slow.

dev-toolings/superpowers-symfony · 53 tokens

migration-specialist

Database and framework migration expert — zero-downtime schema changes, data backfills, version upgrades, legacy-to-modern rewrites.

TheBeardedBearSAS/claude-craft · 29 tokens