drupal-rules
Installation
SKILL.md
Drupal Development Rules
Consolidated rules for Drupal development. Follow these for every implementation task.
Autopilot Interventions (MANDATORY)
When you see AUTOPILOT [type]: messages in hook output, you MUST stop what you are doing and follow the instruction. These are not suggestions — they are policy enforcement from the session autopilot. The intervention contains a specific tool call you must execute before making further edits. Ignoring an autopilot intervention is equivalent to ignoring a test failure.
Services & Dependency Injection
Mandatory Rules
- Use services + dependency injection -- NEVER use
\Drupal::*static calls in classes. - Use Entity API for all CRUD operations -- NEVER use raw SQL queries.
- New modules require:
.info.yml,.module,/src(PSR-4),.services.yml. - Config defaults go in
config/install/, nothook_install(). - Use the library system for front-end assets -- no inline JS/CSS.