Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/YuDefine/nuxt-supabase-starternpx agentmods add rules/yudefine/nuxt-supabase-starter/checker-contractWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/checker-contract)<a href="https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/checker-contract"><img src="https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/checker-contract.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.05466 |
| Opus 5 | $0.00000 | $0.02733 |
| Sonnet 5 | $0.00000 | $0.01093 |
| Haiku 4.5 | $0.00000 | $0.00547 |
Grade A, and why
checker-contract scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 266 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Checker Contract
Mechanical checker 的綠燈是一項可重現的 contract claim:它只證明輸出明寫的 scope 已被完整執行,不能把「沒有執行」包裝成「沒有違規」。本規約對每一支 mechanical checker、每一個安全/contract gate、每一條 CI check entry 與每一份既有債務 allowlist 生效。
REQUIRED output contract
每一支 mechanical checker 在 pass、finding、N/A 與 infrastructure error 四種結果下,都 MUST 輸出以下欄位;JSON 模式使用同名 keys,文字模式使用同順序 labels:
<checker>: <pass|finding|N/A|infrastructure-error>
scope: roots=<實際掃描目錄>; patterns=<實際納入 pattern>; mode=<tracked|staged|filesystem>
skipped: <排除目錄/pattern/原因;沒有就寫 none>
completeness: <complete|partial|unknown>
scope MUST 是本次 invocation 的實際值,不得只在 --help 或 source comment 宣告。沒有 applicable target 時可回 N/A;目錄、symlink、env 或執行依賴缺失時不得回 N/A,必須走 infrastructure error。
completeness 與結果是正交的兩軸
pass|finding 回答「掃到的東西合不合格」,completeness 回答「宣告的 scope 掃完了沒」。兩軸 MUST 分開輸出——pass + partial 是合法且常見的組合(掃到的部分沒問題,但沒掃完),把它塌縮成單一綠燈就是把「沒掃到」講成「沒問題」。
| 值 | 何時用 |
|---|---|
complete |
宣告的 scope 全數執行完 |
partial |
scope 內有單元被跳過(逾時、單檔 parse 失敗、明確 deferred)。MUST 同時在 skipped: 列出被跳過的單元 |
unknown |
checker 無法確定自己掃完沒(glob 展開被上游截斷、列舉命令回傳值不可信) |
Exit code 契約
每一支 checker 的 exit code MUST 讓消費端分得出「跑完了有問題」與「沒跑成」:
| 結果 | exit code |
|---|---|
pass / N/A |
0 |
finding |
1 |
infrastructure-error |
2 |
消費端(CI job、pre-commit hook、gate-runner)收到 2 時 NEVER 當成「檢查過了沒問題」,也 NEVER 當成一般違規去 retry——它代表這個 gate 這次根本沒有執行。
鎖的是語義軸,不是數字。 同一條軸的既有實例:vendor/scripts/pi-dispatch.ts 用 2 = 業務 fail(跑完了,結果不合格)、3 = mechanical failure(codex 缺失/spawn error/timeout/無可解析 JSON)、4 = quota gate。它多一個配額態,數字自然往後排,這是正確的——NEVER 為了對齊數字去改既有 dispatcher 或 checker,要對齊的是「兩類失敗必須是不同 exit code」這件事本身。
Fail-closed Iron Law
違反字面就是違反精神。
安全類/contract 類 gate 的依賴缺失 = INFRASTRUCTURE ERROR,NEVER = 綠燈。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- today Changed · +2 lines 82f377a287c4
- 4d ago First seen · 264 lines · 0 tokens per session scan A cef9509b205f
checker-contract is a cursor rule published in the GitHub repository YuDefine/nuxt-supabase-starter (45 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 5,466 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other cursor rules, from other repositories
workflow
BDD-style workflow, UI screenshots in the PR, HTTP OpenAPI and config schema sync before lint, final checks.
testing
Agent engineering standards — Testing (TR-TEST-001, TR-TEST-002, TR-TEST-004, TR-TEST-005, TR-TEST-006, TR-TEST-007).
mcpnuke-tests
Test conventions for mcpnuke — enforces TDD workflow.
debug-issue
When the user reports a bug, an error, or unexpected behavior. Enforces four structured phases — reproduction, failing test, root cause isolation, fix and verify — to stop guess-and-check loops.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.