So I got this idea - what if we can just write function / class definitions and let AI generate the actual code for us. One thing led to another and after a fun weekend I got something working.
I made a simple python decorator that uses a function definition to generate the function code. It works for async functions and class methods, and it caches the generated code locally. There are some fun use cases like AI-generated fastAPI endpoints and agent tools.
I also realized that this approach somewhat incentivizes test-driven development because if you write the tests ahead of time you don’t only make sure that the code works but it is generated and cached before the actual program runs.
I haven’t had enough time to do a proper comparison but I wonder if this test-driven approach produces better code vs traditional vibe-coding.
I would love to hear your thoughts.
Cheers!