Skip to content

Code Review Workflow

Fresh

Use Gemini Code Assist to accelerate both giving and receiving code reviews.

Self-Review Before Submitting

mermaid
flowchart LR
    A[Write code] --> B[Select key function]
    B --> C[Smart Action: Explain this code]
    C --> D{Makes sense?}
    D -->|No| E[Refactor with /simplify]
    D -->|Yes| F[Generate unit tests]
    F --> G[Review coverage]
    G --> H[Submit PR]
  1. Select your new code
  2. Smart Action: Explain this code — if you can't follow the explanation, reviewers won't either
  3. Smart Action: Generate unit tests — catch edge cases before review
  4. Smart Action: Make code more readable — if explanation was hard to follow

During Code Review

Understand unfamiliar patterns

  1. Select confusing code
  2. Right-click > Explain this code
  3. Ask follow-up in chat: "Why would someone write it this way instead of [alternative]?"

Check for issues

Chat: "Review this function for:
1. Potential null/undefined errors
2. Performance issues (N+1 queries, unnecessary loops)
3. Security concerns (injection, auth bypass)
4. Missing error handling"

Verify reviewer's suggested alternative

Chat: "The reviewer suggested using reduce() instead of this for-loop.
Is their approach better? What are the tradeoffs?"

Post-Review: Applying Feedback

Simple fixes

Use /fix with context from the review comment:

/fix the reviewer asked me to extract the validation logic into a separate validateUser() function

Complex refactors (multiple comments)

Switch to agent mode:

Agent: "Apply these code review comments to /src/services/UserService.ts:
1. Extract validation into UserValidator class
2. Add retry logic to the database calls
3. Replace the nested callbacks with async/await
4. Update unit tests to reflect these changes"

Based on official Google Gemini Code Assist documentation.