AI NewsDev toolsAnnouncement

gap-trap fails the build when AI-written code breaks a team rule

A new open-source skill installs rules and CI checks into a repository so agent-written code fails the build when it breaks a rule the team wrote down.

AI News

Editorial2 min read

LinkedInX

Why it mattersWritten rules do not stop an agent when nothing checks them, so teams that release 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, meaning quality getting worse over time. 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 breaks the separation between layers of the code 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 through mistakes, 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 includes a related 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, confirms each gate fails when it should, and commits, then asks whether to audit the repository against the new rules.

The rules and gates only apply to 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).

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project