Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

php-modernization

БесплатноЗапускает вложенные скриптыНе проверен

Use when modernizing PHP code: PHP 8.1-8.5 features, PSR/PHP-FIG/PER-CS compliance, PHPStan/Rector/PHP-CS-Fixer/PHPat tooling, DTOs/enums/readonly/property…

netresearchот netresearch★ 71 звезда на GitHub10 установок в других каталогах

Об этом скилле

PHP Modernization

Agent contract

  1. Discover: uv run ${CLAUDE_SKILL_DIR}/scripts/introspect.py (cheap), or verify_php_project.py --summary (full, with agent_actions[]). Then read the project's own commands — composer.json scripts, Makefile, DDEV/Docker wrappers, CI config. They fix the runtime, the config and the paths; use them over a bare vendor/bin/* call. Exception: when you must add a flag (--dry-run, --only, a path), run the command the script wraps with the flag written out, in the same runtime — Composer aliases can drop ---forwarded flags.

  2. Drill: ... --check PM-XX per finding. Full output when triaging >3. The verifier does not evaluate llm_review checkpoints (step 4): no result for one is no pass.

  3. Use the project's tools, and run them. Naming a tool is not using it. A check you did not run is reported as not run.

    Concern Tool (the one the project has)
    PHP refactoring Rector (+ TYPO3/Symfony sets)
    Fluid, TypoScript, FlexForm/XML, YAML migration Fractor — not for PHP code
    Types, match completeness (match.unhandled), version floor (phpVersion) PHPStan
    Coding standard PHPCS/PHPCBF or PHP-CS-Fixer — whichever is configured
    Syntax php -l / the project's lint, under the lowest supported PHP
    Behaviour PHPUnit (the project's suite)
    Test strength on the changed lines Infection, where installed
  4. Decide what the tools cannot. Before each change, answer from callers, data flow and tests:

    • Which intent becomes clearer?
    • Which observable behaviour must stay (return values, comparisons, exceptions, stored and external values, public signatures)?
    • Which existing rule or tool makes the change?
    • Which check shows the result is right — and which behaviour test pins the decision?

    The verifier runs mechanical checks only. The llm_review checkpoints in checkpoints.yaml (enums PM-21, PHP 8 features and match PM-22, readonly PM-40, …) are yours; a green verifier does not cover them.

  5. Apply in bounded steps: baseline tests → modernize_loop.py --mode dry-run or rector process <path> --only=<rule> --dry-run (when the project's own command adds a config or a container, run that command with the flags instead: the orchestrator calls the binaries directly) → review the diff against step 4 → apply → formatter → lint, PHPStan, tests → the same dry-run again proposes nothing → commit. Details: references/migration-strategies.md.

  6. References: load on demand; do not pre-load.

Reference routing

Need Read
PHP 8.0-8.3 baseline references/php8-features.md
PHP 8.4 references/php-8.4.md
PHP 8.5 references/php-8.5.md
PSR / PER-CS references/psr-per-compliance.md
PHPStan config references/phpstan-compliance.md
Static analysis references/static-analysis-tools.md
PHP-CS-Fixer deprecations references/php-cs-fixer-deprecations.md
DTOs / VOs / inputs references/type-safety.md, references/request-dtos.md
Adapter / registry references/adapter-registry-pattern.md
Multi-version compat references/multi-version-adapters.md, references/composer-package-metadata.md
Symfony patterns references/symfony-patterns.md
PSR-15 middleware references/psr15-middleware-architecture.md
Doctrine edges references/doctrine-modernization-edges.md
API Platform references/api-platform-edges.md
Immutability references/immutability-boundaries.md
Contracts & invariants references/contracts-and-invariants.md
Mutation testing references/mutation-testing.md
Lexing PHP as tokens, across versions references/lexing-php-across-versions.md
Migration planning references/migration-strategies.md
Public API inventory vs consumers, interface changes on update references/public-api-inventory.md
PHPUnit 12→13, mock vs stub references/phpunit-modernization.md
Multi-agent dispatch hazards references/multi-agent-pitfalls.md
Reading a PHP config file without running it references/reading-php-config-safely.md

Hard guardrails

  • Never apply readonly to Doctrine entities or mapped-superclasses (embeddables: see references/doctrine-modernization-edges.md).
  • Never apply Rector (or modernize_loop.py --mode apply --confirm) before a --dry-run of the same scope and a review of its diff. Rector diffs can change behaviour (loose switch → strict match, readonly over mutable members). Pass --dry-run on the Rector command itself (the one the project's script runs, in its runtime), never through a Composer alias with --: depending on the configuration the alias drops it.
  • Never raise PHPStan level without regenerating + committing the baseline. Shrink, never delete.
  • Never apply blanket final to mock targets or extension points without confirmation.
  • Never edit @generated files
Полный SKILL.md на GitHub

Установить php-modernization в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash(php:*)
Bash(composer:*)
Bash(uv:*)
Bash(vendor/bin/*)
Bash(.Build/bin/*)
Read
Write
Glob
Grep

Вложенные файлы

checkpoints.yamlreferences/adapter-registry-pattern.mdreferences/api-platform-edges.mdreferences/composer-package-metadata.mdreferences/contracts-and-invariants.mdreferences/core-rules.mdreferences/doctrine-modernization-edges.mdreferences/immutability-boundaries.mdreferences/lexing-php-across-versions.mdreferences/migration-strategies.mdreferences/multi-agent-pitfalls.mdreferences/multi-version-adapters.mdreferences/mutation-testing.mdreferences/php-8.4.mdreferences/php-8.5.mdreferences/php-cs-fixer-deprecations.mdreferences/php8-features.mdreferences/phpstan-compliance.mdreferences/phpunit-modernization.mdreferences/psr-per-compliance.mdreferences/psr15-middleware-architecture.mdreferences/public-api-inventory.mdreferences/reading-php-config-safely.mdreferences/request-dtos.mdreferences/static-analysis-tools.mdreferences/symfony-patterns.mdreferences/type-safety.mdscripts/_common.pyscripts/introspect.pyscripts/modernize_loop.pyscripts/verify-php-project.shscripts/verify_php_project.pytemplates/README.mdtemplates/composer-scripts.jsontemplates/github-actions/php-modernization.yml

FAQ

Что делает скилл php-modernization?

Use when modernizing PHP code: PHP 8.1-8.5 features, PSR/PHP-FIG/PER-CS compliance, PHPStan/Rector/PHP-CS-Fixer/PHPat tooling, DTOs/enums/readonly/property hooks, type safety. Triggers: PHP modernization, type safety, PHPStan, Rector, PHP-CS-Fixer, enum, DTO, readonly, strict_types, property hooks, PHP 8.4, PHP 8.5.

Как установить скилл php-modernization?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл php-modernization запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить php-modernization с