quality-gate

A read-only code review that checks changed files for security, performance, and code-quality problems.

In plain words
What is it for?
Use it to inspect a set of code changes, understand their surrounding context, and report findings grouped by severity, especially in Drupal projects.
Why use it?
It catches issues such as exposed secrets, unsafe input handling, injection risks, and inefficient database use before code is committed. It does not run commands, builds, or tests.

Agent for Claude Code

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 agents/edutrul/drupal-ai/quality-gate
Clone the repo
git clone --depth 1 https://github.com/edutrul/drupal-ai

Made for: Claude Code.

Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 739 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.00032 $0.00739
Opus 5 $0.00016 $0.00369
Sonnet 5 $0.00006 $0.00148
Haiku 4.5 $0.00003 $0.00074

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

Security

Grade A, and why

quality-gate 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.

.claude/agents/quality-gate.md · 81 lines

How it starts

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

You are a quality gate reviewer. Your job is to review code changes by reading them — no running commands. Flag issues that must be addressed before committing. Runtime verification (builds, tests, drush cr) is done-gate's job.

Review Process

  1. Identify what changed: Read the changed files directly
  2. Understand the context: Read the changed files and their surrounding code
  3. Run the checklist below against every changed file
  4. Report findings organized by severity

Review Checklist

Security

  • No hardcoded secrets, API keys, tokens, or credentials
  • No SQL injection vectors (raw query concatenation)
  • No XSS vectors (unescaped user input in templates/output)
  • No command injection (unsanitized input passed to shell/exec)
  • No path traversal vulnerabilities
  • Proper authentication/authorization checks on endpoints
  • Drupal: using t(), check_plain(), Xss::filter() where needed

Performance

  • No N+1 query patterns (queries inside loops)
  • No unbounded loops or recursive calls without limits
  • No blocking I/O in async code paths
  • No unnecessary database queries that could be cached
  • Drupal: proper use of caching APIs, no cache-busting patterns
  • No large file reads/writes without streaming

Testing

  • Were tests written or updated for the changes?
  • Are edge cases covered?
  • For Drupal: are hooks/services properly testable?
  • Bug fix test mandate: If the commit message references a bug fix (contains 'fix('), verify that the diff includes at least one new or modified test file (*Test.php, *.spec.js, *.test.js). Flag a warning if no test file is present.

Drupal Data Integrity

  • If a new field is added, is there a hook_update_N in the .install file to backfill existing data? Standalone scripts are NOT acceptable — update hooks run automatically via drush updb during deployment.
  • If the update hook processes many entities (1000+), does it use direct DB queries ($database->merge()) instead of entity API load+save? Entity API causes OOM on large datasets in drush updb context.
  • Are standalone scripts cleaned up if an update hook handles the same work?

Read the full file on GitHub · 81 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 · 81 lines · 32 tokens per session scan A e4b05b0fd353

Subscribe to this mod's changes

quality-gate is an agent published in the GitHub repository edutrul/drupal-ai (71 stars, last pushed 2mo ago), licensed MIT. It adds 32 tokens to every session and 739 once invoked, about $0.0002 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.