ai-pair-programmer

Get second opinions from AI providers (Grok, ChatGPT, Gemini) on implementation plans, code, or architecture decisions. Use when the user asks to "review with [AI name]", "get [AI]'s opinion", "pair program with [AI]", or wants a second perspective on their solution. Supports multiple providers simultaneously for comparative feedback. (Triggers: review with grok, review with gemini, review with chatgpt, pair program, second opinion, ai review)

16 stars

Best use case

ai-pair-programmer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Get second opinions from AI providers (Grok, ChatGPT, Gemini) on implementation plans, code, or architecture decisions. Use when the user asks to "review with [AI name]", "get [AI]'s opinion", "pair program with [AI]", or wants a second perspective on their solution. Supports multiple providers simultaneously for comparative feedback. (Triggers: review with grok, review with gemini, review with chatgpt, pair program, second opinion, ai review)

Teams using ai-pair-programmer should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ai-pair-programmer/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/data-ai/ai-pair-programmer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ai-pair-programmer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ai-pair-programmer Compares

Feature / Agentai-pair-programmerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Get second opinions from AI providers (Grok, ChatGPT, Gemini) on implementation plans, code, or architecture decisions. Use when the user asks to "review with [AI name]", "get [AI]'s opinion", "pair program with [AI]", or wants a second perspective on their solution. Supports multiple providers simultaneously for comparative feedback. (Triggers: review with grok, review with gemini, review with chatgpt, pair program, second opinion, ai review)

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# AI Pair Programmer

You are the lead architect. AI pair programmers (Grok, ChatGPT, Gemini) provide second opinions.

## Supported Providers

| Provider | Aliases | API Key Env Var | Model Override Env Var | Default Model |
|----------|---------|-----------------|------------------------|---------------|
| Grok (xAI) | `grok`, `xai` | `XAI_API_KEY` | `GROK_MODEL` | grok-4-1-fast-reasoning |
| ChatGPT (OpenAI) | `chatgpt`, `openai`, `gpt` | `OPENAI_API_KEY` | `OPENAI_MODEL` | gpt-5.1 |
| Gemini (Google) | `gemini`, `google` | `GEMINI_API_KEY` | `GEMINI_MODEL` | gemini-3-pro-preview |

## Choosing a Provider

When the user mentions a specific AI, use that provider:
- "review with Grok" → `--provider grok`
- "get ChatGPT's opinion" → `--provider chatgpt`
- "ask Gemini" → `--provider gemini`
- "review with Grok and Gemini" → `--provider grok,gemini`
- "get multiple opinions" / "ask all AIs" → `--provider all`

If no specific AI is mentioned, prefer using multiple providers for better coverage:
- `--provider all` uses all configured providers in parallel

## CRITICAL: Content Requirement

**Every call MUST have content to review.** The script will fail with "No content to review" if you don't provide one of these:

| Content Source | When to Use |
|----------------|-------------|
| `--files file1.py file2.py` | Code review with multiple files |
| `--file path/to/file.py` | Code review with single file |
| `--proposal "Your approach..."` | Architecture/plan reviews WITHOUT code files |
| `"Content here"` (positional) | Quick reviews with inline content |
| stdin (piped) | Git diffs via `git diff \| python3 ...` |

**Common mistake:** Calling the script with only `--context` and `--app-context` but no content source. This will fail!

```bash
# WRONG - No content source, will fail!
python3 pair_review.py --provider grok \
  --app-context "React app" \
  --context "User wants dark mode"

# CORRECT - Use --proposal for architecture reviews without files
python3 pair_review.py --provider grok \
  --app-context "React app" \
  --context "User wants dark mode" \
  --proposal "Add ThemeContext provider, store preference in localStorage, use CSS variables"
```

## REQUIRED: Always Provide Full Context

When calling any AI pair programmer, you MUST provide:

1. **App Context** (`--app-context`): Summarize the tech stack
   - Language/runtime (TypeScript, Python, Go, C#, etc.)
   - Framework (React, Next.js, Django, Express, .NET, etc.)
   - Architecture patterns (REST API, GraphQL, microservices, monolith, MVVM, etc.)
   - Key libraries or infrastructure (Redis, PostgreSQL, Docker, etc.)

2. **Problem Context** (`--context`): What is the user trying to accomplish?
   - The user's original request or the problem being solved
   - Any constraints or requirements mentioned

3. **Your Proposal** (`--proposal`): What is YOUR proposed solution?
   - Your approach to solving the problem
   - Key decisions you've made and why
   - This is what the AI(s) will evaluate
   - **IMPORTANT:** If not providing `--files` or `--file`, `--proposal` becomes the content to review!

4. **Already Considered** (`--considered`): What you already tried or rejected (optional)
   - Approaches that didn't work and why
   - Ideas you ruled out so reviewers don't suggest them again
   - Example: "Tried using localStorage but it's not persistent enough; considered Redux but overkill for this use case"

5. **Files/Code** (`--files` or `--file`): The relevant code
   - Only include files directly relevant to the review
   - For large changes, use `--summary` flag instead
   - **If omitted:** You MUST provide `--proposal` which will be used as the content

## Workflow

1. **Understand the request** - Clarify what the user wants
2. **Analyze the codebase** - Read relevant files, understand patterns
3. **Formulate YOUR solution** - Decide on an approach as lead architect
4. **Call AI pair programmer(s)** - Provide full context
5. **Synthesize feedback** - Evaluate points critically, note agreements/disagreements
6. **Present to user** - Share your final recommendation

## When NOT to Call AI Pair Programmers

Skip to save API costs:
- Trivial syntax fixes or one-liners
- Pure UI/styling tweaks
- When you're 100% confident
- User says "no second opinion" or "just implement"
- Questions better answered by docs/search

Reserve for substantive decisions: plans, refactors, architecture trade-offs.

## Script Usage

```bash
# Single provider - Plan review (with files)
python3 {{SKILL_DIR}}/scripts/pair_review.py \
  --provider grok \
  --app-context "React/TypeScript frontend with Redux, Node.js/Express backend, PostgreSQL" \
  --context "User wants to add real-time notifications" \
  --proposal "Use WebSockets with Socket.io, store notification state in Redux, persist to DB" \
  --type plan \
  --files src/services/NotificationService.ts src/store/notificationSlice.ts

# Architecture decision WITHOUT files (--proposal becomes the content)
python3 {{SKILL_DIR}}/scripts/pair_review.py \
  --provider grok \
  --app-context ".NET 9 MvvmCross app for iOS/Android" \
  --context "Auto-scroll to first validation error field after form submit fails" \
  --proposal "Add ScrollToField observable property to ViewModel. iOS: TableViewSource calls ScrollToRow(). Android: Find View Y position and scroll NestedScrollView." \
  --type architecture

# Multiple providers - Architecture decision (with already-considered alternatives)
python3 {{SKILL_DIR}}/scripts/pair_review.py \
  --provider grok,gemini \
  --app-context "Python FastAPI microservices, Docker/Kubernetes, Redis for caching" \
  --context "Need to decide on inter-service communication pattern" \
  --proposal "Use async message queue (RabbitMQ) instead of synchronous HTTP calls" \
  --considered "Tried gRPC but adds complexity; considered Redis pub/sub but need persistence" \
  --type architecture

# All configured providers - Code review
python3 {{SKILL_DIR}}/scripts/pair_review.py \
  --provider all \
  --app-context "Go REST API with Chi router, PostgreSQL, clean architecture" \
  --context "Refactoring authentication to support OAuth2" \
  --proposal "Add OAuth2 middleware, separate auth logic into domain service" \
  --type code \
  --file internal/auth/service.go

# ChatGPT only - API design
python3 {{SKILL_DIR}}/scripts/pair_review.py \
  --provider chatgpt \
  --app-context "Django REST Framework backend, React frontend" \
  --context "Designing new API endpoints for user management" \
  --proposal "RESTful endpoints with versioning, pagination, and rate limiting" \
  --type architecture

# Gemini only - Performance review
python3 {{SKILL_DIR}}/scripts/pair_review.py \
  --provider gemini \
  --app-context "Next.js app with server components, Prisma ORM, Vercel deployment" \
  --context "Page load times are slow on the dashboard" \
  --proposal "Add Redis caching layer, optimize database queries, use React Suspense" \
  --type code \
  --files src/app/dashboard/page.tsx src/lib/queries.ts

# Git diff review with multiple providers
git diff | python3 {{SKILL_DIR}}/scripts/pair_review.py \
  --provider grok,chatgpt \
  --app-context "Ruby on Rails monolith, Sidekiq for background jobs" \
  --context "Bug fix for race condition in order processing" \
  --proposal "Added database-level locking and idempotency checks" \
  --diff

# List available providers and their status
python3 {{SKILL_DIR}}/scripts/pair_review.py --list-providers
```

## Review Types

| Type | Use For |
|------|---------|
| `--type plan` | Implementation plans, step-by-step approaches |
| `--type code` | Code review, bug fixes, refactoring |
| `--type architecture` | System design, technology choices, patterns |
| `--type general` | Anything else |
| `--summary` | High-level descriptions of large changes |
| `--diff` | Git diffs, focused on what changed |
| `--files` | Multiple related files as a unit |

## Multi-Provider Output

When using multiple providers, the output includes:
- Each provider's feedback with clear attribution
- A synthesis guidance section highlighting:
  - Points of agreement (high confidence)
  - Points of disagreement (needs your judgment)
  - Unique insights from each AI

## After Receiving Feedback

As lead architect, YOU make the final decision:

1. **Evaluate each point** - Is the concern valid for this specific context?
2. **Note agreements** - Where AIs agree, confidence increases
3. **Consider adjustments** - If valid issues raised, incorporate them
4. **Disagree when appropriate** - If you have good reasons, explain to user

### Response Format (Single Provider)

```
I consulted with [AI Name] on this approach. Here's the synthesis:

**The Problem:** [what we're solving]

**My Approach:** [your proposed solution]

**[AI Name]'s Feedback:**
- [Key point 1 - whether you agree/disagree and why]
- [Key point 2]

**Final Recommendation:** [your decision, incorporating valid feedback]
```

### Response Format (Multiple Providers)

```
I consulted with [AI 1] and [AI 2] on this approach. Here's the synthesis:

**The Problem:** [what we're solving]

**My Approach:** [your proposed solution]

**Points of Agreement:**
- [Both/All AIs agreed on X]
- [This gives high confidence in Y]

**Differing Perspectives:**
- [AI 1] suggested Z, while [AI 2] preferred W
- My take: [your evaluation of these perspectives]

**Final Recommendation:** [your decision, synthesizing the best insights]
```

## Environment Setup

API keys can be configured in two ways (environment variables take priority):

### Option 1: Environment Variables

```bash
# Grok (xAI)
export XAI_API_KEY="xai-your-api-key-here"

# ChatGPT (OpenAI)
export OPENAI_API_KEY="sk-your-api-key-here"

# Gemini (Google)
export GEMINI_API_KEY="your-api-key-here"
```

### Option 2: config.json (Persistent)

Add `api_key` to each provider in `config.json`:

```json
{
  "providers": {
    "chatgpt": {
      "model": "gpt-5.1",
      "api_key": "sk-your-api-key-here"
    }
  }
}
```

Only configure the providers you plan to use. The skill will automatically detect which are available.

## Model Configuration

Model selection priority (highest to lowest):
1. CLI `--model` flag
2. Environment variable (`GROK_MODEL`, `OPENAI_MODEL`, `GEMINI_MODEL`)
3. `config.json` file
4. Built-in defaults

### Using Environment Variables (Easiest)

Set model override via environment variable:

```bash
# Override Grok model
export GROK_MODEL="grok-3-mini"

# Override ChatGPT model
export OPENAI_MODEL="gpt-4-turbo"

# Override Gemini model
export GEMINI_MODEL="gemini-2.0-flash"
```

Run `--list-providers` to see current model sources:

```bash
python3 {{SKILL_DIR}}/scripts/pair_review.py --list-providers
```

### Using config.json

Models and API keys can be configured in `config.json` in the skill directory:

```json
{
  "providers": {
    "grok": {
      "model": "grok-4-1-fast-reasoning",
      "api_key": "",
      "description": "Grok (xAI) - Set api_key here or XAI_API_KEY env var"
    },
    "chatgpt": {
      "model": "gpt-5.1",
      "api_key": "",
      "description": "ChatGPT (OpenAI) - Set api_key here or OPENAI_API_KEY env var"
    },
    "gemini": {
      "model": "gemini-3-pro-preview",
      "api_key": "",
      "description": "Gemini (Google) - Set api_key here or GEMINI_API_KEY env var"
    }
  },
  "defaults": {
    "provider": "grok",
    "temperature": 0.7,
    "max_tokens": 4096
  }
}
```

**Priority order:** Environment variables > config.json api_key

You can still override any model at runtime with `--model`.

## Debugging

Use `--debug` to see the full prompt sent to providers:
```bash
python3 {{SKILL_DIR}}/scripts/pair_review.py --debug --provider grok ...
```

Use `--list-providers` to check which providers are configured:
```bash
python3 {{SKILL_DIR}}/scripts/pair_review.py --list-providers
```

Related Skills

repairshopr-automation

16
from diegosouzapw/awesome-omni-skill

Automate Repairshopr tasks via Rube MCP (Composio). Always search tools first for current schemas.

agent-repair

16
from diegosouzapw/awesome-omni-skill

A two-phase repair skill that analyzes errors and suggests fixes before executing repairs. Phase one: user describes error, agent analyzes and proposes solution. Phase two: upon approval, executes the repair action.

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

accessibility-mobile

16
from diegosouzapw/awesome-omni-skill

React Native accessibility patterns for iOS and Android. Use when implementing a11y features.

accessibility

16
from diegosouzapw/awesome-omni-skill

Audit and improve web accessibility following WCAG 2.1 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible". Do NOT use for SEO (use seo), performance (use core-web-vitals), or comprehensive site audits covering multiple areas (use web-quality-audit).

accessibility-games

16
from diegosouzapw/awesome-omni-skill

Game accessibility skill for colorblind modes and control remapping.

accessibility-excellence

16
from diegosouzapw/awesome-omni-skill

Master web accessibility (A11y) to ensure your product is usable by everyone, including people with disabilities. Covers WCAG standards, semantic HTML, keyboard navigation, screen readers, color contrast, and inclusive design practices. Accessibility is not a feature—it's a fundamental requirement.

accessibility-checklist

16
from diegosouzapw/awesome-omni-skill

When building UI components, forms, or any user-facing interface. Check before every frontend PR.

accessibility-a11y

16
from diegosouzapw/awesome-omni-skill

Semantic HTML, keyboard navigation, focus states, ARIA labels, skip links, and WCAG contrast requirements. Use when ensuring accessibility compliance, implementing keyboard navigation, or adding screen reader support.

access-management

16
from diegosouzapw/awesome-omni-skill

RBAC/ABAC implementation patterns, least privilege access, row-level security, column masking, and access review workflows.

access-locked-out

16
from diegosouzapw/awesome-omni-skill

Restore access for customers who are locked out of their account or courses. Use when a paying customer cannot log in, access materials, or restore purchases.

access-control-rbac

16
from diegosouzapw/awesome-omni-skill

Implement Role-Based Access Control (RBAC), permissions management, and authorization policies. Use when building secure access control systems with fine-grained permissions.