{"id":"f7ce6c06-fec2-4fb1-8589-6309f9b34c97","shortId":"M7Brej","kind":"skill","title":"magento-php-specialist","tagline":"Advanced PHP development for Magento 2 following PSR-12 and Magento coding standards. Use when writing PHP code, implementing business logic, or ensuring code quality. Masters modern PHP features, object-oriented programming, design patterns, and Magento-specific PHP practices.","description":"# Magento 2 PHP Specialist\n\nExpert specialist in leveraging advanced PHP techniques and modern practices to create high-performance, maintainable Magento 2 applications following enterprise development standards.\n\n## When to Use\n\n- Writing PHP code for Magento 2\n- Implementing business logic\n- Ensuring code quality and standards\n- Working with modern PHP features\n- Implementing design patterns\n\n## PHP Standards (STRICT ENFORCEMENT)\n\n### PSR-12 Compliance\n- **PSR-12**: Strictly adhere to PSR-12 coding standards\n- **Magento2 Coding Standard**: Follow standards in `vendor/magento/magento-coding-standard/Magento2`\n- **Strict Types**: `declare(strict_types=1);` required\n- **EditorConfig**: Check project's `.editorconfig` for indentation (4 spaces), line endings (LF), encoding (UTF-8)\n\n### Code Structure Requirements\n- **Opening Braces**: Classes and methods must have opening braces on their own line (PSR-12)\n- **Constructor Property Promotion**: Use with `readonly` modifier where appropriate\n- **Type Hinting**: All parameters and return types must be type-hinted\n- **Strict Comparisons**: Always use `===` and `!==` (never `==` or `!=`)\n- **Constructor PHPDoc**: Must include `@param` annotation for each parameter\n\n### Modern PHP Features\n- **Constructor Property Promotion**: Use constructor property promotion\n- **Readonly Properties**: Use `readonly` modifier where appropriate\n- **Union Types**: Use union types for flexible type hints\n- **Match Expressions**: Use match expressions instead of switch when appropriate\n- **Named Arguments**: Use named arguments for clarity\n\n### Code Example\n```php\n<?php\n\n/**\n * Copyright © 2025 CompanyName. All rights reserved.\n */\n\ndeclare(strict_types=1);\n\nnamespace CompanyName\\ModuleName\\Model;\n\nuse CompanyName\\ModuleName\\Api\\ConfigInterface;\nuse CompanyName\\ModuleName\\Api\\RepositoryInterface;\n\nclass Service\n{\n    /**\n     * @param RepositoryInterface $repository\n     * @param ConfigInterface $config\n     */\n    public function __construct(\n        private readonly RepositoryInterface $repository,\n        private readonly ConfigInterface $config\n    ) {\n    }\n\n    /**\n     * @param int $id\n     * @return EntityInterface|null\n     */\n    public function getById(int $id): ?EntityInterface\n    {\n        if ($id <= 0) {\n            return null;\n        }\n\n        return $this->repository->getById($id);\n    }\n}\n```\n\n## Best Practices\n\n### Object-Oriented Programming\n- **Composition Over Inheritance**: Prefer composition patterns\n- **Dependency Injection**: Constructor injection only - avoid service locators\n- **Single Responsibility**: One purpose per class/method\n- **Interface Segregation**: Use small, focused interfaces\n- **SOLID Principles**: Follow SOLID principles\n\n### Code Quality\n- **Type Safety**: 100% type coverage - parameters, return types, properties\n- **Error Handling**: Comprehensive exception handling\n- **Logging**: Use `\\Psr\\Log\\LoggerInterface` for logging\n- **Documentation**: Minimal PHPDoc with `@param`, `@return`, `@throws`\n- **Testing**: Write unit tests for business logic\n\n### Magento-Specific Patterns\n- **Service Contracts**: Use service contracts for APIs\n- **Repository Pattern**: Implement repository pattern for data access\n- **Factory Pattern**: Use factories for object creation\n- **Plugin Pattern**: Use plugins to extend functionality\n- **Observer Pattern**: Use observers for event-driven architecture\n\n## References\n\n- [PSR-12 Coding Standard](https://www.php-fig.org/psr/psr-12/)\n- [Adobe Commerce PHP Development](https://developer.adobe.com/commerce/php/development/)\n- [Coding Standards](https://developer.adobe.com/commerce/php/coding-standards/)\n\nFocus on writing clean, maintainable PHP code that follows Magento best practices.","tags":["magento","php","specialist","magento2","agent","skills","maxnorm","agent-skills"],"capabilities":["skill","source-maxnorm","skill-magento-php-specialist","topic-agent-skills","topic-magento2"],"categories":["magento2-agent-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/maxnorm/magento2-agent-skills/magento-php-specialist","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add maxnorm/magento2-agent-skills","source_repo":"https://github.com/maxnorm/magento2-agent-skills","install_from":"skills.sh"}},"qualityScore":"0.454","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 9 github stars · SKILL.md body (3,745 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-05-18T19:08:50.216Z","embedding":null,"createdAt":"2026-05-07T20:43:42.233Z","updatedAt":"2026-05-18T19:08:50.216Z","lastSeenAt":"2026-05-18T19:08:50.216Z","tsv":"'-12':13,103,106,111,160,428 '-8':142 '/commerce/php/coding-standards/)':445 '/commerce/php/development/)':440 '/psr/psr-12/)':433 '0':302 '1':126,254 '100':351 '2':10,47,67,81 '2025':246 '4':135 'access':402 'adher':108 'adob':434 'advanc':5,54 'alway':184 'annot':194 'api':262,267,394 'applic':68 'appropri':169,214,233 'architectur':425 'argument':235,238 'avoid':327 'best':310,456 'brace':147,154 'busi':24,83,382 'check':129 'clariti':240 'class':148,269 'class/method':335 'clean':449 'code':16,22,28,78,86,112,115,143,241,347,429,441,452 'commerc':435 'companynam':247,256,260,265 'comparison':183 'complianc':104 'composit':316,320 'comprehens':360 'config':276,287 'configinterfac':263,275,286 'construct':279 'constructor':161,189,201,205,324 'contract':389,392 'copyright':245 'coverag':353 'creat':61 'creation':409 'data':401 'declar':123,251 'depend':322 'design':38,96 'develop':7,71,437 'developer.adobe.com':439,444 'developer.adobe.com/commerce/php/coding-standards/)':443 'developer.adobe.com/commerce/php/development/)':438 'document':370 'driven':424 'editorconfig':128,132 'encod':140 'end':138 'enforc':101 'ensur':27,85 'enterpris':70 'entityinterfac':292,299 'error':358 'event':423 'event-driven':422 'exampl':242 'except':361 'expert':50 'express':225,228 'extend':415 'factori':403,406 'featur':33,94,200 'flexibl':221 'focus':340,446 'follow':11,69,117,344,454 'function':278,295,416 'getbyid':296,308 'handl':359,362 'high':63 'high-perform':62 'hint':171,181,223 'id':290,298,301,309 'implement':23,82,95,397 'includ':192 'indent':134 'inherit':318 'inject':323,325 'instead':229 'int':289,297 'interfac':336,341 'leverag':53 'lf':139 'line':137,158 'locat':329 'log':363,366,369 'loggerinterfac':367 'logic':25,84,383 'magento':2,9,15,42,46,66,80,385,455 'magento-php-specialist':1 'magento-specif':41,384 'magento2':114 'maintain':65,450 'master':30 'match':224,227 'method':150 'minim':371 'model':258 'modern':31,58,92,198 'modifi':167,212 'modulenam':257,261,266 'must':151,177,191 'name':234,237 'namespac':255 'never':187 'null':293,304 'object':35,313,408 'object-ori':34,312 'observ':417,420 'one':332 'open':146,153 'orient':36,314 'param':193,271,274,288,374 'paramet':173,197,354 'pattern':39,97,321,387,396,399,404,411,418 'per':334 'perform':64 'php':3,6,21,32,44,48,55,77,93,98,199,243,244,436,451 'phpdoc':190,372 'plugin':410,413 'practic':45,59,311,457 'prefer':319 'principl':343,346 'privat':280,284 'program':37,315 'project':130 'promot':163,203,207 'properti':162,202,206,209,357 'psr':12,102,105,110,159,365,427 'public':277,294 'purpos':333 'qualiti':29,87,348 'readon':166,208,211,281,285 'refer':426 'repositori':273,283,307,395,398 'repositoryinterfac':268,272,282 'requir':127,145 'reserv':250 'respons':331 'return':175,291,303,305,355,375 'right':249 'safeti':350 'segreg':337 'servic':270,328,388,391 'singl':330 'skill' 'skill-magento-php-specialist' 'small':339 'solid':342,345 'source-maxnorm' 'space':136 'specialist':4,49,51 'specif':43,386 'standard':17,72,89,99,113,116,118,430,442 'strict':100,107,121,124,182,252 'structur':144 'switch':231 'techniqu':56 'test':377,380 'throw':376 'topic-agent-skills' 'topic-magento2' 'type':122,125,170,176,180,216,219,222,253,349,352,356 'type-hint':179 'union':215,218 'unit':379 'use':18,75,164,185,204,210,217,226,236,259,264,338,364,390,405,412,419 'utf':141 'vendor/magento/magento-coding-standard/magento2':120 'work':90 'write':20,76,378,448 'www.php-fig.org':432 'www.php-fig.org/psr/psr-12/)':431","prices":[{"id":"c4267bbc-9c3a-4cac-9987-18612eef6cf0","listingId":"f7ce6c06-fec2-4fb1-8589-6309f9b34c97","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"maxnorm","category":"magento2-agent-skills","install_from":"skills.sh"},"createdAt":"2026-05-07T20:43:42.233Z"}],"sources":[{"listingId":"f7ce6c06-fec2-4fb1-8589-6309f9b34c97","source":"github","sourceId":"maxnorm/magento2-agent-skills/magento-php-specialist","sourceUrl":"https://github.com/maxnorm/magento2-agent-skills/tree/main/skills/magento-php-specialist","isPrimary":false,"firstSeenAt":"2026-05-18T13:14:29.670Z","lastSeenAt":"2026-05-18T19:08:50.216Z"},{"listingId":"f7ce6c06-fec2-4fb1-8589-6309f9b34c97","source":"skills_sh","sourceId":"maxnorm/magento2-agent-skills/magento-php-specialist","sourceUrl":"https://skills.sh/maxnorm/magento2-agent-skills/magento-php-specialist","isPrimary":true,"firstSeenAt":"2026-05-07T20:43:42.233Z","lastSeenAt":"2026-05-07T22:42:21.949Z"}],"details":{"listingId":"f7ce6c06-fec2-4fb1-8589-6309f9b34c97","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"maxnorm","slug":"magento-php-specialist","github":{"repo":"maxnorm/magento2-agent-skills","stars":9,"topics":["agent-skills","magento2"],"license":"mit","html_url":"https://github.com/maxnorm/magento2-agent-skills","pushed_at":"2026-01-24T16:45:35Z","description":"A collection of specialized agent skills for Magento 2 development, designed to provide domain expertise across all aspects of Magento/Adobe Commerce development workflows. ","skill_md_sha":"00698395a8c8c4b22e291e952d19d4e9dee26334","skill_md_path":"skills/magento-php-specialist/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/maxnorm/magento2-agent-skills/tree/main/skills/magento-php-specialist"},"layout":"multi","source":"github","category":"magento2-agent-skills","frontmatter":{"name":"magento-php-specialist","description":"Advanced PHP development for Magento 2 following PSR-12 and Magento coding standards. Use when writing PHP code, implementing business logic, or ensuring code quality. Masters modern PHP features, object-oriented programming, design patterns, and Magento-specific PHP practices."},"skills_sh_url":"https://skills.sh/maxnorm/magento2-agent-skills/magento-php-specialist"},"updatedAt":"2026-05-18T19:08:50.216Z"}}