TSH Stack: PHP
TSH conventions for PHP 7.4–8.5 and Symfony 5.4–8.x: version-aware design and implementation, framework guidance with its version differences, and a code reviewer agent.
This is a stack plugin, not a discipline plugin. Install it into the projects that run on PHP,
at project scope, so it travels with the repository, which already knows what it runs on. Your
discipline plugin and tsh-core travel with you at user scope. For the install commands, see
Installation.
What it covers
- PHP design and implementation. The minimum code that solves the task, reuse before writing, YAGNI and KISS first, SOLID and DRY with judgement, design patterns and enterprise patterns only when a present need justifies them, architecture styles with their costs, code smells and refactoring, PSR-1 and PSR-12.
- Symfony implementation and review. Services and dependency injection, configuration, events, the HTTP layer, Doctrine, Forms, Validator, Serializer, Security, Messenger, Console and testing, with the differences between Symfony 5.4 and 8.x and the support status of third-party bundles such as FOSUserBundle and SensioFrameworkExtraBundle.
- A reviewer agent. Read-only review of a PHP or Symfony change, returned as a findings report.
The two skills are designed to work together: implementing-symfony-applications builds on the PHP
version rules and design principles of architecting-php-code, and the reviewer agent preloads
both.
Components
| Skill | Invoke | What it does |
|---|---|---|
| architecting-php-code | /tsh-stack-php:architecting-php-code | Guides design, implementation and review of PHP 7.4–8.5 code as a senior architect: the minimum code that solves the task, YAGNI and KISS first, SOLID and DRY applied with judgement, enterprise and design patterns only when a current need justifies them, refactoring, architecture choices, and PSR-12 style. Use when writing, refactoring or reviewing PHP classes, choosing a design pattern or architecture, or checking PSR-12. |
| implementing-symfony-applications | /tsh-stack-php:implementing-symfony-applications | Guides implementation and review of Symfony 5.4–8.x applications as a senior Symfony specialist: detects the project's Symfony version and uses only what exists in it, and justifies every framework feature it reaches for — services and DI, configuration, events, routing and controllers, Doctrine, Forms, Validator, Serializer, Security, Messenger, Console, testing. Use when writing, changing or reviewing code in a Symfony project. |
| Agent | Mention | Model | What it does |
|---|---|---|---|
| php-code-reviewer | @tsh-stack-php:php-code-reviewer | opus | Reviews PHP and Symfony code changes against the project's PHP and Symfony versions, PSR-1/PSR-12, YAGNI/KISS/DRY/SOLID, justified use of patterns and framework features, and reuse of what the codebase already has — runs the project's linters and static analysis and returns a structured findings report. Use after PHP code is written or changed, before merge, or when asked to review PHP or Symfony code. |
Version support
| Supported | When the project's version cannot be determined | |
|---|---|---|
| PHP | 7.4–8.5 | The skill asks |
| Symfony | 5.4–8.x | The skill asks |
Older versions are worked with as they are. The skills never upgrade PHP, Symfony or a bundle unless asked.
Not covered yet
Deliberate gaps, listed in the plugin README as scope rather than oversight:
- Laravel and other frameworks. No skill of their own;
architecting-php-codestill applies to the PHP underneath them. - API Platform. Mentioned for version support only; no implementation guidance.
- PHP below 7.4 and Symfony below 5.4. Outside the supported range.
MCP servers and hooks
None bundled.