$npx skillfedfor your agent

php-rules

PHP Rules enforces coding standards covering style, frameworks, patterns, security, and testing. It guides PSR-12 compliance, modern PHP 8.1+ syntax, Laravel and Symfony conventions, Eloquent and Doctrine patterns, and error handling best practices.

PHP Rules applies comprehensive coding standards, style guidelines, and framework best practices for PHP development.

AI-generated summary based on this skill's SKILL.md

161 21 Apache-2.0updated by softspark

Decision gist · record as of 2026-07-27

PHP Rules applies comprehensive coding standards, style guidelines, and framework best practices for PHP development. PHP Rules enforces coding standards covering style, frameworks, patterns, security, and testing. It guides PSR-12 compliance, modern PHP 8.1+ syntax, Laravel and Symfony conventions, Eloquent and Doctrine patterns, and error handling best practices.

manual: git clone https://github.com/softspark/ai-toolkit → cp -r ai-toolkit/app/skills/php-rules ~/.claude/skills/php-rules
app/skills/php-rules/SKILL.md · version e60a64de

Use it when

  • PHP Rules implements secure PHP code practices preventing SQL injection and XSS vulnerabilities.
  • PHP Rules includes comprehensive guidance for writing and reviewing Laravel and Symfony framework code.

Verify before relying

Read SKILL.md below before installing (1 file). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

softspark/ai-toolkit/php-rules · repository language: Python

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What PHP coding standards and best practices does php-rules cover?

PHP Rules enforces coding standards covering style, frameworks, patterns, security, and testing. It guides PSR-12 compliance, modern PHP 8.1+ syntax, Laravel and Symfony conventions, Eloquent and Doctrine patterns, and error handling best practices.

How does php-rules help prevent SQL injection and XSS attacks?

PHP Rules implements secure PHP code practices preventing SQL injection and XSS vulnerabilities. It covers parameterized queries, input validation, output escaping, CSRF protection in Blade templates, and secure file upload handling to protect against common web vulnerabilities.

Does php-rules support Laravel and Symfony framework code?

PHP Rules includes comprehensive guidance for writing and reviewing Laravel and Symfony framework code. It covers Laravel Eloquent ORM patterns, API Resources, authentication with Sanctum and Passport, queue workers with Horizon, Form Requests validation, and Symfony dependency injection autowiring and Forms validation.

What testing frameworks and practices does php-rules recommend?

PHP Rules guides creation of comprehensive PHP unit and integration tests using PHPUnit and Pest testing frameworks. It emphasizes test structure, assertions, mocking, and integration testing patterns to ensure robust code quality and reliability.

How does php-rules address modern PHP features and refactoring?

PHP Rules supports refactoring PHP code using modern language features and patterns including PHP 8.1+ union types, enums, static analysis with PHPStan, repository patterns, and eager loading optimization to prevent N+1 query problems in Eloquent.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

PHP Rules

These rules come from app/rules/php/ in ai-toolkit. They cover the project's standards for coding style, frameworks, patterns, security, and testing in PHP. Apply them when writing or reviewing PHP code.

PHP Coding Style

Standards

  • Follow PSR-12 extended coding style.
  • Use declare(strict_types=1) at the top of every file.
  • Use PHP 8.1+ features: enums, fibers, readonly properties, intersection types.
  • Use PHP CS Fixer or Pint for automated formatting.

Naming

  • PascalCase: classes, interfaces, traits, enums.
  • camelCase: methods, functions, variables.
  • UPPER_SNAKE: class constants (public const MAX_RETRIES = 3).
  • snake_case: not used for methods. PSR convention is camelCase.
  • Suffix interfaces with Interface or prefix with contract name (project convention).

Type System

  • Use typed properties: private readonly string $name;.
  • Use union types: string|int. Use intersection types: Countable&Iterator.
  • Use enum

(truncated - see the full file via the links below)

File tree — 1 file
app/skills/php-rules/SKILL.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Apply PHP coding standards, style rules, and best practices”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

php-pro
by Jeffallan · Jeffallan/claude-skills

PHP Pro is a senior-level specialist for modern PHP development with Laravel, Symfony, and PHP 8.3+. It enforces strict typing, dependency injection, and PSR compliance while generating typed DTOs, services, controllers, and comprehensive tests. Every implementation passes PHPStan level 9 and PHPUnit/Pest coverage thresholds before delivery.

MITupdated May 2026
★ 10,759repo stars
php-specialist
by Pixel-Process-UG · Pixel-Process-UG/superkit-agents

PHP Specialist guides you through modern PHP 8.x development with language features like enums, readonly properties, and match expressions. It covers the complete toolchain: PSR interoperability, Composer dependency management, static analysis configuration, and coding standards enforcement. Apply it whenever you're authoring, reviewing, or refactoring PHP code to ensure type safety and architectural correctness.

MITupdated Mar 2026
★ 1repo stars
Laravel Idioms
by irahardianto · irahardianto/awesome-agv

Learn Laravel's idiomatic approach to building maintainable applications through Eloquent query scopes, service-oriented architecture, and Form Request validation. Covers testing with Pest, code formatting with Pint, and static analysis via PHPStan to enforce framework best practices.

MITupdated Jul 2026
★ 150repo stars
laravel-specialist
by Jeffallan · Jeffallan/claude-skills

Laravel Specialist guides you through building production-ready Laravel 10+ applications with type-safe Eloquent models, queue workers, API resources, and Livewire components. It enforces modern PHP 8.2+ patterns, eager loading, dependency injection, and >85% test coverage across feature and unit tests. Use it for architecting database schemas, implementing authentication flows, optimizing queries, and validating code against PSR-12 standards.

MITupdated May 2026
★ 10,759repo stars
php-expert
by personamanagmentlayer · personamanagmentlayer/pcl

PHP Expert provides in-depth instruction on PHP 8+ language features including union types, named arguments, match expressions, attributes, and enums. Learn Laravel framework patterns, Composer dependency management, and object-oriented design principles for building robust applications.

Apache-2.0updated Mar 2026
★ 38repo stars
Php Idioms
by irahardianto · irahardianto/awesome-agv

This skill covers idiomatic PHP 8.x development, emphasizing strict typing, immutable data structures via readonly classes and enums, and domain-driven error handling. Learn named arguments, match expressions, constructor injection, and PSR-12 naming conventions alongside static analysis tools like PHPStan and Psalm.

MITupdated Jul 2026
★ 150repo stars

More skills php (MIT) · laravel-11-12-app-guidelines (Apache-2.0) · laravel-api (MIT) · laravel-specialist (MIT) · pest (MIT) · ruby-patterns (Apache-2.0)

Tags
code-qualityframework-agnosticorm-patternsapi-developmentqueue-systemsauth-securitytesting-practicesstatic-analysisdatabase-designweb-vulnerabilities