agentleFS
YorkWong1995YorkWong1995/OPC-Harness/.claude/skills/bugfix/SKILL.md

bugfix

Skill4 starsChanged 6 months agoMITView on GitHub

Locate a defect, make the smallest safe fix, and collect targeted validation evidence with Engineer/QA boundaries.

35 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use feature, refactor and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • bradtraversySkill

    feature

    Manage current feature workflow - start, review, explain or complete

    Also in 7 projects that use this

  • GitHubSkill

    refactor

    Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

    Also in 6 projects that use this

  • SentrySkill

    spec

    Produce a verified spec — problem, desired outcome, and acceptance criteria — before building. Use when given a GitHub/Linear issue link, when starting from a fuzzy in-conversation idea, or asked to "figure out what to do" / "scope this" / "what should I build" — whenever the *what* isn't yet pinned down. Grills the ambiguities, checks the premise against the code, and produces acceptance criteria you sign off on — then hands to design-first.

    Also in 4 projects that use this

  • SentrySkill

    commit

    Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.

    Also in 8 projects that use this

  • BlockSkill

    plan

    Draft a TDD, PRD, or lightweight plan in the conversation without committing it.

    Also in 4 projects that use this

  • Microsoft AzureSkill

    docs

    Also in 3 projects that use this

The file

Files
SKILL.md

bugfix

面向已知缺陷或可复现异常,按 Engineer/QA 边界完成缺陷定位、最小修复和定向验证,不承担需求扩展、架构重构或无关清理。

用法

/bugfix <缺陷描述或复现路径>

目标

  • 明确缺陷现象、影响范围和预期行为
  • 定位最可能根因与受影响文件
  • 实施最小必要修复
  • 输出可复现的验证证据

适用场景

  • 已有测试失败、命令报错或用户提供复现路径
  • 现有功能行为与任务、PRD 或文档验收标准不一致
  • 需要快速修复单点缺陷并保留清晰证据

不适用场景

  • 新功能开发
  • 大范围重构
  • 无明确复现路径的产品方向讨论
  • 需要人工决策的需求取舍

执行流程

  1. 确认输入:记录缺陷描述、复现路径、预期行为、实际行为和相关文件;缺失关键输入时先向用户澄清。
  2. 复现或定位:优先运行最小复现命令、定向测试或读取相关日志;无法复现时说明已检查路径和剩余不确定性。
  3. 根因判断:把现象映射到具体代码、配置或文档约束,说明为什么这是最可能根因。
  4. 最小修复:只修改修复该根因所必需的文件和逻辑,不做顺手重构、风格整理或无关优化。
  5. 定向验证:运行与缺陷直接相关的测试、命令或文件检查;验证失败时回到定位或修复步骤。
  6. 验收证据:输出修复范围、验证命令、关键结果和仍需关注的风险。

执行规则

  1. 先确认缺陷描述、复现路径、预期行为和相关文件;信息不足时先澄清。
  2. 默认只修改触发缺陷所必需的最小文件范围。
  3. 禁止借 bugfix 做无关重构、格式化、依赖升级或顺手优化。
  4. 修复后必须运行定向验证,验证失败不得给出通过结论。
  5. 输出必须包含根因、修复范围和验证证据。
  6. 根因不明确时不得扩大修复范围,只能记录假设、证据和下一步定位建议。

示例

  • /bugfix tests/test_metrics.py 中 run_metrics totals 断言失败
  • /bugfix CLI 执行 opc runs trace 报 KeyError,复现命令为 python -m opc.cli runs trace latest

输出骨架

[缺陷现象] ...
[复现路径] ...
[预期行为] ...
[根因判断] ...
[修复范围]
- 文件:...
- 变更:...
[验证命令 / 检查方法]
- ...
[验证结果] 通过 / 不通过
[验收证据]
- 标准 1 → 通过 / 不通过(证据:path:line 或命令关键输出)
[后续风险] ...

验收标准

  • 至少能从输入中识别缺陷现象、复现路径和预期行为
  • 修复范围只包含与根因直接相关的文件
  • 输出包含根因判断、验证命令和验收证据
  • 若验证失败,结论必须是“不通过”并说明退回步骤

验收

  • 只覆盖缺陷定位、最小修复和定向验证
  • 明确 Engineer/QA 责任边界
  • 禁止超范围重构的规则清晰可检查
  • 输出包含根因和验证证据

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.