drupal-lint

A custom command for checking Drupal projects for code-style and quality issues. Drupal is a content-management system, and the command can check its PHP and JavaScript code separately or together.

In plain words
What is it for?
Use `/drupal-lint` to check PHP, JavaScript, or the whole project, inspect Drupal coding-standard violations, generate summaries, and run available automatic fixes.
Why use it?
It gives developers a consistent way to find style problems before code is merged or deployed. It can also apply automatic fixes where the configured tools support them.

Command for Cursor

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/ivangrynenko/cursorrules/drupal-lint
Clone the repo
git clone --depth 1 https://github.com/ivangrynenko/cursorrules

Made for: Cursor.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,966 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00000 $0.01966
Opus 5 $0.00000 $0.00983
Sonnet 5 $0.00000 $0.00393
Haiku 4.5 $0.00000 $0.00197

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

Security

Grade C, and why

drupal-lint scanned grade C with 1 finding 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf /tmp/rector_cached_files
.cursor/commands/drupal-lint.md · 293 lines

How it starts

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

Custom Command: Drupal Lint

Command Usage

/drupal-lint [scope]

Use the optional scope argument to narrow linting (e.g., php, js, all). Omit it to run the full linting workflow. The sections below describe the available tools and when to use them.

Linting Commands for Drupal Projects

This document provides comprehensive linting instructions for the Drupal project based on Vortex (DrevOps) configuration. When you refactoring existing code (as opposed to making minor adjustments), think harder.

Quick Reference

Model use

Use chatgpt-5-high model for all tasks

Run All Linting

# Run all backend and frontend linting
ahoy lint

# Run only backend linting
ahoy lint-be

# Run only frontend linting
ahoy lint-fe

# Auto-fix linting issues (where possible)
ahoy lint-fix

Backend Linting Tools

1. PHP CodeSniffer (PHPCS)

Purpose: Checks PHP code against Drupal coding standards.

# Run PHPCS on entire codebase
ahoy cli vendor/bin/phpcs

# Run on specific file or directory
ahoy cli vendor/bin/phpcs web/modules/custom/module_name

# Show specific sniffs being used
ahoy cli vendor/bin/phpcs -s

# Generate a report
ahoy cli vendor/bin/phpcs --report=summary

# Check specific standard violations
ahoy cli vendor/bin/phpcs --sniffs=Drupal.Commenting.FunctionComment

Configuration: phpcs.xml

  • Standards: Drupal, DrupalPractice
  • PHP Version: 8.3
  • Checks custom modules, themes, and tests

2. PHP Code Beautifier and Fixer (PHPCBF)

Purpose: Automatically fixes PHPCS violations where possible.

# Auto-fix all fixable issues
ahoy cli vendor/bin/phpcbf

# Fix specific file or directory
ahoy cli vendor/bin/phpcbf web/modules/custom/module_name

# See what would be fixed without making changes
ahoy cli vendor/bin/phpcbf --dry-run

3. PHPStan

Purpose: Static analysis tool that finds bugs without running code.

# Run PHPStan analysis (Level 7)
ahoy cli vendor/bin/phpstan

# Run with memory limit
ahoy cli vendor/bin/phpstan --memory-limit=2G

# Analyze specific paths
ahoy cli vendor/bin/phpstan analyse web/modules/custom/module_name

# Clear cache and re-analyze
ahoy cli vendor/bin/phpstan clear-result-cache
ahoy cli vendor/bin/phpstan

Read the full file on GitHub · 293 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 · 293 lines · 0 tokens per session scan C 350d9bf6aeec

Subscribe to this mod's changes

drupal-lint is a command published in the GitHub repository ivangrynenko/cursorrules (88 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,966 tokens. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.