gap-trap adds rules and gates to a repo so AI-written code fails the build when it breaks a rule
Image: pliablepixels/gap-trap
Why it mattersWritten rules do not slow an agent down when nothing reads them, so teams that ship AI-written code need checks the agent cannot skip.
pliablepixels published gap-trap this weekend, an open-source skill for Claude Code and Codex that reads a repository, writes the rules that fit it, and installs a check for each rule so the build fails when the rule is broken. The repository is three days old and carries 153 stars, all MIT-licensed.
The problem the author names is drift. An agent writes most of a codebase, the team stops reading every diff, and quality falls without anyone noticing until something breaks. The agent writes a helper that already exists. It crosses a layer boundary because the shortcut compiles. It writes a test that asserts the code ran, not that it did the right thing. It follows a rule in AGENTS.md for a week and then forgets it. Nothing stops any of that when the only thing reading the rules is the agent that keeps breaking them.
What the skill installs
gap-trap sets up four pieces in the repository. Contracts name each part of the codebase that has one right way to do things, HTTP or logging or auth, and say what to use, what never to use, and which check finds bypasses. Proven red is a CI job that runs every new test against the old code and fails when the test still passes there, so a test that cannot fail proves nothing. Ratchets count known problems, such as the lint backlog or files over 400 lines, and those counts may go down but never up. Playbooks are the facts the project learned the hard way, written down so the next session does not learn them again.
Node and Python repositories get gates that run inside their test suite. Go, Rust, Java, Ruby, .NET, PHP, Swift and C++ get shell versions that need only git, grep, awk and the project's test command.
What it costs and what it does not do
The author's own repository has 4,400 unit tests and a full gate run finishes in about a minute locally, per the README. The instruction gate adds about a second. Proven red runs only in CI, because it is slow.
gap-trap ships a sibling skill called slop-mop that rewrites the agent's docs, commit messages and pull request bodies to read like a person wrote them. The setup step also lists existing violations by contract and rule, but the initial run changes no code: it writes the framework, proves each gate red, and commits, then asks whether to audit the repository against the new rules.
The rules and gates only bind future work. The size of the existing backlog is what a team sees the first time it runs the audit, and the ratchets stop it growing after that.
Source
Repository: pliablepixels/gap-trap (MIT, 153 stars in three days).
Source: pliablepixels/gap-trap
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually shipping with them. Short, and only when there is something worth reading.

