Free 15-minute callFree 15-minute call →
艾维禾砺Vibe Coding LabIvheli · 1:1 coaching
Practice notes

What code tasks AI can do

AI coding is not always 'building a feature from scratch'. Most of the time it is more like an assistant that can read the whole repository: helping you understand, clean up, optimise and add tests.

Updated 2026-11-112 min readFree guides · 6/96

Seven common task types

  1. Understanding code: where the entry point is, how requests flow, module relationships
  2. Refactoring and migration: splitting files, replacing old patterns, upgrading dependencies
  3. Performance optimisation: finding slow queries, repeated computation, memory problems
  4. Adding tests: edge conditions, failure paths, regression tests
  5. Speeding up work: applying repetitive changes in bulk
  6. Protecting flow: handing off small interrupting tasks
  7. 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.

Want to apply this to your own work?

Read next

Share this article

Where should your idea start?

Bring an idea or a question to a free 15-minute call. Confirm the conversation language and time when booking.

Book a free 15-minute call

Where should your idea start?

Free 15-minute call →Free guides

Book a free 15-minute call

Contact

Booking formEnterprise AI implementation & system developmentSee enterprise services (official site)
Add us on WeChat, mention Vibe Coding and tell us what you want to do
Add us on WeChat, mention Vibe Coding and tell us what you want to do