Hacker News new | ask | show | jobs
by santiagobasulto 4 days ago
Regarding agents following instructions, my recommendation is to split in as many `AGENTS.md` file as possible, and use the root AGENTS.md as an index reference.

For example, this would be the resulting structure:

    src/
        billing/
            AGENTS.md
        products/
            AGENTS.models.md
            AGENTS.api.md
            AGENTS.md
    AGENTS.md
Then in the core AGENTS.md you can reference the main subsystems of your project and instruct the agent to reference the specific AGENTS.md. And `products` is a concrete example of a module so big that you can split instructions in multiple agents files.

This usually keeps the context very clean and working locally reading files is very fast.

1 comments

This is great advice and something I apply everywhere even with skills, where I have SKILL.md as just front matter plus index/ToC. It aligns well with progressive disclosure principles
Yes, this sort of thing is essential. I have a 3-line header for every md file, which contains name, description, and tells the agent if/when it needs to read the whole file. The AGENTS file tells it to read the first 3 lines of all md files in a certain tree, and then decide whether to read the whole file.

I also split into agent-editable and human-only-editable, the latter owned by a different user.