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.
npx agentmods add skills/garrettw/php-arch-skills/architecture-patternsnpx skills add garrettw/php-arch-skills --skill architecture-patternsgit clone --depth 1 https://github.com/garrettw/php-arch-skillsWrote 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.
[](https://agentmods.dev/skills/garrettw/php-arch-skills/architecture-patterns)<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>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.
| Model | Per session | Once 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 |
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.
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-sourcinganddomain-eventsbefore 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.
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.
- 6d ago First seen · 73 lines · 77 tokens per session scan A 91c83197e81e
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.
Other skills, from other repositories
php-rules
PHP coding rules: style, patterns, security, testing. Triggers: .php, composer.json, Laravel, Symfony, PHPUnit, PSR-12, Composer.
symfony:daily-workflow
Daily development workflow for Symfony projects including common tasks, debugging, and productivity tips.
laravel
Laravel mastery skill. Eloquent ORM, service container, queues, events, Sanctum/Passport auth, Pest testing. Triggers on: /godmode:laravel, "laravel app", "eloquent", "artisan", "blade".
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…
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.…
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.