php-standard

php-standard is a skill for Claude Code, Codex from didacrios/ai-coding-protocols. It costs 72 tokens per session (837 once invoked), scanned A, original, MIT.

A set of coding rules for PHP, a programming language, covering clean code, strict type checking, and PHPUnit testing standards. PHPUnit is a tool for running automated PHP tests.

In plain words
What is it for?
Writing, reviewing, or testing PHP code with strict typing, clean-code rules, and PHPUnit standards.
Why use it?
It helps keep PHP code consistent and checks that tests follow the stated standards. It is activated when PHP code is written, reviewed, or tested.

Skill for Claude CodeCodex

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

Good fit Writing, reviewing, or testing PHP code with strict typing, clean-code rules, and PHPUnit standards.

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

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 php-standard

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/didacrios/ai-coding-protocols/php-standard"><img src="https://agentmods.dev/badge/skills/didacrios/ai-coding-protocols/php-standard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 837 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.00072 $0.00837
Opus 5.5 $0.00029 $0.00335
Sonnet 5.5 $0.00014 $0.00167
Haiku 4.5 $0.00007 $0.00084

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

Security

Grade A, and why

php-standard 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 20d 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/php-standard/SKILL.md · 86 lines

How it starts

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

PHP & Testing Standards

Language-specific rules for PHP projects covering strict typing, PSR compliance, clean architecture, and PHPUnit testing conventions.

When to Activate

  • Writing or modifying PHP code (>= 8.2)
  • Creating or updating PHPUnit tests
  • Reviewing PHP code for standards compliance
  • Setting up PHP project architecture

Core Concepts

  • Strict typing everywhere — declare(strict_types=1) in every file
  • PSR compliance — PSR-12 coding style, PSR-4 autoloading
  • Value Objects — domain concepts modeled as immutable objects
  • TDD flow — one test at a time, written before the implementation

Detailed Guidance

Environment & Constraints

  • PHP Version: Target >= 8.2. Use modern features (Readonly properties, Enums, Constructor Promotion) where applicable.
  • Strict Typing: Always include declare(strict_types=1); at the top of every file.
  • PSR Standards: Adhere strictly to PSR-12 (Coding Style) and PSR-4 (Autoloading).

Clean Code & Architecture

  • Method Size: Methods must be between 10 and 20 lines max.
  • Abstractions: Use Value Objects for domain concepts (Email, Price, Id).
  • Inversion of Control: Dependencies must be injected via constructor, preferably using promoted properties.

Testing Protocol (PHPUnit)

  • Framework: PHPUnit.
  • TDD Flow: Create exactly one test before implementing the logic.
  • Naming: test[FunctionName]_[Scenario]_[ExpectedResult].
  • Structure: Use Given-When-Then comments.

Test Maintainability

  • Object Mother: Use for complex entities.
  • Data Providers: Use @dataProvider to keep tests DRY when testing multiple cases.
  • Location: tests/ mirroring src/.

Recursive Verification

  • Autoloading: Check composer.json or directory structure to ensure correct namespaces.
  • Type Tracing: If a method returns a class, peek into that class to understand its structure before using the return value.

Examples

Test structure:

public function testCreateUser_WithValidData_ReturnsUser(): void
{
    // Given
    $email = EmailMother::random();
    // When
    $user = $this->service->create($email);
    // Then
    $this->assertEquals($email, $user->email());
}

Read the full file on GitHub · 86 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. 20d ago Changed · +1 lines · +47 tokens per session 87e5fd0d31cf
  2. 2mo ago First seen · 85 lines · 25 tokens per session scan A 281bc8781327

Subscribe to this mod's changes

php-standard is a skill published in the GitHub repository didacrios/ai-coding-protocols (2 stars, last pushed 5d ago), licensed MIT. It adds 72 tokens to every session and 837 once invoked, about $0.0003 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

Other skills, from other repositories

Codeception Testing

Expert-level Codeception testing skill for PHP applications. Covers acceptance, functional, and unit testing with the Actor pattern, BDD-style syntax, Page Objects, API testing, and database helpers.

PramodDutta/qaskills · 42 tokens

craft-pest

Testing Craft CMS 5 plugins and modules with Pest — test isolation, database safety, and the markhuot/craft-pest-core harness. ALWAYS load when writing, running, fixing, or reviewing tests for a Craft plugin or module, and whenever a suite touches a real Craft install. Covers why rollback is opt-in, tests/Pest.php +…

michtio/craftcms-claude-skills · 175 tokens

phpunit-unit-test-reviewing

Internal sub-skill. Do not auto-activate. Use only when explicitly invoked by name by another skill or agent.

shopwareLabs/ai-coding-tools · 31 tokens

phpunit-unit-test-writing

Use this skill when the user asks to write, generate, create, or add PHPUnit unit tests for a Shopware 6 source class — phrases like "write unit tests for X", "generate tests for ClassName", "create PHPUnit tests", "add test coverage", "test this class", "cover this with tests", "I need tests for", "unit test this"…

shopwareLabs/ai-coding-tools · 187 tokens

noerd-testing

Use this skill when writing or fixing tests for code built on noerd/noerd: Pest feature tests for list/detail/page/modal Livewire components, store and validation tests of YAML-driven forms (validDetailPayload, requiredLayoutFields), route-vs-component modal behaviour (registerTestLivewireRoute), install/update…

noerd-dev/noerd · 121 tokens

php-testing

Use when writing/configuring tests on a non-Laravel PHP project — PHPUnit vs Pest. Do NOT use for Laravel test helpers or quality tooling (php-quality-tooling).

fusengine/agents · 38 tokens