I wrote CONSTRAINTS.md in the current folder. There is no AGENTS.md here, so I didn't add the pointer line to it. In your real repo, add this line to AGENTS.md: Read CONSTRAINTS.md before writing code. Do not weaken it to make a change pass.
What's in it
- Floor (blocks now): no new suppressions, no stubs or empty
catch, no skipped or deleted tests, no stripped assertions, no secrets, and no weakening the file itself. - Warn until 2026-10-24, then block: types, lint, changed-line coverage ≥ 80%, Semgrep, osv-scanner and axe.
- Held, not enforced: project coverage stays at 58.2% (0.5% tolerance) and the bundle stays at 212 kB.
- Budget: checks at task end must finish in 90 seconds. Semgrep, osv-scanner and axe run in CI or on the preview deploy.
- Performance budget: you didn't pick one, so bundle size is only tracked. I picked 80% for changed-line coverage myself, because you asked to hold the current level and 80% is the skill's default for new code. Say so if you'd rather not have it.
What to install and wire up
You already have tsc, Vitest and Biome.
| Tool | Install |
|---|---|
| Coverage | npm i -D @vitest/coverage-v8, with the lcov reporter on |
| gitleaks | brew install gitleaks |
| Semgrep | pipx install semgrep |
| osv-scanner | brew install osv-scanner |
| axe | npm i -D @axe-core/cli |
Add these scripts to package.json:
"check:fast": "tsc --noEmit && biome check . && gitleaks detect --redact --no-banner",
"check:task": "npm run check:fast && vitest run --coverage",
"check:full": "npm run check:task && semgrep scan --config p/default --config p/owasp-top-ten && osv-scanner scan source -r ."
- After each edit: run
check:fast, for example from an agent post-edit hook. - At task end: run
check:task. Compare the lcov it writes againstgit difffor the 80% changed-line check, without running the tests a second time. - In GitHub Actions: run
check:fullon every PR. After the preview deploy, runaxe $PREVIEW_URL --tags wcag2a,wcag2aa,wcag21aa. - Floor guard: it needs no installs and only reads the diff. Adapt the reference implementation in the skill's
references/floor-guard.md, which I haven't opened. - gitleaks: always use
--redact, so a leaked key never lands in a transcript.
The diff against the floor
It violates the floor in four places, and one of them also edits the constraints file.
cart.test.ts:it.skipadds a skipped test, and the assertionexpect(...).toThrow()is stripped. Nothing in the diff gives a reason in a commit message. The negative-quantity rule is no longer tested.pay.ts,// @ts-ignore: this is a new suppression. It hides a type problem onorder.totalthat should be fixed.pay.ts,catch {}: this is an emptycatcharoundcharge(total). A failed payment now passes silently and the code carries on as if it worked. This is the most dangerous change in the diff.CONSTRAINTS.md: the changed-line coverage threshold drops from 80% to 60% in the same change as the code it would excuse. That breaks the rule against weakening the file.
The four edits fit one pattern: the agent hit red checks and took the cheapest route to green. Reject the diff. The agent should restore the test, fix the type of order.total, handle or rethrow the charge error, and put the threshold back at 80%.
Test run with the interview answers given up front, because the Skill does not run its interview in non-interactive mode. The model wrote CONSTRAINTS.md in a temporary folder, listed what to install, and correctly found four floor violations in a sample diff. It chose the 80% coverage figure itself and said so, and it did not open the floor-guard reference file. Nothing was installed.
它做什么
先做一次简短的访谈(技术栈、当前基线、已有的检查、智能体可以改什么),然后写出 CONSTRAINTS.md。里面有从第一天起就拦截的底线(不新增压制注释、不留桩代码或空 catch、不跳过或删除测试、不去掉断言、不放密钥、不削弱这份文件本身),每条都有具名工具和运行时点的数字规则(类型、lint、密钥、改动行覆盖率、代码与依赖安全、无障碍),守住今天的数字而不抬高的棘轮,智能体自检的时间预算,以及带负责人和到期日的例外表。新规则先只告警,并写明改为拦截的日期。它会列出要安装什么、要加哪些脚本,还能把智能体的 diff 拿来对照底线审查。
输出
一份 CONSTRAINTS.md、安装与接线说明,以及(按需)对某个 diff 的审查结论。
适合什么场景
让智能体写代码、又希望检查不能被智能体改写来换取“绿灯”的团队。
中风险:Skill 本身只有指令(外加一份底线守卫脚本的参考文件),但它会让智能体写 CONSTRAINTS.md,并建议你安装工具(覆盖率、gitleaks、Semgrep、osv-scanner、axe)、在项目里加脚本或钩子。运行这些命令之前请先看一遍。因为访谈在非交互模式下不会运行,试用时把访谈的答案预先给出:它把文件写在临时目录,列出了要装的东西(没有真的安装),并在示例 diff 里找出四处违反底线。80% 这个数字是它自己选的,它也明确说了;它没有打开底线守卫的参考文件。作者 Addy Osmani,MIT 协议。