What these prompts cover

These prompts cover the everyday loop of programming work: writing a function or script to a spec, finding out why something broke, restructuring code that has become hard to change, and adding tests so it stays working. Each one is built around what a capable colleague would ask for first (the language version, the runtime, the exact error text, what the code is supposed to do) because generated code follows the quality of the spec far more than the wording of the request.

Pick by the stage you are at, not by language. If nothing exists yet, start with the Python or JavaScript prompt. If something exists and fails, use the debugging prompt, which works across languages and is the broadest of the set. If it works but is hard to live with, refactor. Before or after either, write tests. The prompts hand over to one another: the behaviors restated by the code-writing prompts become test cases, and a diagnosed bug becomes a regression test.

AI models are useful for drafting implementations, reading stack traces, proposing hypotheses and listing edge cases you had not considered. They do not run your code unless your tool has an execution environment, they cannot see files you have not shown them, and they can recall a library function that does not exist. Every prompt here therefore asks the model to separate what it knows from what it assumes, and you should treat the output as a pull request from a fast, well-read contributor: run it, test it and review it before it ships.

Start here

Which prompt should you use?

If you need to…Use
I have an error or a wrong result and need to find the causeBug Diagnosis Prompt
I need a Python script or module written from a descriptionPython Script and Module Prompt
I need a JavaScript or TypeScript function with a clear, typed contractJavaScript and TypeScript Function Prompt
The code works but is hard to read, change or testBehavior-Preserving Refactoring Prompt
I want tests for existing code, or tests first for code I am about to writeUnit Test Writing Prompt

All Coding prompts

Fixing code

Improving code

Writing code

Testing

Guides that help with coding prompts