gap-trap
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "gap-trap":https://skillpi.com/zh/skills/deepskill-a09176d642d232f422be78411480f755fde13c58014654b48ecd405872235189。安装前核对上游来源和版本:https://github.com/pliablepixels/gap-trap。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
在被要求为仓库设置、安装或优化代理质量框架时使用,包括带门禁的规则、架构契约、已验证的红色测试、棘轮机制与操作手册;也在用户提到“gap-trap”、“gap-trap 设置”、“gap-trap 优化”、“规则门禁”或“让代理代码符合规则”时使用此技能。
介绍来源: third_party · pliablepixels · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 软件、账号及付费要求
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: gap-trap
description: Use when asked to set up, install, or refine an agent quality framework in a repository (rules with gates, architecture contracts, proven-red tests, ratchets, playbooks), or when the user says "gap-trap", "gap-trap setup", "gap-trap refine", "gate the rules", or "make the agents' code match the rules".gap-trap
Sets up a quality framework for repositories where agents write most of
the code. Every rule the agents follow has a gate that fails a commit, a
push, or a CI run when the rule breaks. A rule a script could check but
that names no gate is a defect. The framework is the one described in
reference/framework.md; read it before either mode.
Two modes: setup builds the framework in a repo that has none.
refine audits a repo that has it and proposes the next rules and gates
from what broke. Bare gap-trap with no keyword means setup when the
repo has no AGENTS.project.md, otherwise refine. A hand-written
AGENTS.md or CLAUDE.md on its own is input to setup, not a sign the
framework exists.
Model gate
This skill runs on the top coding model of your harness: in Claude Code, Opus or a more capable model (Opus 4.8 or newer, Opus 5, Fable, Mythos); in Codex, the frontier coding model at high or xhigh reasoning effort. Discovery decides which parts of a codebase get a contract, and a wrong contract costs every later session. Your system prompt names your model.
If it is a cheaper or faster tier (Sonnet, Haiku, a mini model, or low reasoning effort), stop. Read nothing, write nothing. Say exactly this and end the turn:
gap-trap runs on the top coding model of this harness. You are on <model name>. Switch with
/model, then run gap-trap again.
Do not dispatch stronger subagents from a weaker orchestrator, start "the easy parts", or offer a lighter version.
setup
- Discover. Follow
reference/discovery.md. It produces a plan file in your scratch directory: stack, commands, CI provider, contract candidates with real symbol names, the first domain facts from history (the revert probe runs at any commit count), and one row per rule found in an existing instruction file with where it goes and what gates it. - Confirm once. Show the plan as a short list: the contracts you
will write (at most six), the gates you will add, the test and lint
commands you found, the migrated-rules table, and where slop-mop
goes. A build, type check, or
lint that is already red is the first item: setup fixes only what
its own gate files need (a missing type package, a lockfile) and
records the rest as a ratchet count or an out-of-scope entry. Name
the cause of each red before recording it: reproduce it, read the
failure, and say what is broken. A failure that names an environment
variable can still be a code defect. In one trial, seven tests
failing with
Environment variable not found: DATABASE_URLwere a Prisma mock loaded after the module under test, not a missing.env; recording that as an environment gap would have buried the bug and the contract that prevents it. Ask one round of questions, only about what discovery could not settle. Then proceed. - Install slop-mop.
git clone https://github.com/pliablepixels/slop-mop.gitinto your scratch directory and copyslop-mop/slop-mopto the skills directory of the harness you are running in (Claude Code:~/.claude/skills/; Codex:~/.agents/skills/), skipping it if present. It is not vendored into the repo; the project rule inAGENTS.project.mdrequires it. A harness loads its skill list when the session starts, so a skill installed here is not available to the run that installed it: write this run's prose from P10 inAGENTS.md, and tell the user in the report that slop-mop applies from their next session. - Write the instruction files from
templates/.AGENTS.mdandagents/generic/agent-workflows.mdare copied unchanged, with one exception: a rule whose gate cannot exist in this repo (I3's accessibility lint and C3's locales in a repo with no UI) gets itsGate:clause replaced byGate: n/a, no <thing> in this repo. Nothing else inAGENTS.mdchanges.AGENTS.project.md,CLAUDE.md, andagents/project/are filled from the plan; drop the UI and end-to-end lines and{{E2E_CMD}}when the repo has no UI, and delete every placeholder you cannot fill with a verified value. Contracts name real symbols only. Existing instruction files (AGENTS.md,CLAUDE.md,.cursorrules,.github/copilot-instructions.md,CONTRIBUTING.md) are migrated from the plan's migrated-rules table, one row at a time: a contract row becomes a contract block, a rule row becomes a project rule with its gate name orGate: review, a playbook row goes verbatim into the namedagents/project/file, a command row fills the verification block, and a duplicate or dropped row is left out. No rule is dropped silently; the confirm step showed the table. A file whose name a template owns (AGENTS.md,CLAUDE.md) is replaced by that template. Any other instruction file (.cursorrules,.github/copilot-instructions.md) becomes a one-line pointer toAGENTS.md, so the agent that reads it lands on the rules instead of a stale copy.CONTRIBUTING.mdstays where it is. The user sees the diff. - Write the gates from
reference/gates.md, in the repo's own test runner and CI provider: the instruction gate, proven red, the PR body check, the ratchet (always, seeded with the counters the repo supports: files over the C2 length, lint problems per rule when a linter runs, each contract Never clause that has violations today), and the mutation smoke when discovery named a risky module (auth, a parser, the API client); otherwise refine adds it after the first fix chain. The stack table there picks the reference: native ports for Node and Python, shell references that need only git, grep, and awk for every other language. Set the instruction gate's word budget at the current count plus half, rounded up to the next 500. - Prove each gate red with a scratch violation, remove the violation, run the repo's full test command, and commit one logical change per commit, in this order: the instruction files with the gate that checks them; one commit per gate after that (ratchet, proven red, mutation smoke, PR body check); the combined gate command and the pre-commit hook; CI last. One commit holding the whole framework hides which gate was proven red against what, and leaves nothing to revert on its own. Do not push unless asked.
- Report what was written, the instruction word count against the
budget, which contracts say
Gate: reviewand why, whether this run installed slop-mop and so it applies from the next session, any always-loaded file outside the repo whose prose style conflicts with the repo's (~/.codex/AGENTS.md,~/.claude/CLAUDE.md, a terse or compressed house style): name the file, and say that the repo's rule governs repo prose. End with the one next step: rungap-trap refineafter the first incident or in a month. - Offer a check. End the report with one question: check the repo
against the new framework now? On no, stop. On yes, change no files
and list, grouped by contract or rule ID:
- each ratchet counter, its count, and the file and line behind each unit of it;
- each
Gate: reviewcontract: read the code itsPath:andNever:lines cover and list suspected violations with file and line, marked unverified because no gate checks them; - the red build, type check, or lint items recorded in step 2.
Fix nothing in this pass. A fix the user picks is its own commit,
and a fix that lowers a count reruns the ratchet with
--update.
Instruction files are read by agents. Write them as terse statements
with IDs and gate names. Human-voice prose belongs in the repo's docs,
not in AGENTS*.md or agents/.
refine
Follow reference/refine.md. It audits rules without gates, contract
names that no longer exist, and the commit history since the last
refine, and it proposes edits through the self-improvement protocol as
one PR. It removes rules with no incident behind them as readily as it
adds gates.
Common mistakes
| Mistake | Fix |
|---|---|
| A contract with a guessed symbol name | Every name in a Path: line is greppable in the tree; the instruction gate fails otherwise |
| Writing ten contracts on day one | Start with the places that have one sanctioned path and a violation today; add the rest through refine |
| A gate that passed on first run | Prove it red with a scratch violation first; a gate that never failed proves nothing |
| Vendoring slop-mop into the repo | It installs per agent from its repo; the project rule requires it |
| Instruction prose polished for people | Agents read it. Statement, one-clause why, gate name |
| Skipping the model gate because the repo is small | Discovery quality is the deliverable; the gate is first for a reason |
版本历史
-
v0.2.2
GitHub ↗
原版更新说明
### Fixed - #2 proven red judges each new test, and runs without --title
-
v0.2.1
GitHub ↗
原版更新说明
### Documentation - fix documentation (grammar-moderate-001)
-
v0.2.0
GitHub ↗
原版更新说明
### Fixed - close the defects the audit found in every port ### Documentation - match the spec to the gates ### Internal - run the gate tests on every push ### Other - Fix typo in validation importance section - reminder to review the rules
-
v0.1.0
GitHub ↗
原版更新说明
### Added - make the framework work in Claude Code and Codex - language-neutral gates and stack tables - gap-trap, a setup skill for an agent quality framework ### Fixed - close five gaps the Claude Code and Codex trial exposed - findings from the setup run on a Go repo - findings from the first setup run on a TypeScript repo ### Documentation - say how each harness loads the instruction files - cover Codex in the README and the site - show the GitHub star count in the site header - add a GitHub Pages site that explains gap-trap - move the logo to assets/ and put the model note back under Install - add the gap-trap logo to the README - explain how to update the skill - offer a repo check against the framework after setup - drop the origin repo's commit counts from the README - migrate existing instruction files during setup - make the problem statement apply to any codebase - add the skills CLI install command - restructure the README into short sections - rewrite the README opening in plain language - cite the chapter's own commit numbers - link the rendered chapter 14 as the inspiration - open the README with the plain-language tagline ### Internal - add a release script that tags and writes the notes - drop a stray .pyc committed by mistake ### Other - Fix formatting issue in README.md - nits
当前收录版本
0.0.1
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- Provides a comprehensive, high-value solution for enforcing code quality in agent-driven development.
- Addresses a specific and important niche: ensuring agent-written code adheres to defined rules via automated gates.
亮点
- Trigger description is highly precise, covering specific keywords and functional contexts.
- Clearly defines when to use the Skill, minimizing ambiguity.
待提升项
-
引用文件缺失 原报告严重程度:重大
The Skill's main body references several critical files (`reference/framework.md`, `reference/discovery.md`, `reference/gates.md`, `reference/refine.md`, `templates/`) that are not included in the provided Skill package. These files are essential for the Skill's execution.
改进建议:Ensure all referenced files are included in the Skill package or provide clear instructions on how to obtain them.
-
文档过长 原报告严重程度:轻微
The main `skill_body` content is excessively long, which can make it difficult to parse and maintain.
改进建议:Consider breaking down the content into smaller, more manageable sections or files, and ensure it is under 500 lines if possible.
亮点
- Clear separation of modes (`setup` and `refine`) and detailed step-by-step instructions.
- Includes a 'Common mistakes' section for better user guidance.
待提升项
-
依赖文件缺失 原报告严重程度:重大
Execution heavily relies on external reference files and templates not present in the package, which will prevent the Skill from running correctly.
改进建议:All dependencies, especially core reference files, must be bundled with the Skill.
亮点
- Includes a 'model gate' check to ensure execution on a capable model, improving reliability.
- Describes a process for proving gates 'red' to ensure they work, which is a good reliability practice.
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- github.com
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
翻译待完成,请参阅来源文档。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。