drupal-dtt

drupal-dtt is a skill for Claude Code, Codex from edutrul/drupal-ai. It costs 36 tokens per session (912 once invoked), scanned A, original, MIT.

A guide to Drupal Test Traits (DTT), a testing tool for checking a real, running Drupal website. It covers tests that create users and content, visit pages, and check their results, including runs with DDEV, a local development environment.

In plain words
What is it for?
Use it for smoke tests, integration tests, and regression tests of Drupal features on a running site.
Why use it?
It helps catch problems that only appear with real content, settings, users, or a production-like website.

Skill for Claude CodeCodex

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 skills/edutrul/drupal-ai/drupal-dtt
Any agent
npx skills add edutrul/drupal-ai --skill drupal-dtt
Clone the repo
git clone --depth 1 https://github.com/edutrul/drupal-ai

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for drupal-dtt

README.md
[![agentmods](https://agentmods.dev/badge/skills/edutrul/drupal-ai/drupal-dtt.svg)](https://agentmods.dev/skills/edutrul/drupal-ai/drupal-dtt)
Your own site
<a href="https://agentmods.dev/skills/edutrul/drupal-ai/drupal-dtt"><img src="https://agentmods.dev/badge/skills/edutrul/drupal-ai/drupal-dtt.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 912 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.00036 $0.00912
Opus 5 $0.00018 $0.00456
Sonnet 5 $0.00007 $0.00182
Haiku 4.5 $0.00004 $0.00091

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

Security

Grade A, and why

drupal-dtt 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 4d 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/skills/drupal-dtt/SKILL.md · 142 lines

How it starts

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

Drupal Test Traits (DTT) — ExistingSite Tests

When to Use

  • Testing against a real, running Drupal site
  • Smoke tests and integration tests against production-like data
  • When you need real content, config, and users
  • Regression tests for bugs found in production

Basic Structure

// tests/src/ExistingSite/MyFeatureTest.php
namespace Drupal\Tests\my_module\ExistingSite;

use weitzman\DrupalTestTraits\ExistingSiteBase;

/**
 * Tests My Feature on an existing site.
 *
 * @group my_module
 * @group existing_site
 */
final class MyFeatureTest extends ExistingSiteBase {

  public function testHomepageLoads(): void {
    $this->drupalGet('/');
    $this->assertSession()->statusCodeEquals(200);
    $this->assertSession()->pageTextContains('Welcome');
  }

  public function testArticleCreation(): void {
    // Create a user with role
    $user = $this->createUser();
    $user->addRole('editor');
    $user->save();
    $this->drupalLogin($user);

    // Create a node
    $node = $this->createNode([
      'type' => 'article',
      'title' => 'Test Article',
      'status' => 1,
    ]);

    $this->drupalGet('/node/' . $node->id());
    $this->assertSession()->statusCodeEquals(200);
    $this->assertSession()->pageTextContains('Test Article');
  }

  public function testFormSubmission(): void {
    $this->drupalGet('/contact');
    $this->assertSession()->statusCodeEquals(200);

    $this->submitForm([
      'name' => 'Test User',
      'mail' => '[email protected]',
      'message[0][value]' => 'Test message',
    ], 'Send message');

    $this->assertSession()->pageTextContains('Your message has been sent.');
  }

}

Common Assertions

// HTTP status
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->statusCodeEquals(403);
$this->assertSession()->statusCodeEquals(404);

// Page content
$this->assertSession()->pageTextContains('Expected text');
$this->assertSession()->pageTextNotContains('Missing text');

// Elements
$this->assertSession()->elementExists('css', '.my-class');
$this->assertSession()->elementTextContains('css', 'h1', 'Page Title');
$this->assertSession()->linkExists('My Link');
$this->assertSession()->linkByHrefExists('/my-path');

// Fields
$this->assertSession()->fieldExists('edit-title-0-value');
$this->assertSession()->fieldValueEquals('edit-title-0-value', 'My Title');

// Response headers
$this->assertSession()->responseHeaderContains('X-Drupal-Cache', 'HIT');

Read the full file on GitHub · 142 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 142 lines · 36 tokens per session scan A 9c8a792e862d

Subscribe to this mod's changes

drupal-dtt is a skill published in the GitHub repository edutrul/drupal-ai (71 stars, last pushed 3mo ago), licensed MIT. It adds 36 tokens to every session and 912 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.