Incident Hotfix
Use this alongside broader incident-response skills when code-level action is required.
Workflow
- 1. Classify severity using INLINECODE0
- Create hotfix branch from current production tag/commit
- Reproduce and isolate with minimal failing test
- Patch with rollback plan
- Run focused CI checks
- Capture evidence bundle
- Merge + verify + postmortem actions
Step 1 — Create incident workspace
CODEBLOCK0
This creates:
- -
hotfix/INC-1234-<slug> branch - INLINECODE2 folder
- starter files for timeline, rollback, and actions
Step 2 — Evidence capture
CODEBLOCK1
Collects into docs/incidents/INC-1234/evidence/:
- - latest commits + diff summary
- changed files list
- local env snapshot (safe subset)
- test output logs
Step 3 — Patch gate
Before PR/merge, ensure:
- - failing case reproduced (or clearly documented)
- minimal patch scope
- rollback command documented in INLINECODE4
- focused tests pass + no new lint/type failures
Step 4 — Postmortem actions
Use references/action-template.md to convert findings into concrete tasks:
- - owner
- due date
- verification criteria
Required outputs
- - INLINECODE6
- INLINECODE7
- INLINECODE8
- INLINECODE9 bundle
Notes
- - Prefer smallest safe patch over broad refactor during incident.
- If root cause is uncertain, ship containment first, then permanent fix.
- Never merge hotfix without rollback path.
事件热修复
当需要执行代码级操作时,将此技能与更广泛的事件响应技能结合使用。
工作流程
- 1. 分类严重程度 — 使用 references/severity-matrix.md
- 创建热修复分支 — 基于当前生产标签/提交
- 复现并隔离 — 使用最小化失败测试
- 修补并制定回滚方案
- 运行聚焦的CI检查
- 捕获证据包
- 合并 + 验证 + 事后处理
步骤1 — 创建事件工作区
bash
bash scripts/start_hotfix.sh --id INC-1234 --base main
这将创建:
- - hotfix/INC-1234- 分支
- docs/incidents/INC-1234/ 文件夹
- 时间线、回滚和操作记录的起始文件
步骤2 — 证据捕获
bash
bash scripts/capture_evidence.sh --id INC-1234
收集到 docs/incidents/INC-1234/evidence/:
- - 最新提交 + 差异摘要
- 变更文件列表
- 本地环境快照(安全子集)
- 测试输出日志
步骤3 — 修补门禁
在PR/合并前,确保:
- - 失败案例已复现(或清晰记录)
- 最小修补范围
- 回滚命令已记录在 ROLLBACK.md 中
- 聚焦测试通过 + 无新的lint/类型错误
步骤4 — 事后处理
使用 references/action-template.md 将发现转化为具体任务:
必需输出
- - docs/incidents//TIMELINE.md
- docs/incidents//ROLLBACK.md
- docs/incidents//ACTIONS.md
- docs/incidents//evidence/ 包
注意事项
- - 事件期间优先选择最小安全修补,而非大规模重构。
- 若根本原因不确定,先实施遏制措施,再执行永久修复。
- 无回滚路径的热修复绝不可合并。