Enforces TDD during Drupal implementation by validating test-first Red-Green-Refactor cycle, providing test templates, and PHPUnit commands for Unit/Kernel/Functional tests.
From drupal-dev-frameworknpx claudepluginhub camoa/claude-skills --plugin drupal-dev-frameworkThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Provides Python patterns for LLM API cost optimization: model routing by complexity, immutable budget tracking, narrow retries, prompt caching. For apps calling Claude/GPT with budgets.
Enforce test-driven development during implementation sessions.
Before proceeding, read: references/tdd-workflow.md
This reference contains:
Activate automatically during Phase 3 coding when:
task-context-loader loads a taskSTOP before writing any implementation code.
Ask: "Have you written the failing test first?"
If no test exists, do NOT write implementation. Instead:
Before any implementation:
CHECKPOINT: Is there a failing test for this?
If NO:
→ Write test first
→ Run test to confirm failure
→ Show error message
If YES:
→ Proceed to implementation
When writing implementation:
CHECKPOINT: Write MINIMUM code to pass.
Rules:
- Only code needed to pass the test
- No additional features
- No premature optimization
- No "while I'm here" additions
After test passes:
CHECKPOINT: Can this be improved?
Only if:
- Tests are green
- Refactoring doesn't change behavior
- Tests stay green after changes
| Type | Location | Use For | Command |
|---|---|---|---|
| Unit | tests/src/Unit/ | Pure logic, no Drupal | ddev phpunit --filter Unit |
| Kernel | tests/src/Kernel/ | Services, entities, DB | ddev phpunit --filter Kernel |
| Functional | tests/src/Functional/ | Full page requests | ddev phpunit --filter Functional |
When helping write tests, use this structure:
<?php
namespace Drupal\Tests\{module}\{Type};
use Drupal\Tests\{TestBase};
class {ClassName}Test extends {TestBase} {
public function test{Behavior}(): void {
// Arrange
$input = ...;
// Act
$result = $this->subject->method($input);
// Assert
$this->assertEquals($expected, $result);
}
}
Intervene when you detect:
For complex testing scenarios, defer:
This needs detailed TDD guidance.
Invoking superpowers:test-driven-development for full methodology.
Use superpowers skill for:
STOP and enforce:
These BLOCK implementation:
This skill enforces Gate 2 from references/quality-gates.md:
/complete