distribution-patterns

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

Guidance for designing APIs and other interfaces that cross a network or process boundary. It covers Remote Facades, which group work into larger operations, and DTOs, which are clearly defined data objects sent across that boundary.

In plain words
What is it for?
Use it when shaping REST, GraphQL, or gRPC endpoints, commands, message handlers, and the data they send or receive.
Why use it?
It prevents internal code structures from becoming accidental API contracts. It also reduces unnecessary network calls and makes the data exchanged easier to understand.

Skill for Claude CodeCodex

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

Good fit Use it when shaping REST, GraphQL, or gRPC endpoints, commands, message handlers, and the data they send or receive.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/garrettw/php-arch-skills/distribution-patterns
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.

Any agent
npx skills add garrettw/php-arch-skills --skill distribution-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 distribution-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/garrettw/php-arch-skills/distribution-patterns/github.svg)](https://agentmods.dev/skills/garrettw/php-arch-skills/distribution-patterns)
Your own site
<a href="https://agentmods.dev/skills/garrettw/php-arch-skills/distribution-patterns"><img src="https://agentmods.dev/badge/skills/garrettw/php-arch-skills/distribution-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for distribution-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/garrettw/php-arch-skills/distribution-patterns"><img src="https://agentmods.dev/badge/skills/garrettw/php-arch-skills/distribution-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,337 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00091 $0.01337
Opus 5.5 $0.00036 $0.00535
Sonnet 5.5 $0.00018 $0.00267
Haiku 4.5 $0.00009 $0.00134

Measured 13d ago against content hash f86b4df6f4d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

distribution-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 13d 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/distribution-patterns/SKILL.md · 57 lines

How it starts

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

Distribution Patterns

These are the patterns about communicating across a boundary (process, network, or layer). They address one root problem: crossing a seam safely and cheaply without leaking the internals on either side. Two patterns make up this skill:

  • Remote Facade — the operation contract you expose to callers (coarse-grained, consumer-shaped).
  • DTO (Data Transfer Object) — the data shape that travels across the seam.

Remote Facade is most often the external-facing contract (a REST endpoint, GraphQL mutation, gRPC method, command endpoint, message handler). A DTO is the data shape used both at that external boundary and at internal seams (between the application layer and the presentation layer, or across bounded contexts). The distinction is operation vs data, not strictly external vs internal — but the motivation in both cases is the same: don't drag the internal object model across the wire.

Remote Facade

A Remote Facade is a coarse-grained facade over a web of fine-grained objects, applied specifically to make remote calls cheap. See remote-facade.md for the full definition, rules, tradeoff, and examples. Key constraints: the facade holds no domain logic and is the only remote surface (the objects beneath it are in-process with no remote interface), and the contract is shaped around consumer needs, not the object model.

DTO (Data Transfer Object)

A DTO is a simple structure for moving data across a boundary — deliberately not a domain object. It keeps the API contract independent from the persistence/domain model so each can evolve for its own reasons. See dto.md for the full treatment, why domain objects don't belong on the wire, and the command/query angle (Commands/Queries/Responses/Events are explicit DTOs).

HTTP/REST contract

When a Remote Facade is exposed as a REST/HTTP interface, it also takes on a concrete contract beyond its operation shape — resource naming, method semantics, status codes, a consistent error envelope, pagination/versioning conventions, and transport security. Those HTTP-level details live in http-api-contract.md. The facade still holds no domain logic; the contract is about how the surface speaks HTTP so clients integrate predictably.

Read the full file on GitHub · 57 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 13d ago Changed f86b4df6f4d0
  2. 16d ago Changed 731fd118acda
  3. 18d ago Changed · +2 lines af4f24351495
  4. 3mo ago First seen · 55 lines · 91 tokens per session scan A 8a39d6663c7f

Subscribe to this mod's changes

distribution-patterns is a skill published in the GitHub repository garrettw/php-arch-skills (17 stars, last pushed 13d ago), licensed MPL-2.0. It adds 91 tokens to every session and 1,337 once invoked, about $0.0004 per session on Opus 5.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

distribution-patterns compared with skills from other repositories

distribution-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
distribution-patternsgarrettw/php-arch-skillsSkill1713d agoMPL-2.0A91Claude Code, Codex
bun-apidmythro/agent-skillsSkill719d agoMITA265Claude Code, Codex
api-designercodebygarv/Ai-skillsSkill283mo agoMITA40Claude Code, Codex
auth-flow-reviewercodebygarv/Ai-skillsSkill283mo agoMITA51Claude Code, Codex
log-message-improvercodebygarv/Ai-skillsSkill283mo agoMITA48Claude Code, Codex
microservices-boundary-definercodebygarv/Ai-skillsSkill283mo agoMITA32Claude Code, Codex
websocket-protocol-designercodebygarv/Ai-skillsSkill283mo agoMITA32Claude Code, Codex