with one click
patch
// Manage the persistent lightweight Patch track for small fixes that should not open a full milestone.
// Manage the persistent lightweight Patch track for small fixes that should not open a full milestone.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | patch |
| description | Manage the persistent lightweight Patch track for small fixes that should not open a full milestone. |
📌 输出语言规则: 读取 config.yaml → output.language
Use this skill when the user invokes /hw:patch or /hypo-workflow:patch.
Patch is a persistent side track for small issues, cleanups, and hot observations that do not deserve their own milestone. It is independent of the pipeline state machine and persists across Cycles.
Canonical Patch directory:
.pipeline/patches/When examples say patches/P001-fix-login.md, interpret it as .pipeline/patches/P001-fix-login.md.
Supported forms:
/hw:patch "描述" [--severity critical|normal|minor]/hw:patch list [--open] [--severity critical|normal|minor]/hw:patch close P{NNN}/hw:patch fix P{NNN} [P{NNN} ...]/hw:patch accept P{NNN}/hw:patch reject P{NNN} "feedback"OpenCode command contract:
accept and reject are argument subcommands of /hw-patch: use /hw-patch accept P{NNN} and /hw-patch reject P{NNN} "feedback"./hw-patch-accept or /hw-patch-reject.# P001: 修复登录页 CSS 错位
- 严重级: normal
- 状态: open
- 发现于: C2/M3
- 创建时间: 28日 11:30
- 改动: (待填写)
- 测试: (待填写)
- 关联: (无)
- resolved_by: null
- related: []
- supersedes: []
Use output.language for labels when generating new content, but preserve the existing file's language when editing it.
Patch numbers are global and never reset across Cycles.
.pipeline/patches/ if it does not exist.P[0-9][0-9][0-9]-*.md.P001, P002, and so on.For /hw:patch "描述" [--severity ...]:
normalcritical, normal, minor.pipeline/cycle.yaml exists and status is active, use C{cycle.number}.pipeline/state.yaml has a current milestone or prompt index, append /M{N}discovered_in as (无) or implicit C1 only in display textoutput.timezone..pipeline/patches/P{NNN}-{slug}.md.For /hw:patch list:
.pipeline/patches/P*.md files.Filters:
--open: include only 状态: open--severity critical|normal|minor: include only matching severityIf no patches match, say so directly.
For /hw:patch close P{NNN}:
状态: open with 状态: closed.output.timezone.When a milestone resolves one or more Patches, update resolved_by with C{N}/M{N} and close the Patch only when the milestone actually delivered the fix.
Use /hw:patch fix P001 to repair one Patch immediately, or /hw:patch fix P001 P003 P007 to repair several Patches in sequence. Patch fix is a lightweight execution lane, not a Milestone and not a TDD pipeline run.
Patch fix is lightweight, but it is still production work. Patch fix must preserve real implement, test, and audit worker separation:
test: owns reproduction, failure evidence, test design, and any test/fixture/assertion/snapshot edits before implementation beginsimplement: owns only production/runtime/documentation implementation edits; it must not create, edit, or rewrite tests, fixtures, snapshots, or assertionsaudit: independently reviews the final diff and closure evidence before auto-closeimplement, test, and audittest, implement, and audit Subagents or native workers when the host supports them; never let the implement worker spawn or impersonate the test or audit workeropen or move to pending_acceptance until independent test and audit workers validate ittest, implement, and audit subworkers before editing code/test files; a /hw:patch fix invocation by itself is not enough authorizationtest, implement, and audit worker identities are still required before auto-closerequested, started, completed|failed|blocked, and closed/released state with worker id, role, scope, and evidence path in the Patch file or .pipeline/log.yamlclose_failed; unresolved worker lifecycle means the Patch cannot auto-close.pipeline/log.yamltest, implement, and audit workers before closurestatus: pending_acceptance or keep status: open, and tell the user independent review is requiredpending_acceptance is a fallback after explicit user-approved local implementation or after implementation already exists; it is not permission to skip the pre-edit authorization gate❌ 绝对禁止:
test / audit worker 且缺少授权时,先本地实现再把 Patch 标成 pending_acceptanceimplement worker 创建、修改或重写测试、fixture、snapshot、assertion,或让它再 spawn/委托 test、audit 身份✅ 必须做到:
test、implement 和 audit worker 都通过且生命周期已关闭/记录后才自动关闭 Patch;否则保持 open 或 pending_acceptancetest、implement 和 audit subworker;未授权时先停止,除非用户明确确认降级且 Patch 不自动关闭For each requested Patch, run these steps strictly in order:
.pipeline/patches/P{NNN}-*.md, parse title, description, discovered_in, and severity. If the Patch status is already closed, report an error for that Patch and skip mutation.test, implement, and audit workers are authorized and available. On Codex, Ask the user for explicit test, implement, and audit subworker authorization before editing; if authorization is declined, stop or proceed only with explicit user-confirmed degraded implementation that cannot auto-close the Patch. On Claude Code and OpenCode, use configured subworkers without this extra authorization gate. Do not silently implement first.test worker before implementation. The test worker owns reproduction, failure evidence, test design, and any test/fixture/assertion/snapshot edits. The implement worker must not write tests first and must not later rewrite the test worker's coverage without an explicit new test worker round.implement worker or an explicitly degraded local implementation. If the repair requires touching more than 5 files, stop that Patch and recommend upgrading it to a Milestone or Cycle plan item. Do not perform opportunistic refactors. The implement worker must not spawn subworkers or satisfy validation roles.test validation and audit closure review from distinct worker identities. If tests fail, revert only the changes made for that Patch, keep the Patch open, and continue to the next requested Patch. If tests pass but no independent test or audit worker is available, do not close the Patch automatically.git commit -m "fix(P001): <Patch title>". For batch fixes, do not combine Patch commits.test validation and audit review passed and all required worker tasks completed successfully with lifecycle states closed/released, update the Patch file as closed, refresh .pipeline/PROGRESS.md board tables, and append a lifecycle event to .pipeline/log.yaml. If any worker task is failed or blocked, or if independent validation or lifecycle closure is missing, set pending_acceptance or keep open, record the missing worker separation evidence, and stop before claiming completion.When Step 8 closes the Patch, update or append these fields in the Patch file while preserving existing notes:
- 状态: closed
- 修复时间: 29日 14:30
- 改动: src/scheduler.py:120 — 修正条件判断逻辑
- 测试: ✅ 回归通过(39/39)
- worker_separation: implement=<worker-id>, test=<worker-id>, audit=<worker-id>
- worker_lifecycle: test=requested/started/completed/closed, implement=requested/started/completed/closed, audit=requested/started/completed/closed
- commit: `a1b2c3d`
Use output.language and output.timezone for generated prose and time formatting. Preserve the existing Patch language if it is already clear.
Update .pipeline/PROGRESS.md as a board-style summary:
Patch 轨道时间线.pipeline/log.yamlExample timeline row:
| 14:30 | Patch | P001 closed | 修复登录页 CSS 错位 |
Do not append standalone one-line progress entries to the bottom of PROGRESS.md.
Append a .pipeline/log.yaml lifecycle event with:
type: patch_fixpatch: P001status: closedcommit: <hash>worker_separation: implement=<worker-id>, test=<worker-id>, audit=<worker-id>worker_lifecycle: test=<status>, implement=<status>, audit=<status>summary: <one-line change summary>tests: <test command and result>Patch fix must never write .pipeline/state.yaml and must never generate report.md.
For /hw:patch fix P001 P003:
3/4 修复成功,P003 失败(测试未通过).discovered_in: Cycle and milestone where the Patch was foundresolved_by: Cycle and milestone or Patch that resolved itrelated: related Patch IDssupersedes: older Patch IDs replaced by this Patchiteration: current repair attempt numberacceptance_requested_at: when manual Patch acceptance was requestedaccepted_at: when the Patch was accepted and closedrejection_refs: structured feedback files under .pipeline/patches/feedback/Patch acceptance is Patch-track state only. It must never write .pipeline/state.yaml.
Patch metadata may use these statuses:
openpending_acceptanceclosedrejectedWhen manual acceptance mode is active, Patch fix Step 6 ends by setting:
- status: pending_acceptance
- iteration: 1
- acceptance_requested_at: 2026-05-03T01:20:00+08:00
/hw:patch accept P001:
OpenCode form: /hw-patch accept P001.
.pipeline/patches/P001-*.md.status: pending_acceptance.status: closed.accepted_at.patch_accept to .pipeline/log.yaml..pipeline/PROGRESS.md./hw:patch reject P001 "feedback":
OpenCode form: /hw-patch reject P001 "feedback".
.pipeline/patches/P001-*.md.status: pending_acceptance..pipeline/patches/feedback/P001-rejection-<timestamp>.yaml.status: open.iteration.rejection_refs.patch_reject to .pipeline/log.yaml..pipeline/PROGRESS.md.acceptance.reject_escalation_threshold or higher, recommend escalation to a Cycle.The feedback file must include problem, reproduce_steps, expected, actual, context, iteration, and created_at. A compatibility feedback field may be present for older readers.
The next /hw:patch fix P001 must read rejection_refs and inject the structured rejection context before editing.
Patches are not archived when a Cycle closes. They stay in .pipeline/patches/ and can be injected into future planning with /hw:plan --context patches or cycle.context_sources: [patches].
skills/cycle/SKILL.md — active Cycle detectionskills/plan-discover/SKILL.md — Patch context injectionreferences/config-spec.md — output language and timezone defaultsSKILL.md — root command routing