Agent skill
code-quality-audit
Automated code quality audit skill that runs PSR-12 compliance checks, phpstan static analysis, phpcs code style validation, and phpmd mess detection for Magento 2 code.
Install this agent skill to your Project
npx add-skill https://github.com/ProxiBlue/claude-skills/tree/main/code-quality-audit
SKILL.md
This skill automates comprehensive code quality checks for Magento 2 projects.
What This Skill Does
-
PSR-12 Compliance Check
- Validates strict PSR-12 adherence
- Checks opening braces placement
- Validates spacing and indentation
- Verifies proper use statement ordering
-
PHPStan Static Analysis
- Type checking at maximum level
- Identifies potential bugs and errors
- Validates method signatures and return types
- Checks for undefined variables and methods
-
PHP_CodeSniffer (Magento2 Standard)
- Enforces Magento2 coding standards
- Validates dependency injection patterns
- Checks service contract usage
- Verifies plugin and observer implementation
-
PHP Mess Detector
- Identifies code complexity issues
- Detects unused code and parameters
- Highlights potential design problems
- Suggests refactoring opportunities
Usage
When invoked, this skill will:
- Run
vendor/bin/php-cs-fixer fix --dry-run --diffto check PSR-12 compliance - Execute
vendor/bin/phpstan analyse -c phpstan.neonfor static analysis - Run
vendor/bin/phpcs --standard=Magento2 app/code/for Magento standards - Execute
vendor/bin/phpmd app/code/ text cleancode,codesize,design,naming,unusedcode
Output
The skill provides:
- List of violations with file paths and line numbers
- Severity classification (Critical, High, Medium, Low)
- Specific recommendations for fixes
- Code examples of proper implementations
When to Use
- Before code review submissions
- After implementing new features or modules
- During pull request validation
- Before production deployments
- As part of CI/CD pipeline validation
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
create-backend-controller
Creates a backend (adminhtml) controller action in Magento 2 with proper ACL, routing, authorization, and admin UI integration. Use when building admin pages, AJAX endpoints, form handlers, or mass actions.
agent-teams
page-banner-setup
hyva-module-compatibility
Identify and fix Magento 2 module compatibility issues with Hyvä Themes. Covers block plugin bypasses, RequireJS/Knockout replacements, ViewModels, and Alpine.js integration for modules that work in admin but fail on Hyvä frontend.
magento-diagnostic
Comprehensive Magento 2 system diagnostic skill that gathers cache status, index status, module information, configuration, logs, and performance metrics for rapid troubleshooting.
create-frontend-controller
Creates a frontend controller action in Magento 2 for the storefront. Use when building custom frontend pages, AJAX endpoints, form submission handlers, or API-like endpoints for JavaScript.
Didn't find tool you were looking for?