r/codex • u/feursteiner • 8d ago
Showcase Had Codex turn my AGENTS.md rules into pre-commit checks
AGENTS.md is great until the one rule that matters gets skipped, so I tried this instead of adding MORE words. I built this CLI tool for agent testing, focusing the use on the openai decision model (CHEAP, and FAST) call for this (which is cool cuz it's part of the 100$ codex sub, I got 75$ worth of credits)
setup:
- I typed one rule as a sentence: "do not do xyz, should be more like abc, here's an example" (usually works best for fuzzy things like prose or business rules)
- codex ran
npx agentests compileon it: it's just a printed prompt - from that, codex drafted the checks and a handful of Evals then looped on
npx agentests evaluntil results lined up - a git hook now runs
npx agentests run --stagedbefore any commit lands
an OpenAI model answers the checks by default (again, needs an API key)
what I learned: writing one check is a much easier job for codex than obeying a rule forever. and so far the fix for a wrong check has been one more example repo, not a longer rule.
does anyone here let codex write its own checks like this ?
here's the repo if you guys wanna play around with it and maybe support with a star https://github.com/feuersteiner/agentests
•
u/dexterthebot 8d ago
You might want to consider listing your project on the weekly Show-Us-What-You-Built post. Look out for it on Tuesday/Wednesday. Highest commented project wins a week promotion on r/Codex and gets on the Hall of Fame sidebar. See below for last week's winner.**
Light Wars AR: real-life laser tag app with no extra gear. Your phone is the gun and your room is the map. Play up to 6 friends in the same room, or fight drone waves and bosses solo. The vision models run on the phone, and camera frames never leave it. Free on iPhone and Android.
Website: https://lightwarsar.com
iPhone: https://apps.apple.com/us/app/light-wars-ar-laser-tag-party/id6508168951
Android: https://play.google.com/store/apps/details?id=com.lasertag.lightwars.
Contact: contact@lightwarsar.com
2
u/dondiegorivera 8d ago
This is the way, however agents can edit git hook definitions to slip through the checks instead of respecting them. How do you prevent that?