Install
$ agentstack add skill-edutrul-drupal-ai-drupal-render ✓ 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 Render Arrays
Basic Structure
$build = [
'#type' => 'container',
'#attributes' => ['class' => ['my-wrapper']],
'content' => [
'#markup' => $this->t('Hello world'),
],
];
Cache Metadata (Always Required)
$build['content'] = [
'#markup' => $output,
'#cache' => [
'tags' => ['node:' . $node->id(), 'node_list'],
'contexts' => ['user.permissions', 'url.query_args'],
'max-age' => 3600,
],
];
Cache Tag Conventions
| Tag | Invalidates when | |---|---| | node:123 | Node 123 is saved | | node_list | Any node is created/deleted | | user:456 | User 456 is saved | | taxonomy_term:789 | Term 789 is saved | | config:my_module.settings | Config is saved | | block_content:1 | Block content is saved |
Cache Contexts
| Context | Varies by | |---|---| | user | Current user identity | | user.permissions | User's permissions | | user.roles | User's roles | | url | Full URL | | url.path | URL path only | | url.query_args | Query string | | languages | Current language | | session | Session data | | theme | Active theme |
Markup Safety
// Plain text — always safe
$build['#plain_text'] = $user_input;
// Trusted markup — use Markup class
use Drupal\Core\Render\Markup;
$build['#markup'] = Markup::create('Safe');
// User input in markup — filter first
use Drupal\Component\Utility\Xss;
$build['#markup'] = Markup::create(Xss::filter($user_input));
// Admin-level markup — allows more tags
$build['#markup'] = Markup::create(Xss::filterAdmin($html));
Render Elements
// HTML tag
$build['heading'] = [
'#type' => 'html_tag',
'#tag' => 'h2',
'#value' => $this->t('Title'),
'#attributes' => ['class' => ['my-heading']],
];
// Link
$build['link'] = [
'#type' => 'link',
'#title' => $this->t('Go'),
'#url' => Url::fromRoute('entity.node.canonical', ['node' => $nid]),
'#attributes' => ['class' => ['button']],
];
// Entity view
$build['node'] = $this->entityTypeManager
->getViewBuilder('node')
->view($node, 'teaser');
// Inline template
$build['inline'] = [
'#type' => 'inline_template',
'#template' => '{{ content }}',
'#context' => ['class' => 'my-class', 'content' => $content],
];
Lazy Builder (Uncacheable Content)
$build['dynamic'] = [
'#lazy_builder' => [
'my_module.service:buildDynamicContent',
[$arg1, $arg2],
],
'#create_placeholder' => TRUE,
];
Rendering Programmatically
// Inject renderer service
public function __construct(
private readonly RendererInterface $renderer,
) {}
// Render to string
$html = $this->renderer->render($build);
// Render in isolated context (doesn't bubble cache)
$html = $this->renderer->renderInIsolation($build);
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.