A simple suggestion:
Right now, the templates to generate the code are hardcoded in the functions. They could be moved to a "templates" directory and have their contents included in the final result with include_bytes!.
I have a feeling this would make things easier to update/add new functionality/support different tools.
(Another solution would be use Tera for extended template support, but I guess this is a second step after this.)