跳到正文
Skillpedia
通用编程7.6k · #13160

fix-at-the-boundary

它能做什么

这项技能指导在做任何修复之前,搜索某个漏洞模式出现的每一个位置。它适用于漏洞源于重复模式而非单个文件的情况。适合希望修复能覆盖整个代码库的开发者。

适用场景

  • ✓当漏洞由重复的模式引起,例如复制的辅助函数或常见的调用形式的时候。
  • ✓当你已经修复了几处,却不确定是否还有其他地方的时候。
  • ✓当同样的缺陷可能存在于其他应用或模板中的时候。

技能链接

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/fix-at-the-boundary/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“在修复之前,请检查某个保存函数中的这个竞态条件是否也出现在其他地方。”

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

工作原理

智能体在编辑任何内容之前,搜索该模式的每一处匹配并全部列出。它修复范围内的问题,并报告其他位置。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Fix at the Boundary

Activation guard

Use this skill when a reported bug's root cause is a pattern — a function shape, a write sequence, a device/permission check, a duplicated literal, a copy-pasted helper — rather than a fact unique to the one file named in the report.

If the bug is genuinely local (a typo, a value that only makes sense for that one app, a one-time data fix), say so explicitly — "this is local to <file>, no sweep needed" — and skip the rest of this skill. Don't sweep as theater.

Do NOT skip the sweep in these situations

  • "The report only names one file, I'll patch that and move on." A stale-diff write race, a mic-device resolution order, a missing scoped-access check — these are usually copy-pasted everywhere the same operation is implemented.
  • "I found 3 callers and fixed those, that's probably all." Enumerate every hit from the search before editing anything — stopping at the first few you notice is how instances 4–9 survive.
  • "Grepping the whole repo will take too long." A few rg calls take seconds; rediscovering the same fix across four more user reports doesn't.
  • "This looks like the same bug in an area I don't own, but that's not what I was asked to fix." Still enumerate it — just don't edit it (see below).
  • "I fixed the shared helper, callers will pick it up automatically." Only true if every sibling actually calls it — confirm with the same search.

Workflow

  1. Derive the fingerprint from the symptom, not the file: the exact function/hook name, the anti-pattern shape (read stale state → write without re-checking), a literal string, or an import path.
  2. Search before editing:
    # exact call/hook, whole repo
    rg -n "computeDiffBase\(|stashLocalDiffBase\(" --type ts -g '!**/node_modules/**'
    # duplicated literal (device id, action name, config key)
    rg -n "'design-native-asset'" -g '*.ts' -g '*.tsx'
    # same shape copy-pasted across template apps
    rg -n "getUserMedia" templates/*/app templates/*/src 2>/dev/null
    
    Widen the pattern (drop args, add -C 3, try a sibling term like diffBase vs diff_base) until confident no caller phrases it slightly differently.
  3. Enumerate every hit before touching any file — write the list in your response so step 5 is checkable.
  4. Decide where the fix lives. A shared helper some callers bypass → fix the helper and point bypassers at it. No shared helper and N ≥ 3 duplicate sites → consider extracting one instead of pasting a 4th time.
  5. Apply the fix to every in-scope hit.

Ownership boundaries

Enumerating isn't editing. A hit inside a path this task's DO NOT TOUCH list assigns to another agent gets listed as found-but-out-of-scope and flagged via spawn_task or a direct note — never silently edited or silently dropped. See concurrent-agents.

Reporting the sweep

Report the full blast radius, not just what you changed:

Fixed the stale-diff-base race in:
- insert-design-native-asset.ts (as reported)
- insert-asset.ts, apply-a11y-fix.ts, generate-design.ts (same pattern)
Found but out of scope (owned by another agent this task): apply-visual-edit.ts
in templates/design/** — flagged via spawn_task.
No other callers of computeDiffBase().

Why this exists

  • "apply-visual-edit.ts has the same stale-diff-base write-race bug that was just fixed in insert-design-native-asset.ts, insert-asset.ts, apply-a11y-fix.ts ... and generate-design.ts" — one defect, 9 files, fixed one report at a time instead of once.
  • Mic-device resolution was independently fixed in four different Clips surfaces (useMediaDevices.ts, media-capture-constraints.ts, offscreen.ts, recorder-engine.ts).
  • "i want to make sure universally cmd+click works ... can we do a quick sweep of other apps" — the user had to ask for a sweep across 4 templates that should have happened proactively.
  • "remember - if any other apps like in our core repo templates/ does this wrong, fix that too" — exists only because the first fix didn't already answer it.

Related Skills

  • concurrent-agents — why an out-of-scope sibling gets flagged, not edited.
  • adding-a-feature — the four-area checklist a proper fix should satisfy.
常见问题

是否总是需要全面排查?

不是。技能说明,像拼写错误这样真正局部的缺陷不需要排查,智能体应当明确说明这一点。

它会修改每一处匹配吗?

不一定。技能要求列出其他自有区域中的匹配,并避免修改任务之外的代码。

为什么不在找到几处后就停下?

技能警告说,过早停止正是同一缺陷的后续副本得以存活的原因。

详情

作者的原始描述

How to find every sibling instance of a reported bug before fixing it. Use whenever a bug report names one file but the defect is a call pattern, hook, duplicated literal, or copy-pasted helper that plausibly exists in other files, apps, or templates.

repo: BuilderIO/agent-native

热度

GitHub 星标
7.6k
排名
#13160
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能