Coding style guidelines for AI?

There seem to be a fair few of us using AI to work on this repo, and I remember that last time I did it, I had to go back and re-do a bunch of work because what it spat out did not fit the conventions of the repo.

I am now playing with some more modifications, so I thought I would have a stab at giving it some conventions up front, but not really knowing WTF I am talking about C/C++ wise (And it was too long ago that I did it that my memory is now hazy), I am not sure what it has written is good.

I am thinking that maybe we can come up with some prompts which cause it to generate code in an appropriate style in the first place, which we can all use, and commit it to the repo.

Does anyone fancy reviewing these files and seeing if they think it covers it?

I guess the place it has put it is probably specific to my AI agen (GitHub copilot), so it maybe needs moving somewhere else ultimately, and then each author would be responsible for pointing there AI at the relevant files

Tagging @marcmerlin on this one (Sorry for spamming you today mate!)

Its probably a good idea.
maybe putting AGENTS.md in the root of the project as thats what most environments recognise.

I’m not one to craft it though :),
But I imagine things like keep the same coding style, where you can keep things modularized, make sure comments are added to make it clear to anyone trying to maintain it in future etc

I obviously didn’t pick the C++ style since I didn’t author this project but what I would do, is:

  1. tell AI to analyse the C style and write a spec sheet for it

  2. save that spec sheet in a README in the project that other AIs can just read and apply as is

In my experience, GitHub CoPilot (aka Microsoft CoPilot) isn’t always delivering brilliant code.

I’ve had consistently good value from Claude - integrate github and Claude into Visual Studio and away you go!

Just check everything any AI produces.