Pardon me if I misread, but wouldn't that be better served by a ready-made library (with, if you must AI, some futzing to account for call signature)?
What is the value add of having the AI rebuild code over and over, individually for each project using it?