Appendix: Prompt Toolkit for Machine Coding
These prompts are designed to support the crystallization phase of your AI-powered development process.
They’re reusable, customizable, and should become part of your personal prompt arsenal.
🧠 File Polishing Prompt
Use when: a file is functionally complete, but needs cleanup and clarity.
Polish this file. Improve variable and function naming, clean up the structure, and add comments that explain why each part exists. Make it ready for review or handoff.
🧪 Test Generation Prompt
Use when: you want to auto-generate basic tests using pytest.
Write pytest unit tests for every major function in this file. Include at least one edge case for each.
📄 Documentation Prompt
Use when: you want AI to create usable markdown docs.
Summarize this file’s purpose, list its main functions, and provide example usage in markdown. Include installation or setup steps if needed.
🧹 Complexity Reduction Prompt
Use when: the code is too long, messy, or hard to maintain.
What parts of this code are unnecessary or can be simplified while still achieving the goal? Remove dead weight or flag overengineering.
🧰 Tips for Using This Toolkit
- Start with one file at a time during final cleanup.
- Customize each prompt to match your project or language.
- Save your personal best versions in a local prompt library.
- Use these as part of a final polishing checklist before handoff or deployment.
👉 These prompts were introduced in Chapter 13: Machine Coding.
Refer back to that chapter to see how they’re used in context.