{"id":"cb4c9ebb-cc9e-47a1-adbb-d500a275f4ac","shortId":"xN37AQ","kind":"skill","title":"php-modernization","tagline":"Use when working with ANY PHP modernization task: upgrading PHP 8.1+ (TYPO3 v14.3 LTS accepts 8.2-8.5), adding strict types, configuring PHPStan/Rector/PHP-CS-Fixer, refactoring to enums/DTOs/readonly/property hooks (PHP 8.4), improving type safety, reviewing PHP code quality. Tr","description":"# PHP Modernization Skill\n\nModernize PHP applications to PHP 8.x with type safety, PSR compliance, and static analysis.\n\n## Expertise Areas\n\n- **PHP 8.x**: Constructor promotion, readonly, enums, match, attributes, union/intersection types, `#[Override]`, typed constants, `#[SensitiveParameter]`, property hooks\n- **PSR/PER Compliance**: Active PHP-FIG standards (PSR-3/4/6/7/11/14/15/16/17/18/20, PER-CS)\n- **Static Analysis**: PHPStan (level 9+, `treatPhpDocTypesAsCertain: false`), PHPat, Rector, PHP-CS-Fixer\n- **Type Safety**: DTOs/VOs over arrays, generics via PHPDoc, copy-on-write awareness\n- **Pitfalls**: DOMDocument UTF-8 encoding, PHP-CS-Fixer deprecated aliases\n\n## Reference Documentation\n\n| Topic | Reference File |\n|-------|---------------|\n| PHP 8.0-8.5 features | `references/php8-features.md` |\n| PSR/PER compliance | `references/psr-per-compliance.md` |\n| PHPStan levels | `references/phpstan-compliance.md` |\n| Static analysis tools | `references/static-analysis-tools.md` |\n| PHP-CS-Fixer deprecations | `references/php-cs-fixer-deprecations.md` |\n| Type safety, DTOs | `references/type-safety.md` |\n| Request DTOs | `references/request-dtos.md` |\n| Adapter registry | `references/adapter-registry-pattern.md` |\n| Multi-version adapters | `references/multi-version-adapters.md` |\n| Symfony patterns | `references/symfony-patterns.md` |\n| TYPO3 PSR patterns | `references/typo3-psr-patterns.md` |\n| Migration planning | `references/migration-strategies.md` |\n\nAlways run `vendor/bin/php-cs-fixer fix --dry-run 2>&1 | grep -A 20 \"Detected deprecations\"` to check for deprecated rules.\n\n## Running Scripts\n\nVerify a project: `scripts/verify-php-project.sh /path/to/project`\n\n## Required Tools\n\n| Tool | Requirement |\n|------|-------------|\n| PHPStan | **Level 9 minimum**, level 10 recommended |\n| PHPat | Required for defined architectures |\n| Rector | Required for automated modernization |\n| PHP-CS-Fixer | Required with `@PER-CS` ruleset |\n\n## Core Rules\n\n- **DTOs required** over arrays for structured data\n- **Backed enums required** for fixed value sets (not constants)\n- **PSR interfaces** for type-hinting dependencies (PSR-3, PSR-6, PSR-7, PSR-11, PSR-14, PSR-18)\n\nSee `references/core-rules.md` for code examples and scoring criteria.\n\n## Migration Checklist\n\n- [ ] `declare(strict_types=1)` in all files\n- [ ] PER Coding Style via PHP-CS-Fixer (`@PER-CS`) with no deprecated aliases\n- [ ] PHPStan level 9+ (`treatPhpDocTypesAsCertain: false`, level 10 for new projects)\n- [ ] PHPat architecture tests for layer boundaries\n- [ ] Return types and parameter types on all methods\n- [ ] DTOs for data transfer, no array params/returns\n- [ ] Backed enums for all status/type values\n- [ ] Type-hint against PSR interfaces, not implementations\n- [ ] `#[Override]` on overridden methods (PHP 8.3+)\n- [ ] `#[SensitiveParameter]` on password/secret params (PHP 8.2+)\n- [ ] Typed class constants (PHP 8.3+)\n\n---\n\n> **Contributing:** https://github.com/netresearch/php-modernization-skill","tags":["php","modernization","skill","netresearch","agent-skills","ai-agent","open-standard"],"capabilities":["skill","source-netresearch","skill-php-modernization","topic-agent-skills","topic-ai-agent","topic-open-standard"],"categories":["php-modernization-skill"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/netresearch/php-modernization-skill/php-modernization","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add netresearch/php-modernization-skill","source_repo":"https://github.com/netresearch/php-modernization-skill","install_from":"skills.sh"}},"qualityScore":"0.457","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 14 github stars · SKILL.md body (3,007 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T13:03:27.352Z","embedding":null,"createdAt":"2026-04-19T00:40:37.952Z","updatedAt":"2026-04-22T13:03:27.352Z","lastSeenAt":"2026-04-22T13:03:27.352Z","tsv":"'-11':267 '-14':269 '-18':271 '-3':85,261 '-6':263 '-7':265 '-8':119 '-8.5':20,134 '/4/6/7/11/14/15/16/17/18/20':86 '/netresearch/php-modernization-skill':369 '/path/to/project':203 '1':186,285 '10':213,310 '2':185 '20':189 '8':48,61 '8.0':133 '8.1':14 '8.2':19,360 '8.3':354,365 '8.4':31 '9':94,210,306 'accept':18 'activ':79 'ad':21 'adapt':160,166 'alias':126,303 'alway':178 'analysi':57,91,144 'applic':45 'architectur':219,315 'area':59 'array':107,240,333 'attribut':68 'autom':223 'awar':115 'back':244,335 'boundari':319 'check':193 'checklist':281 'class':362 'code':37,275,290 'complianc':54,78,138 'configur':24 'constant':73,252,363 'constructor':63 'contribut':366 'copi':112 'copy-on-writ':111 'core':235 'criteria':279 'cs':89,101,123,149,227,233,295,299 'data':243,330 'declar':282 'defin':218 'depend':259 'deprec':125,151,191,195,302 'detect':190 'document':128 'domdocu':117 'dri':183 'dry-run':182 'dtos':155,158,237,328 'dtos/vos':105 'encod':120 'enum':66,245,336 'enums/dtos/readonly/property':28 'exampl':276 'expertis':58 'fals':96,308 'featur':135 'fig':82 'file':131,288 'fix':181,248 'fixer':102,124,150,228,296 'generic':108 'github.com':368 'github.com/netresearch/php-modernization-skill':367 'grep':187 'hint':258,343 'hook':29,76 'implement':348 'improv':32 'interfac':254,346 'layer':318 'level':93,141,209,212,305,309 'lts':17 'match':67 'method':327,352 'migrat':175,280 'minimum':211 'modern':3,10,41,43,224 'multi':164 'multi-vers':163 'new':312 'overrid':71,349 'overridden':351 'param':358 'paramet':323 'params/returns':334 'password/secret':357 'pattern':169,173 'per':88,232,289,298 'per-c':87,231,297 'php':2,9,13,30,36,40,44,47,60,81,100,122,132,148,226,294,353,359,364 'php-cs-fixer':99,121,147,225,293 'php-fig':80 'php-modern':1 'phpat':97,215,314 'phpdoc':110 'phpstan':92,140,208,304 'phpstan/rector/php-cs-fixer':25 'pitfal':116 'plan':176 'project':201,313 'promot':64 'properti':75 'psr':53,84,172,253,260,262,264,266,268,270,345 'psr/per':77,137 'qualiti':38 'readon':65 'recommend':214 'rector':98,220 'refactor':26 'refer':127,130 'references/adapter-registry-pattern.md':162 'references/core-rules.md':273 'references/migration-strategies.md':177 'references/multi-version-adapters.md':167 'references/php-cs-fixer-deprecations.md':152 'references/php8-features.md':136 'references/phpstan-compliance.md':142 'references/psr-per-compliance.md':139 'references/request-dtos.md':159 'references/static-analysis-tools.md':146 'references/symfony-patterns.md':170 'references/type-safety.md':156 'references/typo3-psr-patterns.md':174 'registri':161 'request':157 'requir':204,207,216,221,229,238,246 'return':320 'review':35 'rule':196,236 'ruleset':234 'run':179,184,197 'safeti':34,52,104,154 'score':278 'script':198 'scripts/verify-php-project.sh':202 'see':272 'sensitiveparamet':74,355 'set':250 'skill':42 'skill-php-modernization' 'source-netresearch' 'standard':83 'static':56,90,143 'status/type':339 'strict':22,283 'structur':242 'style':291 'symfoni':168 'task':11 'test':316 'tool':145,205,206 'topic':129 'topic-agent-skills' 'topic-ai-agent' 'topic-open-standard' 'tr':39 'transfer':331 'treatphpdoctypesascertain':95,307 'type':23,33,51,70,72,103,153,257,284,321,324,342,361 'type-hint':256,341 'typo3':15,171 'union/intersection':69 'upgrad':12 'use':4 'utf':118 'v14.3':16 'valu':249,340 'vendor/bin/php-cs-fixer':180 'verifi':199 'version':165 'via':109,292 'work':6 'write':114 'x':49,62","prices":[{"id":"cec55cb1-ded2-4445-b046-07473550217b","listingId":"cb4c9ebb-cc9e-47a1-adbb-d500a275f4ac","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"netresearch","category":"php-modernization-skill","install_from":"skills.sh"},"createdAt":"2026-04-19T00:40:37.952Z"}],"sources":[{"listingId":"cb4c9ebb-cc9e-47a1-adbb-d500a275f4ac","source":"github","sourceId":"netresearch/php-modernization-skill/php-modernization","sourceUrl":"https://github.com/netresearch/php-modernization-skill/tree/main/skills/php-modernization","isPrimary":false,"firstSeenAt":"2026-04-19T00:40:37.952Z","lastSeenAt":"2026-04-22T13:03:27.352Z"}],"details":{"listingId":"cb4c9ebb-cc9e-47a1-adbb-d500a275f4ac","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"netresearch","slug":"php-modernization","github":{"repo":"netresearch/php-modernization-skill","stars":14,"topics":["agent-skills","ai-agent","open-standard"],"license":"other","html_url":"https://github.com/netresearch/php-modernization-skill","pushed_at":"2026-04-22T10:53:57Z","description":"Agent Skill: PHP 8.x modernization patterns - typing, attributes, PHPStan | Claude Code compatible","skill_md_sha":"7f86e6e931ca244e96b73bdff0e50c6039ca8cf2","skill_md_path":"skills/php-modernization/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/netresearch/php-modernization-skill/tree/main/skills/php-modernization"},"layout":"multi","source":"github","category":"php-modernization-skill","frontmatter":{"name":"php-modernization","license":"(MIT AND CC-BY-SA-4.0)","description":"Use when working with ANY PHP modernization task: upgrading PHP 8.1+ (TYPO3 v14.3 LTS accepts 8.2-8.5), adding strict types, configuring PHPStan/Rector/PHP-CS-Fixer, refactoring to enums/DTOs/readonly/property hooks (PHP 8.4), improving type safety, reviewing PHP code quality. Triggers: PHP upgrade, modernize, type safety, PHPStan, Rector, PHP-CS-Fixer, enum, DTO, readonly, strict_types, property hooks, PHP 8.5.","compatibility":"Requires php 8.1+, composer."},"skills_sh_url":"https://skills.sh/netresearch/php-modernization-skill/php-modernization"},"updatedAt":"2026-04-22T13:03:27.352Z"}}