andreibesleaga/gabbe/performant-php
Claude Code and agent skill by andreibesleaga/gabbe
- community
Checking that the SKILL.md file is still in the repository.
High-performance modern PHP — PHP 8.4/8.5, OPcache+JIT, FrankenPHP workers, Composer, Symfony/Laravel, PHPStan/Psalm, Pest. Use when: php, php 8.4, php 8.5, composer, symfony, laravel, frankenphp, opcache, jit, phpstan, psalm, pest, phpunit, php performance.
Install
npx vskill@latest install andreibesleaga/gabbe/performant-phpSKILL.md
The same SKILL.md was published earlier as andreibesleaga/gabbe/performant-php.
Performant PHP Skill
Goal
Build fast, type-safe, maintainable PHP services using the current ecosystem (versions verified 2026-06-10). This is the language-level companion to performant-laravel.skill.md; use it for general PHP, Symfony, and framework-agnostic work.
Capabilities
1. Modern language baseline
- Target PHP 8.4+ (8.5 current stable). Use property hooks and asymmetric visibility (8.4) to remove boilerplate getters/setters; lazy objects (8.4) for deferred initialization; PDO driver-specific subclasses. On 8.5, the pipe operator `|>` chains callables and the built-in URI extension parses/normalizes URLs (RFC 3986 / WHATWG).
- Always
declare(strict_types=1);. Usereadonlyclasses/properties, enums (backed where serialized), first-class callable syntax, and constructor property promotion.
2. Runtime performance
- OPcache must be enabled in production; tune
opcache.memory_consumption,opcache.max_accelerated_files, andopcache.validate_timestamps=0(with deploy-time cache reset). - JIT (available 8.3+) more than doubles throughput on CPU-bound work (benchmarks ~+110%); negligible/negative for typical I/O-bound web requests — enable and measure, don't assume.
- FrankenPHP worker mode (Caddy-based app server) keeps the framework booted between requests — large latency wins for Laravel/Symfony; also gives Early Hints and real-time (Mercure). Alternative: RoadRunner or Swoole/OpenSwoole.
- Use
preloadfor hot framework classes.
3. Database & I/O
- Eliminate N+1: eager-load (Eloquent
with(), Doctrine fetch joins); add covering indexes; useEXPLAIN. - Stream large results with generators (
yield) to keep memory constant; chunk batch jobs. - Cache with Redis (PSR-6/PSR-16); use tags and explicit invalidation; queue slow work (Horizon / Symfony Messenger).
4. Type safety & quality gates
- PHPStan (aim level 8–9) or Psalm for static analysis; Rector for automated upgrades/refactors.
- Pint / PHP-CS-Fixer (PSR-12) for formatting; Deptrac for architectural layer enforcement.
- composer audit +
roave/security-advisoriesto block vulnerable dependencies.
5. Testing
- Pest (or PHPUnit) for unit + feature tests; PCOV/Xdebug for coverage; HTTP fakes for external calls; Testcontainers / sqlite-in-memory for integration.
6. Frameworks
- Laravel 12 (min PHP 8.2) — see
performant-laravel.skill.mdfor Octane/Eloquent specifics. - Symfony 7.4 (LTS, supported to 2028/2029) — autowiring, attributes, Messenger for async, API Platform for APIs; latest line is Symfony 8.x.
Steps
- Baseline: profile a representative request (Blackfire / Xdebug profiler /
phpbench) before changing anything. - Enable OPcache + JIT, measure, then add worker mode (FrankenPHP/RoadRunner) if request boot dominates.
- Kill N+1 and add indexes; cache the verified-hot, rarely-changing reads.
- Raise the static-analysis level (PHPStan/Psalm) and let it fail CI; apply Rector for safe upgrades.
- Re-profile and record the before/after numbers.
Constraints
- Measure before optimising: no JIT, preloading or worker mode without a before and after profile.
- Check the PHP and framework versions in
composer.jsonbefore using 8.4 or 8.5 syntax. - Production settings:
display_errors=Off,expose_php=Off, secrets from the environment.
Output Format
Changed files plus a record of the before and after profile numbers for each optimisation.
Sources (verified 2026-06-10)
- PHP 8.5 / 8.4 features: <https://www.php.net/releases/8.5/en.php> · <https://php.watch/versions>
- Laravel 12: <https://laravel.com/docs/12.x/releases>
- Symfony 7.4 LTS: <https://symfony.com/releases>
- FrankenPHP: <https://frankenphp.dev/>
Limits and safety
- Use PDO prepared statements or the ORM's bindings; never put user input into SQL, shell commands (
exec,shell_exec) orunserialize(). - In FrankenPHP worker mode, RoadRunner or Swoole the process outlives the request: reset per-request state (auth, tenant, static caches) so data cannot leak between users.
- Run
composer auditin CI; changing dependency versions to fix an audit result needs the human's approval. - Load secrets from the environment, never from committed files.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/gabbe-coding/skills/performant-php/SKILL.md
Popularity
- Repository stars
- 23
- Repository forks
- 8
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/andreibesleaga/gabbe/performant-php)