architecture-patterns

architecture-patterns is a skill for Claude Code, Codex from garrettw/php-arch-skills. It costs 77 tokens per session (1,355 once invoked), scanned A, original, MPL-2.0.

Guidance for choosing the overall structure of a PHP application, such as a monolith, modular monolith, microservices, event-driven system, serverless system, clean architecture, or domain-driven design. It bases the choice on the application's size, complexity, workload, and business needs.

In plain words
What is it for?
Use it when starting or growing a PHP application and deciding how its major parts should be organized, deployed, and scaled.
Why use it?
It helps avoid choosing a complicated distributed design before the application's boundaries and needs are clear. It also highlights common architecture decisions teams later regret.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

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 skills/garrettw/php-arch-skills/architecture-patterns
Any agent
npx skills add garrettw/php-arch-skills --skill architecture-patterns
Clone the repo
git clone --depth 1 https://github.com/garrettw/php-arch-skills

Made for: Claude Code, Codex.

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 architecture-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/garrettw/php-arch-skills/architecture-patterns.svg)](https://agentmods.dev/skills/garrettw/php-arch-skills/architecture-patterns)
Your own site
<a href="https://agentmods.dev/skills/garrettw/php-arch-skills/architecture-patterns"><img src="https://agentmods.dev/badge/skills/garrettw/php-arch-skills/architecture-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,355 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.00077 $0.01355
Opus 5 $0.00039 $0.00678
Sonnet 5 $0.00015 $0.00271
Haiku 4.5 $0.00008 $0.00136

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

Security

Grade A, and why

architecture-patterns 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.

skills/architecture-patterns/SKILL.md · 73 lines

How it starts

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

Choosing an Architecture

This skill is about the system-level decision: which architecture style fits this application before you are deep into one. It does not redefine the individual patterns — those live in their own skills (linked below). Its job is to help you pick, and to warn you off the moves that teams most often regret.

Decision Guide

Answer in order; the first matching branch wins.

START
  │
  ├─ Team is small (< 10) and domain is simple/CRUD?  ──────→ Monolith (or Modular Monolith)
  │
  ├─ Need independent deploy/scale per business area?  ─────→ Microservices (only once boundaries are clear)
  │
  ├─ Audit trail / temporal query required?  ───────────────→ Event Sourcing
  │   (see `event-sourcing`, `domain-events`)
  │
  ├─ Variable / unpredictable load, bursty work?  ──────────→ Serverless (for the bursty parts)
  │
  ├─ Complex business logic with many invariants?  ─────────→ Clean / Hexagonal + DDD
  │   (see `domain-modeling`, `application-layer`, `infrastructure-boundaries`)
  │
  ├─ High-read workload, reads and writes diverge?  ────────→ CQRS (often with Event Sourcing)
  │   (see `application-layer`, `distribution-patterns`)
  │
  └─ Default  ──────────────────────────────────────────────→ Modular Monolith

How to read the branches

  • Monolith / Modular Monolith is the right default for most teams. A modular monolith organizes code by business capability (feature folders) with explicit module boundaries, so you can later extract a service without a rewrite. Prefer this unless a branch above clearly applies.
  • Microservices earn their cost only when you have (a) clear, stable bounded contexts and (b) a real need to deploy or scale them independently. Without both, they add distributed-systems complexity for no benefit.
  • Event-Driven / Event Sourcing / CQRS are patterns for specific needs (auditability, temporal queries, read/write divergence) — not a default. See event-sourcing and domain-events before reaching for them.
  • Clean / Hexagonal + DDD is about internal structure (dependencies point inward, domain at the center, ports & adapters at the edge). It pairs with any of the above deployment styles. The boundary-protection patterns that realize it are catalogued in distribution-patterns (boundary-protection-patterns.md).
  • Serverless suits bursty, stateless work; it is rarely the whole system. Keep functions small and push state to external stores.

Read the full file on GitHub · 73 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 · 73 lines · 77 tokens per session scan A 91c83197e81e

Subscribe to this mod's changes

architecture-patterns is a skill published in the GitHub repository garrettw/php-arch-skills (11 stars, last pushed 1mo ago), licensed MPL-2.0. It adds 77 tokens to every session and 1,355 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

php-rules

PHP coding rules: style, patterns, security, testing. Triggers: .php, composer.json, Laravel, Symfony, PHPUnit, PSR-12, Composer.

softspark/ai-toolkit · 38 tokens

symfony:daily-workflow

Daily development workflow for Symfony projects including common tasks, debugging, and productivity tips.

dev-toolings/superpowers-symfony · 22 tokens

laravel

Laravel mastery skill. Eloquent ORM, service container, queues, events, Sanctum/Passport auth, Pest testing. Triggers on: /godmode:laravel, "laravel app", "eloquent", "artisan", "blade".

arbazkhan971/godmode · 52 tokens

bun-api

Bun runtime API reference for TypeScript scripts. Covers Bun.serve() HTTP/HTTP/2 server with routes and WebSockets, fetch() transport options, Bun.file(), Bun.write(), Bun.$() shell, Bun.spawn(), Bun.Glob, Bun.env, bun:sqlite, Bun.sql() for PostgreSQL/MySQL via DATABASEURL, Bun.s3 for S3-compatible storage, Bun.redis…

dmythro/agent-skills · 250 tokens

deps-upgrade

Validate JavaScript/TypeScript dependency upgrades after an interactive or manual update. Establish the real delta from git, detect peer/engine/type conflicts, extract breaking changes, migrations and adoptable features from release notes, assess held-back or seemingly unused packages, and run verification gates.…

dmythro/agent-skills · 134 tokens

typescript-guardian

Focuses specifically on TypeScript type safety - any usage, unsound generics, interface design, and type narrowing. Use for a deep type-system review, not general code quality.

codebygarv/Ai-skills · 41 tokens