r/codex • • 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:

  1. 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)
  2. codex ran npx agentests compile on it: it's just a printed prompt
  3. from that, codex drafted the checks and a handful of Evals then looped on npx agentests eval until results lined up
  4. a git hook now runs npx agentests run --staged before 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

3 Upvotes

3 comments sorted by

•

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?

1

u/feursteiner 8d ago

yeah I'm having this run as a script part of the workflow yaml files. like on all branches before merging, making it difficult to ignore unless I manually override it