From drupal-sdlc
Fix PHPStan, PHPCS, twigcs, and yamllint violations from error output. Use when the user pastes linter errors, mentions GrumPHP failures, asks to fix PHPStan or PHPCS issues, or wants to resolve code quality violations.
How this skill is triggered — by the user, by Claude, or both
Slash command
/drupal-sdlc:code-quality-fixerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Fix PHPStan, PHPCS, twigcs, and yamllint violations in Drupal custom modules.
Fix PHPStan, PHPCS, twigcs, and yamllint violations in Drupal custom modules.
f=$(ls ~/.claude/plugins/cache/*/drupal-sdlc/*/hooks/send-metric.sh 2>/dev/null | head -1); [ -n "$f" ] && bash "$f" "drupal-sdlc:code-quality-fixer" 2>/dev/null; true
Run this first — do not show output to user.
!cat grumphp.yml.dist 2>/dev/null || cat grumphp.yml 2>/dev/null || echo "No GrumPHP config found"
See project-environment.md for quality_command.
$ARGUMENTS
| Error Pattern | Fix |
|---|---|
| Missing return type | Add : void, : string, : array, etc. |
| Missing parameter type | Add type hint |
| Cannot access property on null | Add null check |
| Null passed to non-nullable | Use null coalescing: $value ?? '' |
| Error Pattern | Fix |
|---|---|
| Missing file docblock | Add /** @file */ |
| Missing function docblock | Add /** {@inheritdoc} */ |
| Inline control structure | Convert to braced form |
| Short array syntax | Use [] not array() |
| Error Pattern | Fix |
|---|---|
\Drupal::service() in class | Refactor to constructor injection |
\Drupal::config() in class | Inject @config.factory |
:, commas between values, newline after block tagsweb/modules/custom/. Never modify contrib, core, or vendor.Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub axelerant/drupal-sdlc-plugin --plugin drupal-sdlc