maintain-formal-verification-skill
它能做什么
让智能体在代码变化后更新项目的形式化验证,使证明继续准确描述代码的行为。适合在关键代码上运行模型检查器或验证器的团队。
适用场景
- ✓当合并或编辑改变了形式化检查所覆盖的代码的时候。
- ✓当你想确认某个形式化模型是否仍然与代码一致的时候。
- ✓当形式化检查失败,你需要判断是代码还是检查有误的时候。
技能链接
https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/maintain-formal-verification-skill/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我们的合并改动了任务队列。请检查我们的形式化模型是否仍与代码一致,并告诉我是否有东西被破坏。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会找出触及被验证代码的提交,更新模型或属性使其与代码一致,重新运行检查,并将每个结果标记为同步、已更新、错误或受阻。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Maintain a formal verification skill
In Claude Code, read the Claude Code adapter once per session before you follow this skill. It maps the Cursor names in pstack skills to Claude Code.
A formal check proves a property of what it describes. When the code changes and the verification does not, the check can keep passing while it describes code that no longer exists. That pass is the dangerous case, because it looks like a proof. This skill is the upkeep loop for a verify skill that /create-formal-verification-skill generated, or for any project-local skill that runs a model checker, prover, or code-level verifier against named code. The project-local skill handles a change that an agent makes while it uses that skill. This skill handles the changes that skipped it: merges, edits made without the skill, and drift that builds up across many commits.
Outcomes
Give each check one outcome, and say which:
- in sync: no change since the last sync alters what the check describes, and the check passes.
- updated: the code changed, the verification now describes the new code, and the check passes.
- bug: the verification describes the current code, and the code breaks the property. This is a finding about the code. It is not drift.
- blocked: the check could not be brought back in line or could not run. Say exactly why.
A check can be both updated and bug: the update makes the verification describe the code again, and then the property fails on it.
Edit scope
Edit only the verification: models, harnesses, property files, and the verify skill itself. Never edit product code during a run, unless the user asks you to. When a property fails on the current code, do not weaken the property or the model to make it pass. Report the failure.
Pass
Find the checks. A verify skill has no fixed name, so find it by what it does: a project skill that runs a model checker, a prover, or another verifier against named code. Read each one you find, or the one the user named. For each check, collect the property, the code it covers, the bounds and assumptions, the command that runs it, and the commit where it was last confirmed to describe the code. If no verify skill exists, stop and point at
/create-formal-verification-skill. If the skill does not record a sync commit, use the last commit that changed the verification files, and say that you did.Run it as it is. Run each check once before you change anything, and record the result. A pass here does not tell you that the code is correct. It tells you that the old description still holds. A failure here can be drift or a bug. Do not decide which until step 5.
Read every change to covered code. Diff the covered files from the sync commit to the current commit, and read each commit message. Also look for code that moved: a covered function that is renamed, split, or moved to another file is still covered code. Also look for new code that touches the state that a check guards, such as a new function that writes the same fields. For each change, decide which of these it is:
- No effect. The change does not alter anything the verification describes, such as formatting, comments, or code paths that the verification does not cover. Check this against the model or harness, not against the commit message.
- The verification no longer describes the code. A step that was one indivisible action is now two, a branch was added or removed, a check moved, a new path reaches the guarded state, or a value now has a different range. The model or harness must change.
- The promise changed on purpose. The change alters what the code promises, and evidence in the change says that this is intended: the doc comment, the tests, the changelog, or the commit message. The property must change, and you must cite that evidence.
- The promise may be broken. The code changed, and no evidence says that the promise changed. Treat a failure that follows as a bug candidate.
Update from the code, not from the result. Change the model or harness so that each changed part again points to code that a reviewer can open, and keep one indivisible step in the code as one step in the verification. Write the update from the code before you rerun, and do not shape it by what makes the check pass. Change a property only for a promise that changed on purpose. Write down the old wording, the new wording, and t
常见问题
为什么这很重要?
针对过时代码的检查仍可能通过,这看起来像是证明,实际上描述的却是已经不存在的代码。
“错误”结果意味着什么?
验证描述的是当前代码,而代码违反了该属性,因此这是一个真实的发现。
它只能配合它自己生成的技能使用吗?
不是。它可以配合任何运行模型检查器、证明器或验证器并针对指定代码的项目技能使用。
详情
作者的原始描述
Bring a project's formal verification back in line with the code after the code changes: find the commits that touched verified code, update the model, harness, or properties to describe the code as it is now, rerun, and say whether each failure is drift in the verification or a bug in the code. Use for /maintain-formal-verification-skill, \"is the model still true to the code\", or after merges and refactors that touched verified code without rechecking it.
repo: cursor/plugins
热度
- GitHub 星标
- 15k
- 排名
- #10967
- 许可证
- —
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
advisor
15k如果你开启该功能,让你的智能体在关键节点咨询一个更强的第二模型,例如在重大决定之前,或在错误上卡住时。
check-agent-compatibility
15k全面检查 AI 编程智能体能否启动、验证和记录某个代码仓库,并返回一个兼容性评分以及主要问题。
cli-for-agents
15k教你的智能体设计或审查命令行工具,使 AI 智能体无需提示即可运行,并提供清晰的帮助文字和示例。
continual-learning
15k通过把回顾过往对话的工作交给专门的记忆更新程序,使你的 AGENTS.md 笔记保持最新。