Runtime verifier hooks for repository agent instructions
Teams using coding agents should turn recurring repository instructions into executable pre-completion checks. A practical version is a small rule file with three fields per rule: when it applies, what behavior is required, and how the agent proves it passed. The hook can run before the agent declares a task done, checking items such as test commands, forbidden file edits, cleanup of temporary files, migration rules, or required review notes.
Trace gives the clearest pattern: it extracts user corrections, rewrites them as atomic rules, and blocks completion until a verifier passes. The reported drop in ClawArena preference violations, from 100.0% to 37.6% in distribution and to 2.0% out of distribution, is a useful target for teams that already keep agent instructions as Markdown. The repository-level study adds a warning about quality: instruction files had mixed effects across 148 projects, and projects with large merge-rate gains had longer, more structured files than projects with large drops. A cheap pilot is to pick five instructions that reviewers repeat most often, attach one verifier to each, and compare violation rate and reviewer comments for agent pull requests over two weeks.