php

php is a skill for Claude Code from xobotyi/cc-foundry. It costs 38 tokens per session (4,207 once invoked), scanned B, original, MIT.

A PHP coding guide focused on modern PHP syntax, explicit types, object-oriented design, and language conventions.

In plain words
What is it for?
Use it when writing, reviewing, refactoring, debugging, or explaining PHP projects.
Why use it?
It gives agents clear rules for producing and changing PHP code consistently, including the project’s expected PHP version and style.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_SKILL_DIR} variable. Also seen: mentions subagents.

Part of the php plugin — 3 skills shipped together

Good fit Use it when writing, reviewing, refactoring, debugging, or explaining PHP projects.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xobotyi/cc-foundry/php
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 xobotyi/cc-foundry --skill php
Clone the repo
git clone --depth 1 https://github.com/xobotyi/cc-foundry

Made for: Claude Code.

Or install php, the plugin that ships this one along with the rest of its 3 skills.

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 php

README.md
[![agentmods](https://agentmods.dev/badge/skills/xobotyi/cc-foundry/php/github.svg)](https://agentmods.dev/skills/xobotyi/cc-foundry/php)
Your own site
<a href="https://agentmods.dev/skills/xobotyi/cc-foundry/php"><img src="https://agentmods.dev/badge/skills/xobotyi/cc-foundry/php/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 php

Your own site · 80×15
<a href="https://agentmods.dev/skills/xobotyi/cc-foundry/php"><img src="https://agentmods.dev/badge/skills/xobotyi/cc-foundry/php.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,207 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00038 $0.04207
Opus 5.5 $0.00015 $0.01683
Sonnet 5.5 $0.00008 $0.00841
Haiku 4.5 $0.00004 $0.00421

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

Security

Grade B, and why

php scanned grade B with 1 finding 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 1mo 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.

Strips warnings and disclaimersmediumAnti-refusal

Omitting safety caveats hides risk from the user and is a common jailbreak preamble.

When **reviewing** PHP code: cite the specific violation and show the fix inline. Don't lecture — state what's wrong and
plugins/php/skills/php/SKILL.md · 379 lines

How it starts

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

PHP

Strict types, explicit contracts, no magic. If a class needs a docblock to explain what its properties do, the properties are named wrong.

PHP 8.5+ is the baseline. Use modern syntax unconditionally — union types, enums, readonly classes, property hooks, named arguments, match, pipe operator. No backward compatibility with older PHP versions unless the project explicitly requires it.

Every PHP file starts with declare(strict_types=1).

References

  • Type system → ${CLAUDE_SKILL_DIR}/references/typing.md — Union/intersection/DNF types, nullable patterns, typed properties and constants, coercion rules, variance
  • OOP patterns → ${CLAUDE_SKILL_DIR}/references/oop.md — Interfaces, traits, readonly, property hooks, enums, constructor promotion, lazy objects, magic methods
  • Concurrency → ${CLAUDE_SKILL_DIR}/references/concurrency.md — Fiber API, generator coroutines, comparison table, async library guidance
  • Packaging → ${CLAUDE_SKILL_DIR}/references/packaging.md — composer.json templates, version constraints, project layouts, namespace conventions

Naming

  • Classes, interfaces, traits, enums — PascalCase: UserService, Renderable, Status

  • Methods, functions — camelCase: findById, getFullName

  • Properties, variables — camelCase: $userName, $isActive

  • Constants (class and global) — UPPER_SNAKE_CASE: MAX_RETRIES, DEFAULT_LOCALE

  • Namespaces — PascalCase segments: App\Http\Controller

  • Enum cases — PascalCase: Status::Active, Suit::Hearts

  • Descriptive names. $userCount not $n. Short names ($i, $k, $v) only in tiny scopes (loops, array operations).

  • No redundant context. $car->make not $car->carMake.

  • Boolean names: is/has/can/should prefix: $isValid, $hasAccess.

  • Abbreviations as words. HttpClient not HTTPClient, JsonParser not JSONParser. Treat abbreviations and acronyms as regular words — uppercase first letter only (PER-CS).

  • No underscore prefix for protected/private visibility. Visibility modifiers exist for that.

Read the full file on GitHub · 379 lines

Files

What ships with it

5 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. 1mo ago First seen · 379 lines · 38 tokens per session scan B 07f09751820b

Subscribe to this mod's changes

php is a skill published in the GitHub repository xobotyi/cc-foundry (22 stars, last pushed 7d ago), licensed MIT. It adds 38 tokens to every session and 4,207 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B with 1 finding (strips warnings and disclaimers). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories