checker-contract

checker-contract is a cursor rule for Cursor from YuDefine/nuxt-supabase-starter. It costs 0 tokens per session (5,466 once invoked), scanned A, original, MIT.

A rule for designing mechanical checkers and CI gates so their results state exactly what was scanned and whether the scan was complete.

In plain words
What is it for?
It guides the output fields, pass and error states, scope reporting, skipped-item handling, and exit codes for checkers, contract checks, allowlists, and CI entries.
Why use it?
It prevents a checker from treating skipped files, missing dependencies, or an incomplete scan as proof that nothing is wrong.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions Codex.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node scripts/sync-something.ts | head -5.

Good fit It guides the output fields, pass and error states, scope reporting, skipped-item handling, and exit codes for checkers, contract checks, allowlists, and CI entries.

Compare 6 cursor rules from other repositories ↓
Install

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.

Clone the repo
git clone --depth 1 https://github.com/YuDefine/nuxt-supabase-starter
agentmods
npx agentmods add rules/yudefine/nuxt-supabase-starter/checker-contract

Made for: Cursor.

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

agentmods badge for checker-contract

README.md
[![agentmods](https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/checker-contract.svg)](https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/checker-contract)
Your own site
<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>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 5,466 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured today against content hash 82f377a287c4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

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.

template/.cursor/rules/checker-contract.mdc · 266 lines

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.ts2 = 業務 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 = 綠燈。

Read the full file on GitHub · 266 lines

Changes

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.

  1. today Changed · +2 lines 82f377a287c4
  2. 4d ago First seen · 264 lines · 0 tokens per session scan A cef9509b205f

Subscribe to this mod's changes

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.