drupal-php-standards

Run PHPCS, PHPStan level 8, PHPMD, and spelling checks on Drupal PHP files.

3|5|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/sparkfabrik/sf-awesome-copilot --skill drupal-php-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drupal-php-standards
Source: https://github.com/sparkfabrik/sf-awesome-copilot/tree/main/skills/drupal/drupal-php-standards
Command: npx skills add https://github.com/sparkfabrik/sf-awesome-copilot --skill drupal-php-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Drupal PHP development often triggers QA failures at commit time due to inconsistent coding standards, leaving teams to chase post-commit fixes.

Core Features & Use Cases

  • Enforces Drupal-focused coding standards using PHPCS, PHPStan level 8, PHPMD, and CSpell to ensure zero-tolerance quality at commit.
  • Applies to modules, themes, and core Drupal PHP files such as .php, .module, .install, .inc, and .theme, providing guardrails for both small edits and larger refactors.
  • Use case: when implementing a new Drupal service or hook, ensure your change passes all quality gates before submission.

Quick Start

Run the Drupal PHP standards workflow on new or modified PHP files to guarantee QA compliance before commit.

Frequently Asked Questions about drupal-php-standards

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

FAQPage Schema
How do I enforce Drupal coding standards before committing PHP code?

To enforce Drupal coding standards before committing PHP code, run automated static analysis checks using GrumPHP. This applies PHPCS, PHPStan level 8, PHPMD, and spelling checks to your modules and themes to prevent QA failures.

What's the best way to prevent QA failures when writing Drupal modules and themes?

The best way to prevent QA failures when writing Drupal modules and themes is automating strict quality checks at commit time. Applying zero-tolerance static analysis to PHP files catches coding standard violations before integration.

Does GrumPHP work with PHPStan level 8 for Drupal PHP static analysis?

Yes, GrumPHP integrates with PHPStan level 8 for Drupal PHP static analysis. It runs these checks alongside PHPCS, PHPMD, and CSpell on modified PHP files to enforce zero-tolerance quality thresholds.

Can I run Drupal coding standard checks on .module and .install files?

Yes, you can run Drupal coding standard checks on .module and .install files. The automated checks also apply to .php, .inc, and .theme files, providing guardrails for both small edits and larger refactors.

Why do my Drupal PHP code changes fail QA at commit time?

Drupal PHP code changes fail QA at commit time due to inconsistent coding standards across modules and themes. Automating strict static analysis with zero-tolerance thresholds before integration prevents these post-commit fixes.

Does Drupal static analysis support checking one-line hooks and new service methods?

Yes, Drupal static analysis supports checking both one-line hooks and new service methods. It applies automated quality gates across any modified Drupal module or theme PHP file to ensure full compliance.