From 526a7c0702109072352b9756b64cb94e342fe102 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Tue, 3 Jun 2025 15:19:39 -0300 Subject: [PATCH] agent: Support `AGENT.md` and `AGENTS.md` as rules file names (#31998) These started to be used more recently, so we should also support them. Release Notes: - agent: Added support for `AGENT.md` and `AGENTS.md` as rules file names. --- crates/agent/src/thread_store.rs | 4 +++- docs/src/ai/rules.md | 13 +++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/crates/agent/src/thread_store.rs b/crates/agent/src/thread_store.rs index b6edbc3919..964cb8d75e 100644 --- a/crates/agent/src/thread_store.rs +++ b/crates/agent/src/thread_store.rs @@ -70,13 +70,15 @@ impl Column for DataType { } } -const RULES_FILE_NAMES: [&'static str; 6] = [ +const RULES_FILE_NAMES: [&'static str; 8] = [ ".rules", ".cursorrules", ".windsurfrules", ".clinerules", ".github/copilot-instructions.md", "CLAUDE.md", + "AGENT.md", + "AGENTS.md", ]; pub fn init(cx: &mut App) { diff --git a/docs/src/ai/rules.md b/docs/src/ai/rules.md index 68162ca6ac..81b8480bd9 100644 --- a/docs/src/ai/rules.md +++ b/docs/src/ai/rules.md @@ -5,8 +5,17 @@ Currently, Zed supports `.rules` files at the directory's root and the Rules Lib ## `.rules` files -Zed supports including `.rules` files at the top level of worktrees, and act as project-level instructions you'd like to have included in all of your interactions with the Agent Panel. -Other names for this file are also supported—the first file which matches in this list will be used: `.rules`, `.cursorrules`, `.windsurfrules`, `.clinerules`, `.github/copilot-instructions.md`, or `CLAUDE.md`. +Zed supports including `.rules` files at the top level of worktrees, and act as project-level instructions that are included in all of your interactions with the Agent Panel. +Other names for this file are also supported for compatibility with other agents, but note that the first file which matches in this list will be used: + +- `.rules` +- `.cursorrules` +- `.windsurfrules` +- `.clinerules` +- `.github/copilot-instructions.md` +- `AGENT.md` +- `AGENTS.md` +- `CLAUDE.md` ## Rules Library {#rules-library}