php

php is a skill for Claude Code, Codex from nimadorostkar/Claude-Skills-collection. It costs 42 tokens per session (804 once invoked), scanned A, original, MIT.

A PHP coding guide for PHP 8.2+ and Laravel or Symfony projects. It promotes strict types, modern language features, standard conventions, and static analysis with PHPStan.

In plain words
What is it for?
Use it to write or review PHP, add type checking to legacy code, model domain values, improve ORM-heavy performance, and follow PSR standards.
Why use it?
It helps catch defects earlier and makes loosely typed or older PHP code easier to understand and maintain.

Skill for Claude CodeCodex

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

Good fit Use it to write or review PHP, add type checking to legacy code, model domain values, improve ORM-heavy performance, and follow PSR standards.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/php/github.svg)](https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/php)
Your own site
<a href="https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/php"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/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/nimadorostkar/claude-skills-collection/php"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/php.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 804 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00042 $0.00804
Opus 5 $0.00021 $0.00402
Sonnet 5 $0.00008 $0.00161
Haiku 4.5 $0.00004 $0.00080

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

Security

Grade A, and why

php 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 7d 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/languages/php/SKILL.md · 99 lines

How it starts

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

PHP

Purpose

Write PHP that behaves like a typed language: strict types on, enums instead of string constants, readonly value objects, and PHPStan at a level high enough to catch real defects.

When to Use

  • Writing or reviewing PHP 8.2+.
  • Working in Laravel or Symfony applications.
  • Introducing static analysis to a legacy PHP codebase.
  • Modeling domain values and states.
  • Fixing performance problems in ORM-heavy code.

Capabilities

  • Strict typing, union and intersection types, never and readonly.
  • Enums with backing values and interfaces.
  • Attributes for routing, validation, and DI metadata.
  • PSR-4 autoloading, PSR-12 style, PSR-3 logging.
  • PHPStan configuration and incremental adoption via baselines.

Inputs

  • Source tree, composer.json, framework and version.
  • Existing analysis configuration and baseline, if any.

Outputs

  • Files opening with declare(strict_types=1);.
  • Typed properties, parameters, and return types throughout.
  • A PHPStan configuration at level 8 (or a baseline plus a plan to reach it).

Workflow

  1. Turn on strictnessdeclare(strict_types=1) in every file; PHPStan with a baseline to freeze existing debt.
  2. Replace magic with types — String constants become enums; array shapes become value objects or DTOs.
  3. Implement — Constructor promotion, readonly properties, named arguments at call sites.
  4. Eliminate ORM traps — Eager-load relations; never query inside a loop.
  5. Gate — PHPStan, PHP-CS-Fixer, PHPUnit or Pest.

Best Practices

  • Never use array as a domain type. An untyped array is a shape that no tool can check.
  • Enums replace class constants and give you exhaustive match.
  • Readonly promoted constructor properties are the shortest path to immutable value objects.
  • In Eloquent, with() your relations. An N+1 query in a list endpoint is the single most common PHP performance defect.
  • Do not catch \Exception broadly. Catch the specific type, or let it reach the handler.
  • Keep framework types out of the domain layer — a domain service should not know what an HTTP request is.

Read the full file on GitHub · 99 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. 7d ago First seen · 99 lines · 42 tokens per session scan A ab9ac6eb8425

Subscribe to this mod's changes

php is a skill published in the GitHub repository nimadorostkar/Claude-Skills-collection (26 stars, last pushed 22d ago), licensed MIT. It adds 42 tokens to every session and 804 once invoked, about $0.0002 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-09-03.

Related

Other skills, from other repositories

emlog-app-dev

A development guide for Emlog, a PHP-based blogging and content-management system. It covers building and changing Emlog plugins, themes, templates, and related code.

emlog/emlog-app-dev-skill · 125 tokens

laravel-specialist

Build and configure Laravel 10+ applications, including creating Eloquent models and relationships, implementing Sanctum authentication, configuring Horizon queues, designing RESTful APIs with API resources, and building reactive interfaces with Livewire. Use when creating Laravel models, setting up queue workers…

Jeffallan/claude-skills · 86 tokens

php-pro

Use when building PHP applications with modern PHP 8.3+ features, Laravel, or Symfony frameworks. Invokes strict typing, PHPStan level 9, async patterns with Swoole, and PSR standards. Creates controllers, configures middleware, generates migrations, writes PHPUnit/Pest tests, defines typed DTOs and value objects…

Jeffallan/claude-skills · 107 tokens

auditing-php-applications

Audit PHP web application source for critical vulnerabilities using PHP's specific sink and footgun catalog — object injection via unserialize and phar:// POP chains, type-juggling and magic-hash auth bypass, LFI/RFI through php:// and phar:// wrappers, dynamic includes and extract()/superglobal trust, SQL injection…

trilwu/secskills · 129 tokens

craftcms

Craft CMS 5 plugin and module development — extending Craft with PHP. Covers elements, element queries, services, models, records, controllers, migrations, queue jobs, console commands, field types, native fields, events, behaviors, Twig extensions, widgets, filesystems, permissions, project config, GraphQL, testing…

michtio/craftcms-claude-skills · 327 tokens

craft-php-guidelines

Craft CMS 5 PHP coding standards and conventions. ALWAYS load when writing, editing, reviewing, or discussing any PHP in a Craft plugin or module — even small edits. Also when running ECS, PHPStan, or scaffolding with ddev craft make. Covers: PHPDoc blocks (@author, @since, @throws chains), section headers…

michtio/craftcms-claude-skills · 336 tokens