跳到正文
Skillpedia
测试48k · #6171

what-could-break

它能做什么

这个工具可以帮你在修改代码时,找出可能会被破坏的地方。它不仅检查你改动的部分,还会检查这个改动可能如何影响系统中与你的编辑没有直接关联的其他部分。

适用场景

  • ✓在跨多个代码段进行大规模修改之前。
  • ✓当你要编辑被许多其他程序使用的文件时。
  • ✓当你希望确认一个小改动不会引起意外问题时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/what-could-break/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/what-could-break/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“这次改动可能会破坏系统中的哪些其他部分?”

每周 5 个新技能,1 分钟读完。

工作原理

工具会分析你的改动,并在其他地方寻找潜在问题。它会用修改后的代码运行真实测试,尝试证明你的改动是安全的。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

What Could Break

Overview

Listing callers is not the job. Grep does that in a second. This skill finds the breakage grep will not show you, and produces one proof that the change is safe.

Run it before design, not only before merge. Whenever a task asserts something about existing code ("X already handles Y", "just make X public"), that assertion is a hypothesis, and the census of real consumers decides the design.

When to Use

  • Use before any multi-file edit, or an edit to a shared path: API payload, config, stored data, a client other apps read, a prompt or policy file
  • Use when the user asks "what could this break" or "blast radius of X"
  • Use for a small diff you do not trust
  • Use when a brief asserts something about existing code, before you design against that assertion

How It Works

Step 1: Do not trust your own writeup

A risk analysis that sounds right is worthless: it reads as convincing whether or not it is true. Find the one or two facts the whole change depends on, and get each one as far down this ladder as is cheap. Say where it stopped.

  1. You said so. Worth nothing on its own.
  2. You pointed at it. A real file:line, or the library's own source at the pinned version.
  3. You walked it. You traced the bad case step by step and it does not reach.
  4. You ran it. A script or test calls the real code and fails loud if you are wrong.
  5. You saw it live. Reproduced in the running app, service or device.

Rung 4 is usually one small script that imports the same module production runs and calls the exact function you are worried about, with the input you are worried about.

Step 2: Read the change

The diff, the symbols it adds, changes and deletes, and what it now does differently, including what the diff does not spell out. git log -S '<symbol>' and git log -L :<function>:<file> show why the old shape exists; a guard that looks pointless often has a commit explaining the incident it stopped.

Step 3: Find the one fact it is safe because of

Most risky-looking changes are safe because of one fact ("this only drops cache entries that are already expired", "no client reads this field"). If it holds, most risks clear at once. If you cannot find one, the change is not understood yet.

Step 4: Look where grep stops

Search for the literal value, the field name, the error text and the old behavior, not only the symbol you renamed. Then check each of these by hand:

  • The same rule living twice. A second config file, a fallback path that hardcodes the old default, a copy synced into another repo, a constant duplicated in a migration or test fixture, a feature flag default.
  • Prompts and agent files that restate the rule. System prompts, agent and skill files, AGENTS.md, CLAUDE.md, runbooks. An agent obeys the stale sentence, not your code.
  • Every other client. Web, iOS, Android, desktop, CLI, extensions, partner integrations. Mobile clients in users' hands stay on the old version for weeks: what does an old client do with the new shape, and a new client with the old server?
  • Wire formats. JSON field names and types, enum values, null versus missing, date formats, pagination shape, error codes, webhook payloads, queue schemas, GraphQL and protobuf contracts.
  • Stored state. Columns and their defaults, rows written under the old shape, cache entries, files on disk, append-only logs, session and cookie contents, search indexes. Old data outlives the deploy.
  • Environment and secrets. An env var renamed in code but not in the deploy config, CI, the image, or the second service that reads it.
  • Processes that restart separately. Web server, workers, cron jobs, serverless functions, the mobile app, a sidecar. During a rollout one runs new code while another runs old code against the same data. Can both coexist for an hour?
  • Timing and concurrency. Two writers on the same row or key, a retry that now fires twice, ordering that only held because one step was slow.
  • Library source at its pinned version. Read the dependency's code at the lockfile version, not your memory of its docs.
  • Generated and vendored code. Clients generated from a schema, vendored copies, committed build artifacts, bundles whose cache-busting key did not change.
  • Tests and fixtures that encode the old behavior. A test that passes because its fixture still has the old shape proves nothing about the new one.

…

常见问题

为什么不直接用 'grep'?

'grep' 只能搜索特定的文本。这个工具更进一步,会检查代码实际如何运行,以及它如何与其他部分交互,这是 'grep' 做不到的。

‘rung 4’是什么意思?

‘rung 4’是一种可信度等级,指用预期输入运行真实代码的测试或脚本,如果出现问题就会失败。它是证明代码按预期工作的一种方式。

什么是“wire formats”?

指系统各部分之间交换数据的方式,比如消息格式(JSON、XML)、字段名、数据类型,以及错误信息的传递方式。

详情

作者的原始描述

Find what a change breaks outside its own diff, then prove the one fact that makes it safe by running real code. Use before any multi-file edit or an edit to a shared path.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#6171
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能