No code without a rule: keeping AI coding agents anchored to a specification
AI handles one-off, short-lived tasks well. On a system you have to maintain for years, it starts to slip.
Working on different projects, I kept hitting the same problem: the agent loses context, or the context grows so large that it overloads the session. So I turned what worked into a defined approach. It is not a silver bullet. It is my recipe, built on my own experience and a survey of existing approaches.
It's called SpecSheriff: a spec-anchored development method and the tools that enforce it. You work on the specification: the business logic, plus technical details where they are needed. The agent writes the code. Skills tell it how to work, and hooks check every edit and every commit.
Six principles:
- Specification first, in one direction: rule → test → code, never the reverse.
- Rule, test and code share a permanent id, and rules are linked by typed links, so the agent gets the rules its task touches, not the whole specification.
- Nothing unapproved is implemented: anyone may write a rule, but it is implemented only once an owner approves its wording.…
