Show me your AGENTS.md rules system!

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.

What do you guys think, is there a better way?

2 Likes

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"
}
1 Like

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..).

Some plug system for AGENTS would be nice..

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.