invariant-guard-correctness SKILL.md skillA
invariant-guard-correctness from findscripter/everything-skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add findscripter/everything-skills/invariant-guard-correctness@git:20260916.3b600cbPins git:20260916.3b600cb in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 19 of 19 checks passed
- Kind
- SKILL.md skill
- Repository
- findscripter/everything-skills
- Path
00-meta/invariant-guard-correctness/SKILL.md- Versions recorded
- 2
- Latest version
- git:20260916.3b600cb, committed Sep 16, 2026
- First version recorded
- Jun 3, 2026
- Size
- 11,721 bytes
- Repository stars
- 11
- License
- a license file GitHub does not identify
当编写或评审"自以为熟悉"的算法(循环/递归/原地修改/边界)时使用;在写代码前先落笔函数契约、循环不变式、终止性论证与边界清单,产出正确性优先的实现与自检;不适用于显然无误的一行式或纯并发同步推理;触发词:循环不变式、二分边界、off-by-one.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
## 何时使用 在编写或评审"显然实现往往悄悄出错"的算法时使用本技能。模型知道什么是循环不变式、递归要有 base case、空表会出问题、`<` 与 `≤` 有别——但它不会在写代码前把这些写下来,于是交付了测试抓不到的细微正确性 bug。 **典型场景(后置条件比循环天然不变式更强):** - 后置条件强于循环不变式:Boyer–Moore 多数投票、Floyd 判环、最左 vs 任意二分、QuickSelect 划分。 - 读+写双指针的原地修改:原地去重、划分、旋转。 - 带多参数或累加器状态的递归。 - 含重复元素、空输入、边界值的 off-by-one 嫌疑点。 - 必须收敛终止的迭代细化:不动点、牛顿法、EM。 - 任何让你冒出"这算法我会"念头的函数——陷阱通常在契约里,不在循环体里。 **不该用的边界:** - 显然不会失败的一行式:协议本身是开销,留给非平凡的循环/递归/原地修改。 - 纯数学(概率、FFT、几何):转 `mathguard`,近似算法的后置条件是 ε-界而非等式。 - 并发推理:不变式默认假设单线程;多线程需额外的 happens-before / 可线性化论证,本技能不覆盖。 - 算法尚未选定时:先到 `lemmaly` 定算法,再回来写不变式。 ## 步骤(写代码前的协议,按此顺序) 在产出含循环、递归或非平凡状态的代码前,你的消息必须依次包含: 1. **函数契约** — 前置条件、后置条件、返回值,各一行。 2. **循环不变式** — 每个循环一条(规则 1)。 3. **终止性论证** — 每个循环或递归一条(规则 2、3)。 4. **base case 与度量** — 递归专用(规则 3)。 5. **边界用例表** — 每个适用情形一条,附预期行为(规则 4)。 6. **非法状态不可表示** — 指明用哪些类型或断言来强制不变式(规则 5)。 7. **代码本体。** 8. **自检** — 每个循环一行,确认不变式在循环顶成立、循环体保持它、退出条件蕴含后置条件。 **1–6 中任一缺失,不得产出代码。** ## 指令 铁律(不可违反): ```text 没有书面的不变式与终止性论证,就不写任何循环或递归 ``` 若你无法用一句话写出不变式,说明你还没设计好这个循环。 **五条不可协商规则:** 1. **每个循环一行不变式。** 写循环前,一句话陈述每次迭代顶部成立的事实。例:`循环顶:result 等于 a[0..i) 之和`;`循环顶:lo ≤ 目标位置 ≤ hi`。 2. **每个循环一行终止性论证。** 指名每次迭代严格递减(或严格趋向某界)的量。例:`hi − lo 每次严格递减`;`i 每次 +1 且以 n 为上界`。无终止性论证则不写循环。 …
Read the whole file at its exact version.
How to install
claude plugin marketplace add https://markdownregistry.com/mp/a/art_x6b5xe3onvexc3pe/9be386e583dad8e5931fa289f3ecc0f471075f74b00f42fa3ba31a923141075b.json
Then /plugin install invariant-guard-correctness@markdownregistry-x6b5xe3onvexc3pe in Claude Code. It installs git:20260916.3b600cb, the one graded A here, pinned to the commit it was graded at, and leaves it there.
mdr add findscripter/everything-skills/invariant-guard-correctness@sha256:9be386e583dad8e5The line at the top of this page pins the label git:20260916.3b600cb, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_x6b5xe3onvexc3pe)
0 badge image fetches in 30 days. What the badge shows.
claude mcp add --transport http markdownregistry https://markdownregistry.com/mcp/registry
Then ask it: what changed in findscripter/everything-skills/invariant-guard-correctness since the version I have? It reads every saved version here, no key and no account. Any agent that speaks MCP can add it.
Got a copy of invariant-guard-correctness from somewhere else? Ask it: where did my invariant-guard-correctness come from, and what was changed? It names the public original, the version yours is closest to and every changed line. The text is not kept.
Versions
The registry has recorded 2 versions of this file, between Jun 3, 2026 and Sep 16, 2026, about one every 105 days.
Watch this file (sign in, one email per new version)
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20260916.3b600cb latest | 2026-09-16 | 3b600cb | 11,721 B | A | view · diff |
| git:20260603.7a915e7 | 2026-06-03 | 7a915e7 | 11,725 B | A | view |
Committed this skill to a repository? Install the markdownregistry skill updates app on it, or on all of them. When the registry saves a newer version, a pull request brings your copy to it within minutes, the newest version first, then what changed and any check it newly trips. A copy you edited is never touched, and nothing is deleted.
It asks to read and write contents and pull requests, and to read metadata. No workflow file, no Actions setting, nothing runs on your runners. Uninstall it and everything the registry kept about your repository is deleted.
Committed this skill to a repository? Add one workflow file, and when a newer version is saved, a pull request brings your copy to it, the newest version first, then what changed and any check it newly trips. A copy you edited is never touched, and nothing is deleted.
mkdir -p .github/workflows && curl -fsSL https://markdownregistry.com/ci/skill-updates.yml -o .github/workflows/skill-updates.yml
It runs daily on GitHub Actions, no key and no account. Read the workflow before you add it.
Installed this file, say at .claude/skills/invariant-guard-correctness/SKILL.md? Drop it here to learn which saved version you have and what changed since. Your browser works out its SHA-256 fingerprint and sends only that; the file itself never leaves your computer.
Or paste its contents
Your agent can run this same check on the agent markdown files you have installed, up to 50 in one ask. Add the registry once:
claude mcp add --transport http markdownregistry https://markdownregistry.com/mcp/registry
Then ask it to check the files you have installed. No key and no account.
From the root of your project, one line hashes each installed skill's SKILL.md, your AGENTS.md and your CLAUDE.md, and asks the registry once. Only the fingerprints and paths are sent.
sha256sum .claude/skills/*/SKILL.md AGENTS.md CLAUDE.md | curl -s --data-binary @- https://markdownregistry.com/api/v1/check-copies
In CI, add --fail-with-body: the answer is 409 when any file is behind, so the step fails and still prints which files.
sha256sum .claude/skills/*/SKILL.md AGENTS.md CLAUDE.md | curl -s --fail-with-body --data-binary @- https://markdownregistry.com/api/v1/check-copies
No sha256sum on your machine? shasum -a 256 prints the same lines.
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (11721 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No encoded command decoded and run in a shell
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No decoded text run in a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
findscripter/everything-skills · 11 stars · license a license file GitHub does not identify · pushed 2026-11-22 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_x6b5xe3onvexc3pe GET https://markdownregistry.com/api/v1/resolve?ref=findscripter/everything-skills/invariant-guard-correctness GET https://markdownregistry.com/api/v1/blob/9be386e583dad8e5931fa289f3ecc0f471075f74b00f42fa3ba31a923141075b GET https://markdownregistry.com/api/v1/list?kind=skill
Every file of this kind listed here, most starred first, in pages: send each page's next back as cursor. JSON, no key.
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.