Seven common task types
- Understanding code: where the entry point is, how requests flow, module relationships
- Refactoring and migration: splitting files, replacing old patterns, upgrading dependencies
- Performance optimisation: finding slow queries, repeated computation, memory problems
- Adding tests: edge conditions, failure paths, regression tests
- Speeding up work: applying repetitive changes in bulk
- Protecting flow: handing off small interrupting tasks
- Exploring ideas: quickly validating a technical direction
Prompts and acceptance for each type
Understanding code
- Prompt: “Where is the entry point for this feature? How does a request get to the response? Which modules are involved?”
- Acceptance: the explanation can be verified against the code yourself
Refactoring and migration
- Prompt: “Split this file into modules by responsibility and add tests for each module”
- Acceptance: tests pass, behaviour unchanged, the diff is readable
Performance optimisation
- Prompt: “Find the repeated computation in this handler, explain why it is slow, and propose an optimisation”
- Acceptance: there is a measured comparison, not just a verbal “it is faster”
Adding tests
- Prompt: “Add unit tests for this function covering empty input, boundary values and failure paths”
- Acceptance: the tests really run and can locate failures
Bulk changes
- Prompt: “Replace this pattern consistently across all relevant files and list the changes”
- Acceptance: the list can be checked and nothing is missed or wrongly changed
Working habits
- Ask for understanding first, then change: understanding questions are cheap, wrong changes are expensive
- One type at a time: if refactoring, do not sneak in features
- Use a task queue: put ideas into the queue and handle them in order to keep context clean
- Have it ask like a well-written issue: background, goal, acceptance criteria, constraints
- Keep the comparison: have it give a “before/after” difference note
- Choose among options: for important changes, ask for 2–3 options and compare before choosing
Common pitfalls
- Asking it to change logic and formatting at once → problems hard to locate
- Accepting without reading the diff → unrelated changes slip in
- Treating “looks faster” as a conclusion → no measurement
- Not running tests after changes → regressions go unnoticed
Checklist
- Every task type has a clear acceptance method
- Understand first, change later
- Only one type of change at a time
- A diff note exists after changes
- Tests really ran
- Performance changes have measurements
- Key changes get human review
Reference: task categories and prompt examples adapted from OpenAI’s business guide “How OpenAI uses Codex”, rewritten for general tools.
Questions
Will AI make the code messier the more it changes?
Not if you change one type of thing at a time, run tests after each change and read the diff. The worst case is asking it to refactor, add features and change styling at the same time, leaving problems impossible to locate.
How do I make it understand an unfamiliar project?
First ask understanding questions like where the entry point is, how requests flow, which modules are involved; do not ask it to change things right away. Once it understands, change requests are far more accurate.
Can I trust it on performance optimisation?
It can provide clues, but you must verify the conclusion: have it explain why it is faster and add tests or benchmark comparisons; do not ship an optimisation without measurement.