behavioral-generator

behavioral-generator is an agent for Claude Code from dykyi-roman/awesome-claude-code. It costs 50 tokens per session (1,477 once invoked), scanned A, original, MIT.

A PHP 8.4 code generator for common behavioral design patterns, such as Strategy, State, and Decorator. It creates reusable components that control how objects behave.

In plain words
What is it for?
Use it to generate PHP components for interchangeable algorithms, state machines, request chains, wrappers, default no-op behavior, and other listed patterns.
Why use it?
It removes the need to write these pattern structures from scratch when behavior changes by state, workflow, or selected algorithm.

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/behavioral-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 behavioral-generator

README.md
[![agentmods](https://agentmods.dev/badge/agents/dykyi-roman/awesome-claude-code/behavioral-generator.svg)](https://agentmods.dev/agents/dykyi-roman/awesome-claude-code/behavioral-generator)
Your own site
<a href="https://agentmods.dev/agents/dykyi-roman/awesome-claude-code/behavioral-generator"><img src="https://agentmods.dev/badge/agents/dykyi-roman/awesome-claude-code/behavioral-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,477 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.00050 $0.01477
Opus 5 $0.00025 $0.00739
Sonnet 5 $0.00010 $0.00295
Haiku 4.5 $0.00005 $0.00148

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

Security

Grade A, and why

behavioral-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/behavioral-generator.md · 219 lines

How it starts

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

Behavioral Patterns Generator

You are an expert code generator for behavioral patterns in PHP 8.4 projects. You create Strategy, State, Chain of Responsibility, Decorator, Null Object, Template Method, Visitor, Iterator, and Memento patterns following DDD and Clean Architecture principles.

Pattern Detection Keywords

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

Strategy Pattern

  • "strategy", "algorithm", "interchangeable"
  • "payment processor", "shipping calculator"
  • "switch on type", "conditional algorithm"

State Pattern

  • "state", "state machine", "transitions"
  • "order status", "workflow", "lifecycle"
  • "switch on status", "state-dependent behavior"

Chain of Responsibility

  • "chain of responsibility", "middleware", "handler chain"
  • "request pipeline", "validation chain"
  • "pass to next", "process or delegate"

Decorator Pattern

  • "decorator", "wrapper", "logging decorator"
  • "caching decorator", "dynamic behavior"
  • "add functionality", "compose behavior"

Null Object Pattern

  • "null object", "null check elimination"
  • "default behavior", "no-op implementation"
  • "avoid null checks", "safe default"

Template Method Pattern

  • "template method", "algorithm skeleton", "hooks"
  • "base class with steps", "override steps"
  • "data importer", "report generator"

Visitor Pattern

  • "visitor", "double dispatch", "accept method"
  • "operations on elements", "external operations"
  • "export visitor", "calculator visitor"

Iterator Pattern

  • "iterator", "collection", "sequential access"
  • "traversal", "aggregate iteration"
  • "filtered collection", "paginated results"

Memento Pattern

  • "memento", "undo", "redo", "snapshot"
  • "state saving", "state restoration"
  • "history", "checkpoint", "rollback"

Generation Process

Step 1: Analyze Existing Structure

# Check existing structure
Glob: src/Domain/**/*.php
Glob: src/Application/**/*.php

# Check for existing patterns
Grep: "Strategy|State|Handler|Decorator|NullObject" --glob "**/*.php"

# Identify namespaces
Read: composer.json (for PSR-4 autoload)

Read the full file on GitHub · 219 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 · 219 lines · 50 tokens per session scan A 75496519eaf4

Subscribe to this mod's changes

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

PHP MCP Expert

Expert assistant for PHP MCP server development using the official PHP SDK with attribute-based discovery.

github/awesome-copilot · 20 tokens

php-developer

Write idiomatic PHP code with design patterns, SOLID principles, and modern best practices. Implements PSR standards, dependency injection, and comprehensive testing. Use PROACTIVELY for PHP architecture, refactoring, or implementing design patterns.

davepoon/buildwithclaude · 51 tokens

symfony-tdd-coach

Guides TDD workflow for Symfony projects using Pest PHP or PHPUnit. Drives strict RED-GREEN-REFACTOR cycles with proper test isolation, Foundry factories, and regression protection. Use when writing tests, adding test coverage, or practicing TDD.

dev-toolings/superpowers-symfony · 58 tokens

php-expert

Use when: composer.json present WITHOUT an artisan file. Do NOT use for: Laravel apps (composer.json + artisan → laravel-expert), frontend (framework experts).

fusengine/agents · 38 tokens

laravel-developer

Use this agent to implement features end-to-end in Laravel apps — models, migrations, Actions, services, Livewire/Flux components, policies, and the accompanying Pest tests. The build-phase workhorse; delegate a well-scoped feature and get working, tested code back.

nasrulhazim/claude · 60 tokens

package-maintainer

Use this agent for anything in /Packages — scaffolding new Laravel packages, upgrading dependencies or Laravel/PHP version constraints, running Testbench tests, updating CHANGELOG and README, preparing releases, and publishing to Packagist. Safe to fan out in parallel across multiple packages.

nasrulhazim/claude · 59 tokens