r/opencodeCLI • • 19m ago

How do you regression-test your AGENTS.md rules when switching models in OpenCode?

How do you know whether the new model still follows your engineering conventions?

I've been building an approach where written rules become executable tests, independently of the coding agent or model.
For example:

  • Never mock our own hooks.
  • Never use time.sleep() in tests.
  • Always use our internal error class.

Each rule gets explicit passing and failing examples.
Glob and grep handle what can be checked deterministically. Specialized decision models handle what requires semantic judgment. Checks run at commit time or in CI.

In one of my experiments, 97.6% of checks could be handled before making a model call.

The idea isn't to replace linters or CI, but to make written conventions testable without having to implement every new rule manually.

I'm building this as an open-source project called Agentests: https://github.com/feuersteiner/agentests

Would love some feedback from people regularly switching between models.

1 Upvotes

0 comments sorted by