Claude Cursor Skill

php-conventions

PHP code conventions covering PHP 8.2+ strict types, PSR-12 formatting, PHPStan/Psalm static analysis, PHPUnit, Composer dependency management, PSR-4 autoloading, and security. Load when writing or reviewing PHP code.

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download goldziher-ai-rulez-internal_builtins_languages_php_skills_php-conventions-ca967ad.zip · 0 KB
Part of goldziher/ai-rulez — 151 skills

Install

skills CLI npx skills add https://github.com/Goldziher/ai-rulez/tree/main/internal/builtins/languages/php/skills/php-conventions
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install goldziher-ai-rulez@llmmart
Git git clone https://github.com/Goldziher/ai-rulez.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole goldziher/ai-rulez collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

  • PHP 8.2+, declare(strict_types=1), typed properties, union types, enums, readonly classes.
  • Formatting: PSR-12 via a fixer (e.g., PHP_CodeSniffer/phpcbf or php-cs-fixer). Static analysis: a strict analyzer (e.g., PHPStan at max level or Psalm).
  • Testing: PHPUnit with @dataProvider, 80%+ coverage.
  • Error handling: specific exceptions extending RuntimeException, constructor promotion for value objects.
  • First-class callable syntax ($fn = strlen(...)) for callbacks. Arrow functions (fn() =>) for simple closures.
  • Dependencies: Composer with composer.lock committed, ^ version constraints. composer audit in CI.
  • Security: require roave/security-advisories as dev dependency to block vulnerable packages.
  • PSR-4 autoloading exclusively — no require/include for classes.
  • Intersection types for strict parameter contracts. Named arguments for readability.
  • Anti-patterns: @ suppression, eval(), dynamic property access, extract().
Files (ai-rulez)
  • SKILL.md 1.2 KB
    ---
    name: php-conventions
    description: PHP code conventions covering PHP 8.2+ strict types, PSR-12 formatting, PHPStan/Psalm static analysis, PHPUnit, Composer dependency management, PSR-4 autoloading, and security. Load when writing or reviewing PHP code.
    ---
    
    - PHP 8.2+, `declare(strict_types=1)`, typed properties, union types, enums, readonly classes.
    - Formatting: PSR-12 via a fixer (e.g., PHP_CodeSniffer/phpcbf or php-cs-fixer). Static analysis: a strict analyzer (e.g., PHPStan at max level or Psalm).
    - Testing: PHPUnit with `@dataProvider`, 80%+ coverage.
    - Error handling: specific exceptions extending `RuntimeException`, constructor promotion for value objects.
    - First-class callable syntax (`$fn = strlen(...)`) for callbacks. Arrow functions (`fn() =>`) for simple closures.
    - Dependencies: Composer with `composer.lock` committed, `^` version constraints. `composer audit` in CI.
    - Security: require `roave/security-advisories` as dev dependency to block vulnerable packages.
    - PSR-4 autoloading exclusively — no `require`/`include` for classes.
    - Intersection types for strict parameter contracts. Named arguments for readability.
    - Anti-patterns: `@` suppression, `eval()`, dynamic property access, `extract()`.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related