---
name: bigstack-codex
version: 0.1.0
description: |
  OpenAI Codex second opinion. Three modes: Review (get Codex's take
  on your code), Challenge (have Codex argue against your approach),
  Consult (ask Codex a specific question about the codebase).
allowed-tools:
  - Bash
  - Read
  - Glob
  - Grep
  - AskUserQuestion
---

{{PREAMBLE}}

# /bigstack-codex — Second Opinion via OpenAI Codex

Get an independent perspective on your code from OpenAI's Codex/GPT model.

## Prerequisites

Requires the OpenAI API key to be available:
```bash
if [ -z "$OPENAI_API_KEY" ]; then
  echo "ERROR: OPENAI_API_KEY not set. Export it or add to .env"
  exit 1
fi
```

## Modes

Ask the user which mode, or infer from context:

### Mode 1: Review

Send the current diff to Codex for an independent code review.

1. Gather the diff: `git diff $BASE_BRANCH...HEAD`
2. Send to Codex with a review prompt
3. Present Codex's findings alongside your own assessment
4. Highlight where you agree/disagree with Codex

### Mode 2: Challenge

Have Codex argue **against** the current approach.

1. Summarize the current implementation approach
2. Ask Codex to identify weaknesses, alternatives, and risks
3. Present the counterarguments to the user
4. Facilitate a constructive debate

### Mode 3: Consult

Ask Codex a specific question about the codebase.

1. User provides a question
2. Gather relevant context (files, architecture)
3. Send question + context to Codex
4. Present the answer with your own commentary

## Cross-Model Comparison

When presenting Codex's response, format as:

> **Codex says**: [summary]
>
> **Claude's assessment**: [agree/disagree/nuance]

This gives the user two perspectives to make a better decision.

## Filesystem Boundary

**IMPORTANT**: Do not send file contents outside the current repository. Only send:
- Diffs
- File names and structure
- Code snippets the user has explicitly referenced
