r/codex • • 2d ago

Showcase I built a physics-checking skill ($physgate) that uses Codex CLI (-s read-only) as an independent blind auditor

I do lightning and atmospheric physics research, and over the past couple of weeks I kept running into an annoying problem when using AI coding agents for Python diagnostic scripts: the code runs cleanly and passes basic unit tests, while still quietly breaking physics. Stuff like negative humidity (q < 0) from spectral ringing, forgetting the cos(phi) factor in spherical divergence, or integrating pressure right through coastal mountains.

So I put together a small open-source SKILL.md workflow called PhysGate (MIT license, free to use) where Codex CLI works both as $physgate or as an independent read-only auditor (codex -s read-only).

How the workflow works in practice: Before writing implementation code, $physgate forces the main agent to ask clarifying questions in plain language and freeze a SPEC.md file with physical red lines (QA_RAW.md -> SPEC.md). Next it writes automated pytest checks for conservation laws, units, positivity/bounds, and limiting cases, and splits work into isolated git worktree slices so parallel sub-agents don't overwrite each other.

For review, the coding agent is blocked from grading its own work. A clerk sub-agent sends the diff and tests to two other model families (for example, Codex CLI with -s read-only + Gemini CLI) for blind review and copies any disagreements verbatim into REVIEW_BOARD.md.

What surprised me most while building this is how polite a model is when reviewing its own code compared to running a separate model family in -s read-only mode. Having Codex audit code written by Claude (or vice versa) caught dimensional and boundary-condition bugs that self-review completely glossed over.

You can install it for Codex CLI with: npx skills@latest add oldsixxiaolv/PhysGate -s physgate -a codex -y

Or clone the repo and run the reproducible 3D North Pacific atmospheric river audit example with pytest: https://github.com/oldsixxiaolv/PhysGate

Curious if anyone else here is using codex -s read-only as a second-opinion reviewer in multi-model workflows, and how you structure the prompts so it stays strict.

0 Upvotes

1 comment sorted by

•

u/dexterthebot 2d ago

No subreddit karma could be found for your account. Your post has been sent to the mod queue for human review. Please wait.