magento-php-specialist

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.

16 stars

Best use case

magento-php-specialist is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using magento-php-specialist should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/magento-php-specialist/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/data-ai/magento-php-specialist/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/magento-php-specialist/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How magento-php-specialist Compares

Feature / Agentmagento-php-specialistStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Magento 2 PHP Specialist

Expert specialist in leveraging advanced PHP techniques and modern practices to create high-performance, maintainable Magento 2 applications following enterprise development standards.

## When to Use

- Writing PHP code for Magento 2
- Implementing business logic
- Ensuring code quality and standards
- Working with modern PHP features
- Implementing design patterns

## PHP Standards (STRICT ENFORCEMENT)

### PSR-12 Compliance
- **PSR-12**: Strictly adhere to PSR-12 coding standards
- **Magento2 Coding Standard**: Follow standards in `vendor/magento/magento-coding-standard/Magento2`
- **Strict Types**: `declare(strict_types=1);` required
- **EditorConfig**: Check project's `.editorconfig` for indentation (4 spaces), line endings (LF), encoding (UTF-8)

### Code Structure Requirements
- **Opening Braces**: Classes and methods must have opening braces on their own line (PSR-12)
- **Constructor Property Promotion**: Use with `readonly` modifier where appropriate
- **Type Hinting**: All parameters and return types must be type-hinted
- **Strict Comparisons**: Always use `===` and `!==` (never `==` or `!=`)
- **Constructor PHPDoc**: Must include `@param` annotation for each parameter

### Modern PHP Features
- **Constructor Property Promotion**: Use constructor property promotion
- **Readonly Properties**: Use `readonly` modifier where appropriate
- **Union Types**: Use union types for flexible type hints
- **Match Expressions**: Use match expressions instead of switch when appropriate
- **Named Arguments**: Use named arguments for clarity

### Code Example
```php
<?php

/**
 * Copyright © 2025 CompanyName. All rights reserved.
 */

declare(strict_types=1);

namespace CompanyName\ModuleName\Model;

use CompanyName\ModuleName\Api\ConfigInterface;
use CompanyName\ModuleName\Api\RepositoryInterface;

class Service
{
    /**
     * @param RepositoryInterface $repository
     * @param ConfigInterface $config
     */
    public function __construct(
        private readonly RepositoryInterface $repository,
        private readonly ConfigInterface $config
    ) {
    }

    /**
     * @param int $id
     * @return EntityInterface|null
     */
    public function getById(int $id): ?EntityInterface
    {
        if ($id <= 0) {
            return null;
        }

        return $this->repository->getById($id);
    }
}
```

## Best Practices

### Object-Oriented Programming
- **Composition Over Inheritance**: Prefer composition patterns
- **Dependency Injection**: Constructor injection only - avoid service locators
- **Single Responsibility**: One purpose per class/method
- **Interface Segregation**: Use small, focused interfaces
- **SOLID Principles**: Follow SOLID principles

### Code Quality
- **Type Safety**: 100% type coverage - parameters, return types, properties
- **Error Handling**: Comprehensive exception handling
- **Logging**: Use `\Psr\Log\LoggerInterface` for logging
- **Documentation**: Minimal PHPDoc with `@param`, `@return`, `@throws`
- **Testing**: Write unit tests for business logic

### Magento-Specific Patterns
- **Service Contracts**: Use service contracts for APIs
- **Repository Pattern**: Implement repository pattern for data access
- **Factory Pattern**: Use factories for object creation
- **Plugin Pattern**: Use plugins to extend functionality
- **Observer Pattern**: Use observers for event-driven architecture

## References

- [PSR-12 Coding Standard](https://www.php-fig.org/psr/psr-12/)
- [Adobe Commerce PHP Development](https://developer.adobe.com/commerce/php/development/)
- [Coding Standards](https://developer.adobe.com/commerce/php/coding-standards/)

Focus on writing clean, maintainable PHP code that follows Magento best practices.

Related Skills

jekyll-specialist

16
from diegosouzapw/awesome-omni-skill

Manages the samueltauil.github.io Jekyll site. Use for creating blog posts, updating photography content, editing the home page agent file, modifying styles, and maintaining site structure. Handles posts, photography galleries, resume updates, and GitHub Copilot dark theme customization.

agent-seo-specialist

16
from diegosouzapw/awesome-omni-skill

Expert SEO strategist specializing in technical SEO, content optimization, and search engine rankings. Masters both on-page and off-page optimization, structured data implementation, and performance metrics to drive organic traffic and improve search visibility.

abm-specialist

16
from diegosouzapw/awesome-omni-skill

Эксперт ABM. Используй для account-based marketing, target account selection и personalized campaigns.

bullmq-specialist

16
from diegosouzapw/awesome-omni-skill

BullMQ expert for Redis-backed job queues, background processing, and reliable async execution in Node.js/TypeScript applications. Use when: bullmq, bull queue, redis queue, background job, job queue.

API Integration Specialist

16
from diegosouzapw/awesome-omni-skill

Expert guidance for designing, integrating, and maintaining third-party APIs with best practices for authentication, error handling, rate limiting, security, and data transformation. Use when integrating external APIs, troubleshooting API issues, implementing OAuth flows, handling webhooks, or building API wrappers and clients.

AI Integration Specialist

16
from diegosouzapw/awesome-omni-skill

Integrate AI tools and APIs into business workflows and applications

agent-laravel-specialist

16
from diegosouzapw/awesome-omni-skill

Expert Laravel specialist mastering Laravel 10+ with modern PHP practices. Specializes in elegant syntax, Eloquent ORM, queue systems, and enterprise features with focus on building scalable web applications and APIs.

security-specialist

16
from diegosouzapw/awesome-omni-skill

安全专家。专注于应用安全、威胁建模、安全合规和数据保护。提供安全审查、漏洞扫描、安全配置和合规检查。用于构建安全可靠的应用系统。

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

moai-lang-r

16
from diegosouzapw/awesome-omni-skill

R 4.4+ best practices with testthat 3.2, lintr 3.2, and data analysis patterns.

moai-lang-python

16
from diegosouzapw/awesome-omni-skill

Python 3.13+ development specialist covering FastAPI, Django, async patterns, data science, testing with pytest, and modern Python features. Use when developing Python APIs, web applications, data pipelines, or writing tests.

moai-icons-vector

16
from diegosouzapw/awesome-omni-skill

Vector icon libraries ecosystem guide covering 10+ major libraries with 200K+ icons, including React Icons (35K+), Lucide (1000+), Tabler Icons (5900+), Iconify (200K+), Heroicons, Phosphor, and Radix Icons with implementation patterns, decision trees, and best practices.