Code Quality Skills¶
Maintain coding standards and manage Composer dependency patches.
What changed in 2.0
As of 2.0, CMS Cultivator focuses on CMS development workflows. The comprehensive quality-audit capability moved to a separate internal Kanopi library, alongside the other audit skills.
Skills¶
code-standards-checker [standard]— Check coding standards compliance (PHPCS, ESLint)composer-patch-generator— Generate CI-safe patches for Composer packages
code-standards-checker Skill¶
Check coding standards compliance with PHPCS/ESLint for Drupal and WordPress projects.
/code-standards-checker # Auto-detect standards
/code-standards-checker drupal # Drupal coding standards
/code-standards-checker wordpress # WordPress coding standards
How It Works¶
The skill discovers commands rather than assuming them. Script aliases are defined by each project, so a memorized list goes stale — and recommending a command a project never declared is a confusing failure.
- Detect — read the
scriptsblocks incomposer.jsonandpackage.jsonat the level that owns the changed files (theme, plugin, module, or project root), prefix withddevwhen.ddev/exists, and check for config files (.phpcs.xml.dist,phpstan.neon,rector.php,.eslintrc*,.stylelintrc*) that reveal a configured tool with no alias wrapping it - Map — match the changed file type to a job: PHP to PHPCS, Twig to twig-cs-fixer,
JS and SCSS to the wp-scripts or ESLint/stylelint commands, with a raw
vendor/bin/…ornpx …fallback when no alias exists - Run auto-fix, then verify —
phpcbfbeforephpcs,formatbeforelint:js, then re-run the check and report what survived - Report — remaining violations with
file:lineand the command to re-verify
Kanopi starter script names (code-fix, code-sniff, twig-lint, rector-check) appear
in the skill as one row of a general alias lookup, alongside vanilla Drupal, WordPress,
and wp-scripts conventions — a reference to confirm against the project, not a command
list to recite.
If no alias, binary, or config file exists, the skill says so and offers to install the standards rather than guessing. It never certifies compliance from reading code: with the tooling unavailable, the summary begins "Standards not verified" and names what could not run.
composer-patch-generator Skill¶
Generate patches for Composer packages that apply cleanly both locally and in CI.
What It Does¶
- Creates patches in the correct
diff -ruNformat against the dist archive - Wires the patch into
composer.jsonviaextra.patches(cweagans/composer-patches) - Verifies the patch applies with a clean
composer install - Diagnoses "applies locally but fails in CI" mismatches
Common Workflows¶
Pre-commit standards check:
Patch a contrib module bug before the fix lands upstream:
Related Skills¶
- Testing Skills — Coverage analysis with
coverage-analyzer - PR Workflow —
/pr-review selfincludes a code quality pass - Drupal.org Contribution — Upstream the fixes you patch