This project is not covered by Drupal’s security advisory policy.
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? Only08-forms.mdis 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
- Enable the module:
drush en ai_agents_md - Run the install command:
drush ai-agents-md:install- This copies
AGENTS.mdto your project root and the.kb/folder alongside it. - Use
--forceto overwrite existing files without prompting.
- This copies
- Open your AI coding tool (Cursor, Claude Code, GitHub Copilot, Windsurf, etc.) in the project directory.
- The AI agent will automatically read
AGENTS.mdand 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)
Recommended modules/libraries
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.mdfile 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.mdfiles (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
- agents.md standard: agents.md
- Getting Started with AI Coding Tools on Drupal: drupal.org docs
Project information
- Project categories: Artificial Intelligence (AI)
- Ecosystem: AI (Artificial Intelligence)
- Created by dspachos on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
