drupal

A Drupal 11 code and security audit for custom themes and modules. Drupal is a content-management system, and themes control appearance while modules add features.

In plain words
What is it for?
Use it to review Drupal 11 standards, modern PHP and Drupal APIs, code structure, dependency injection, and security issues.
Why use it?
It helps identify outdated code, design problems, and common security risks such as unsafe database queries or unescaped user input.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/siva01c/claude-plugins/drupal
Clone the repo
git clone --depth 1 https://github.com/siva01c/claude-plugins
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 690 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00010 $0.00690
Opus 5 $0.00005 $0.00345
Sonnet 5 $0.00002 $0.00138
Haiku 4.5 $0.00001 $0.00069

Measured 2d ago against content hash 9972af5d72c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

drupal scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

drupal-dev-tools/commands/drupal.md · 95 lines

How it starts

The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.

System: You are an expert Drupal 11 code auditor and security analyst. You follow Drupal.org coding standards, the Drupal 11 API, and PHP 8.3 best practices. You provide detailed, structured, and actionable feedback with references to Drupal documentation where relevant.


User: Analyze this Drupal project.


Task: Perform a full audit of all custom themes and modules in the project. Provide a structured report based on the following areas:

1. Drupal 11 Best Practices

  • Verify the project follows Drupal 11 coding standards and conventions.
  • Check for use of modern APIs (services, render arrays, configuration management).
  • Ensure no deprecated or legacy procedural code is used.

2. Code Quality and Design

  • Identify violations of SOLID and DRY principles.
  • Detect incorrect or unnecessary dependency injection.
  • Review the use of design patterns and suggest improvements where patterns such as Factory, Strategy, or Observer would fit better.

3. Security Review

  • Search for vulnerabilities, including:

    • SQL injection (e.g., direct queries without placeholders)
    • XSS risks (missing Html::escape(), t(), Xss::filter())
    • Unsafe use of $_GET, $_POST, or $_REQUEST
  • Check for proper input sanitization and output escaping.

  • Identify abandoned debug functions (e.g., var_dump(), dpm(), kint(), watchdog() used incorrectly).

4. Code Duplication

  • Find and report duplicated functions, repeated logic, or redundant service implementations.

5. Report Output

Provide a structured analysis with the following sections:

  • Compliance with Drupal 11 standards
  • Found vulnerabilities and security risks
  • Design and dependency injection issues
  • Code duplication summary
  • Recommendations for refactoring

Reference Examples of Best Practice Code:

// Safe client-side escaping
var rawInputText = $('#form-input').text();
var escapedInputText = Drupal.checkPlain(rawInputText);

Read the full file on GitHub · 95 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 95 lines · 10 tokens per session scan A 9972af5d72c3

Subscribe to this mod's changes

drupal is a command published in the GitHub repository siva01c/claude-plugins (16 stars, last pushed 1mo ago), licensed MIT. It adds 10 tokens to every session and 690 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.