ClaudeMap

gap-trap

Turns vibe coding into high-quality code: an agent skill that writes the rules your repo needs and turns every rule into a gate the agent cannot skip.

Skills & Commandsskillcode-qualitycigatescontracts

The failure mode is familiar: the agent writes most of the code, you stop reading every diff, and quality drifts until something breaks. Run /gap-trap setup once in a repository and it reads the code, writes the rules that fit that codebase, and adds a gate for each rule — a check that fails the commit or CI run when the rule is broken. It sets up four instruments: Contracts (one entry per part of the code with one right way — HTTP, logging, settings, auth), Proven red (a CI job that runs every new test against the old code and fails when the test passes there), Ratchets (counts of known problems — the lint backlog, files over 400 lines — that may go down but never up), and Playbooks (the facts the project learned the hard way, written down so the next session does not learn them again). It also installs the sibling skill slop-mop so docs, commit messages and PR bodies read like a person wrote them. Works with any language: Node and Python repos get gates inside their test suite; everything else — Go, Rust, Java, Ruby, .NET, PHP, Swift, C++ — gets shell versions that need only git, grep, awk and your test command.

What it does

  • One /gap-trap setup run: reads the repo, shows a short plan, writes contracts and gates, proves each gate red, then commits — it never pushes
  • Four instruments: contracts, proven-red CI, ratchets, playbooks — the agent cannot skip a gate because gates fail the build, not the mood
  • /gap-trap refine, about once a month, hunts rules without gates, contracts naming code that no longer exists, and lessons in commit history nobody wrote down; it proposes one PR
  • Installs sibling skill slop-mop so the agent's docs, commit messages and PR bodies read human; a harness loads its skills from the next session on

When to use it

Agent-heavy repos where nobody reads diffs line by line; also a natural inner loop to complement spec-driven development. The framework is the one zmNinjaNg runs on, documented in its Agent development model chapter.

Getting started

npx skills add pliablepixels/gap-trap

# or by hand (Claude Code reads ~/.claude/skills, Codex ~/.agents/skills):
git clone https://github.com/pliablepixels/gap-trap.git
mkdir -p ~/.claude/skills
cp -r gap-trap/gap-trap ~/.claude/skills/

# then, in the repo you want to set up:
/gap-trap setup

Things to know

MIT. The skill deliberately refuses to run on anything smaller than Opus (in Claude Code) or the frontier coding model at high reasoning (in Codex) — choosing the wrong contracts costs every later session. The origin repo's full gate set (4,400 unit tests, a build, three lints) runs in about a minute locally; proven-red runs only in CI. Updates via npx skills update gap-trap; hand installs should replace the whole copy so files removed upstream do not linger.

Repository

pliablepixels/gap-trap

Charted

Related on the map

  • Guizang's agent skill turns your repo's recent updates into a finished promo video — real components, code-rendered animation, an original code-written soundtrack — no video editor involved.

    • agent-skill
    • video
    • promo
    • marketing
  • An agent skill that geolocates a photo with nothing readable in it — OSM geometry, elevation skylines and satellite tiles turn “where was this taken?” into a measured answer with an error radius.

    • agent-skill
    • geolocation
    • osint
    • openstreetmap
  • A skill that makes AI coding agents map the architecture and declare the blast radius before they touch a line of code — rendered as one standalone HTML page.

    • skill
    • architecture
    • code-visualization
    • change-scope