Logo Gap Trap

Gap Trap

Cộng đồng
pliablepixels
gap-trap

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".

Tổng quan

Nhà phát hànhpliablepixels
Kho mãgap-trap
Tên kỹ nănggap-trap
Sao
181
Bản fork
9
Tệp đi kèm
23
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 23 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được pliablepixels công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Gap Trap trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/pliablepixels/gap-trap/tree/main/gap-trap
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/pliablepixels/gap-trap.git /tmp/gap-trap
mkdir -p .claude/skills
cp -r /tmp/gap-trap/gap-trap .claude/skills/gap-trap
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Gap Trap trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Gap Trap ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Gap Trap không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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 . 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

  1. 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.
  2. 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_URL were 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.
  3. Install slop-mop. git clone https://github.com/pliablepixels/slop-mop.git into your scratch directory and copy slop-mop/slop-mop to 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 in AGENTS.project.md requires 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 in AGENTS.md, and tell the user in the report that slop-mop applies from their next session.
  4. Write the instruction files from templates/. AGENTS.md and agents/generic/agent-workflows.md are 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 its Gate: clause replaced by Gate: n/a, no <thing> in this repo. Nothing else in AGENTS.md changes. AGENTS.project.md, CLAUDE.md, and agents/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 or Gate: review, a playbook row goes verbatim into the named agents/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 to AGENTS.md, so the agent that reads it lands on the rules instead of a stale copy. CONTRIBUTING.md stays where it is. The user sees the diff.
  5. 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.
  6. 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.
  7. Report what was written, the instruction word count against the budget, which contracts say Gate: review and 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: run gap-trap refine after the first incident or in a month.
  8. 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: review contract: read the code its Path: and Never: 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

MistakeFix
A contract with a guessed symbol nameEvery name in a Path: line is greppable in the tree; the instruction gate fails otherwise
Writing ten contracts on day oneStart with the places that have one sanctioned path and a violation today; add the rest through refine
A gate that passed on first runProve it red with a scratch violation first; a gate that never failed proves nothing
Vendoring slop-mop into the repoIt installs per agent from its repo; the project rule requires it
Instruction prose polished for peopleAgents read it. Statement, one-clause why, gate name
Skipping the model gate because the repo is smallDiscovery quality is the deliverable; the gate is first for a reason

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Gap Trap làm được gì?

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".

Vì sao nên dùng Gap Trap trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Gap Trap là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Gap Trap trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/pliablepixels/gap-trap/tree/main/gap-trap. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Gap Trap?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Gap Trap với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Gap Trap với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Gap Trap có miễn phí không?

Có. Kỹ năng này được pliablepixels phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇