HACKER Q&A
📣 endorphine

Do global AGENTS.md with coding principles make sense?


For example, greenfield advice like: "prefer clear over clever code. Strive for maintainable, simple and testable code etc".

Do these kind of vague advice make sense to have on an AGENTS.md file? And if so, any reason to not have it in the global one?


  👤 verdverm Accepted Answer ✓
I put these in my system prompt, but I can do that directly in my custom setup. If your tooling does this with a global md, good enough I suppose

They are helpful. It's surprising to me that on one hand you can write a bunch and the agent will ignore it, while you can also drop a line like "talk to me like a peer who's helping work through the problem" can make a noticeable difference


👤 dnw
Honestly it is unclear to me still. Last month wrote a whole coding principles AGENTS/CLAUDE MD file but not clear if the produced code has changed _because of_ that or other reasons. Couple of things give me confidence that the models actually do read them and follow them.

1) I have a sentence that says: "I am your pairing buddy Bob. Occasionally address me by my name." And you will see them address you by the name, occasionally. 2) I do have per project "Project Tenets." Each tenets is a catchy couple of words, like Design for Agent First, Tolerant Interfaces over Robust Interfaces. If you notice the coding assistant referring to this you know they are aware, and they do sometimes refer to it. I also have a common list of principles but I think they are less useful because those are generic for software engineering. 3) Occasionally, I will do the following prompt: i) Who am I? ii) What is our design philosophy and tenets? iii) Go through the repo and ensure the architecture and codebase adheres to our design philosophy and tenets.

Kind of works.