code-quality-audit

Run Magento 2 code quality checks with PSR-12, PHPStan, PHP_CodeSniffer, and PHP Mess Detector.

15|1|Updated Oct 24, 2025
One-click install
npx skills add https://github.com/ProxiBlue/claude-skills --skill code-quality-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-quality-audit
Source: https://github.com/ProxiBlue/claude-skills/tree/main/code-quality-audit
Command: npx skills add https://github.com/ProxiBlue/claude-skills --skill code-quality-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill eliminates the tedious manual effort of enforcing consistent Magento 2 code quality by running a comprehensive suite of automated checks (PSR-12, PHPStan, PHP_CodeSniffer, and PHP Mess Detector) across the codebase.

Core Features & Use Cases

  • PSR-12 Compliance Check: Validates strict PSR-12 adherence, including braces, spacing, and use statement order.
  • Static Analysis & Style Enforcement: Performs PHPStan analysis, Magento2-specific PHP_CodeSniffer checks, and code complexity auditing with PHP Mess Detector.
  • Use Case: Integrate into CI to catch style and quality regressions before merging, or run locally during feature development to maintain high-quality Magento 2 modules.

Quick Start

Run the following commands to perform the standard quality checks on your project: vendor/bin/php-cs-fixer fix --dry-run --diff vendor/bin/phpstan analyse -c phpstan.neon vendor/bin/phpcs --standard=Magento2 app/code/ vendor/bin/phpmd app/code/ text cleancode,codesize,design,naming,unusedcode

Frequently Asked Questions about code-quality-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Magento 2 code quality checks for PSR-12 and PHPStan?

Automate Magento 2 code quality checks by running vendor binaries for PHPStan, PHP_CodeSniffer, and PHP Mess Detector to validate PSR-12 adherence and enforce coding standards during development and CI workflows.

Can I use PHP_CodeSniffer to enforce Magento 2 coding standards locally?

Use PHP_CodeSniffer with the Magento2 standard on your app/code/ directory to validate strict coding standards locally. This catches style regressions during feature development before merging code.

What is the best way to run static analysis and code complexity audits in Magento 2?

Run static analysis and code complexity audits using PHPStan and PHP Mess Detector. These vendor binaries analyze your codebase to target complex designs, naming issues, and unused code in Magento 2 modules.

Do I need vendor binaries to perform PHP Mess Detector checks on a Magento 2 project?

You need vendor binaries to perform PHP Mess Detector checks. The automation executes vendor/bin/phpmd to audit code complexity using cleancode, codesize, design, naming, and unusedcode rulesets.

How does automated PSR-12 compliance validation work for Magento 2 modules?

Automated PSR-12 compliance validation works by running vendor/bin/php-cs-fixer in dry-run mode with diff output. This identifies strict formatting violations including braces, spacing, and use statement order in your codebase.