drupal-menus

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

A guide to Drupal menu links, tabs, action links, contextual links, and code that builds menu trees. It shows how YAML files connect links to routes and how code can load and filter menus.

In plain words
What is it for?
Use it to add admin navigation, settings tabs, add-item actions, contextual links, or programmatically loaded menu trees.
Why use it?
It helps you place administration pages, tabs, and actions in Drupal’s navigation without hard-coding the menu structure.

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-menus
Any agent
npx skills add edutrul/drupal-ai --skill drupal-menus
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-menus

README.md
[![agentmods](https://agentmods.dev/badge/skills/edutrul/drupal-ai/drupal-menus.svg)](https://agentmods.dev/skills/edutrul/drupal-ai/drupal-menus)
Your own site
<a href="https://agentmods.dev/skills/edutrul/drupal-ai/drupal-menus"><img src="https://agentmods.dev/badge/skills/edutrul/drupal-ai/drupal-menus.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 548 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.00029 $0.00548
Opus 5 $0.00015 $0.00274
Sonnet 5 $0.00006 $0.00110
Haiku 4.5 $0.00003 $0.00055

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

Security

Grade A, and why

drupal-menus 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 5d 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-menus/SKILL.md · 97 lines

What it actually says

Drupal Menus

# my_module.links.menu.yml

my_module.admin:
  title: 'My Module'
  description: 'Configure My Module.'
  route_name: my_module.admin
  parent: system.admin_config
  weight: 10

my_module.admin.settings:
  title: 'Settings'
  route_name: my_module.admin.settings
  parent: my_module.admin
  weight: 0
# my_module.links.task.yml

my_module.settings_tab:
  title: 'Settings'
  route_name: my_module.admin.settings
  base_route: my_module.admin

my_module.advanced_tab:
  title: 'Advanced'
  route_name: my_module.admin.advanced
  base_route: my_module.admin
  weight: 10
# my_module.links.action.yml

my_module.add_item:
  title: 'Add Item'
  route_name: my_module.add
  appears_on:
    - my_module.list

Programmatic Menu Tree

use Drupal\Core\Menu\MenuTreeParameters;

$menu_tree = \Drupal::menuTree();
$parameters = new MenuTreeParameters();
$parameters->setMaxDepth(2)->onlyEnabledLinks();

$tree = $menu_tree->load('main', $parameters);
$manipulators = [
  ['callable' => 'menu.default_tree_manipulators:checkAccess'],
  ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'],
];
$tree = $menu_tree->transform($tree, $manipulators);
$build = $menu_tree->build($tree);
#[Hook('menu_links_discovered_alter')]
public function menuLinksDiscoveredAlter(array &$links): void {
  if (isset($links['my_module.some_link'])) {
    $links['my_module.some_link']['title'] = new TranslatableMarkup('New Title');
  }
}
// src/Plugin/Menu/MyDynamicMenuLink.php
use Drupal\Core\Menu\MenuLinkDefault;

final class MyDynamicMenuLink extends MenuLinkDefault {
  public function getTitle(): string {
    return 'Dynamic Title from ' . $this->getRouteName();
  }
}
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. 5d ago First seen · 97 lines · 29 tokens per session scan A b3a4cb01b6dc

Subscribe to this mod's changes

drupal-menus is a skill published in the GitHub repository edutrul/drupal-ai (71 stars, last pushed 3mo ago), licensed MIT. It adds 29 tokens to every session and 548 once invoked, about $0.0001 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.

Related

Other skills, from other repositories

opencli-sitemap-author

Use when creating or maintaining OpenCLI site sitemaps: agent-facing navigation, page-state, action, workflow, API-reference, pitfall, and fallback knowledge for a website. Use after browser exploration discovers durable site context, when a sitemap is stale, or when promoting local site knowledge into the repo.

jackwener/OpenCLI · 67 tokens

golden-rss

Use when testing the rss golden build.

yusufkaraaslan/Skill_Seekers · 12 tokens

overleaf-sync

Two-way sync between a local paper directory and an Overleaf project, so ARIS audit/edit workflows stay on the local copy while collaborators edit in the Overleaf web UI. Use when user says "同步 overleaf", "overleaf sync", "推送到 overleaf", "connect overleaf", "Overleaf 桥接", "pull overleaf", "push overleaf", or wants to…

wanshuiyin/Auto-claude-code-research-in-sleep · 97 tokens

omh-code-review

This is a Hermes-native code-review workflow skill.

rlaope/oh-my-hermes · 46 tokens

android-pentest

安卓应用渗透测试 — APK分析、Hook、自动化测试、运行态驱动、签名恢复、抓包分析.

Netw0rkNoob/VulnClaw · 32 tokens

product-agent

Discover and validate product ideas, analyze markets, scope MVPs, and optimize app store presence for iOS/macOS apps. Use when user asks to discover, validate, assess, scope, or analyze product ideas, market opportunities, or when they mention "product agent", "app idea validation", "should I build this", "MVP"…

rshankras/claude-code-apple-skills · 81 tokens