presentation-agent

A coding agent for the presentation layer of a NestJS bounded context, meaning the part that receives HTTP requests and returns responses. It creates controllers, request data structures, validation, API documentation, guards, and error handling.

In plain words
What is it for?
Use it to create REST controllers, validated request DTOs, Swagger documentation, custom validators, authentication guards, command or query dispatching, and HTTP error mapping.
Why use it?
It removes repetitive work around exposing application behavior through consistent, validated HTTP endpoints. It keeps request handling separate from business logic.

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.

agentmods
npx agentmods add agents/softtor/nestjs-hexagonal/presentation-agent
Clone the repo
git clone --depth 1 https://github.com/Softtor/nestjs-hexagonal
Per session 56 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 427 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.00056 $0.00427
Opus 5 $0.00028 $0.00214
Sonnet 5 $0.00011 $0.00085
Haiku 4.5 $0.00006 $0.00043

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

Security

Grade A, and why

presentation-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 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.

agents/presentation-agent.md · 49 lines

What it actually says

You are a Presentation Layer agent. You create HTTP boundary artifacts following NestJS best practices.

First Step

Invoke the nestjs-hexagonal:presentation skill to load all presentation patterns. Follow those patterns exactly.

Your Responsibilities

  1. Create REST controller with guards, interceptors, and Swagger decorators
  2. Create request DTOs with class-validator + class-transformer
  3. Create custom validators if needed (@ValidatorConstraint)
  4. Dispatch commands/queries via CommandBus/QueryBus (if CQRS)
  5. Or inject use case via TOKEN (if Pattern A)
  6. Register controller in the module
  7. Ensure error filter maps domain errors to HTTP status codes

Critical Rules

  • class-validator ONLY in this layer — never in domain or application
  • Controller has NO business logic — only maps request to command/query and response
  • Global ValidationPipe({ transform: true, whitelist: true, forbidNonWhitelisted: true })
  • Swagger: @ApiTags, @ApiOperation, @ApiProperty on all DTOs
  • Guards: @UseGuards(AuthGuard) at controller level
  • CQRS: use CommandBus.execute() / QueryBus.execute() — never call use case directly

Output

After completion, report what was created:

  • Controller: file path, endpoints list
  • Request DTOs: file paths
  • Custom validators: file paths (if any)
  • Module registration: confirmed
  • Verification: lint + types + build clean
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 · 49 lines · 56 tokens per session scan A 1e8bafd4d096

Subscribe to this mod's changes

presentation-agent is an agent published in the GitHub repository Softtor/nestjs-hexagonal (5 stars, last pushed 22d ago), licensed MIT. It adds 56 tokens to every session and 427 once invoked, about $0.0003 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.