I often just take an approach similar to cog [1], but it's simple enough I prefer to roll my own to do whatever code generation I'm wanting. E.g. write a ~100 line python file that reads source file(s), reads special comments with code gen or introspection instructions, and then insert generated code at some designated point(s).
Off course one can just hunt down the advance material looking through discord, read the bigger zig codebases etc but having it all in one place a couple of books that describe and explains is just way better to level up and get rid of the skill issue :)