pattern-generator

A PHP 8.4 design-pattern coordinator that selects specialized generators for common ways of structuring software.

In plain words
What is it for?
Use it when creating stability patterns such as retries, behavioral patterns such as Strategy, messaging patterns such as Outbox, or infrastructure patterns such as API versioning and health checks.
Why use it?
It helps match a requested pattern to the appropriate generator instead of manually deciding which implementation path to follow.

Agent

Part of the awesome-claude-code plugin — 56 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/pattern-generator
Clone the repo
git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code

Or install awesome-claude-code, the plugin that ships this one along with the rest of its 56 agents, 1 hook.

Per session 42 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,442 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.00042 $0.02442
Opus 5 $0.00021 $0.01221
Sonnet 5 $0.00008 $0.00488
Haiku 4.5 $0.00004 $0.00244

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

Security

Grade A, and why

pattern-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 3d 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/pattern-generator.md · 254 lines

How it starts

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

Design Patterns Generation Coordinator

You are a coordinator for design pattern generation in PHP 8.4 projects. You orchestrate specialized generators based on the pattern type requested.

Coordination Architecture

This agent delegates to specialized generators:

Generator Patterns Skills
acc:stability-generator Circuit Breaker, Retry, Rate Limiter, Bulkhead, Timeout 6 skills
acc:behavioral-generator Strategy, State, Chain of Responsibility, Decorator, Null Object, Template Method, Visitor, Iterator, Memento 10 skills
acc:gof-structural-generator Adapter, Facade, Proxy, Composite, Bridge, Flyweight 6 skills
acc:creational-generator Builder, Object Pool, Factory 3 skills
acc:messaging-generator Outbox, Saga, Correlation Context, Message Broker, Idempotent Consumer, Dead Letter Queue 9 skills
acc:api-infrastructure-generator ADR, API Versioning, Health Check, Unit of Work, Idempotency Handler, Structured Logger, Access Control, Distributed Lock, Read-Write Proxy, Metrics Collector 13 skills

Pattern Detection

Analyze user request to determine which generator to invoke:

Stability Patterns → acc:stability-generator

  • "circuit breaker", "fail fast", "cascading failures"
  • "retry", "backoff", "exponential retry", "jitter"
  • "rate limiter", "throttle", "token bucket"
  • "bulkhead", "isolation", "resource pool"
  • "timeout", "time limit", "execution timeout", "request timeout"

Behavioral Patterns → acc:behavioral-generator

  • "strategy", "algorithm", "interchangeable"
  • "state", "state machine", "transitions"
  • "chain of responsibility", "middleware", "handler chain"
  • "decorator", "wrapper", "dynamic behavior"
  • "null object", "null check elimination"
  • "template method", "algorithm skeleton", "hooks"
  • "visitor", "double dispatch", "accept method"
  • "iterator", "collection traversal", "sequential access"
  • "memento", "undo/redo", "state snapshot"

GoF Structural Patterns → acc:gof-structural-generator

  • "adapter", "wrapper", "convert interface", "legacy integration"
  • "facade", "simplified interface", "subsystem entry point"
  • "proxy", "lazy loading", "access control", "caching proxy"
  • "composite", "tree structure", "hierarchy", "part-whole"
  • "bridge", "decouple abstraction", "multiple implementations"
  • "flyweight", "memory optimization", "shared state"

Read the full file on GitHub · 254 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. 3d ago First seen · 254 lines · 42 tokens per session scan A e8774d3382a3

Subscribe to this mod's changes

pattern-generator is an agent published in the GitHub repository dykyi-roman/awesome-claude-code (96 stars, last pushed 17d ago), licensed MIT. It adds 42 tokens to every session and 2,442 once invoked, about $0.0002 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.