php-modern-standards/SKILL.md
Modern PHP development standards for maintainable, testable, object-oriented code. Use when writing PHP 8+ applications, implementing OOP patterns, ensuring security, following PSR standards, optimizing performance, or building Laravel...
npx skillsauth add peterbamuhigire/skills-web-dev php-modern-standardsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
php-modern-standards or would be better handled by a more specific companion skill.references, examples only as needed.SKILL.md first, then load only the referenced deep-dive files that are necessary for the task.references/ directory for deep detail after reading the core workflow below.examples/ directory for concrete patterns when implementation shape matters.Production-grade PHP patterns for maintainable, testable, secure, high-performance applications.
Core Principle: Write type-safe, secure, performant PHP code following PSR standards with modern PHP 8+ features.
References:
references/performance-efficiency.md — generators, OPcache, profiling, Fibers deep divereferences/code-quality-tooling.md — PHPStan, Pint config, CI/CD patternsreferences/rate-limiting.md — rate limiting patternsreferences/message-queues.md — queue patternsreferences/cache-invalidation.md — cache invalidation patternsreferences/resilience-patterns.md — circuit breakers, retriesreferences/restful-api-patterns.md — cURL client, Attribute routing, JWT, API versioning, testingreferences/database-orm-patterns.md — PDO, QueryBuilder, Active Record Model, soft delete, ORM conceptsreferences/attack-prevention.md — SQL injection, XSS, CSRF, CSP, brute force, least privilegeExamples: examples/modern-php-patterns.php, examples/laravel-patterns.php
Security: Use php-security skill for comprehensive security patterns.
✅ PHP 8+ ✅ OOP ✅ Security ✅ Testing ✅ Performance ✅ Laravel | ❌ Legacy PHP (<7.4) ❌ WordPress
<?php
declare(strict_types=1);
namespace App\Domain\User;
use App\Domain\Shared\ValueObject;
final readonly class User
{
public function __construct(
private int $id,
private string $email,
) {
}
}
Rules: Always declare(strict_types=1), one class per file, namespace = directory, import all dependencies.
Code runs on Windows (dev), Ubuntu (staging), and Debian (production). Linux is case-sensitive:
StaffService.php)src/config/, src/lang/)src/HR/Services/)/ (forward slash). Never hardcode C:\. Use sys_get_temp_dir() for temp files.Extended guidance for php-modern-standards was moved to references/skill-deep-dive.md to keep this entrypoint compact and fast to load.
Use that deep dive for:
Type SystemModern FeaturesPerformanceSOLID PrinciplesControl FlowSecurity (Essentials)TestingLaravel ConventionsCode Quality ToolingPSR StandardsAnti-PatternsChecklistdata-ai
Use when adding AI-powered analytics to a SaaS platform — semantic search over business data, natural language queries, trend detection, anomaly alerts, and AI-generated insights for dashboards. Covers embeddings, NL2SQL, and per-tenant analytics...
data-ai
Design AI-powered analytics dashboards — what metrics to show, how to display AI predictions and confidence, drill-down patterns, KPI cards, trend visualisation, AI Insights panels, export design, and role-based dashboard variants. Invoke when...
development
Use when designing, building, reviewing, or upgrading production software systems that must be secure, performant, maintainable, scalable, and user-centered. Apply before writing specs, code, architecture, APIs, databases, mobile apps, SaaS platforms, or ERP systems.
development
Professional web app UI using commercial templates (Tabler/Bootstrap 5) with strong frontend design direction when needed. Use for CRUD interfaces, dashboards, admin panels with SweetAlert2, DataTables, Flatpickr. Clone seeder-page.php, use...