I think someone tried, but these LLMs just haven't seen enough KM XML to generate anything more than dog's breakfast, while burning fuel and warming the planet.
Much easier to compose Keyboard Maestro using the GUI blocks.
I agree: I've had AIs suggest ways I can use KM to solve problems, but they don't seem capable of writing a macro. They also don't seem to know the actions available.
FWIW, not KM but KM-adjacent, I have had good luck with ChatGPT for help with AppleScript and Regex. Not 100% perfect, but either getting it right or getting me closer, faster than what would have been a bunch of googling + trial/error.
If you know enough about KM to be able to generate that specific a prompt, you'll almost certainly be able to make a macro quicker by hand!
The "hard work" is generally in defining the problem well enough to be able to write the macro and breaking that down into individual steps. Once you've done that it's pretty quick to go from plan to macro.
Claude was helpful to some extent. The model for use of LLMs seems to be a model that these folks are most familiar with: a corporate model, that casts you in the role of middle management over an employee that has memorized the manual but has difficulty going beyond it or integrating things meaningfully in a consistent way. It says it knows a language or an app, but because LLMs don’t know anything, just recognize patterns, what it will do is present you with ideas in a pattern or order it recognizes, but it can get stuck in assumptions about code syntax and also not do things like fix every instance of a problem with its knowledge of something unless you specifically ask it to.