There also is one special instructions file which you can add and that's
an agents.md file. This is a file or a
convention that's supported by other coding agents, like Cursor as well.
And the idea is the same. You can put general instructions in here.
Unlike the instruction file from earlier, it's not restricted to
specific files though. Instead, agents.md will essentially always
be loaded for all your prompts. Therefore, you also don't wanna make it too
complex because all the instructions you put in there will always be
loaded and will always consume tokens.
But for example, I could put the instruction ensure we
rules in there to make sure that our Python code is in line with the
PEP8 Python styling rules, which is what that is about, in case you
don't know Python. This is simply a style guide in the end
again, you can make that more complex.
Put anything in there that should always be loaded.
You just should keep in mind that it will always be loaded.
You can also put multiple agents.md files in your
code and for example, have them in subfolders.
So let's say in a source folder, and then the
instructions in there would only be loaded if the agent works in
a file in that subfolder. So that allows you to set up
subfolder specific instructions with help of
agents.md. When working with GitHub Copilot,
those Copilot instructions which I showed you before, like this
one, or agents.md or both. That is totally up to
you. The advantage of agents.md is that it will also work with other coding
assistants. The disadvantage is that you don't have the fine-grain control
you have with the Copilot instructions.