From harness-flow
Analyzes urgent production defects: builds reproduction paths, performs root cause analysis with 5 Whys, defines minimal safe fix boundaries, syncs status, hands off to hf-test-driven-dev. For hotfix scenarios excluding code changes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/harness-flow:hf-hotfixThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
在不放弃验证纪律的前提下处理紧急缺陷。本 skill 不写生产代码——负责分析、根因收敛、状态同步,然后 handoff 给 `hf-test-driven-dev`。
在不放弃验证纪律的前提下处理紧急缺陷。本 skill 不写生产代码——负责分析、根因收敛、状态同步,然后 handoff 给 hf-test-driven-dev。
本 skill 融合以下已验证方法:
适用:
不适用:
hf-test-driven-devhf-incrementhf-workflow-routerhf-test-driven-devhf-test-driven-devinteractive 模式下必须先确认边界再 handoff读缺陷报告、用户描述、相关代码/日志、项目级约定、feature progress.md(默认 features/<active>/progress.md)、当前已批准规格 / 设计 / 任务工件(默认 features/<active>/spec.md / design.md / tasks.md),以及受影响的 review / gate / verification 记录(如有)。
如果用户声称“这是 bug”,但改动内容看起来像新增字段、放宽约束、改变导出格式或扩展行为,先补一层契约核对:
hf-increment在进入复现与 handoff 设计前,先确认:
progress.md 的 Current Stage、Current Active Task、worktree 字段与当前案例证据不冲突若不满足,停止 hotfix 主流程,并写出唯一下一步:
hf-incrementhf-workflow-router确认复现方法。记录步骤、环境、预期 vs 实际。若无法复现 → 标为阻塞并说明原因。
定位根因。确定最小安全修复范围:改什么文件、影响什么行为、不改什么。显式写出修复边界,不扩大也不缩小。
出现以下任一信号时,不要直接 handoff 实现:
probable 而不是 demonstrated处理规则:
interactive:先展示“建议修什么 / 明确不修什么 / 为什么这仍是最小边界”,等真人确认auto:只有边界仍清晰且证据足够时才继续;否则回 hf-workflow-routerhf-test-driven-devhf-incrementhf-workflow-router记录保存到 项目声明的 verification 路径;若无项目覆写,默认使用 features/<active>/verification/hotfix-<topic>.md。同步 feature progress.md(默认 features/<active>/progress.md)。若使用 worktree 记录 Worktree Path/Branch。
写记录时优先使用 references/hotfix-repro-and-sync-record-template.md;时间极紧时可先用其中的简化版模板,但不能省略复现方式、修复边界和唯一下一步。
至少同步:
Current StageCurrent Active Task(保留原值或在明确失效时写明)Pending Reviews And GatesWorkspace Isolation / Worktree Path / Worktree Branch(若存在)Next Action Or Recommended Skill默认输出 / 记录结构:
## 热修复摘要
- 问题:
- 当前判断:`confirmed-hotfix` | `more-like-increment` | `blocked`
- 影响范围:
- 紧急级别:
## 证据基线
- 合同 / 回归证明:
- `Current Stage`:
- `Current Active Task`:
- `Pending Reviews And Gates`:
- `Worktree Path`:
- `Worktree Branch`:
## 复现信息
- 期望行为:
- 实际行为:
- 复现方式:
- 失败证据:
## 修复范围
- 最小改动内容:
- 未纳入本次修复的内容:
- 根因信心:`demonstrated` | `probable`
## 同步项
- 规格 / 设计 / 任务:
- 发布说明 / 状态记录:
## 状态同步
- `Current Stage`:
- `Current Active Task`:
- `Pending Reviews And Gates`:
- Next Action Or Recommended Skill:
Hotfix 分析结束时必须明确:
hf-test-driven-dev、hf-increment 还是 hf-workflow-router| 文件 | 用途 |
|---|---|
references/hotfix-repro-and-sync-record-template.md | 热修复复现、边界、同步项和下一步的标准模板 |
| 借口 | 反驳 / Hard rule |
|---|---|
| "线上着急,先打补丁,复现路径回头补。" | Hard Gates: hotfix 必须有最小复现路径;无复现 → 回 hf-workflow-router 走 increment 流程。 |
| "顺手把附近不相关的 bug 一起修。" | Hard Gates: hotfix 必须最小修复边界;越界改动 → 拆出 hf-increment。 |
| "test 留到 mainline merge 时再补。" | Hard Gates: hotfix 仍走 RED → GREEN,缺 RED 即视为未完成。 |
hf-test-driven-devprogress.md 已按 canonical schema 同步,且唯一下一步清晰npx claudepluginhub hujianbest/harness-flow --plugin harness-flowApplies a minimal, targeted fix for emergency bugs with enforced testing and review, skipping planning phases.
Finds and fixes bugs: default careful mode reproduces, investigates, tests changes; --fast mode creates hotfix branch from production, minimal fix, ships PR.
Systematically diagnoses and fixes bugs with a four-phase workflow: root cause investigation, pattern analysis, test-first repair, and wrap-up. Produces a tri-fold works.md. Triggers: fix bug, bugfix, hotfix.