Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Systematic bug sweep with a codebase-scaled target value, doubling escalation, area tracking, and final verification. Use on /bugsweep or whenever the user requests a systematic bug pass.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 93% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 210% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 95% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 84% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 74% | 0% |
> 中文 — bugsweep 官方中文版本。
具有收敛停止条件的迭代式 Bug 排查流程。根据代码库规模按比例调整目标,在搜索显得过于表面时触发升级,并通过区域追踪防止重复检查。
LOC = productive source lines (src/, lib/ — excluding tests, configs, docs, generated)
x = max(1, ceil(LOC / 1500))
base_rate = x * 3| LOC | x | 基础轮数 (Base rate) | |-----|---|-----------| | ~1500 | 1 | 3 | | ~3000 | 2 | 6 | | ~4500 | 3 | 9 | | ~10000 | 7 | 21 |
向用户汇报: "代码库规模: {LOC} LOC → 基础轮数 = {base_rate} 次无 Bug 搜索轮次。"
counter = 0
target = base_rate
any_bug_found = False
checked = [] # (area_name, type: code|task)
LOOP:
area = pick_new_area() # see area rules
checked.append(area)
Perform a thorough bug search
IF bug found:
any_bug_found = True
Fix following bugfix-protocol (phases 4+5)
Review: see model rule (newer model classes: no external review needed)
Commit + push
counter = 0 # RESET
ELSE:
counter += 1
Report: "✓ Clean: {area} — {counter}/{target}"
IF counter >= target:
IF NOT any_bug_found:
# Doubling escalation: not a single bug → search too shallow?
target = base_rate * 2
any_bug_found = True # escalate only ONCE
Report: "⚠ No bug in {base_rate} passes → target doubled to {target}."
CONTINUE LOOP
ELSE:
GOTO final verificationgit 的环境中(例如云端同步的项目文件夹),使用版本化备份代替 "commit + push":在首次修复前创建 file_<ts>.bak。注意 — 修复前的备份并非最终工作备份: 完成最后一次修复后,务必再创建一个新的 _FINAL_ 备份,否则同步波动可能会抹掉整个修复过程。“区域”可以是一个代码重点,也可以是一个任务(代码的功能目的)。
maintenance.py,第 5 轮 = maintenance.py + orchestrator.py(扩展)maintenance.py,第 5 轮 = maintenance.py(完全相同)"{name}" ({type}: code|task)当 counter >= target 且 any_bug_found 时:
步骤 A — bugfix-protocol 第 5 阶段:
pytest)py_compile 或单纯的 import 只能检查语法,无法验证路径是否正常运行。步骤 B — 审查 (模型规则):
如果在验证期间发现 Bug: → 修复 + 测试 + 提交 → 重置: counter = 0, target = base_rate(全新的基础轮数,不翻倍) → 返回搜索循环(已检查清单 checked 保留,any_bug_found = True)
如果验证完全无误: → 完成。Commit + push。输出协议总结。
markdown## Bug Sweep Result - **Codebase:** {LOC} LOC - **Base rate:** {base_rate} (escalated: {target}) - **Areas checked:** {len(checked)} - **Bugs found:** {count} - **Resets:** {reset_count} - **Doubling triggered:** yes/no - **Fixes:** - {title} — {commit_hash} - ... - **Final test suite:** {passed}/{total} green - **Review verdict:** self-verification (newer model class) / advisor confirmed / gaps named
/bugsweep 时Other measured skills in the registry, with their headline benchmark lift.