Agent skill

Php Idioms

by irahardianto in irahardianto/awesome-agv

Modern PHP 8.x idioms: strict types, typed properties, enums, readonly classes, match expressions, and PSR standards.

MITAuto-check passedDevelopment

Install Php Idioms

skills CLI
$ npx skills add irahardianto/awesome-agv --skill php-idioms -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install irahardianto/awesome-agv php-idioms --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/irahardianto/awesome-agv.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/php-idioms .claude/skills/php-idioms && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
php-idioms
GitHub stars
157
Token cost
~883 tokens
SKILL.md length
193 words
Files
1
Skills in repo
34
Repo updated
First seen
Licence
MIT

At a glance

Modern PHP 8.x idioms: strict types, typed properties, enums, readonly classes, match expressions, and PSR standards.

  • Works in 5 steps: declare(strict_types=1) — always, every… → Enums for domain constants → Readonly classes for immutable DTOs → …
  • Reviewing pure PHP code
  • Calls composer
  • Domain services

What it does

Php Idioms is an agent skill from irahardianto/awesome-agv. Modern PHP 8.x idioms: strict types, typed properties, enums, readonly classes, match expressions, and PSR standards. Use when writing, refactoring, or reviewing pure PHP code, domain services, or libraries. Pair with laravel-idioms for Laravel applications.

Its SKILL.md is about 880 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Backend development and Refactoring. It works with PHP and Laravel. The repository describes itself as: Comprehensive sets of standards and practices designed to elevate the capabilities of AI coding agents. The licence is MIT.

When your agent uses it

  • Reviewing pure PHP code
  • Domain services

Example prompts

  • “/php-idioms”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. declare(strict_types=1) — always, every file.
  2. Enums for domain constants
  3. Readonly classes for immutable DTOs
  4. Named arguments for clarity
  5. Match expressions over switch

What it can do on your machine

Read from SKILL.md and the folder at commit 9e997ba. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • composer

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Php Idioms loads about 883 tokens when it runs. Until then it costs about 67 tokens; SKILL.md has 193 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~883

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from irahardianto/awesome-agv at commit 9e997ba, republished under its MIT licence (© irahardianto). 193 words, ~883 tokens.

Download SKILL.mdSave it as .claude/skills/php-idioms/SKILL.md (or your agent's skills folder).
name
php-idioms
description
Modern PHP 8.x idioms: strict types, typed properties, enums, readonly classes, match expressions, and PSR standards. Use when writing, refactoring, or reviewing pure PHP code, domain services, or libraries. Pair with laravel-idioms for Laravel applications.

PHP Idioms and Patterns

Modern PHP (8.x) rewards type safety, immutability, and framework-agnostic design. Lean into typed properties, enums, and readonly classes. Idiomatic PHP = strict types, PSR-compliant, well-tested.

Scope: PHP coding idioms. Test naming: .agents/rules/testing-strategy.md. Logging: @.agents/skills/logging-implementation/SKILL.md.

Modern PHP Features (8.x)
  1. declare(strict_types=1) — always, every file.

  2. Enums for domain constants:

    php
    enum Priority: string {
        case Low = 'low';
        case Medium = 'medium';
        case High = 'high';
    }
  3. Readonly classes for immutable DTOs:

    php
    readonly class CreateTaskRequest {
        public function __construct(
            public string $title,
            public Priority $priority,
        ) {}
    }
  4. Named arguments for clarity:

    php
    $task = new Task(title: 'Deploy fix', priority: Priority::High);
  5. Match expressions over switch:

    php
    $score = match($priority) {
        Priority::Low => 1,
        Priority::Medium => 5,
        Priority::High => 10,
    };
Error Handling
  1. Domain exception hierarchies:

    php
    abstract class DomainException extends \RuntimeException {}
    
    class NotFoundException extends DomainException {
        public function __construct(
            public readonly string $resource,
            public readonly string $resourceId,
        ) {
            parent::__construct("{$resource} '{$resourceId}' not found");
        }
    }
  2. Never catch (\Exception) without re-throw or specific handling.

  3. Type-safe return types — never mixed without justification.

Interfaces and DI
  1. Define interface where consumed, implement where provided:
    php
    // In task feature
    interface TaskStorage {
        public function getById(string $id): Task;
        public function save(Task $task): void;
    }
    
    // Constructor injection
    class TaskService {
        public function __construct(
            private readonly TaskStorage $storage,
        ) {}
    }
Naming (PSR-12)
  1. PascalCase for classes, interfaces, traits, enums.
  2. camelCase for methods, properties.
  3. UPPER_SNAKE_CASE for constants.
  4. PSR-4 autoloading — namespace = directory path.
Testing
  1. PHPUnit or Pest:

    php
    test('calculate discount returns zero for no items', function () {
        $result = $this->calculator->calculateDiscount([], $this->coupon);
        expect($result)->toBe(0.0);
    });
  2. Data providers for parameterized tests.

  3. Mockery or PHPUnit mocks — never test implementation details.

Formatting and Static Analysis
ToolPurposeCommand
PHP CS FixerPSR-12 formattingphp-cs-fixer fix .
PHPStan (level 9)Static analysisphpstan analyse src/ --level 9
PsalmType checkingpsalm --show-info=true
composer auditCVE scanningcomposer audit
  • Code Idioms and Conventions .agents/rules/code-idioms-and-conventions.md
  • Testing Strategy .agents/rules/testing-strategy.md
  • Error Handling Principles .agents/rules/error-handling-principles.md

© irahardianto, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/php-idioms of irahardianto/awesome-agv.

Open the folder on GitHubat commit 9e997ba

Compare with similar skills

Php Idioms next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Php Idioms compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Php Idioms this skillirahardianto/awesome-agv157—~883Automated safety check: PassMIT
Livewire Developmentcoollabsio/coolify63k—~964Automated safety check: PassMIT
Livewire Developmentyungifez/skuul4091 repos~1.9kAutomated safety check: PassMIT
Octane Frankenphp GotchasAratKruglik/claude-laravel155—~732Automated safety check: PassNone
PHP ProJeffallan/claude-skills12k—~1.6kAutomated safety check: NotesMIT
Spatie Guidelinesfreekmurze/dotfiles1k—~2.7kAutomated safety check: PassMIT

Similar skills

  • Livewire Development

    coollabsio/coolify

    A skill your agent uses for any task or question involving Livewire.

    63k GitHub stars~964 tokensUpdated today
    Backend & APIsAuto-check passed
  • Livewire Development

    yungifez/skuul

    A skill your agent uses for any task or question involving Livewire.

    409 GitHub starsUsed in 1 repo~1.9k tokens
    Backend & APIsAuto-check passed
  • Octane Frankenphp Gotchas

    AratKruglik/claude-laravel

    A skill your agent uses when debugging unexpected behavior in Laravel Octane with FrankenPHP - stale data between requests, memory leaks, singleton contamination, static property state, or anything…

    155 GitHub stars~732 tokensUpdated 5 mo ago
    Backend & APIsAuto-check passed
  • PHP Pro

    Jeffallan/claude-skills

    Writes strictly typed modern PHP 8.3+ for Laravel, Symfony and plain projects, with PHPStan level 9, PHPUnit or Pest tests, typed DTOs and secure defaults.

    12k GitHub stars~1.6k tokensUpdated 5 days ago
    Backend & APIsAuto-check: notes
  • Spatie Guidelines

    freekmurze/dotfiles

    Spatie's PHP, Laravel, JavaScript and Vue coding guidelines and conventions.

    1k GitHub stars~2.7k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Laravel Clean Architecture

    HoangNguyen0403/agent-skills-standard

    Implement Domain-Driven Design with typed DTOs, repository interfaces, and single-responsibility Action classes in Laravel.

    571 GitHub stars~913 tokensUpdated today
    Backend & APIsAuto-check passed

More from irahardianto/awesome-agv

All 34 skills in this repo
  • Distinctive Frontend Design Builder

    irahardianto/awesome-agv

    Commits to one bold aesthetic direction, sets up a CSS token system for it, then builds the interface in Vue or plain HTML using those tokens.

    157 GitHub stars~2.4k tokensUpdated 4 days ago
    Auto-check passed
  • Perf Optimization

    irahardianto/awesome-agv

    Profile-driven performance optimization protocol. An agent skill from irahardianto/awesome-agv.

    157 GitHub stars~4.3k tokensUpdated 4 days ago
    Auto-check passed
  • Angular Idioms and Patterns

    irahardianto/awesome-agv

    Coding conventions for Angular 19 and later: standalone components, signals, OnPush change detection, lazy routes and where RxJS still belongs.

    157 GitHub stars~3.8k tokensUpdated 4 days ago
    Auto-check passed
  • CI/CD Pipeline Principles

    irahardianto/awesome-agv

    Rules for designing CI/CD pipelines in layers: universal lint, test and scan stages, container builds with SBOM attestation, and GitOps for orchestrated deployments.

    157 GitHub stars~2.7k tokensUpdated 4 days ago
    Auto-check: notes
  • Hono Idioms

    irahardianto/awesome-agv

    Hono lightweight web framework patterns: type-safe route handlers, middleware composition, Zod validation, and RPC clients for Cloudflare Workers, Node, or Bun.

    157 GitHub stars~3k tokensUpdated 4 days ago
    Auto-check passed
  • Mobile Testing

    irahardianto/awesome-agv

    Mobile E2E testing patterns — Flutter integrationtest, Patrol, Maestro, golden testing, device matrix, and test data management.

    157 GitHub stars~1.8k tokensUpdated 4 days ago
    Auto-check: notes

Works with

Questions about Php Idioms

What does Php Idioms do?

Modern PHP 8.x idioms: strict types, typed properties, enums, readonly classes, match expressions, and PSR standards. Php Idioms is an agent skill from irahardianto/awesome-agv.x idioms: strict types, typed properties, enums, readonly classes, match expressions, and PSR standards.

When should I use Php Idioms?

Php Idioms fits situations like: reviewing pure PHP code; domain services.

How do I install Php Idioms in Claude Code?

Run `npx skills add irahardianto/awesome-agv --skill php-idioms -a claude-code`. Or copy the skill folder (.agents/skills/php-idioms in irahardianto/awesome-agv) into .claude/skills/php-idioms in your project. Claude Code loads it when a task matches its description.

How do I install Php Idioms in Codex?

Run `npx skills add irahardianto/awesome-agv --skill php-idioms -a codex`. Or copy the skill folder (.agents/skills/php-idioms in irahardianto/awesome-agv) into .agents/skills/php-idioms in your project. Codex loads it when a task matches its description.

Can I use Php Idioms in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add irahardianto/awesome-agv --skill php-idioms -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/php-idioms, .gemini/skills/php-idioms, .github/skills/php-idioms and .opencode/skills/php-idioms in your project.

What does Php Idioms need to run?

Going by SKILL.md and its folder, Php Idioms needs the command-line tools its instructions call (composer).

Does Php Idioms access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Php Idioms safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Php Idioms use?

Php Idioms is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Php Idioms use?

About 883 tokens (SKILL.md is roughly 3.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Php Idioms?

Skills that share tags, products or a category with Php Idioms: Livewire Development (coollabsio/coolify, 63k stars), Livewire Development (yungifez/skuul, 409 stars), Octane Frankenphp Gotchas (AratKruglik/claude-laravel, 155 stars) and PHP Pro (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Php Idioms?

irahardianto (a GitHub user) maintains it in irahardianto/awesome-agv, which has 157 GitHub stars. The repository holds 34 skills in this directory. The repository was last updated on October 5, 2026.

Source: irahardianto/awesome-agv on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.