Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
netresearch avatar

Php Modernization

  • 297 installs
  • 37 repo stars
  • Updated August 3, 2026
  • netresearch/php-modernization-skill

Modernize legacy PHP apps by upgrading syntax, frameworks, dependency patterns, and service layers while preserving behavior during refactors.

About

Guides modernization of legacy PHP codebases toward current language standards, cleaner architecture, and maintainable backend services. Covers framework upgrades, dependency hygiene, typing, and incremental refactors suited to APIs, SaaS, and ecommerce backends.

  • Legacy-to-modern PHP upgrades
  • Framework migration guidance
  • Typed, testable service layers
  • Dependency and autoload cleanup
  • Safer incremental refactors

Php Modernization by the numbers

  • 297 all-time installs (skills.sh)
  • +10 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #30 of 65 PHP & Laravel skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/netresearch/php-modernization-skill --skill php-modernization

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs297
repo stars37
Last updatedAugust 3, 2026
Repositorynetresearch/php-modernization-skill

What it does

Modernize legacy PHP apps by upgrading syntax, frameworks, dependency patterns, and service layers while preserving behavior during refactors.

Files

SKILL.mdMarkdownGitHub ↗

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[]). 2. Drill: ... --check PM-XX per finding. Full output when triaging >3. 3. Apply: uv run ${CLAUDE_SKILL_DIR}/scripts/modernize_loop.py --mode dry-run. Review transcript before applying. 4. References: load on demand; do not pre-load.

Reference routing

NeedRead
PHP 8.0-8.3 baselinereferences/php8-features.md
PHP 8.4references/php-8.4.md
PHP 8.5references/php-8.5.md
PSR / PER-CSreferences/psr-per-compliance.md
PHPStan configreferences/phpstan-compliance.md
Static analysisreferences/static-analysis-tools.md
PHP-CS-Fixer deprecationsreferences/php-cs-fixer-deprecations.md
DTOs / VOs / inputsreferences/type-safety.md, references/request-dtos.md
Adapter / registryreferences/adapter-registry-pattern.md
Multi-version compatreferences/multi-version-adapters.md
Symfony patternsreferences/symfony-patterns.md
PSR-15 middlewarereferences/psr15-middleware-architecture.md
Doctrine edgesreferences/doctrine-modernization-edges.md
API Platformreferences/api-platform-edges.md
Immutabilityreferences/immutability-boundaries.md
Contracts & invariantsreferences/contracts-and-invariants.md
Mutation testingreferences/mutation-testing.md
Migration planningreferences/migration-strategies.md
PHPUnit 12→13, mock vs stubreferences/phpunit-modernization.md
Multi-agent dispatch hazardsreferences/multi-agent-pitfalls.md

Hard guardrails

  • Never apply readonly to Doctrine entities or mapped-superclasses (embeddables: see references/doctrine-modernization-edges.md).
  • Never run Rector without --dry-run. Invoke vendor/bin/rector directly — composer script aliases can drop ---forwarded flags depending on configuration.
  • 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 or files under var/cache/, vendor/, node_modules/, .Build/.
  • Never git checkout -- files outside your scope in shared trees — use git stash / git diff.
  • Never trust a warm PHPStan cache after vendor change: rm -rf /tmp/phpstan-* var/cache/phpstan first.
  • Never mass-substitute createMockcreateStub — promote to expects(...)->method(...)->with(...).

Migration checklist

  • [ ] declare(strict_types=1) everywhere
  • [ ] @PER-CS, no deprecated aliases
  • [ ] PHPStan ≥9 (treatPhpDocTypesAsCertain: false); 10 for new
  • [ ] PHPat for layer boundaries
  • [ ] Return + parameter types on all methods
  • [ ] DTOs over arrays; backed enums over constants
  • [ ] PSR interfaces in type-hints
  • [ ] #[Override] (8.3+), #[SensitiveParameter] (8.2+), typed constants (8.3+)
  • [ ] readonly on DTOs/VOs/events only
  • [ ] Property hooks (8.4); array_find/any/all (8.4); pipe |> (8.5)
  • [ ] PHPUnit 12+: stubs use createStub, mocks createMock + expects (no self::any() in 13)
  • [ ] Rector withComposerBased(symfony: true) (per-version SymfonySetList::SYMFONY_* are @deprecated)

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.