Install
$ agentstack add skill-edutrul-drupal-ai-drupal-kernel ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Drupal Kernel Tests
When to Use
- Testing services that interact with Drupal's service container
- Database operations and entity CRUD
- Hook implementations
- Config operations
- Tests needing a real database but not a full browser
Basic Structure
// tests/src/Kernel/MyServiceTest.php
namespace Drupal\Tests\my_module\Kernel;
use Drupal\KernelTests\KernelTestBase;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
/**
* Tests MyService integration.
*
* @group my_module
*/
final class MyServiceTest extends KernelTestBase {
protected static $modules = [
'system',
'user',
'node',
'field',
'text',
'my_module',
];
protected function setUp(): void {
parent::setUp();
$this->installSchema('system', ['sequences']);
$this->installSchema('node', ['node_access']);
$this->installEntitySchema('user');
$this->installEntitySchema('node');
$this->installConfig('my_module');
// Create content type
NodeType::create(['type' => 'article', 'name' => 'Article'])->save();
}
public function testServiceProcessesNode(): void {
$node = Node::create([
'type' => 'article',
'title' => 'Test Node',
'status' => 1,
]);
$node->save();
$service = $this->container->get('my_module.my_service');
$result = $service->process($node);
$this->assertTrue($result);
}
}
installEntitySchema vs installSchema
// For entity types (creates entity tables)
$this->installEntitySchema('node');
$this->installEntitySchema('user');
$this->installEntitySchema('taxonomy_term');
$this->installEntitySchema('paragraph');
// For specific table schemas (not entity-based)
$this->installSchema('system', ['sequences', 'key_value']);
$this->installSchema('node', ['node_access']);
// For config from a module's config/install
$this->installConfig('my_module');
$this->installConfig(['node', 'user']);
Creating Test Users
use Drupal\user\Entity\User;
$user = User::create([
'name' => 'test_user',
'mail' => 'test@example.com',
'status' => 1,
]);
$user->save();
// Set as current user
$this->setCurrentUser($user);
Testing Config
$config = $this->config('my_module.settings');
$this->assertTrue($config->get('enabled'));
// Update config
$this->config('my_module.settings')
->set('enabled', FALSE)
->save();
Testing Hooks
public function testHookNodePresave(): void {
$node = Node::create(['type' => 'article', 'title' => 'Test']);
$node->save();
// Reload to verify hook ran
$node = Node::load($node->id());
$this->assertEquals('Modified by hook', $node->get('field_processed')->value);
}
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: edutrul
- Source: edutrul/drupal-ai
- License: MIT
- Homepage: https://eduardotelaya.com/drupal-ai/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.