GC-301i · Module 2

Pair Programming with AI

3 min read

AI pair programming is not the developer watching the AI write code. It is the developer and the AI thinking through a problem together — the developer provides intent, context, and judgment; the AI provides implementation speed, pattern recall, and tireless iteration. The most productive pairing sessions follow a rhythm: the developer describes the goal and constraints, Gemini proposes an approach, the developer refines or redirects, Gemini implements, the developer reviews and requests changes. This is not delegation — it is collaboration with faster feedback loops.

Effective AI pairing requires explicit context management. At the start of a session, give Gemini the big picture: "We are refactoring the auth module to support OAuth2. The current implementation uses session cookies. We need to maintain backward compatibility for two releases." Then narrow to the specific task: "Start with the token validation middleware." Without the big picture, Gemini optimizes locally — producing correct code that does not fit the larger architecture. With it, Gemini makes design decisions aligned with your direction.

PAIR PROGRAMMING SESSION STRUCTURE

1. ORIENT (30 seconds)
   "We are working on [feature/bug/refactor].
    The goal is [outcome].
    The constraint is [limitation]."

2. PLAN (1-2 minutes)
   "Before writing code, outline the approach.
    What files need to change?
    What is the sequence of changes?
    What could go wrong?"

3. IMPLEMENT (iterative)
   "Start with [specific file/function].
    Follow our [convention] for [pattern]."
   → Review output
   → "Change X to Y because [reason]"
   → Review again

4. VALIDATE (1-2 minutes)
   "Run the tests.
    Check for type errors.
    Does this handle the edge case where [scenario]?"

5. COMMIT (30 seconds)
   "Write a commit message that explains the why.
    Reference [ticket/issue] if applicable."