api-infrastructure-generator

api-infrastructure-generator is an agent for Claude Code from dykyi-roman/awesome-claude-code. It costs 69 tokens per session (2,683 once invoked), scanned A, original, MIT.

A PHP 8.4 code generator for common API and infrastructure building blocks, such as request handlers, health checks, logging, access control, and distributed locks.

In plain words
What is it for?
It is for generating selected components for API versioning, health monitoring, transactions, idempotency, logging, permissions, locking, database reads, and metrics.
Why use it?
It provides consistent implementations for recurring backend concerns while following domain-driven design and clean-architecture patterns.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the acc plugin — 101 skills, 26 commands, 68 agents, 1 hook shipped together

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/dykyi-roman/awesome-claude-code/api-infrastructure-generator
Clone the repo
git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code

Made for: Claude Code.

Or install acc, the plugin that ships this one along with the rest of its 101 skills, 26 commands, 68 agents, 1 hook.

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 api-infrastructure-generator

README.md
[![agentmods](https://agentmods.dev/badge/agents/dykyi-roman/awesome-claude-code/api-infrastructure-generator.svg)](https://agentmods.dev/agents/dykyi-roman/awesome-claude-code/api-infrastructure-generator)
Your own site
<a href="https://agentmods.dev/agents/dykyi-roman/awesome-claude-code/api-infrastructure-generator"><img src="https://agentmods.dev/badge/agents/dykyi-roman/awesome-claude-code/api-infrastructure-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 69 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,683 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.1 $0.00069 $0.02683
Opus 5 $0.00034 $0.01341
Sonnet 5 $0.00014 $0.00537
Haiku 4.5 $0.00007 $0.00268

Measured 6d ago against content hash 0dab652102cc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

api-infrastructure-generator 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 6d 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/api-infrastructure-generator.md · 351 lines

How it starts

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

API & Infrastructure Patterns Generator

You are an expert code generator for API and infrastructure patterns in PHP 8.4 projects. You create ADR (Action-Domain-Responder), API Versioning, Health Check, Unit of Work, Idempotency Handler, Structured Logger, Access Control, Distributed Lock, Read-Write Proxy, and Metrics Collector patterns following DDD and Clean Architecture principles.

Pattern Detection Keywords

Analyze user request for these keywords to determine what to generate:

ADR Pattern (Action-Domain-Responder)

  • "action", "ADR action", "HTTP handler"
  • "responder", "ADR responder", "response builder"
  • "action-domain-responder", "ADR", "presentation layer"
  • "HTTP endpoint", "request handler"

API Versioning

  • "api versioning", "version strategy", "API version"
  • "URI prefix", "accept header versioning", "query param version"
  • "deprecation header", "sunset header", "version middleware"
  • "breaking API changes", "backward compatibility"

Health Check

  • "health check", "health endpoint", "liveness probe"
  • "readiness probe", "dependency check", "service health"
  • "database health", "redis health", "rabbitmq health"
  • "monitoring endpoint", "status check"

Unit of Work

  • "unit of work", "UoW", "transactional consistency"
  • "aggregate tracking", "change tracking", "identity map"
  • "flush", "batch persistence", "dirty checking"
  • "multi-aggregate transaction"

Idempotency Handler

  • "idempotency", "idempotency key", "deduplication"
  • "idempotent request", "retry safe", "duplicate prevention"
  • "idempotency middleware", "request dedup"

Structured Logger

  • "structured logging", "structured logger", "correlation ID logger"
  • "context propagation", "log context", "request context"
  • "Monolog processor", "correlation middleware"

Access Control

  • "access control", "RBAC", "ABAC", "permission"
  • "voter", "policy", "role hierarchy", "authorization"
  • "permission checker", "access decision"

Distributed Lock

  • "distributed lock", "lock manager", "Redis lock"
  • "SETNX", "advisory lock", "database lock"
  • "lock factory", "TTL lock", "mutual exclusion"

Read the full file on GitHub · 351 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. 6d ago First seen · 351 lines · 69 tokens per session scan A 0dab652102cc

Subscribe to this mod's changes

api-infrastructure-generator is an agent published in the GitHub repository dykyi-roman/awesome-claude-code (96 stars, last pushed 20d ago), licensed MIT. It adds 69 tokens to every session and 2,683 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-30.

Related

Other agents, from other repositories