@fitlab-ai/agent-infra 0.7.4 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/bin/cli.ts +13 -11
  2. package/dist/bin/cli.js +13 -11
  3. package/dist/lib/init.js +1 -1
  4. package/dist/lib/merge.js +1 -1
  5. package/dist/lib/sandbox/commands/create.js +26 -4
  6. package/dist/lib/sandbox/index.js +21 -21
  7. package/dist/lib/sandbox/tools.js +20 -1
  8. package/dist/lib/task/commands/log.js +56 -6
  9. package/dist/lib/task/index.js +13 -13
  10. package/dist/lib/update.js +1 -1
  11. package/lib/init.ts +1 -1
  12. package/lib/merge.ts +1 -1
  13. package/lib/sandbox/commands/create.ts +33 -4
  14. package/lib/sandbox/index.ts +21 -21
  15. package/lib/sandbox/tools.ts +28 -1
  16. package/lib/task/commands/log.ts +59 -6
  17. package/lib/task/index.ts +13 -13
  18. package/lib/update.ts +1 -1
  19. package/package.json +1 -1
  20. package/templates/.agents/rules/README.en.md +7 -3
  21. package/templates/.agents/rules/README.zh-CN.md +7 -3
  22. package/templates/.agents/rules/cli-help-format.en.md +49 -0
  23. package/templates/.agents/rules/cli-help-format.zh-CN.md +49 -0
  24. package/templates/.agents/rules/no-mid-flow-questions.en.md +25 -2
  25. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +25 -2
  26. package/templates/.agents/rules/pr-sync.github.en.md +8 -6
  27. package/templates/.agents/rules/pr-sync.github.zh-CN.md +8 -6
  28. package/templates/.agents/rules/review-handshake.en.md +97 -0
  29. package/templates/.agents/rules/review-handshake.zh-CN.md +97 -0
  30. package/templates/.agents/rules/task-management.en.md +25 -0
  31. package/templates/.agents/rules/task-management.zh-CN.md +29 -0
  32. package/templates/.agents/scripts/lib/post-review-commit.js +56 -0
  33. package/templates/.agents/scripts/lib/review-artifacts.js +117 -0
  34. package/templates/.agents/scripts/review-diff-fingerprint.js +99 -0
  35. package/templates/.agents/scripts/validate-artifact.js +251 -2
  36. package/templates/.agents/skills/analyze-task/SKILL.en.md +63 -6
  37. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +63 -6
  38. package/templates/.agents/skills/block-task/SKILL.en.md +10 -0
  39. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +10 -0
  40. package/templates/.agents/skills/cancel-task/SKILL.en.md +10 -0
  41. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +11 -1
  42. package/templates/.agents/skills/close-codescan/SKILL.en.md +10 -0
  43. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +10 -0
  44. package/templates/.agents/skills/close-dependabot/SKILL.en.md +10 -0
  45. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +10 -0
  46. package/templates/.agents/skills/code-task/SKILL.en.md +11 -0
  47. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +11 -0
  48. package/templates/.agents/skills/code-task/config/verify.en.json +3 -0
  49. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +3 -0
  50. package/templates/.agents/skills/code-task/reference/fix-mode.en.md +5 -3
  51. package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +5 -3
  52. package/templates/.agents/skills/code-task/reference/report-template.en.md +4 -4
  53. package/templates/.agents/skills/code-task/reference/report-template.zh-CN.md +4 -4
  54. package/templates/.agents/skills/code-task/scripts/detect-mode.js +2 -107
  55. package/templates/.agents/skills/commit/SKILL.en.md +16 -0
  56. package/templates/.agents/skills/commit/SKILL.zh-CN.md +16 -0
  57. package/templates/.agents/skills/commit/reference/task-status-update.en.md +8 -0
  58. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +8 -0
  59. package/templates/.agents/skills/complete-task/SKILL.en.md +20 -0
  60. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +20 -0
  61. package/templates/.agents/skills/complete-task/config/verify.en.json +2 -0
  62. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +2 -0
  63. package/templates/.agents/skills/create-pr/SKILL.en.md +20 -1
  64. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +20 -1
  65. package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +1 -1
  66. package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +1 -1
  67. package/templates/.agents/skills/create-release-note/SKILL.en.md +16 -1
  68. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +16 -1
  69. package/templates/.agents/skills/create-task/SKILL.en.md +11 -0
  70. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +14 -3
  71. package/templates/.agents/skills/import-codescan/SKILL.en.md +11 -0
  72. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +11 -0
  73. package/templates/.agents/skills/import-dependabot/SKILL.en.md +11 -0
  74. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +11 -0
  75. package/templates/.agents/skills/import-issue/SKILL.en.md +16 -0
  76. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +16 -0
  77. package/templates/.agents/skills/plan-task/SKILL.en.md +13 -1
  78. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +13 -1
  79. package/templates/.agents/skills/plan-task/config/verify.en.json +3 -0
  80. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +3 -0
  81. package/templates/.agents/skills/restore-task/SKILL.en.md +10 -0
  82. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +10 -0
  83. package/templates/.agents/skills/review-analysis/SKILL.en.md +10 -0
  84. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +10 -0
  85. package/templates/.agents/skills/review-analysis/config/verify.en.json +2 -1
  86. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +2 -1
  87. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +5 -4
  88. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +5 -4
  89. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +4 -0
  90. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +4 -0
  91. package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +1 -0
  92. package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +1 -0
  93. package/templates/.agents/skills/review-code/SKILL.en.md +14 -1
  94. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +14 -1
  95. package/templates/.agents/skills/review-code/config/verify.en.json +5 -2
  96. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +5 -2
  97. package/templates/.agents/skills/review-code/reference/output-templates.en.md +5 -4
  98. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +5 -4
  99. package/templates/.agents/skills/review-code/reference/report-template.en.md +6 -0
  100. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +6 -0
  101. package/templates/.agents/skills/review-code/reference/review-criteria.en.md +1 -0
  102. package/templates/.agents/skills/review-code/reference/review-criteria.zh-CN.md +1 -0
  103. package/templates/.agents/skills/review-plan/SKILL.en.md +10 -0
  104. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +10 -0
  105. package/templates/.agents/skills/review-plan/config/verify.en.json +2 -1
  106. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +2 -1
  107. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +5 -4
  108. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +5 -4
  109. package/templates/.agents/skills/review-plan/reference/report-template.en.md +4 -0
  110. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +4 -0
  111. package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +1 -0
  112. package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +1 -0
  113. package/templates/.agents/skills/watch-pr/SKILL.en.md +10 -0
  114. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +10 -0
  115. package/templates/.agents/templates/task.en.md +12 -0
  116. package/templates/.agents/templates/task.zh-CN.md +12 -0
  117. package/templates/.github/workflows/metadata-sync.yml +1 -1
  118. package/templates/.github/workflows/pr-label.yml +1 -1
  119. package/templates/.github/workflows/status-label.yml +1 -1
@@ -11,6 +11,16 @@ Dismiss the specified Dependabot security alert and record a justified reason.
11
11
 
12
12
  > If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
13
13
 
14
+ ## Step Start: Write the started Marker
15
+
16
+ After prerequisites pass and before this step's first artifact action, append a started marker to task.md `## Activity Log` (same base action as this step's done entry plus a ` [started]` suffix, note `started`):
17
+
18
+ ```
19
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Close Dependabot [started]** by {agent} — started
20
+ ```
21
+
22
+ `ai task log` pairs it with the done entry written on completion onto one row (in progress → done). See the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
23
+
14
24
  ## Execution Flow
15
25
 
16
26
  ### 1. Retrieve Alert Information
@@ -11,6 +11,16 @@ description: "关闭 Dependabot 安全告警并记录理由"
11
11
 
12
12
  > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
13
13
 
14
+ ## 步骤开始:写入 started 标记
15
+
16
+ 确认前置条件后、本步骤第一个产出动作之前,向 task.md `## 活动日志` 追加一条 started 标记(与本步骤 done 条目同基名 + ` [started]` 后缀,note 用 `started`):
17
+
18
+ ```
19
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Close Dependabot [started]** by {agent} — started
20
+ ```
21
+
22
+ `ai task log` 会把它与完成时写入的 done 条目配对成一行(进行中 → 已完成)。约定见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
23
+
14
24
  ## 执行流程
15
25
 
16
26
  ### 1. 获取告警信息
@@ -11,6 +11,7 @@ Implement the approved plan and produce `code.md` or `code-r{N}.md`. This skill
11
11
 
12
12
  - Follow the latest plan artifact: `plan.md` or `plan-r{N}.md`
13
13
  - Fix mode verifies each finding of the latest `review-code` one by one: fix it if it holds, or rebut it and record it under unresolved if it is unfounded/hallucinated; do not expand to issues the review did not list; env-blocked items are out of scope
14
+ - If implementation encounters a key design decision not covered by the plan, record `[needs-human-decision]` / `HD-` rows according to `.agents/rules/no-mid-flow-questions.md` instead of asking mid-flow or expanding scope silently
14
15
  - Never auto-run `git add` or `git commit`
15
16
  - Create a new code artifact for each round and never overwrite an older one
16
17
  - After executing this skill, you **must** immediately update task.md
@@ -33,6 +34,16 @@ tail .agents/workspace/active/{task-id}/task.md
33
34
 
34
35
  > If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
35
36
 
37
+ ## Step Start: Write the started Marker
38
+
39
+ After prerequisites (step 1) and mode/round (step 4) are confirmed and before this round's first artifact action, append a started marker to task.md `## Activity Log` (same base action as this round's done entry plus a ` [started]` suffix, note `started`):
40
+
41
+ ```
42
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Code Task (Round {N}) [started]** by {agent} — started
43
+ ```
44
+
45
+ In fix mode the base must match this round's done entry, i.e. `Code Task (Round {N}, fix for {review-artifact}) [started]`. `ai task log` pairs it with the done entry written on completion (step 10) onto one row (in progress → done). Format and pairing rules: see the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
46
+
36
47
  ## Steps
37
48
 
38
49
  ### 1. Verify Prerequisites
@@ -11,6 +11,7 @@ description: "根据技术方案编码任务并输出报告"
11
11
 
12
12
  - 严格遵循最新方案产物:`plan.md` 或 `plan-r{N}.md`
13
13
  - 修复模式逐条核实最新 `review-code` 的发现:成立则修复,判定为不成立/幻觉则在报告中反驳并记入 unresolved;不擅自扩大到审查未列出的问题;env-blocked 项不在修复范围
14
+ - 实现中遇到方案未覆盖的关键设计决策时,按 `.agents/rules/no-mid-flow-questions.md` 判据记录 `[needs-human-decision]` / `HD-` 行,不中途提问或擅自扩范围
14
15
  - 绝不自动执行 `git add` 或 `git commit`
15
16
  - 每轮实现都创建新的实现产物,不覆盖旧文件
16
17
  - 执行本技能后,你**必须**立即更新 task.md
@@ -47,6 +48,16 @@ tail .agents/workspace/active/{task-id}/task.md
47
48
 
48
49
  > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
49
50
 
51
+ ## 步骤开始:写入 started 标记
52
+
53
+ 确认前置条件(步骤 1)与模式/轮次(步骤 4)后、本轮第一个产出动作之前,向 task.md `## 活动日志` 追加一条 started 标记(与本轮 done 条目同基名 + ` [started]` 后缀,note 用 `started`):
54
+
55
+ ```
56
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Code Task (Round {N}) [started]** by {agent} — started
57
+ ```
58
+
59
+ 修复模式的基名须与本轮 done 一致,即 `Code Task (Round {N}, fix for {review-artifact}) [started]`。`ai task log` 会把它与步骤完成时(步骤 10)写入的 done 条目配对成一行(进行中 → 已完成)。格式与配对规则见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
60
+
50
61
  ## 执行步骤
51
62
  ### 1. 验证前置条件
52
63
 
@@ -35,6 +35,9 @@
35
35
  "expected_action_pattern": "(Code Task|Code) \\(Round \\d+(?:, fix for review-code(?:-r\\d+)?\\.md)?\\)",
36
36
  "freshness_minutes": 30
37
37
  },
38
+ "review-ledger": {
39
+ "stage_scope": ["analysis", "plan"]
40
+ },
38
41
  "platform-sync": {
39
42
  "when": "issue_number_exists",
40
43
  "expected_status_label": "status: in-progress",
@@ -35,6 +35,9 @@
35
35
  "expected_action_pattern": "(Code Task|Code) \\(Round \\d+(?:, fix for review-code(?:-r\\d+)?\\.md)?\\)",
36
36
  "freshness_minutes": 30
37
37
  },
38
+ "review-ledger": {
39
+ "stage_scope": ["analysis", "plan"]
40
+ },
38
41
  "platform-sync": {
39
42
  "when": "issue_number_exists",
40
43
  "expected_status_label": "status: in-progress",
@@ -4,9 +4,11 @@ Read this file before changing code during fix mode.
4
4
 
5
5
  ## Plan the Fixes
6
6
 
7
- **Verify each finding first (mandatory before editing)**: for every finding in `{review-artifact}`, Read/Grep the cited `file:line` and the corresponding `git diff` to confirm the issue is real:
8
- - Holds → include it in the classification and fixes below
9
- - Unfounded / based on a wrong `file:line` / hallucinated do not change code; give a counter-argument in the report's `## Per-Finding Verification` section and record it under unresolved issues
7
+ **Verify each finding first (mandatory before editing)**: for every finding in `{review-artifact}`, Read/Grep the cited `file:line` and the corresponding `git diff` to confirm the issue is real, then dispose of it with one of the four states in `.agents/rules/review-handshake.md`, and write the disposition + commensurate evidence back to the matching row in the task.md disagreement ledger (stage=code, round +1; symmetric evidence — every state needs evidence, "accept" is not a zero-cost default):
8
+ - `accepted` → include it in the classification and fixes below; evidence cites the fix `file:line`
9
+ - `adjusted` use an alternative fix, with rationale; awaits review-code confirmation
10
+ - `refuted` → verification judged it unfounded / a wrong `file:line` / hallucinated → do not change code; give a counter-argument in the report's `## Per-Finding Verification` section; awaits review-code confirmation
11
+ - `cannot-judge` → insufficient evidence to decide; hand to reviewer/human
10
12
  - Do not expand fixes to issues the review did not list
11
13
 
12
14
  Classify and prioritize work:
@@ -4,9 +4,11 @@
4
4
 
5
5
  ## 规划修复
6
6
 
7
- **先逐条核实(动手前必做)**:对 `{review-artifact}` 的每一条发现,先 Read/Grep 其引用的 `file:line` 与对应 `git diff`,确认问题真实存在:
8
- - 成立纳入下方分类与修复
9
- - 不成立 / 基于错误 `file:line` / 幻觉 不改代码,在报告 `## 对审查发现的逐条核实` 给出反证,并记入 unresolved issues
7
+ **先逐条核实(动手前必做)**:对 `{review-artifact}` 的每一条发现,先 Read/Grep 其引用的 `file:line` 与对应 `git diff`,确认问题真实存在,再按 `.agents/rules/review-handshake.md` 的四态处置,并把处置 + 相称证据回写 task.md `## 审查分歧账本` 对应行(stage=code,round +1;对称证据:每态都要附证据,"接受"不是零成本默认):
8
+ - `accepted`纳入下方分类与修复,证据指向修复点 `file:line`
9
+ - `adjusted` → 采用替代修法,附理由,待 review-code 复核确认
10
+ - `refuted` → 核实判定不成立 / 基于错误 `file:line` / 幻觉 → 不改代码,在报告 `## 对审查发现的逐条核实` 给出反证,待 review-code 复核确认
11
+ - `cannot-judge` → 证据不足无法判断,交检视方/人工
10
12
  - 不擅自把修复扩大到审查未列出的问题
11
13
 
12
14
  按以下顺序分类并确定优先级:
@@ -64,11 +64,11 @@ $ {command}
64
64
 
65
65
  ## Per-Finding Verification
66
66
 
67
- > Fix mode only; for an initial implementation write "(initial implementation this round, no review findings)". Read/Grep-verify each finding of the previous `review-code` before acting on it.
67
+ > Fix mode only; for an initial implementation write "(initial implementation this round, no review findings)". Read/Grep-verify each finding of the previous `review-code`, then dispose of it with one of the four states in `.agents/rules/review-handshake.md`; write the disposition and **commensurate evidence** back to the matching row in the task.md disagreement ledger (stage=code, round +1). Symmetric evidence: accepted/adjusted cite the fix `file:line`; refuted/cannot-judge cite counter-evidence `file:line` or raw command output.
68
68
 
69
- | Finding | Reproduced? | Disposition (fix / rebut) |
70
- |------|----------|----------------------|
71
- | {finding} | {yes/no, with file:line or command} | {fix note, or counter-argument + recorded under unresolved} |
69
+ | Finding | Disposition | Commensurate evidence |
70
+ |------|----------|----------|
71
+ | {finding} | {accepted / adjusted / refuted / cannot-judge} | {fix file:line, or counter-evidence file:line / raw command output} |
72
72
 
73
73
  ## Items for Review
74
74
 
@@ -64,11 +64,11 @@ $ {command}
64
64
 
65
65
  ## 对审查发现的逐条核实
66
66
 
67
- > 仅修复模式填写;初次实现写「(本轮为初次实现,无审查发现)」。对上一轮 `review-code` 的每条发现先 Read/Grep 核实再处置。
67
+ > 仅修复模式填写;初次实现写「(本轮为初次实现,无审查发现)」。对上一轮 `review-code` 的每条发现先 Read/Grep 核实,再按 `.agents/rules/review-handshake.md` 的四态处置;并把处置与**相称证据**回写 task.md `## 审查分歧账本` 对应行(stage=code,round +1)。对称证据:accepted/adjusted 附修复点 file:line,refuted/cannot-judge 附反证 file:line 或命令原文。
68
68
 
69
- | 发现 | 是否复现 | 处置(修复 / 反驳) |
70
- |------|----------|----------------------|
71
- | {finding} | {是/否,附 file:line 或命令} | {修复说明,或反证 + 记入 unresolved} |
69
+ | 发现 | 处置状态 | 相称证据 |
70
+ |------|----------|----------|
71
+ | {finding} | {accepted / adjusted / refuted / cannot-judge} | {修复点 file:line,或反证 file:line / 命令原文} |
72
72
 
73
73
  ## 供审查关注的内容
74
74
 
@@ -2,6 +2,8 @@ import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import process from "node:process";
4
4
 
5
+ import { artifactName, maxRound, parseVerdict } from "../../../scripts/lib/review-artifacts.js";
6
+
5
7
  function main() {
6
8
  const taskDir = process.argv[2];
7
9
  if (!taskDir) {
@@ -170,26 +172,6 @@ function main() {
170
172
  }
171
173
  }
172
174
 
173
- function maxRound(entries, stem) {
174
- let max = 0;
175
- for (const entry of entries) {
176
- if (entry === `${stem}.md`) {
177
- max = Math.max(max, 1);
178
- continue;
179
- }
180
-
181
- const match = entry.match(new RegExp(`^${escapeRegExp(stem)}-r(\\d+)\\.md$`));
182
- if (match) {
183
- max = Math.max(max, Number(match[1]));
184
- }
185
- }
186
- return max;
187
- }
188
-
189
- function artifactName(stem, round) {
190
- return round === 1 ? `${stem}.md` : `${stem}-r${round}.md`;
191
- }
192
-
193
175
  function checkPlanAheadOfCode({ resolvedTaskDir, codeMax, planMax, reviewPlanMax }) {
194
176
  if (planMax === 0 || reviewPlanMax === 0) {
195
177
  return { replan: false };
@@ -275,96 +257,9 @@ function safeStat(filePath) {
275
257
  }
276
258
  }
277
259
 
278
- function parseVerdict(reviewPath) {
279
- if (!fs.existsSync(reviewPath)) {
280
- return { ok: false, verdict: null, message: `Review artifact not found: ${path.basename(reviewPath)}` };
281
- }
282
-
283
- const content = fs.readFileSync(reviewPath, "utf8");
284
- const summary = extractSection(content, ["审查摘要", "Review Summary"]);
285
- const fileName = path.basename(reviewPath);
286
- if (!summary) {
287
- return { ok: false, verdict: null, message: `cannot locate review summary section in ${fileName}` };
288
- }
289
-
290
- const verdictMatch = summary.match(/^[-*]?\s*\*\*(?:总体结论|Overall Verdict)\*\*[::]\s*(.+?)\s*$/im);
291
- if (!verdictMatch) {
292
- return { ok: false, verdict: null, message: `cannot parse verdict in ${fileName}` };
293
- }
294
-
295
- const verdict = normalizeVerdict(verdictMatch[1]);
296
- if (!verdict) {
297
- return {
298
- ok: false,
299
- verdict: null,
300
- message: `unrecognized verdict '${verdictMatch[1].trim()}' in ${fileName}`
301
- };
302
- }
303
-
304
- if (verdict !== "Approved") {
305
- return { ok: true, verdict };
306
- }
307
-
308
- const findingsMatch = summary.match(/^[-*]?\s*\*\*(?:发现(AI 可处理)|Findings \(AI-actionable\))\*\*[::]\s*(.+?)\s*$/im);
309
- if (!findingsMatch) {
310
- return { ok: false, verdict, message: `cannot parse findings count in ${fileName}` };
311
- }
312
-
313
- const counts = findingsMatch[1].match(/(\d+)\s*(?:阻塞项|blockers?).*?(\d+)\s*(?:主要|majors?).*?(\d+)\s*(?:次要|minors?)/i);
314
- if (!counts) {
315
- return { ok: false, verdict, message: `cannot parse findings count in ${fileName}` };
316
- }
317
-
318
- const [, blockers, majors, minors] = counts.map(Number);
319
- return {
320
- ok: true,
321
- verdict: blockers === 0 && majors === 0 && minors === 0 ? "Approved" : "Approved-with-issues"
322
- };
323
- }
324
-
325
- function normalizeVerdict(raw) {
326
- const value = String(raw).trim().toLowerCase();
327
- if (value === "通过" || value === "approved") {
328
- return "Approved";
329
- }
330
- if (value === "需要修改" || value === "changes requested") {
331
- return "Changes Requested";
332
- }
333
- if (value === "拒绝" || value === "rejected") {
334
- return "Rejected";
335
- }
336
- return "";
337
- }
338
-
339
- function extractSection(content, names) {
340
- const lines = content.split(/\r?\n/);
341
- const nameSet = new Set(names);
342
- const start = lines.findIndex((line) => {
343
- const match = line.trim().match(/^##\s+(.+?)\s*$/);
344
- return match ? nameSet.has(match[1]) : false;
345
- });
346
-
347
- if (start === -1) {
348
- return "";
349
- }
350
-
351
- const sectionLines = [];
352
- for (let index = start + 1; index < lines.length; index += 1) {
353
- if (/^##\s+/.test(lines[index])) {
354
- break;
355
- }
356
- sectionLines.push(lines[index]);
357
- }
358
- return sectionLines.join("\n");
359
- }
360
-
361
260
  function writeResult(result, code) {
362
261
  process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
363
262
  process.exitCode = code;
364
263
  }
365
264
 
366
- function escapeRegExp(value) {
367
- return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
368
- }
369
-
370
265
  main();
@@ -21,6 +21,16 @@ When updating related `task.md` frontmatter, read `.agents/rules/version-stamp.m
21
21
 
22
22
  > If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
23
23
 
24
+ ## Step Start: Write the started Marker
25
+
26
+ Before checking local modifications, append a started marker to task.md `## Activity Log` (same base action as this step's done entry plus a ` [started]` suffix, note `started`):
27
+
28
+ ```
29
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Commit [started]** by {agent} — started
30
+ ```
31
+
32
+ `ai task log` pairs it with the done entry written when the commit completes onto one row (in progress → done). Format and pairing rules: see the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`. Only write it when this task has a task.md (a bare commit with no task context may skip it).
33
+
24
34
  ## 1. Check Local Modifications (CRITICAL)
25
35
 
26
36
  Before any edit, inspect:
@@ -48,6 +58,12 @@ Review status, diff, and recent history, then prepare a Conventional Commit with
48
58
 
49
59
  Stage specific files only and run `git commit` with the prepared message.
50
60
 
61
+ If this commit is associated with a task and a `review-code` artifact exists, read the highest-round `review-code` artifact before committing:
62
+ - If that artifact's `Overall Verdict` / `总体结论` is Approved, parse `Review Baseline Commit` / `审查基线提交` as `R`, and `Reviewed Diff Fingerprint` / `审查差异指纹` as `F`
63
+ - After staging the explicit files, run `node .agents/scripts/review-diff-fingerprint.js staged <R>` to get `S`, and record `pre_head=$(git rev-parse HEAD)`
64
+ - After committing, write `last_reviewed_commit: <new_head>` to task.md frontmatter only when `pre_head == R` and `S == F`; otherwise do not advance that field
65
+ - Do not scan backward to earlier Approved artifacts; the highest-round `review-code` artifact is the only authoritative source
66
+
51
67
  ## 5. Update Task Status When Applicable
52
68
 
53
69
  Get the current time:
@@ -21,6 +21,16 @@ description: "提交当前变更到 Git"
21
21
 
22
22
  > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
23
23
 
24
+ ## 步骤开始:写入 started 标记
25
+
26
+ 开始检查本地修改之前,向 task.md `## 活动日志` 追加一条 started 标记(与本步骤 done 条目同基名 + ` [started]` 后缀,note 用 `started`):
27
+
28
+ ```
29
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Commit [started]** by {agent} — started
30
+ ```
31
+
32
+ `ai task log` 会把它与提交完成时写入的 done 条目配对成一行(进行中 → 已完成)。格式与配对规则见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。仅当本任务存在 task.md 时写入(无任务上下文的纯提交可跳过)。
33
+
24
34
  ## 1. 检查本地修改(关键)
25
35
 
26
36
  在任何编辑前先检查:
@@ -48,6 +58,12 @@ git diff
48
58
 
49
59
  只暂存明确列出的文件,然后执行 `git commit`。
50
60
 
61
+ 如果本次提交关联任务且存在 `review-code` 产物,在提交前读取最高轮 `review-code` 产物:
62
+ - 若该产物 `总体结论` / `Overall Verdict` 为 Approved,解析 `审查基线提交` / `Review Baseline Commit` 为 `R`,解析 `审查差异指纹` / `Reviewed Diff Fingerprint` 为 `F`
63
+ - 暂存明确文件后运行 `node .agents/scripts/review-diff-fingerprint.js staged <R>` 得到 `S`,并记录 `pre_head=$(git rev-parse HEAD)`
64
+ - 提交后仅当 `pre_head == R` 且 `S == F` 时,在 task.md frontmatter 写入 `last_reviewed_commit: <new_head>`;否则不推进该字段
65
+ - 不向后扫描更早的 Approved 产物;最高轮 `review-code` 产物是唯一权威来源
66
+
51
67
  ## 5. 按需更新任务状态
52
68
 
53
69
  获取当前时间:
@@ -18,6 +18,14 @@ For every task-related commit, append this Activity Log entry in `task.md`:
18
18
  - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Commit** by {agent} — {commit hash short} {commit subject}
19
19
  ```
20
20
 
21
+ If the commit stage confirmed that the highest-round `review-code` artifact is Approved, `pre_head` equals its review baseline commit `R`, and the staged diff fingerprint `S` equals its reviewed diff fingerprint `F`, also write or refresh:
22
+
23
+ ```yaml
24
+ last_reviewed_commit: {new_head}
25
+ ```
26
+
27
+ This field is the preferred baseline for the `complete-task` `post-review-commit` gate. When any condition is not met, do not write or advance it.
28
+
21
29
  Before selecting the next step, verify:
22
30
  - `current_step` and the latest workflow progress in `task.md`
23
31
  - whether the latest `review-code.md` / `review-code-r{N}.md` passed without findings
@@ -18,6 +18,14 @@ date "+%Y-%m-%d %H:%M:%S%:z"
18
18
  - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Commit** by {agent} — {commit hash short} {commit subject}
19
19
  ```
20
20
 
21
+ 如果提交阶段已确认最高轮 `review-code` 产物 Approved、`pre_head` 等于其审查基线提交 `R`、且 staged 差异指纹 `S` 等于其审查差异指纹 `F`,同时写入或刷新:
22
+
23
+ ```yaml
24
+ last_reviewed_commit: {new_head}
25
+ ```
26
+
27
+ 该字段是 `complete-task` 的 `post-review-commit` gate 优先 baseline。条件不满足时不要写入或推进该字段。
28
+
21
29
  在决定下一步之前,先确认:
22
30
  - `task.md` 中的 `current_step` 和最新工作流进度
23
31
  - 最新的 `review-code.md` / `review-code-r{N}.md` 是否无问题通过
@@ -30,6 +30,16 @@ Before the state check is complete, do not make external-state assertions such a
30
30
 
31
31
  > If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
32
32
 
33
+ ## Step Start: Write the started Marker
34
+
35
+ After confirming the task exists and before this round's first artifact action, append a started marker to task.md `## Activity Log` (same base action as this round's done entry plus a ` [started]` suffix, note `started`):
36
+
37
+ ```
38
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Complete Task [started]** by {agent} — started
39
+ ```
40
+
41
+ `ai task log` pairs it with the done entry written on completion onto one row (in progress → done). Format and pairing rules: see the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
42
+
33
43
  ## Steps
34
44
 
35
45
  ### 1. Verify Task Exists
@@ -77,6 +87,16 @@ Before marking complete, verify ALL of these:
77
87
  - [ ] Code has been reviewed (`review-code.md` or `review-code-r{N}.md` exists, and the latest review verdict is Approved; or review was done externally)
78
88
  - [ ] Code has been committed (no uncommitted changes related to this task)
79
89
  - [ ] Tests are passing
90
+ - [ ] The disagreement ledger has no unclosed disagreements and there are no un-re-reviewed post-review commits (mechanically checked by the "Pre-completion hard gate" below)
91
+
92
+ **Pre-completion hard gate (run BEFORE moving the directory or releasing the short id)**: the Step 7 `gate complete-task` runs only after the directory has been `mv`-ed to `completed/` and the short id released; to avoid a gate failure occurring after those irreversible operations, run the two new completion gates on the **active directory** first:
93
+
94
+ ```bash
95
+ node .agents/scripts/validate-artifact.js check review-ledger .agents/workspace/active/{task-id} --skill complete-task --format text
96
+ node .agents/scripts/validate-artifact.js check post-review-commit .agents/workspace/active/{task-id} --skill complete-task --format text
97
+ ```
98
+
99
+ A non-zero exit from either (fail/blocked) -> treat as an unmet prerequisite and **stop**, do not run Steps 3-7. `--force` does **NOT** lift this hard gate: unclosed disagreements must first be closed in the ledger (`confirmed`/`closed`/`human-decided`), and un-re-reviewed post-review commits must be re-reviewed via `review-code` or covered by a `post-review-commit` / `human-decided` exemption row in the ledger.
80
100
 
81
101
  > **⚠️ Prerequisite Branch Check — you must decide whether to continue or stop before proceeding:**
82
102
  >
@@ -30,6 +30,16 @@ tail .agents/workspace/active/{task-id}/task.md
30
30
 
31
31
  > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
32
32
 
33
+ ## 步骤开始:写入 started 标记
34
+
35
+ 确认任务存在后、本轮第一个产出动作之前,向 task.md `## 活动日志` 追加一条 started 标记(与本轮 done 条目同基名 + ` [started]` 后缀,note 用 `started`):
36
+
37
+ ```
38
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Complete Task [started]** by {agent} — started
39
+ ```
40
+
41
+ `ai task log` 会把它与完成时写入的 done 条目配对成一行(进行中 → 已完成)。格式与配对规则见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
42
+
33
43
  ## 执行步骤
34
44
  ### 1. 验证任务存在
35
45
 
@@ -76,6 +86,16 @@ tail .agents/workspace/active/{task-id}/task.md
76
86
  - [ ] 代码已审查(`review-code.md` 或 `review-code-r{N}.md` 存在,且最新审查结论为 Approved;或已在外部完成审查)
77
87
  - [ ] 代码已提交(没有与此任务相关的未提交变更)
78
88
  - [ ] 测试通过
89
+ - [ ] 审查分歧账本无未关闭分歧,且无未复审的 post-review 提交(由下方「预完成硬门禁」机械校验)
90
+
91
+ **预完成硬门禁(在移动目录、释放短号之前运行)**:步骤 7 的 `gate complete-task` 在目录已 `mv` 到 `completed/`、短号已释放之后才运行;为避免门禁失败发生在不可逆操作之后,必须在 **active 目录**上预先运行新增的两项完成门禁:
92
+
93
+ ```bash
94
+ node .agents/scripts/validate-artifact.js check review-ledger .agents/workspace/active/{task-id} --skill complete-task --format text
95
+ node .agents/scripts/validate-artifact.js check post-review-commit .agents/workspace/active/{task-id} --skill complete-task --format text
96
+ ```
97
+
98
+ 任一退出码非 0(fail/blocked)→ 按前置条件未满足处理,**停止**,不执行步骤 3-7。`--force` **不解除**本硬门禁:未关闭分歧必须先在账本闭合(`confirmed`/`closed`/`human-decided`),未复审 post-review 提交必须重新 `review-code` 或在账本追加 `post-review-commit` / `human-decided` 豁免行。
79
99
 
80
100
  > **⚠️ 前置条件分支判断 — 你必须先判断“继续”还是“停止”:**
81
101
  >
@@ -24,6 +24,8 @@
24
24
  "completion-checklist": {
25
25
  "require_all_checked": true
26
26
  },
27
+ "review-ledger": {},
28
+ "post-review-commit": {},
27
29
  "platform-sync": {
28
30
  "when": "issue_number_exists",
29
31
  "expected_comment_marker": "<!-- sync-issue:{task-id}:summary -->",
@@ -24,6 +24,8 @@
24
24
  "completion-checklist": {
25
25
  "require_all_checked": true
26
26
  },
27
+ "review-ledger": {},
28
+ "post-review-commit": {},
27
29
  "platform-sync": {
28
30
  "when": "issue_number_exists",
29
31
  "expected_comment_marker": "<!-- sync-issue:{task-id}:summary -->",
@@ -15,6 +15,16 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
15
15
 
16
16
  > If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
17
17
 
18
+ ## Step Start: Write the started Marker
19
+
20
+ After the pre-flight gate and prerequisites pass and before this step's first artifact action, append a started marker to task.md `## Activity Log` (same base action as this step's done entry plus a ` [started]` suffix, note `started`). Only write it when an associated `{task-id}` / task.md exists:
21
+
22
+ ```
23
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Create PR [started]** by {agent} — started
24
+ ```
25
+
26
+ `ai task log` pairs it with the done entry written on completion onto one row (in progress → done). See the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
27
+
18
28
  ## Execution Flow
19
29
 
20
30
  ### Pre-gate: Project-level PR Flow Check
@@ -128,7 +138,16 @@ Next step - Watch PR checks (auto self-heal until required checks are green):
128
138
  - Codex CLI: $watch-pr {task-ref}
129
139
  ```
130
140
 
131
- Once green, `watch-pr` then guides toward `complete-task {task-ref}`.
141
+ Alternatively, to skip CI monitoring and archive the task right away, use `complete-task` instead:
142
+
143
+ ```
144
+ Next step (alternative) - Skip monitoring and archive the task directly:
145
+ - Claude Code / OpenCode: /complete-task {task-ref}
146
+ - Gemini CLI: /agent-infra:complete-task {task-ref}
147
+ - Codex CLI: $complete-task {task-ref}
148
+ ```
149
+
150
+ `watch-pr` is the primary path; once checks are green it guides you toward `complete-task {task-ref}`. Run the `complete-task` block above directly only when you intend to skip monitoring — the two are not equivalent.
132
151
 
133
152
  ## Notes
134
153
 
@@ -15,6 +15,16 @@ description: "创建 Pull Request 到目标分支"
15
15
 
16
16
  > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
17
17
 
18
+ ## 步骤开始:写入 started 标记
19
+
20
+ 通过前置门控、确认前置条件后、本步骤第一个产出动作之前,向 task.md `## 活动日志` 追加一条 started 标记(与本步骤 done 条目同基名 + ` [started]` 后缀,note 用 `started`)。仅当存在关联 `{task-id}` / task.md 时写入:
21
+
22
+ ```
23
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Create PR [started]** by {agent} — started
24
+ ```
25
+
26
+ `ai task log` 会把它与完成时写入的 done 条目配对成一行(进行中 → 已完成)。约定见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
27
+
18
28
  ## 执行流程
19
29
 
20
30
  ### 前置门控:项目级 PR 流程检查
@@ -128,7 +138,16 @@ node .agents/scripts/validate-artifact.js gate create-pr .agents/workspace/activ
128
138
  - Codex CLI:$watch-pr {task-ref}
129
139
  ```
130
140
 
131
- `watch-pr` 全绿后会再引导 `complete-task {task-ref}`。
141
+ 或者,若想跳过 CI 监控、直接归档任务,改用 `complete-task`:
142
+
143
+ ```
144
+ 下一步(备选)- 跳过监控、直接归档任务:
145
+ - Claude Code / OpenCode:/complete-task {task-ref}
146
+ - Gemini CLI:/agent-infra:complete-task {task-ref}
147
+ - Codex CLI:$complete-task {task-ref}
148
+ ```
149
+
150
+ `watch-pr` 为主路径,全绿后会再引导 `complete-task {task-ref}`;上面的 `complete-task` 备选块仅用于跳过 CI 监控、直接归档——两者并不等价。
132
151
 
133
152
  ## 注意事项
134
153
 
@@ -9,7 +9,7 @@ Read this file before creating or updating the single reviewer-facing PR summary
9
9
  - Generate or update the `<!-- sync-pr:{task-id}:summary -->` comment with the canonical template from `.agents/rules/pr-sync.md`
10
10
  - When a matching summary comment already exists, PATCH only when the body changed; otherwise skip the write
11
11
  - In this skill, summary sync failures follow the existing `create-pr` error handling and must not roll back an already-created PR
12
- - Populate the "Manual Verification Required" section per the aggregation rules in `.agents/rules/pr-sync.md` (sources: plan assumptions/open questions, review-code "Environment-Blocked Findings"/"Self-Doubt"); write the explicit placeholder when there are none
12
+ - Populate `{manual-verify-section}` per the aggregation rules in `.agents/rules/pr-sync.md`: include only post-code-stage checks that the AI cannot close on its own and that require a human to execute or judge; sources are `review-code*` "Environment-Blocked Findings" plus `code*` items that satisfy the admission boundary; each item must state "what to verify + location + why only a human can verify it". Render in two branches: **with retained items** → `### ⚠️ Manual Verification Required` heading + item list; **with none** `### No Manual Verification Needed` heading + a single line (no ⚠️, no old list placeholder)
13
13
 
14
14
  ## Result Reporting
15
15
 
@@ -9,7 +9,7 @@
9
9
  - 按 `.agents/rules/pr-sync.md` 中的唯一权威模板生成或更新 `<!-- sync-pr:{task-id}:summary -->` 评论
10
10
  - PR 已存在同标记评论时,只在正文变化时 PATCH;否则跳过写入
11
11
  - 本 skill 中,摘要同步失败沿用 `create-pr` 的现有错误处理,不回滚已经创建的 PR
12
- - 按 `.agents/rules/pr-sync.md` 的聚合规则填充「需人工校验」段落(来源:plan 假设/未决问题、review-code 环境性遗留/自我质疑);无事项时写显式占位
12
+ - 按 `.agents/rules/pr-sync.md` 的聚合规则填充 `{manual-verify-section}`:只收进入 code 阶段后 AI 无法自行关闭、需要人实际执行或判断的校验点;来源为 `review-code*` 的「环境性遗留」以及 `code*` 中满足准入边界的校验点;每条写明「校验什么 + 定位 + 为什么只能由人校验」。按两分支渲染:**有保留项** → `### ⚠️ 需人工校验` 标题 + 条目列表;**无保留项** → `### ✅ 无需人工校验` 标题 + 单行说明(不带 ⚠️、不写旧的列表占位)
13
13
 
14
14
  ## 结果回传
15
15
 
@@ -160,7 +160,21 @@ Ask:
160
160
 
161
161
  ### 9. Publish the Release Notes (If Confirmed)
162
162
 
163
- Write the notes by following the "Publish the Release Notes" command in `.agents/rules/release-commands.md` (it updates the Release already created and published by the release workflow, falling back to creating it if missing).
163
+ 9.1 Write the generated notes to a temp file **outside the working tree** so no uncommitted artifact is left behind in the repo (do not write into `.agents/workspace/` or any version-controlled directory):
164
+
165
+ ```bash
166
+ NOTES_FILE="$(mktemp "${TMPDIR:-/tmp}/agent-infra-release-notes.XXXXXX")"
167
+ ```
168
+
169
+ Write the notes content to `$NOTES_FILE`.
170
+
171
+ 9.2 Publish by following the "Publish the Release Notes" command in `.agents/rules/release-commands.md` (use `$NOTES_FILE` for `{notes-file}`; it updates the Release already created and published by the release workflow, falling back to creating it if missing).
172
+
173
+ 9.3 Remove the temp file whether publishing succeeds or fails:
174
+
175
+ ```bash
176
+ rm -f "$NOTES_FILE"
177
+ ```
164
178
 
165
179
  Output:
166
180
  ```
@@ -179,6 +193,7 @@ The notes have been written to the Release. Edit further at the URL above if nee
179
193
  2. **Tags must exist**: Run the release skill first to create tags
180
194
  3. **Release auto-published**: the `v{version}` Release is created and published by the release workflow (the upload target for Homebrew bottles); this skill writes/refreshes the notes on that Release
181
195
  4. **Classification accuracy**: Auto-classification is based on title/scope/files; complex PRs may need manual adjustment
196
+ 5. **No leftover artifacts**: Always write notes to a temp file outside the working tree (`mktemp`) and delete it after publishing; never write into the repo directory
182
197
 
183
198
  ## Error Handling
184
199