Instead of just bitching at you, here are some tips for getting code out of your AI that even a beginner might be able to read and understand, and that might not be complete garbage:
Include in your prompt a file of instructions like:
1. Do not make any function longer than 5 lines of code, excluding documentation and logging. Limit all files to 250 lines of code.
2. Make the code highly object-oriented (or highly functional, whichever you prefer or depending upon your use case) and modular.
3. Include a logger, integrate it into every function, and make it so that I can run the app with different logging levels.
4. Write extensive user documentation for everything, including type definitions and examples for implementation.
5. Use constants wherever applicable, and group the constants at the top of the class or module.
6. Use private or protected wherever useful.
7. Refactor and simply the code, and remove any dead or redundant code, after each pass.
8. Separate concerns, and give all functions a human-readable name.
9. Add a description of the architecture, patterns, protocols (like Nostr), and libraries you expect to be preferred.
10. If implementing a GUI or other user interface, point it to an example of one you like and tell it to give you something similar.
Then submit your request in Gherkin scenarios, instead of prose.
Reorganize the scenarios into features -- which should be relatively small, like "broadcast button" -- and get it all sort of comprehensive and coherent, and then feed the AI one feature at a time, along with the prompt instruction file.
And then work that one feature until it's good, manually test it and refactor the code, AND THEN COMMIT THE CODE TO GIT, before asking it to do the next feature. Start a new conversation before the next feature. This is like high-speed agile development and will ALWAYS get a better result because it's iterative and therefore more like how the best human developers work.
If you ask it to fix some code, open a different chat and tell it that another AI wrote the code. Even better, ask another AI and tell it the name of the other one. Just trust me on this one.
Once you have it doing what you want it to do, and the state can be fixed and tagged, have it write unit tests to freeze the functionality. Then make sure the unit tests are easy to read and understand. Remove any test you don't understand. Avoid mocking relays. Use a local or ephemeral relay for testing, instead.
And then write your own integration test, with some realistic examples.
We could also have a Liminal agent, that talks you to death and then suggests something really brilliant, so that you almost miss it because your mind is exhausted from the long preamble.
And a Michael agent that responds to every question with something like "This coulda been a singelton." or "Have you considered configuring this to be reusable?"
And a nostr:nprofile1qy2hwumn8ghj7etyv4hzumn0wd68ytnvv9hxgqguwaehxw309ankjarrd96xzer9dshxummnw3erztnrdakj7qpqecdlntvjzexlyfale2egzvvncc8tgqsaxkl5hw7xlgjv2cxs705s4t4uaf agent, that usually ignores you and then occasionally drops something complex, and then disappears again.
A nostr:nprofile1qyghwumn8ghj7mn0wd68ytnvv9hxgtcpzemhxue69uhhyetpd3ujumtvv44h2tnyv4mz7qpqfjqqy4a93z5zsjwsfxqhc2764kvykfdyttvldkkkdera8dr78vhsfa5ckl agent would yell at you for a solid 10 minutes, calm down, and then program, reprogram, and refactor and reprogram in record time, and then drop the result in your feed and be like, "I suffer you idiots all day."
nostr:nprofile1qy2hwumn8ghj76rfwd6zumn0wd68ytnvv9hxgqghwaehxw309ahxverz9ehx7umhdpjhyefwvdhk6qpq2262qa4uhw7u8gdwlgmntqtv7aye8vdcmvszkqwgs0zchel6mz7s4pc3yf agent would seem to never be around or responsive, but then suddenly drop a "Check you messages." in the chat feed and deliver some major feature you asked for 2 months ago and had given up all hope for.
And so on. Could be really fun. 😅
Showing page 1 of
1 pages