AI Pair Programming Cheat Sheet

Prompts and habits that make an AI coding assistant worth its latency

AI coding assistants are strongest with context and weakest with assumptions. Most of the skill is in what you give them before you ask.

Category: AI Coding Difficulty: Beginner Version: 1.0 Updated: February 1, 2026 Author: Sabir

Give context first

Request patterns

Goal Ask for
Understanding code "Explain what this does and name any edge case it mishandles"
A bug you cannot see "List three possible causes, most likely first, and how to test each"
A refactor "Refactor for X only. Change nothing else and keep the signature"
Tests "Write tests for the boundaries and failures, not the happy path"
A review "Review this as a hostile reviewer. What breaks in production?"

Review it like a stranger wrote it

Generated code is fluent, which makes it read as reviewed when it has not been. Check three things specifically: invented API methods that do not exist, error paths that silently swallow, and dependencies added without being asked for. Fluency is not correctness, and confident code is the hardest kind to review.

FAQs

Why does it suggest APIs that do not exist?

It is completing a plausible shape rather than recalling a specific library version. Naming the language, framework and version in the prompt removes most of it; the rest is caught by actually running the code.

What should I never delegate?

Anything you cannot verify quickly. If reviewing the output costs more than writing it, the assistant has moved work rather than removed it.