Drupal is a registered trademark of Dries Buytaert
Release: Leaflet 10.4.11 Minor update available for module leaflet (10.4.11). Release: Session Inspector 1.0.8 Minor update available for module session_inspector (1.0.8). Release: Migrate QA 2.0.4 Minor update available for module migrate_qa (2.0.4). Release: CKEditor Description List 3.0.0 Major update available for module ckeditor_descriptionlist (3.0.0). Release: FlowDrop 2.4.0 Minor update available for module flowdrop (2.4.0). Release: JWT Token Refresh 1.0.4 Minor update available for module jwt_token_refresh (1.0.4). Release: ConReg 1.0.0-beta1 First beta version released for module conreg (1.0.0-beta1). Release: AI Image Studio 1.0.0-beta8 New beta version released for module ai_image_studio (1.0.0-beta8). Usage Milestone: Statistics Counter Module statistics_counter crossed 1,000 active installs. Module Revived: Decoupled Router 2.0.7 Module decoupled_router updated after 11 months of inactivity (2.0.7).

Agents MD

No security coverage
View on drupal.org

This module provides an AI-optimized AGENTS.md file and a modular knowledge base for your Drupal project. It enables AI coding assistants to quickly access relevant, task-specific guidance from a slim entry point and a collection of focused files, rather than loading a massive, monolithic document. This approach reduces token consumption and improves the efficiency of AI-assisted Drupal development.

The AI Agents MD module installs an AI-optimized AGENTS.md file and a modular .kb/ (knowledge base) folder directly into your Drupal project root. These files follow the agents.md standard and provide structured, task-specific Drupal development guidance to AI coding agents like Cursor, Claude Code, GitHub Copilot, Windsurf, and others.

Traditional monolithic AGENTS.md files for Drupal are massive — around 1,500 lines consuming ~8,000 tokens. Every AI request loads the entire file, even for simple tasks like fixing a typo. This module solves that with a slim entry point (60 lines, ~400 tokens) plus a knowledge base of 23 focused files that AI agents read on demand, only when relevant to the current task.

After enabling the module, run the provided Drush command to copy the AGENTS.md and .kb/ folder to your project root. Open your AI coding tool in the project directory and it will automatically read the entry point and load only the knowledge-base files it needs for each task — covering services, entities, plugins, forms, security, caching, testing, and more.

Features

  • Slim AGENTS.md entry point — A concise 60-line file (~400 tokens) that is always loaded, containing project overview, critical rules, and a routing table telling the agent which knowledge-base file to read for each task type.
  • 23 focused knowledge-base files — The .kb/ folder contains self-contained guides covering: code standards, module scaffolding, services & dependency injection, entity API, plugin system, hooks, forms API, routes & controllers, security, caching & performance, anti-patterns, testing, events, configuration, batch & queue, render API, migration, Composer, JavaScript, workflow, and troubleshooting.
  • On-demand loading — AI agents read only the .kb/ files relevant to the current task. Building a form? Only 08-forms.md is loaded. This reduces token consumption from ~8,000 to ~400 for simple tasks.
  • Cross-referenced content — Each .kb/ file links to related files so agents can chain-read when a task spans multiple topics (e.g., services + entities + caching).
  • Copy-pasteable code examples — Every knowledge-base file includes PHP, YAML, Twig, and JavaScript snippets following Drupal coding standards.
  • Drupal 10.x and 11.x support — All patterns and code examples target modern Drupal with PHP 8.3+.
  • Drush command — One command (drush ai-agents-md:install) to deploy the files to your project root.

Post-Installation

  1. Enable the module: drush en ai_agents_md
  2. Run the install command: drush ai-agents-md:install
    • This copies AGENTS.md to your project root and the .kb/ folder alongside it.
    • Use --force to overwrite existing files without prompting.
  3. Open your AI coding tool (Cursor, Claude Code, GitHub Copilot, Windsurf, etc.) in the project directory.
  4. The AI agent will automatically read AGENTS.md and load the appropriate .kb/ files based on the task at hand.

No configuration page is needed — the files are plain Markdown and can be freely edited to match your project's specific conventions and requirements.

Additional Requirements

  • Drupal 10.x or 11.x
  • PHP 8.3+
  • Drush 13+ (for the install command)

This module has no dependencies beyond Drupal core and Drush. However, it pairs well with:

  • Claude Code — If you use Claude Code as your AI assistant, that module provides additional CLAUDE.md integration.
  • AI — The Drupal AI ecosystem module for building AI-powered features within Drupal itself.

Similar projects

  • Claude Code — Provides a CLAUDE.md file with Drupal-specific guidance for Anthropic's Claude Code. That module targets a single AI tool, whereas AI Agents MD follows the tool-agnostic agents.md standard and uses a modular knowledge-base architecture that works with any AI coding agent.
  • drupal-agents-md (GitHub) — The upstream repository this module is based on. That project provides standalone AGENTS.md files (including DDEV and Lagoon variants) that you copy manually. This module packages the knowledge-base architecture as a Drupal module with a Drush command for easier installation and updates.

Supporting this Module

This module is maintained by amazee.io and contributors. To support development:

  • Contribute on GitHub — pull requests, issues, and feedback are welcome.

Community Documentation

Activity

Tracked releases
1
Tracked since
Aug 2026
Latest release
6 days ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
1.0.x-dev Dev Aug 17, 2026