Skip to main content
skill CX Codex

drupal-security — Claude Code skill: secure Drupal code

A coding-agent skill that nudges you toward safe Drupal patterns: parameterized queries, escaped output, permission checks. It activates on its own while you write forms, controllers or handle user input.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add madsnorgaard/drupal-agent-resources --skill drupal-security -a claude-code
Open on GitHub

What drupal-security does

The skill fires automatically when the agent writes or edits forms, controllers or plugins, builds database queries, or handles user input. It warns during the edit, not after the commit.

Inside is a walkthrough of the usual holes: string concatenation in SQL, output through #markup, accessCheck(FALSE) on entity queries, routes missing _permission, {{ var|raw }} in Twig, hardcoded passwords and keys. Each one comes with a safe alternative: the query builder with condition(), placeholders like :name, #plain_text, Xss::filterAdmin(), CSRF tokens for AJAX. File uploads get their own section — check the MIME type, not just the extension.

There is a pre-commit checklist and a red-flag table listing the pattern, the risk and the fix. The skill also suggests four questions for any code: where the data comes from, where it goes, who should reach it, and what happens with malicious input. Treat it as a nudge while you type, not a replacement for a security audit.

Install is one command through npx skills add.

What it helps with

  • Catches XSS, SQL injection and access bypass while the code is being written instead of at review time.
  • Gives safe replacements for common Drupal anti-patterns: query builder over concatenation, #plain_text over #markup, accessCheck(TRUE) over FALSE.
  • Ships a pre-commit checklist and a red-flag table you can run against someone else's code.

Example prompts for the agent

  • Install the skill, then ask the agent to write a form or controller — it pulls in the safe patterns on its own.
  • During review, ask: "check this code for SQL injection and XSS against Drupal rules".
  • Ask "how do I safely render user HTML in Drupal?" and the skill points to Xss::filterAdmin() and the right render elements.

How to install drupal-security

1Skills CLI (Vercel)

npx skills add madsnorgaard/drupal-agent-resources --skill drupal-security -a claude-code

2Manually: put the files in place

~/.claude/skills/drupal-security/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/drupal-security/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about drupal-security

How do I install drupal-security in Claude Code?

Run npx skills add madsnorgaard/drupal-agent-resources --skill drupal-security -a claude-code. The skill file lands at ~/.claude/skills/drupal-security/SKILL.md.

What does the drupal-security skill do?

It suggests safe Drupal patterns while code is written: parameterized queries, escaped output, permission checks and CSRF handling. It activates by itself when you touch forms, controllers, queries or user input.

Which platforms does drupal-security support?

Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. Each has its own install command, for example gh skill install madsnorgaard/drupal-agent-resources drupal-security for GitHub Copilot.

Similar skills

Everything for Security →

From the same set3

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor