How "SpecSheriff" Keeps AI Coding Agents From Drifting Off-Spec

Started by freeplusac, Today at 07:20 AM

Previous topic - Next topic

freeplusacTopic starter

Anyone using Claude Code or Codex to maintain billing panels, provisioning engines, or customer portals in late 2026 knows how quickly "vibe-coding" turns into business-logic drift: you write a nice markdown plan (Kiro, Spec Kit, or OpenSpec), the agent ships the feature, and three weeks later another agent silently alters a credit limit or bypasses an edge case because nothing mechanically binds your code to your rules.

A fascinating new open-source plugin architecture called SpecSheriff attacks this exact problem by turning specifications into atomic, schema-validated JSON nodes, where each business rule carries a permanent sid (like "A tab holds the debt within the limit"), a human-approved status (draft until a rule owner signs off on the exact wording, reverting to draft the instant meaning changes), and mandatory bidirectional @spec tags linking every test and every class straight back to its governing rule.

Instead of relying on developer willpower, deterministic harness hooks and git pre-commit checks physically block any edit or commit that touches untagged code, writes implementation before a failing @spec test exists, implements a draft rule, or modifies an approved rule without updаting its linked tests and code in the same commit, and then passes the diff to a cold, blind reviewer LLM (stripped of the coding session's chat history) to verify that the code does only what its cited rules authorize, nothing more and nothing less.

Best of all for long-lived infrastructure projects, SpecSheriff splits requirements across three files moving at different speeds, static method guidelines, tech-agnostic Base Specification rules, and a swappable Technical Appendix-meaning you can migrate an entire backend stack from Node to Rust without touching a single business rule.
  •