verify-and-fix

verify-and-fix is a skill for Claude Code from Lion-1209/Lion-Skills. It costs 26 tokens per session (3,086 once invoked), scanned A, a copy of verify-and-fix, MIT.

A development practice for checking that code really works before calling it finished. It uses tests, type checks, and real runs of the target scenario where available.

In plain words
What is it for?
Use it after writing or changing code, when fixing bugs, and when verifying refactors or failures in tests and type checking.
Why use it?
It catches runtime errors, type mismatches, and missed edge cases that a code review alone may not reveal, while encouraging fixes to the underlying cause.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the lion-skills plugin — 13 skills shipped together

Good fit Use it after writing or changing code, when fixing bugs, and when verifying refactors or failures in tests and type checking.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lion-1209/lion-skills/verify-and-fix
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Lion-1209/Lion-Skills --skill verify-and-fix
Clone the repo
git clone --depth 1 https://github.com/Lion-1209/Lion-Skills

Made for: Claude Code.

Or install lion-skills, the plugin that ships this one along with the rest of its 13 skills.

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 verify-and-fix

README.md
[![agentmods](https://agentmods.dev/badge/skills/lion-1209/lion-skills/verify-and-fix/github.svg)](https://agentmods.dev/skills/lion-1209/lion-skills/verify-and-fix)
Your own site
<a href="https://agentmods.dev/skills/lion-1209/lion-skills/verify-and-fix"><img src="https://agentmods.dev/badge/skills/lion-1209/lion-skills/verify-and-fix/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for verify-and-fix

Your own site · 80×15
<a href="https://agentmods.dev/skills/lion-1209/lion-skills/verify-and-fix"><img src="https://agentmods.dev/badge/skills/lion-1209/lion-skills/verify-and-fix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,086 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 100% copy Near-identical to another mod 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.00026 $0.03086
Opus 5 $0.00013 $0.01543
Sonnet 5 $0.00005 $0.00617
Haiku 4.5 $0.00003 $0.00309

Measured 12d ago against content hash d74c0e651050, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

verify-and-fix 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 12d ago.

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.

Origin

This is a copy

100% identical to verify-and-fix — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/verify-and-fix/SKILL.md · 133 lines

How it starts

The opening of the file, as written. The whole thing — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Verify and Fix

概述

把"声称完成"变成"经验证完成"。核心:代码写完 ≠ 测试过 ≠ 类型对 ≠ 真的没问题——这三个"≠"是大多数返工和线上事故的源头。本 skill 的纪律是:交付前用工具实际跑一遍验证,修 bug 时找根因而非压症状,绝不为"通过"而弱化检查。

灵感来自 multi-agent "loop engineering"(写代码的 agent 与检查的 agent 分离、循环到全绿)。但本 skill 提炼的是纪律本身——无论单 agent 迭代还是多 agent loop,验证-修复的纪律不变。loop 是一种强制实现,纪律才是本质。

何时使用

  • 刚写完代码,准备声称"完成"/"修好了"
  • 修 bug,决定怎么修
  • 测试/类型检查报错,要处理
  • 来回改同一处反复出问题(怀疑在原地打转)

不该用:纯探索/原型阶段(本来就不要求正确,验证是负担);明确无失败可能的确定性逻辑(过度验证也是负担)。

与相邻 skill 的衔接verify-and-fix 在 task-breakdown 的下游——每个任务的"完成定义"就是它的验证目标。task 拆出"做完 X 后能验证 Y",verify-and-fix 负责"实际去验证 Y、不通过就修"。它把 task-breakdown 里的"完成定义"从纸面标准变成实际跑过的证据。

核心内容

第一原则:未经运行的代码不算完成

"我看了一遍,应该没问题"——这是最危险的完成声明。代码审查(肉眼看)不能替代运行验证。肉眼能发现风格、明显逻辑错,但发现不了:实际运行时的类型不匹配、边界数据触发的分支、依赖交互、并发时序。

完成的标准必须是实际跑过的证据

  • 有测试 → 跑测试,全绿才算过
  • 有类型系统(TS/带 type hint 的 Python/Rust)→ 跑类型检查
  • 能跑 → 实际跑一遍目标场景
  • 三者都要,不是任选其一(测试过不代表类型对,类型对不代表运行时分支都对)

重构场景尤其要防回归:把 for 循环换成 find、换库、提函数、改异步为同步——这类"等价改写"最易悄悄丢失原代码处理的边界(原循环在没找到时可能返回 null/抛业务错,find 改写后这个分支没了)。验证重构时,问自己:原代码处理过哪些情况?新写法每一条都覆盖了吗? 尤其是边界——空集合、找不到、异常输入。重构的验证标准比新写更高:新写只验"能跑",重构还要验"行为没变"。

反例:用户说"我把 for 循环改成 find,应该没问题",你附和"嗯看着对"——但 find 可能返回 undefined,.name 就抛错。这种 bug 肉眼看不出来,跑一下立刻暴露。

修病因,不修症状

修 bug 最常见的错法:在报错末端兜底,把错误压住,而不查它为什么报错。

  • 报错 Cannot read 'map' of undefined → 加可选链 data?.map(...) 压住。错误消失了,但 data 为什么是 undefined 的病因还在——换个场景又会炸。
  • 测试报 result is 4, expected 5 → 把断言改成 toBe(4)。测试变绿了,但"为什么是 4 而不是 5"的问题被掩盖。

区分"合理兜底"和"掩盖 bug"

  • 合理兜底:值合法地可能为空(如可选字段、外部数据可能缺失),兜底是设计的一部分。例:user.nickname ?? user.name——昵称本来就可不填。
  • 掩盖 bug:值本不该为空却空了——说明上游有 bug(数据源问题、初始化遗漏、路径没覆盖)。这时兜底只是把火盖住,火还在烧。

判断尺子:问"这个 undefined/null 在什么情况下出现?"——能说出一个合理的业务场景("用户没填昵称")→ 合理兜底;说不清、或答"反正运行时出现了"→ 是 bug,查源头。

修病因的路径:沿错误向上游追溯——报错点 ← 数据从哪来 ← 谁产生/传递的 ← 什么条件下变成这样。修在最上游的"产生"处,而不是最下游的"消费"处。

断言失败时的灰度——先确认期望值的权威性。测试报"实际 4,期望 5"时,别本能地认定"代码错了、断言对"。先问:期望值 5 从哪来? 是规格文档/业务约定的硬需求 → 代码错了,修代码;还是开发者随手写的猜测("我觉得应该是 5")→ 可能断言本身错了。区分两种"改断言":

  • 错的改断言:期望值有权威来源(规格/约定),为了通过把它改成实际值——这是弱化检查。
  • 对的改断言:发现期望值本身就是错的(规格已改、当初写错了),改成正确的期望值——这是修正错误期望,不是放水。

Read the full file on GitHub · 133 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 133 lines · 26 tokens per session scan A d74c0e651050

Subscribe to this mod's changes

verify-and-fix is a skill published in the GitHub repository Lion-1209/Lion-Skills (5 stars, last pushed 2mo ago), licensed MIT. It adds 26 tokens to every session and 3,086 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to verify-and-fix, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

arize-dataset

INVOKE THIS SKILL when creating, managing, or querying Arize datasets and examples. Also use when the user needs test data or evaluation examples for their model. Covers dataset CRUD, appending examples, exporting data, and file-based dataset creation using the ax CLI.

boshi-xixixi/TraeSkill · 60 tokens

breakdown-plan

Issue Planning and Automation prompt that generates comprehensive project plans with Epic > Feature > Story/Enabler > Test hierarchy, dependencies, priorities, and automated tracking.

boshi-xixixi/TraeSkill · 35 tokens

breakdown-test

Test Planning and Quality Assurance prompt that generates comprehensive test strategies, task breakdowns, and quality validation plans for GitHub projects.

boshi-xixixi/TraeSkill · 29 tokens

eval-driven-dev

Improve AI application with evaluation-driven development. Define eval criteria, instrument the application, build golden datasets, observe and evaluate application runs, analyze results, and produce a concrete action plan for improvements. ALWAYS USE THIS SKILL when the user asks to set up QA, add tests, add evals…

boshi-xixixi/TraeSkill · 89 tokens

autoresearch

Autonomous iterative experimentation loop for any programming task. Guides the user through defining goals, measurable metrics, and scope constraints, then runs an autonomous loop of code changes, testing, measuring, and keeping/discarding results. Inspired by Karpathy's autoresearch. USE FOR: autonomous improvement…

boshi-xixixi/TraeSkill · 116 tokens

csharp-mstest

Get best practices for MSTest 3.x/4.x unit testing, including modern assertion APIs and data-driven tests.

boshi-xixixi/TraeSkill · 28 tokens