@vladimir.troyanenko1
Vladimir TroyanenkoDeveloper▲5
AI engineer, Independent
2h ago · AI Engineering, Agents, Vibe-coding · Prague

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:

  1. Specification first, in one direction: rule → test → code, never the reverse.
  2. 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.
  3. Nothing unapproved is implemented: anyone may write a rule, but it is implemented only once an owner approves its wording.
  4. Deterministic checks on every edit and every commit, plus an independent model that refuses code doing more or less than its rules say.
  5. A rule is self-sufficient: its reason, links and decisions live in the rule, not in a chat history.
  6. Three documents, three rates of change: guidelines, base specification, technical appendix. A new stack means a new appendix, not new rules.

Plugins for Claude Code and Codex CLI.
Details: https://specsheriff.com/

AI Builders ToolkitSkillsAgentsToolsPrompts

Comments1

  • @ryanallis
    Ryan Allis
    Founder of AI Lounge and SaasRise, helping founders reach $100M+ exits
    1h ago

    Requiring an owner to approve a rule's wording before any code gets written is what a cautious CTO will pay for.

Log in to join the thread.