review-codex
Auto-detect what was built, write a Codex adversarial prompt, dispatch Codex directly via `codex exec`, then verify results when complete
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Auto-detect what was built, write a Codex adversarial prompt, dispatch Codex directly via `codex exec`, then verify results when complete
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | review-codex |
| description | Auto-detect what was built, write a Codex adversarial prompt, dispatch Codex directly via `codex exec`, then verify results when complete |
| argument-hint | [optional: feature-name or path-to-review.md] |
Handles the full Codex review lifecycle automatically — Claude dispatches Codex directly via the local codex CLI (no terminal hand-off to the user). Detects what needs reviewing from context.
Argument handling:
.md): write prompt for that feature, dispatch.md file: verify that existing Codex review, implement fixescodex-adversarial-*.md file was recently created in docs/reviews/, ask user if they want to verify itClaude has direct access to Codex via the codex binary (C:\Users\mikew\AppData\Roaming\npm\codex.cmd on Windows, codex on POSIX). Dispatch is a Bash call from inside this skill — the user does NOT open a separate terminal.
Required pre-flight (Phase 2 only — once per skill invocation):
codex login status
Expect Logged in using ChatGPT (or equivalent). If not logged in, stop the skill and surface the message — the user must run codex login themselves (interactive browser flow).
Dispatch command (Phase 2e):
cd "<repo-root>" && codex exec - < "<prompt-file-path>" > "<output-file-path>" 2>&1
codex exec - reads the prompt from stdin (avoids argv length limits for large prompts).docs/reviews/codex-adversarial-{feature}-{date}.md.run_in_background: true on the Bash tool call — Codex with model_reasoning_effort = "xhigh" typically runs 10-45 minutes. The harness notifies when the background job completes.~/.codex/config.toml (currently model = "gpt-5.5", model_reasoning_effort = "xhigh"). Do NOT override unless the user asks.AGENTS.md automatically (no need to mention it in the prompt).When the background job notifies completion:
Error: / panic: / login failure / empty file, fall back to manual dispatch by telling the user the failure mode.git diff --name-only HEAD and git diff --name-only HEAD~3..HEAD to find recently changed .cs filesMain/Features/SettlementGuards/ → SettlementGuards)docs/reviews/ for any codex-adversarial-*.md file modified in the last hour
Go to Phase 2 with that feature.
.md path:Go to Phase 3 with that file.
Find all files for the feature:
Main/Features/{feature}/ — all .cs files (services, hooks, models, UI, IoC)DOTS.Tests/Features/{feature}/ — all test filesMain/_Module/ModuleData/ — any config files (JSON, XML) used by the featureMain/Adapters/ — any adapters used by this feature (grep for feature-related types)docs/features/{feature}.md — feature documentation if it existsMain/SubModule.cs and Main/IoC.cs for registration linesCount files, identify GameModel overrides, Harmony patches, config files, and test coverage.
For each Harmony patch, identify the vanilla class and method being patched.
For each GameModel, identify the vanilla base class being overridden.
Map these to paths in E:\Decompiled_Bannerlord\ for the prompt.
Run a quick analysis of the feature for likely issues:
?? true vs ?? false)OnGameLoadedEvent handler that mutates Hero/Settlement state, enumerate all possible entity states (recruited, traveling, dead, prisoner, fugitive) and check whether the mutation is guarded for each. This is a HIGH-priority suspect — Review #23 found a ship-blocking bug from this pattern.List 3-6 Known Suspects with specific hypotheses for Codex to CONFIRM or DISPUTE.
Use flat formatting — NO indented continuation lines (triggers backslash-escape prompt). Use -- not —.
The prompt must include:
docs/reviews/codex-adversarial-{feature}-{date}.prompt.md so it's reviewable + reusable.codex login status once. If not Logged in, stop and tell the user to codex login.Bash tool call:
command: cd "<repo-root>" && codex exec - < "docs/reviews/codex-adversarial-{feature}-{date}.prompt.md" > "docs/reviews/codex-adversarial-{feature}-{date}.md" 2>&1
run_in_background: true
timeout: 600000 (10 min — Codex usually finishes inside this; harness will notify when actually done)
xhigh reasoning). Do NOT poll the background job — the harness sends a notification when the job actually completes.Fallback path (only if direct dispatch fails — codex binary missing, auth expired, sandbox refuses):
Tell the user:
Direct Codex dispatch failed: <exact error from Bash output>.
Manual fallback:
1. Open a terminal
2. cd <repo-root>
3. codex exec - < "docs/reviews/codex-adversarial-{feature}-{date}.prompt.md" > "docs/reviews/codex-adversarial-{feature}-{date}.md"
4. When done, re-invoke /review-codex with the .md file path as argument
Read process docs first:
docs/reviews/REVIEW-GUIDE.md — failure patterns, success patternsdocs/reviews/REVIEW-LOG.md — scoring historyRead the Codex review file. Identify:
A Codex finding is a hypothesis, not a verdict (per .claude/rules/evidence-over-claims.md; review accuracy is ~95%, not 100% — feedback_audit_findings_not_always_correct.md). Verify EVERY finding against the DOTS source and decompiled vanilla BEFORE implementing it — re-read the actual code, don't act on the reviewer's confidence. This skill auto-implements confirmed findings, so an unverified finding becomes an unverified change.
For EACH finding:
Read the DOTS source. Does the code do what Codex claims?
Verify "missing" claims. Grep the codebase — don't trust "I didn't find it."
Decompile vanilla targets. For Harmony/GameModel findings, check E:\Decompiled_Bannerlord\ (Campaign/, MountAndBlade/, Modules/, Core/, UI/).
Check TOR comparison fairness. TOR targets older Bannerlord — flag API differences.
Check what Codex missed:
?? true vs ?? false)If the review has Known Suspects with CONFIRMED/DISPUTED verdicts:
Output table:
| # | Codex Severity | Your Severity | Agree? | Reason |
|---|
Then categorize:
For EACH confirmed bug that Codex found, answer:
What category? (pick one)
Why did Claude miss it during implementation?
Preventive action: For each root cause, add ONE of:
docs/reviews/REVIEW-GUIDE.md as a new check item.claude/rules/ if it's a recurring patternDo NOT skip this step. The point is not just to fix bugs — it's to make the same category of bug impossible in future features. Output the analysis as:
| # | Bug | Category | Why Missed | Preventive Action |
|---|
For each confirmed bug:
dotnet build DOTS.Tests — must compiledotnet test DOTS.Tests — must passCodex learns from us through AGENTS.md. After each review, update the "Lessons From Prior Reviews" section:
This creates a feedback loop: Claude's findings improve Codex's next review. Over time, Codex's accuracy improves and the gap between what Codex finds and what Claude catches shrinks.
docs/reviews/REVIEW-LOG.mddocs/reviews/REVIEW-GUIDE.md if discoveredAuthor a culture's armor items and swap troop equipment rosters via the generator + validation pipeline. Use when adding/revamping armor. Enforces the canonical-folder + cover-attribute rules.
Give DOTS lords lore-driven skill values and traits via the DOTS SkillSet system. Use when a canonical lord has wrong stats or a culture roster needs a balance pass.
Author or revamp a DOTS culture's armor set, troop tree, and recruitment wiring end-to-end. Use for new cultures or troop-tree revamps. Follows docs/ai-includes/new-culture-authoring.md.
Use when reviewing an external repo or article to adopt practices into DOTS — security-vet first, map novel vs duplicative, port (never install), review, commit your changes.
Structured 4-phase self-debug for failing agent runs (looping, drifting, burning tokens). Capture, diagnose, contained recovery, report. Complements /investigate (which is for code bugs); this skill is for harness/agent failures.
Incrementally fix dotnet build errors with minimal diffs, one error at a time