Cursor obeys this spec, fortunately https://agents.md/ . Now I have my rules in project/AGENTS.md, Cursor automatically reads it. Claude code needs a workaround:
ln -s AGENTS.md CLAUDE.md
I find myself editing AGENTS quite often, and there is a core and framework related part, that should be spread over all projects, automagically.
I’m pondering ~/agents/AGENTS.md, with a concatenation script updateagent.sh of project/PROJECT.md - merges generic and project specific rules.
Another updateallagents.sh script to iterate thru all projects.
Works well. I also call it in my project creation script, and then open ai/PROJECT.md with cursor.
# update local AGENTS.md from AGENTS_CORE.md
updateagents() {
cat ~/dotfiles/prompts/AGENTS_CORE.md > AGENTS.md && \
if [[ -f ai/PROJECT.md ]]; then
cat ai/PROJECT.md >> AGENTS.md
else
echo "No ai/PROJECT.md found"
fi
# claude symlink (only if not exists)
[ -L CLAUDE.md ] || ln -s AGENTS.md CLAUDE.md
}
# update AGENTS.md in all 1st-level subdirs under $HOME/flutter
updateagentsall() {
local CURRENT_DIR=$(pwd)
cdflutter || return 1
setopt local_options null_glob
for dir in */; do
if [[ -f "${dir}AGENTS.md" ]]; then
echo "🔧 Updating ${dir}AGENTS.md"
(cd "$dir" && updateagents)
fi
done
cd "$CURRENT_DIR"
}
There is also agent specific stuff coming up (codex has some issues calling flutter directly..). And features I only need from time to time (logging + what to test for debugging..).