{
  "markdown": "<p align=\"center\"><img src=\"logo.png\" width=\"120\" alt=\"logo\" /></p>\n\n# claude-codex-skill\n\n> **Generate images with the OpenAI Codex CLI without an `OPENAI_API_KEY` — plus second-opinion code review and implementation, all from inside Claude Code.**\n\n<p align=\"center\">\n  <img src=\"assets/panda.png\" width=\"420\" alt=\"Red panda holding a heart-mug coffee, generated by codex CLI on ChatGPT login alone — no OPENAI_API_KEY\"/>\n</p>\n\n<p align=\"center\"><sub>↑ Generated by <code>codex exec</code> in 12 seconds. <b>No <code>OPENAI_API_KEY</code></b>. Just <code>codex login</code> with ChatGPT.</sub></p>\n\n<p align=\"center\">\n  <a href=\"https://github.com/cskwork/claude-codex-skill/stargazers\"><img src=\"https://img.shields.io/github/stars/cskwork/claude-codex-skill?style=for-the-badge&logo=github&color=ffd700\" alt=\"Stars\"/></a>\n  <a href=\"https://github.com/cskwork/claude-codex-skill/blob/main/LICENSE\"><img src=\"https://img.shields.io/badge/license-MIT-green.svg?style=for-the-badge\" alt=\"MIT\"/></a>\n  <img src=\"https://img.shields.io/badge/codex--cli-%E2%89%A5%200.128-blue?style=for-the-badge\" alt=\"codex-cli ≥ 0.128\"/>\n  <img src=\"https://img.shields.io/badge/Claude%20Code-skill-orange?style=for-the-badge\" alt=\"Claude Code skill\"/>\n</p>\n\n---\n\n## The hook\n\n**`codex` CLI ships with a built-in image generation tool (`image_gen.imagegen`) that nobody talks about.**\n\nIt's gated behind a feature flag that is **already on by default** (`codex features list | grep image_generation`). It uses your ChatGPT subscription auth — no separate OpenAI API key, no separate billing.\n\nThe catch: in `codex exec` mode, the model only picks this tool if you don't tell it to \"use the OpenAI API\" or \"use curl/python\". Most users never discover it.\n\nThis skill teaches Claude Code the right prompt shape to unlock it — plus wires up two more modes for the things `codex` is actually built for: **review** and **impl**.\n\n## Three modes\n\nThe skill exposes one slash command, `/codex-cli`, with a subcommand as the first argument:\n\n| Invocation | What it does | Example |\n|---|---|---|\n| `/codex-cli review` | Hands the diff to Codex for a second-opinion review | `/codex-cli review --base main` |\n| `/codex-cli impl <prompt>` | Hands a coding task to Codex non-interactively | `/codex-cli impl \"add JWT refresh to api/auth.ts\"` |\n| `/codex-cli image <prompt>` | Generates an image via Codex's built-in tool — no API key | `/codex-cli image \"isometric CPU diagram, neon\"` |\n\nYou can also just describe what you want in natural language (\"ask codex to review my diff\", \"have codex generate an isometric CPU diagram\"). The skill's `when_to_use` field tells Claude to load it on those phrasings.\n\n## Install\n\n### One-liner (Windows / PowerShell)\n\n```powershell\niwr -useb https://raw.githubusercontent.com/cskwork/claude-codex-skill/main/install.ps1 | iex\n```\n\n### One-liner (macOS / Linux)\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/cskwork/claude-codex-skill/main/install.sh | bash\n```\n\n### Manual\n\nDrop `SKILL.md` into your Claude Code skills directory:\n\n| OS | Path |\n|---|---|\n| Windows | `%USERPROFILE%\\.claude\\skills\\codex-cli\\SKILL.md` |\n| macOS / Linux | `~/.claude/skills/codex-cli/SKILL.md` |\n\nRestart Claude Code. The skill auto-registers — type `/codex-cli` to confirm.\n\n## Prerequisites\n\n- [Claude Code](https://docs.claude.com/en/docs/claude-code) installed\n- [Codex CLI](https://github.com/openai/codex) ≥ 0.128.0 (`codex --version`)\n- `codex login status` shows \"Logged in\" (ChatGPT login is enough; API key login also works)\n\n## Usage examples\n\n### 1. Code review on uncommitted changes\n\n```\n/codex-cli review\n```\n\nClaude takes Codex's findings, regroups them by **CRITICAL / HIGH / MEDIUM / LOW**, and writes them back as a structured review with `file:line` citations — instead of dumping raw output. If Codex contradicts something Claude already verified, it flags the conflict instead of silently siding with Codex.\n\n### 2. Hand off a coding task\n\n```\n/codex-cli impl \"add a /healthz endpoint to api/server.ts that returns 200 if redis is reachable\"\n```\n\nRuns `codex exec -s workspace-write -C <repo>`, sandboxed to your workspace. Network access on, writes outside the repo blocked.\n\n### 3. Generate an image\n\n```\n/codex-cli image \"isometric data center, glowing fiber, dark background, 1024x1024\"\n```\n\n→ Claude tells Codex to generate it (without naming an API).\n→ Codex picks `image_gen.imagegen` automatically.\n→ PNG lands at `~/.codex/generated_images/<session>/ig_*.png`.\n→ Claude copies it to your workspace and prints the absolute path.\n\n## Why this skill exists\n\nThree pain points it removes:\n\n1. **The image-generation discovery problem.** Codex CLI's image tool works through ChatGPT login alone, but the docs barely mention it. Most people end up trying to set `OPENAI_API_KEY` and giving up. This skill encodes the right invocation.\n2. **The Windows sandbox copy bug.** On Windows, `codex-cli 0.128.0` generates the image fine but fails to copy it into your workspace (`CreateProcessAsUserW failed: 5`). Most users see the failure message and assume nothing was generated. The skill knows to look in `~/.codex/generated_images/` and copy the file itself.\n3. **Sandbox safety.** The skill never escalates to `-s danger-full-access` or `--dangerously-bypass-approvals-and-sandbox` without explicit per-run approval. You get Codex's power without bypassing its guardrails.\n\n## How it actually works\n\n```\n┌─────────────────┐  /codex-cli image \"...\"   ┌──────────────────┐\n│  Claude Code    │ ────────────────────────▶ │  Skill (this)    │\n└─────────────────┘                           └────────┬─────────┘\n                                                       │\n                                                       ▼\n                              codex exec -s workspace-write -C <out>\n                                          \"Generate an image of ...\"\n                                                       │\n                                                       ▼\n                             ┌──────────────────────────────────────┐\n                             │  Codex CLI agent (gpt-5.5)           │\n                             │  picks built-in image_gen.imagegen   │\n                             │  → uses ChatGPT auth from auth.json  │\n                             └──────────────────────────────────────┘\n                                                       │\n                                                       ▼\n                              ~/.codex/generated_images/<session>/\n                                          ig_<hash>.png\n                                                       │\n                                                       ▼\n                              Claude copies → workspace/output.png\n```\n\n## Verified — trust record\n\nThis skill ships with a reproducible test suite. The last verified run is committed at [`tests/RESULTS.md`](tests/RESULTS.md), so you can see exactly what was checked, when, and on which platform without running anything.\n\n```bash\n# Run the full suite (requires `codex login` with ChatGPT)\npython tests/run.py\n\n# Skip the E2E image-gen step (still validates metadata, URLs, codex install)\npython tests/run.py --skip-image\n```\n\nThe suite covers metadata correctness (frontmatter spec compliance, no fictitious slash aliases), URL availability (install one-liners actually resolve), codex prerequisites (installed + logged in), and an end-to-end image generation that proves the no-API-key path works through the documented Windows copy-workaround. See [`tests/README.md`](tests/README.md) for the full list of checks and how to add new ones.\n\n## Compatibility matrix\n\n| Codex CLI | Image gen | Code review | Code impl | Notes |\n|---|---|---|---|---|\n| 0.128.x (Windows) | ✅ via skill workaround | ✅ | ✅ | Sandbox copy bug — skill handles it |\n| 0.128.x (macOS / Linux) | ✅ | ✅ | ✅ | Should work without the copy workaround |\n| < 0.128 | ❓ untested | ✅ | ✅ | `image_generation` feature flag may differ |\n\n## Contributing\n\nPRs welcome. The skill is one Markdown file (`SKILL.md`) + frontmatter — no build step, no JS, no dependencies. Test by editing locally and restarting Claude Code.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n\n## Credits\n\nBuilt and verified using Claude Code itself. The first generated image (the red panda above) was the moment we confirmed the `image_gen.imagegen` tool works through ChatGPT auth alone — no API key required.\n",
  "bytes": 8444,
  "sha": "36765f6f7251a81f44922b7c4ba81b361010df989da1fc6bad9bb48bd0ea78dd",
  "repo_slug": "cskwork/claude-codex-skill",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_cskwork_claude_codex_skill_19bb5fc7/readme"
}