@fitlab-ai/agent-infra 0.6.0 → 0.6.1

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 (87) hide show
  1. package/README.md +12 -12
  2. package/README.zh-CN.md +12 -12
  3. package/bin/cli.ts +5 -1
  4. package/dist/bin/cli.js +6 -1
  5. package/dist/lib/defaults.json +4 -3
  6. package/dist/lib/sandbox/config.js +1 -1
  7. package/dist/package.json +1 -1
  8. package/lib/defaults.json +4 -3
  9. package/lib/sandbox/config.ts +1 -1
  10. package/package.json +3 -3
  11. package/templates/.agents/README.en.md +8 -8
  12. package/templates/.agents/README.zh-CN.md +8 -8
  13. package/templates/{.claude → .agents}/hooks/check-version-format.sh +3 -3
  14. package/templates/.agents/rules/create-issue.github.en.md +6 -0
  15. package/templates/.agents/rules/create-issue.github.zh-CN.md +6 -0
  16. package/templates/.agents/rules/issue-fields.github.en.md +155 -0
  17. package/templates/.agents/rules/issue-fields.github.zh-CN.md +155 -0
  18. package/templates/.agents/rules/issue-pr-commands.github.en.md +1 -0
  19. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +1 -0
  20. package/templates/.agents/rules/issue-sync.github.en.md +2 -1
  21. package/templates/.agents/rules/issue-sync.github.zh-CN.md +2 -1
  22. package/templates/.agents/rules/task-management.en.md +17 -9
  23. package/templates/.agents/rules/task-management.zh-CN.md +17 -9
  24. package/templates/.agents/rules/testing-discipline.en.md +40 -0
  25. package/templates/.agents/rules/testing-discipline.zh-CN.md +40 -0
  26. package/templates/.agents/rules/version-stamp.en.md +29 -0
  27. package/templates/.agents/rules/version-stamp.zh-CN.md +29 -0
  28. package/templates/.agents/scripts/platform-adapters/platform-sync.github.js +143 -6
  29. package/templates/.agents/scripts/validate-artifact.js +32 -5
  30. package/templates/.agents/skills/analyze-task/SKILL.en.md +3 -0
  31. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -0
  32. package/templates/.agents/skills/analyze-task/config/verify.json +2 -0
  33. package/templates/.agents/skills/block-task/SKILL.en.md +3 -0
  34. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +3 -0
  35. package/templates/.agents/skills/block-task/config/verify.json +1 -0
  36. package/templates/.agents/skills/cancel-task/SKILL.en.md +3 -0
  37. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +3 -0
  38. package/templates/.agents/skills/cancel-task/config/verify.json +1 -0
  39. package/templates/.agents/skills/commit/SKILL.en.md +10 -0
  40. package/templates/.agents/skills/commit/SKILL.zh-CN.md +10 -0
  41. package/templates/.agents/skills/commit/config/verify.json +1 -0
  42. package/templates/.agents/skills/commit/reference/task-status-update.en.md +5 -0
  43. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +5 -0
  44. package/templates/.agents/skills/complete-task/SKILL.en.md +4 -0
  45. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +4 -0
  46. package/templates/.agents/skills/complete-task/config/verify.json +2 -0
  47. package/templates/.agents/skills/create-pr/SKILL.en.md +5 -1
  48. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +5 -1
  49. package/templates/.agents/skills/create-pr/config/verify.json +1 -0
  50. package/templates/.agents/skills/create-task/SKILL.en.md +9 -0
  51. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +9 -0
  52. package/templates/.agents/skills/create-task/config/verify.json +1 -0
  53. package/templates/.agents/skills/implement-task/SKILL.en.md +16 -1
  54. package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +16 -1
  55. package/templates/.agents/skills/implement-task/config/verify.json +2 -0
  56. package/templates/.agents/skills/import-codescan/config/verify.json +1 -0
  57. package/templates/.agents/skills/import-dependabot/config/verify.json +1 -0
  58. package/templates/.agents/skills/import-issue/SKILL.en.md +10 -0
  59. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +10 -0
  60. package/templates/.agents/skills/import-issue/config/verify.json +1 -0
  61. package/templates/.agents/skills/plan-task/SKILL.en.md +3 -0
  62. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +3 -0
  63. package/templates/.agents/skills/plan-task/config/verify.json +2 -0
  64. package/templates/.agents/skills/refine-task/SKILL.en.md +15 -1
  65. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +15 -1
  66. package/templates/.agents/skills/refine-task/config/verify.json +2 -0
  67. package/templates/.agents/skills/refine-task/reference/fix-workflow.en.md +9 -0
  68. package/templates/.agents/skills/refine-task/reference/fix-workflow.zh-CN.md +9 -0
  69. package/templates/.agents/skills/refine-task/reference/report-template.en.md +11 -0
  70. package/templates/.agents/skills/refine-task/reference/report-template.zh-CN.md +11 -0
  71. package/templates/.agents/skills/restore-task/SKILL.en.md +3 -0
  72. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +3 -0
  73. package/templates/.agents/skills/restore-task/config/verify.json +1 -0
  74. package/templates/.agents/skills/review-task/SKILL.en.md +16 -1
  75. package/templates/.agents/skills/review-task/SKILL.zh-CN.md +16 -1
  76. package/templates/.agents/skills/review-task/config/verify.json +3 -0
  77. package/templates/.agents/skills/review-task/reference/output-templates.en.md +20 -5
  78. package/templates/.agents/skills/review-task/reference/output-templates.zh-CN.md +20 -5
  79. package/templates/.agents/skills/review-task/reference/report-template.en.md +13 -0
  80. package/templates/.agents/skills/review-task/reference/report-template.zh-CN.md +13 -0
  81. package/templates/.agents/skills/review-task/reference/review-criteria.en.md +18 -0
  82. package/templates/.agents/skills/review-task/reference/review-criteria.zh-CN.md +18 -0
  83. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +4 -3
  84. package/templates/.agents/templates/task.en.md +5 -0
  85. package/templates/.agents/templates/task.zh-CN.md +5 -0
  86. package/templates/.claude/settings.json +1 -1
  87. package/templates/.codex/hooks.json +17 -0
@@ -22,12 +22,14 @@ const DEFAULT_REQUIRED_FIELDS = [
22
22
  "status",
23
23
  "created_at",
24
24
  "updated_at",
25
+ "agent_infra_version",
25
26
  "current_step",
26
27
  "assigned_to"
27
28
  ];
28
29
 
29
30
  const DEFAULT_FRESHNESS_MINUTES = 30;
30
31
  const DATE_TIME_PATTERN = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}(?:[+-]\d{2}:\d{2})?$/;
32
+ const AGENT_INFRA_VERSION_PATTERN = /^v\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
31
33
  const ACTIVITY_LOG_PATTERN = /^- (\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}(?:[+-]\d{2}:\d{2})?) — \*\*(.+?)\*\* by (.+?) — (.+)$/;
32
34
  const BRANCH_SLUG_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
33
35
 
@@ -212,8 +214,24 @@ function checkTaskMeta({ taskDir, config }) {
212
214
  const metadata = task.metadata;
213
215
  const requiredFields = config.required_fields || DEFAULT_REQUIRED_FIELDS;
214
216
  const missingFields = requiredFields.filter((field) => isBlank(metadata[field]));
215
- if (missingFields.length > 0) {
216
- return failResult("task-meta", `Missing required fields: ${missingFields.join(", ")}`);
217
+ const blockingMissingFields = missingFields.filter((field) => field !== "agent_infra_version");
218
+ const warnings = [];
219
+ if (missingFields.includes("agent_infra_version")) {
220
+ warnings.push("field 'agent_infra_version' missing — historical task or skipped version stamp");
221
+ }
222
+ if (blockingMissingFields.length > 0) {
223
+ return failResult("task-meta", `Missing required fields: ${blockingMissingFields.join(", ")}`);
224
+ }
225
+
226
+ if (
227
+ !isBlank(metadata.agent_infra_version) &&
228
+ metadata.agent_infra_version !== "unknown" &&
229
+ !AGENT_INFRA_VERSION_PATTERN.test(metadata.agent_infra_version)
230
+ ) {
231
+ return failResult(
232
+ "task-meta",
233
+ `Invalid agent_infra_version: ${metadata.agent_infra_version}`
234
+ );
217
235
  }
218
236
 
219
237
  const invalidDates = ["created_at", "updated_at", "completed_at", "blocked_at", "cancelled_at"]
@@ -272,7 +290,12 @@ function checkTaskMeta({ taskDir, config }) {
272
290
  }
273
291
  }
274
292
 
275
- return passResult("task-meta", `Task metadata valid (${requiredFields.length} required fields checked)`);
293
+ const warningSuffix = warnings.length > 0 ? `; warnings: ${warnings.join("; ")}` : "";
294
+ return passResult(
295
+ "task-meta",
296
+ `Task metadata valid (${requiredFields.length} required fields checked${warningSuffix})`,
297
+ warnings
298
+ );
276
299
  }
277
300
 
278
301
  function validateTaskBranch(metadata) {
@@ -683,8 +706,12 @@ function buildSingleCheckSummary(status) {
683
706
  return "0 passed, 1 failed";
684
707
  }
685
708
 
686
- function passResult(type, message) {
687
- return { type, status: "pass", message };
709
+ function passResult(type, message, warnings = []) {
710
+ const result = { type, status: "pass", message };
711
+ if (warnings.length > 0) {
712
+ result.warnings = warnings;
713
+ }
714
+ return result;
688
715
  }
689
716
 
690
717
  function failResult(type, message, failType = "check_failed") {
@@ -11,6 +11,8 @@ description: "Analyze a task and produce a requirements document"
11
11
  - Base the analysis strictly on the existing requirements, context, and source information in `task.md`
12
12
  - After executing this skill, you **must** immediately update task status in task.md
13
13
 
14
+ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
15
+
14
16
  ## Steps
15
17
 
16
18
  ### 1. Verify Prerequisites
@@ -110,6 +112,7 @@ Update `.agents/workspace/active/{task-id}/task.md`:
110
112
  - `current_step`: requirement-analysis
111
113
  - `assigned_to`: {current AI agent}
112
114
  - `updated_at`: {current time}
115
+ - `agent_infra_version`: value from `.agents/rules/version-stamp.md`
113
116
  - Record the analysis artifact for this round: `{analysis-artifact}` (Round `{analysis-round}`)
114
117
  - If the task template contains a `## Analysis` section, update it to link to `{analysis-artifact}`
115
118
  - Mark requirement-analysis as complete in workflow progress and include the actual round when the task template supports it
@@ -11,6 +11,8 @@ description: "分析任务并输出需求分析文档"
11
11
  - 严格基于 `task.md` 中已有的需求、上下文和来源信息展开分析
12
12
  - 执行本技能后,你**必须**立即更新 task.md 中的任务状态
13
13
 
14
+ 版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
15
+
14
16
  ## 执行步骤
15
17
 
16
18
  ### 1. 验证前置条件
@@ -110,6 +112,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
110
112
  - `current_step`:requirement-analysis
111
113
  - `assigned_to`:{当前 AI 代理}
112
114
  - `updated_at`:{当前时间}
115
+ - `agent_infra_version`:按 `.agents/rules/version-stamp.md` 取值
113
116
  - 记录本轮分析产物:`{analysis-artifact}`(Round `{analysis-round}`)
114
117
  - 如任务模板包含 `## 分析` 段落,更新为指向 `{analysis-artifact}` 的链接
115
118
  - 在工作流进度中标记 requirement-analysis 为已完成,并注明实际轮次(如果任务模板支持)
@@ -9,6 +9,7 @@
9
9
  "status",
10
10
  "created_at",
11
11
  "updated_at",
12
+ "agent_infra_version",
12
13
  "current_step",
13
14
  "assigned_to"
14
15
  ],
@@ -37,6 +38,7 @@
37
38
  "verify_comment_content": true,
38
39
  "verify_task_comment_content": true,
39
40
  "verify_issue_type": true,
41
+ "verify_issue_fields": false,
40
42
  "verify_milestone": true,
41
43
  "expected_status_label_key": "pendingDesignWork",
42
44
  "expected_comment_marker_key": "artifact"
@@ -17,6 +17,8 @@ description: "Mark a task as blocked and record the reason"
17
17
  - **Resource issues**: Missing access, waiting for external team, blocked by another task
18
18
  - **Decision needed**: Architecture decision pending, stakeholder approval required
19
19
 
20
+ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
21
+
20
22
  ## Steps
21
23
 
22
24
  ### 1. Verify Task Exists
@@ -47,6 +49,7 @@ Update `.agents/workspace/active/{task-id}/task.md`:
47
49
  - `status`: blocked
48
50
  - `blocked_at`: {current timestamp}
49
51
  - `updated_at`: {current timestamp}
52
+ - `agent_infra_version`: value from `.agents/rules/version-stamp.md`
50
53
  - **Append** to `## Activity Log` (do NOT overwrite previous entries):
51
54
  ```
52
55
  - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Blocked** by {agent} — {one-line reason}
@@ -17,6 +17,8 @@ description: "标记任务为阻塞状态并记录原因"
17
17
  - **资源问题**:缺少访问权限、等待外部团队、被其他任务阻塞
18
18
  - **需要决策**:待定的架构决策、需要利益相关者批准
19
19
 
20
+ 版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
21
+
20
22
  ## 执行步骤
21
23
 
22
24
  ### 1. 验证任务存在
@@ -47,6 +49,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
47
49
  - `status`:blocked
48
50
  - `blocked_at`:{当前时间戳}
49
51
  - `updated_at`:{当前时间戳}
52
+ - `agent_infra_version`:按 `.agents/rules/version-stamp.md` 取值
50
53
  - **追加**到 `## Activity Log`(不要覆盖之前的记录):
51
54
  ```
52
55
  - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Blocked** by {agent} — {一行原因}
@@ -9,6 +9,7 @@
9
9
  "status",
10
10
  "created_at",
11
11
  "updated_at",
12
+ "agent_infra_version",
12
13
  "current_step",
13
14
  "assigned_to",
14
15
  "blocked_at"
@@ -11,6 +11,8 @@ description: "Cancel an unneeded task and move it"
11
11
  - Cancel only when the task no longer needs implementation, review, or follow-up work
12
12
  - When a valid `issue_number` exists, Issue sync is required
13
13
 
14
+ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
15
+
14
16
  ## Steps
15
17
 
16
18
  ### 1. Verify Task Exists
@@ -48,6 +50,7 @@ Update `task.md` in the task directory:
48
50
  - `cancelled_at`: {current timestamp}
49
51
  - `cancel_reason`: {cancellation reason}
50
52
  - `updated_at`: {current timestamp}
53
+ - `agent_infra_version`: value from `.agents/rules/version-stamp.md`
51
54
  - **Append** to `## Activity Log` (do NOT overwrite previous entries):
52
55
  ```
53
56
  - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Cancelled** by {agent} — {one-line cancellation reason}
@@ -11,6 +11,8 @@ description: "取消不再需要的任务并转移"
11
11
  - 只有在确认该任务无需继续实现、审查或修复时才可取消
12
12
  - 有效 `issue_number` 存在时,Issue 同步属于必做项
13
13
 
14
+ 版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
15
+
14
16
  ## 执行步骤
15
17
 
16
18
  ### 1. 验证任务存在
@@ -48,6 +50,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
48
50
  - `cancelled_at`:{当前时间戳}
49
51
  - `cancel_reason`:{取消原因}
50
52
  - `updated_at`:{当前时间戳}
53
+ - `agent_infra_version`:按 `.agents/rules/version-stamp.md` 取值
51
54
  - **追加**到 `## Activity Log`(不要覆盖之前记录):
52
55
  ```
53
56
  - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Cancelled** by {agent} — {一行取消原因}
@@ -9,6 +9,7 @@
9
9
  "status",
10
10
  "created_at",
11
11
  "updated_at",
12
+ "agent_infra_version",
12
13
  "current_step",
13
14
  "assigned_to",
14
15
  "cancelled_at",
@@ -7,6 +7,16 @@ description: "Commit the current changes to Git"
7
7
 
8
8
  Create a Git commit without overwriting user work and update the related task state when needed.
9
9
 
10
+ When updating related `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
11
+
12
+ ## Common Rationalizations and Rebuttals
13
+
14
+ | Rationalization | Rebuttal |
15
+ |------|------|
16
+ | "The tests already ran earlier, so I do not need to rerun them." | The staged content is the current truth; before committing, re-check `git status` and `git diff` instead of relying on memory. |
17
+ | "`git add -A` is faster." | `git add -A` and `git add .` are forbidden; stage only explicitly listed files to avoid including unrelated changes. |
18
+ | "This file has a copyright header, but the year can wait." | If you changed it, update the copyright year using `date +%Y`; this is a hard pre-commit check. |
19
+
10
20
  ## 1. Check Local Modifications (CRITICAL)
11
21
 
12
22
  Before any edit, inspect:
@@ -7,6 +7,16 @@ description: "提交当前变更到 Git"
7
7
 
8
8
  在不覆盖用户本地工作的前提下创建 Git commit,并在需要时更新关联任务状态。
9
9
 
10
+ 更新关联 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
11
+
12
+ ## 常见违规借口与反驳
13
+
14
+ | 借口 | 反驳 |
15
+ |------|------|
16
+ | 「测试之前跑过了,不用重跑」 | 暂存内容是最新现实;提交前必须重新核对 `git status`/`git diff`,不能凭记忆。 |
17
+ | 「`git add -A` 更省事」 | 禁止 `git add -A`/`git add .`;只暂存明确列出的文件,避免带入无关改动。 |
18
+ | 「改了带版权头的文件,年份先不动」 | 改了就更新版权年份(动态取 `date +%Y`),这是提交前的硬性检查。 |
19
+
10
20
  ## 1. 检查本地修改(关键)
11
21
 
12
22
  在任何编辑前先检查:
@@ -9,6 +9,7 @@
9
9
  "status",
10
10
  "created_at",
11
11
  "updated_at",
12
+ "agent_infra_version",
12
13
  "current_step",
13
14
  "assigned_to"
14
15
  ]
@@ -2,6 +2,8 @@
2
2
 
3
3
  Read this file before choosing the post-commit task-state branch.
4
4
 
5
+ Before updating task metadata, read `.agents/rules/version-stamp.md` and refresh `agent_infra_version` together with `updated_at`.
6
+
5
7
  ## Update the Related Task State
6
8
 
7
9
  Get the current time first:
@@ -53,6 +55,7 @@ Next step - complete and archive the task:
53
55
 
54
56
  If more work is still pending:
55
57
  - update `updated_at` in `task.md`
58
+ - update `agent_infra_version` from `.agents/rules/version-stamp.md`
56
59
  - record what this commit finished
57
60
  - record what the next human or agent action is
58
61
 
@@ -61,6 +64,7 @@ If more work is still pending:
61
64
  If this commit hands work over to code review:
62
65
  - update `current_step` to `code-review`
63
66
  - update `updated_at`
67
+ - update `agent_infra_version` from `.agents/rules/version-stamp.md`
64
68
  - mark implementation as finished in the workflow state
65
69
 
66
70
  Required next-step commands:
@@ -76,6 +80,7 @@ Next step - code review:
76
80
 
77
81
  If the next step is Pull Request creation:
78
82
  - update `updated_at`
83
+ - update `agent_infra_version` from `.agents/rules/version-stamp.md`
79
84
  - record the PR plan in `task.md`
80
85
 
81
86
  Required next-step commands:
@@ -2,6 +2,8 @@
2
2
 
3
3
  在选择提交后的任务状态分支之前先读取本文件。
4
4
 
5
+ 更新任务元数据前,先读取 `.agents/rules/version-stamp.md`,并随 `updated_at` 一起刷新 `agent_infra_version`。
6
+
5
7
  ## 更新关联任务状态
6
8
 
7
9
  先获取当前时间:
@@ -53,6 +55,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
53
55
 
54
56
  如果仍有工作待完成:
55
57
  - 更新 `task.md` 中的 `updated_at`
58
+ - 按 `.agents/rules/version-stamp.md` 更新 `agent_infra_version`
56
59
  - 记录这次提交完成了什么
57
60
  - 记录下一位人类或 agent 需要继续做什么
58
61
 
@@ -61,6 +64,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
61
64
  如果这次提交把工作移交给代码审查:
62
65
  - 将 `current_step` 更新为 `code-review`
63
66
  - 更新 `updated_at`
67
+ - 按 `.agents/rules/version-stamp.md` 更新 `agent_infra_version`
64
68
  - 在工作流状态中标记实现阶段已完成
65
69
 
66
70
  必带下一步命令:
@@ -76,6 +80,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
76
80
 
77
81
  如果下一步是创建 Pull Request:
78
82
  - 更新 `updated_at`
83
+ - 按 `.agents/rules/version-stamp.md` 更新 `agent_infra_version`
79
84
  - 在 `task.md` 中记录 PR 计划
80
85
 
81
86
  必带下一步命令:
@@ -10,6 +10,8 @@ description: "Mark a task as completed and archive it"
10
10
  - This command updates task metadata AND physically moves the task directory
11
11
  - Do not move a task that has incomplete workflow steps unless forced
12
12
 
13
+ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
14
+
13
15
  ## Steps
14
16
 
15
17
  ### 1. Verify Task Exists
@@ -58,8 +60,10 @@ date "+%Y-%m-%d %H:%M:%S%:z"
58
60
 
59
61
  Update `.agents/workspace/active/{task-id}/task.md`:
60
62
  - `status`: completed
63
+ - `current_step`: completed
61
64
  - `completed_at`: {current timestamp}
62
65
  - `updated_at`: {current timestamp}
66
+ - `agent_infra_version`: value from `.agents/rules/version-stamp.md`
63
67
  - Mark all workflow steps as complete
64
68
  - Verify and check off all items in `## Completion Checklist` (change `- [ ]` to `- [x]`)
65
69
  - **Append** to `## Activity Log` (do NOT overwrite previous entries):
@@ -10,6 +10,8 @@ description: "标记任务完成并归档"
10
10
  - 本命令更新任务元数据并物理移动任务目录
11
11
  - 除非强制执行,不要转移有未完成工作流步骤的任务
12
12
 
13
+ 版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
14
+
13
15
  ## 执行步骤
14
16
 
15
17
  ### 1. 验证任务存在
@@ -58,8 +60,10 @@ date "+%Y-%m-%d %H:%M:%S%:z"
58
60
 
59
61
  更新 `.agents/workspace/active/{task-id}/task.md`:
60
62
  - `status`:completed
63
+ - `current_step`:completed
61
64
  - `completed_at`:{当前时间戳}
62
65
  - `updated_at`:{当前时间戳}
66
+ - `agent_infra_version`:按 `.agents/rules/version-stamp.md` 取值
63
67
  - 标记所有工作流步骤为已完成
64
68
  - 逐项验证并勾选 `## 完成检查清单` 中的所有条目(将 `- [ ]` 改为 `- [x]`)
65
69
  - **追加**到 `## Activity Log`(不要覆盖之前的记录):
@@ -9,6 +9,7 @@
9
9
  "status",
10
10
  "created_at",
11
11
  "updated_at",
12
+ "agent_infra_version",
12
13
  "current_step",
13
14
  "assigned_to",
14
15
  "completed_at"
@@ -29,6 +30,7 @@
29
30
  "verify_task_comment_content": true,
30
31
  "sync_checked_requirements": true,
31
32
  "verify_issue_type": true,
33
+ "verify_issue_fields": false,
32
34
  "verify_milestone": true,
33
35
  "expected_comment_marker_key": "summary"
34
36
  }
@@ -7,6 +7,10 @@ description: "Create a Pull Request to a target branch"
7
7
 
8
8
  Create a Pull Request and, when task-related, sync the essential metadata and reviewer summary immediately.
9
9
 
10
+ ## Boundary / Critical Rules
11
+
12
+ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
13
+
10
14
  ## Execution Flow
11
15
 
12
16
  ### 1. Parse Command Arguments
@@ -72,7 +76,7 @@ Get the current time:
72
76
  date "+%Y-%m-%d %H:%M:%S%:z"
73
77
  ```
74
78
 
75
- If `{task-id}` is available, update task.md with `pr_number`, `updated_at`, and append the PR Created Activity Log entry including metadata-sync and summary results.
79
+ If `{task-id}` is available, update task.md with `pr_number`, `updated_at`, `agent_infra_version`, and append the PR Created Activity Log entry including metadata-sync and summary results.
76
80
 
77
81
  ### 9. Verification Gate
78
82
 
@@ -7,6 +7,10 @@ description: "创建 Pull Request 到目标分支"
7
7
 
8
8
  创建 Pull Request,并在与任务关联时立即补齐核心元数据和 reviewer 摘要。
9
9
 
10
+ ## 行为边界 / 关键规则
11
+
12
+ 版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
13
+
10
14
  ## 执行流程
11
15
 
12
16
  ### 1. 解析命令参数
@@ -72,7 +76,7 @@ description: "创建 Pull Request 到目标分支"
72
76
  date "+%Y-%m-%d %H:%M:%S%:z"
73
77
  ```
74
78
 
75
- 如果获取到了 `{task-id}`,更新 task.md 的 `pr_number`、`updated_at`,并追加 PR Created 的 Activity Log,记录元数据同步和摘要发布结果。
79
+ 如果获取到了 `{task-id}`,更新 task.md 的 `pr_number`、`updated_at`、`agent_infra_version`,并追加 PR Created 的 Activity Log,记录元数据同步和摘要发布结果。
76
80
 
77
81
  ### 9. 完成校验
78
82
 
@@ -9,6 +9,7 @@
9
9
  "status",
10
10
  "created_at",
11
11
  "updated_at",
12
+ "agent_infra_version",
12
13
  "current_step",
13
14
  "assigned_to"
14
15
  ]
@@ -20,6 +20,8 @@ The user's description is a **work item**, not an **instruction to execute immed
20
20
 
21
21
  After executing this skill, you **must** immediately update task status in task.md.
22
22
 
23
+ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
24
+
23
25
  ## Steps
24
26
 
25
27
  ### 1. Parse the User Description
@@ -74,12 +76,18 @@ workflow: feature-development|bug-fix|refactoring
74
76
  status: active
75
77
  created_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
76
78
  updated_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
79
+ agent_infra_version: {agent_infra_version}
77
80
  created_by: human
81
+ priority: # optional; Urgent | High | Medium | Low
82
+ effort: # optional; High | Medium | Low
83
+ start_date: # optional; YYYY-MM-DD
84
+ target_date: # optional; YYYY-MM-DD
78
85
  current_step: requirement-analysis
79
86
  assigned_to: {current AI agent}
80
87
  ```
81
88
 
82
89
  Note: `created_by` is `human` because the task comes from the user's description.
90
+ Optional Issue field metadata may be left empty at task creation; do not invent dates.
83
91
 
84
92
  ### 3. Update Task Status
85
93
 
@@ -93,6 +101,7 @@ Update `.agents/workspace/active/{task-id}/task.md`:
93
101
  - `current_step`: requirement-analysis
94
102
  - `assigned_to`: {current AI agent}
95
103
  - `updated_at`: {current time}
104
+ - `agent_infra_version`: value from `.agents/rules/version-stamp.md`
96
105
  - `## Context` -> `- **Branch**:`: update it to the generated branch name
97
106
  - **Append** to `## Activity Log` (do NOT overwrite previous entries):
98
107
  ```
@@ -20,6 +20,8 @@ description: "根据自然语言描述创建任务"
20
20
 
21
21
  执行本技能后,你**必须**立即更新 task.md 中的任务状态。
22
22
 
23
+ 版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
24
+
23
25
  ## 执行步骤
24
26
 
25
27
  ### 1. 解析用户描述
@@ -74,12 +76,18 @@ workflow: feature-development|bug-fix|refactoring
74
76
  status: active
75
77
  created_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
76
78
  updated_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
79
+ agent_infra_version: {agent_infra_version}
77
80
  created_by: human
81
+ priority: # 可选;Urgent | High | Medium | Low
82
+ effort: # 可选;High | Medium | Low
83
+ start_date: # 可选;YYYY-MM-DD
84
+ target_date: # 可选;YYYY-MM-DD
78
85
  current_step: requirement-analysis
79
86
  assigned_to: {当前 AI 代理}
80
87
  ```
81
88
 
82
89
  注意:`created_by` 为 `human`,因为任务来源于用户的描述。
90
+ 可选 Issue 字段元数据在创建任务时可留空;不要臆测日期。
83
91
 
84
92
  ### 3. 更新任务状态
85
93
 
@@ -93,6 +101,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
93
101
  - `current_step`:requirement-analysis
94
102
  - `assigned_to`:{当前 AI 代理}
95
103
  - `updated_at`:{当前时间}
104
+ - `agent_infra_version`:按 `.agents/rules/version-stamp.md` 取值
96
105
  - `## 上下文` 中的 `- **分支**:`:更新为生成的分支名
97
106
  - **追加**到 `## Activity Log`(不要覆盖之前的记录):
98
107
  ```
@@ -10,6 +10,7 @@
10
10
  "status",
11
11
  "created_at",
12
12
  "updated_at",
13
+ "agent_infra_version",
13
14
  "current_step",
14
15
  "assigned_to"
15
16
  ],
@@ -14,6 +14,19 @@ Implement the approved task and produce `implementation.md` or `implementation-r
14
14
  - Create a new implementation artifact for each round and never overwrite an older one
15
15
  - After executing this skill, you **must** immediately update task.md
16
16
 
17
+ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
18
+
19
+ ## Common Rationalizations and Rebuttals
20
+
21
+ Before implementing, stop if any of these thoughts appear. They are violations:
22
+
23
+ | Rationalization | Rebuttal |
24
+ |------|------|
25
+ | "The code is too simple to need tests." | Simple code still regresses; without a failing-to-passing case there is no completion signal, so write a test that verifies business behavior first. |
26
+ | "Writing code first and adding tests later is faster." | Tests added after implementation often mirror the implementation; goal-driven work defines the verifiable case first and then makes it pass. |
27
+ | "This plan is flawed, so I will improve it as I go." | Deviations from `{plan-artifact}` must be recorded in the report; if the direction is questionable, stop and confirm instead of changing it silently. |
28
+ | "The tests passed, so I can commit this too." | This skill never runs `git add` or `git commit`; committing is a separate step explicitly requested by the user. |
29
+
17
30
  ## Steps
18
31
 
19
32
  ### 1. Verify Prerequisites
@@ -62,7 +75,8 @@ Read `{plan-artifact}` carefully and extract:
62
75
 
63
76
  Follow `.agents/workflows/feature-development.yaml` and the plan in order.
64
77
 
65
- > Detailed implementation rules, testing discipline, and deviation handling live in `reference/implementation-rules.md`. Read `reference/implementation-rules.md` before executing this step.
78
+ > Detailed implementation rules, the test execution loop, and deviation handling live in `reference/implementation-rules.md`. Read `reference/implementation-rules.md` before executing this step.
79
+ > Test-writing discipline (RED-GREEN-REFACTOR and anti-patterns) lives in `.agents/rules/testing-discipline.md`; read it before adding or changing tests.
66
80
 
67
81
  ### 7. Run Test Verification
68
82
 
@@ -88,6 +102,7 @@ Update `.agents/workspace/active/{task-id}/task.md`:
88
102
  - `current_step`: implementation
89
103
  - `assigned_to`: {current agent}
90
104
  - `updated_at`: {current time}
105
+ - `agent_infra_version`: value from `.agents/rules/version-stamp.md`
91
106
  - review the `## Requirements` section and only change items from `- [ ]` to `- [x]` when they are clearly satisfied by this round's implemented code and passing tests
92
107
  - record `{implementation-artifact}` for Round `{implementation-round}`
93
108
  - append:
@@ -14,6 +14,19 @@ description: "根据技术方案实施任务并输出报告"
14
14
  - 每轮实现都创建新的实现产物,不覆盖旧文件
15
15
  - 执行本技能后,你**必须**立即更新 task.md
16
16
 
17
+ 版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
18
+
19
+ ## 常见违规借口与反驳
20
+
21
+ 动手实现前,若冒出以下念头,先停下——它们都是违规借口:
22
+
23
+ | 借口 | 反驳 |
24
+ |------|------|
25
+ | 「代码太简单,不需要测试」 | 简单代码也会回归;没有"失败→通过"的用例就没有完成标志,先写验证业务行为的测试。 |
26
+ | 「先写代码再补测试更高效」 | 后补测试常沦为对实现的镜像;目标驱动应先定义可验证用例再让它通过。 |
27
+ | 「方案这里不合理,顺手改更好」 | 偏离 `{plan-artifact}` 必须在报告中记录原因;有异议先停下确认,不擅自改方向。 |
28
+ | 「测试过了,顺便提交一下」 | 本技能绝不执行 `git add`/`git commit`,提交是用户显式发起的独立步骤。 |
29
+
17
30
  ## 执行步骤
18
31
 
19
32
  ### 1. 验证前置条件
@@ -62,7 +75,8 @@ description: "根据技术方案实施任务并输出报告"
62
75
 
63
76
  按照 `.agents/workflows/feature-development.yaml` 和方案顺序实施。
64
77
 
65
- > 详细实现规则、测试纪律和偏离处理见 `reference/implementation-rules.md`。执行此步骤前,先读取 `reference/implementation-rules.md`。
78
+ > 详细实现规则、测试执行循环和偏离处理见 `reference/implementation-rules.md`。执行此步骤前,先读取 `reference/implementation-rules.md`。
79
+ > 测试编写纪律(RED-GREEN-REFACTOR 与反模式)见 `.agents/rules/testing-discipline.md`;新增或调整测试前先读取该文件。
66
80
 
67
81
  ### 7. 运行测试验证
68
82
 
@@ -88,6 +102,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
88
102
  - `current_step`:implementation
89
103
  - `assigned_to`:{当前代理}
90
104
  - `updated_at`:{当前时间}
105
+ - `agent_infra_version`:按 `.agents/rules/version-stamp.md` 取值
91
106
  - 审查 `## 需求` 段落,仅把本轮已由代码实现且有测试通过支撑的条目从 `- [ ]` 勾为 `- [x]`
92
107
  - 记录 Round `{implementation-round}` 的 `{implementation-artifact}`
93
108
  - 追加:
@@ -9,6 +9,7 @@
9
9
  "status",
10
10
  "created_at",
11
11
  "updated_at",
12
+ "agent_infra_version",
12
13
  "current_step",
13
14
  "assigned_to"
14
15
  ],
@@ -36,6 +37,7 @@
36
37
  "verify_comment_content": true,
37
38
  "verify_task_comment_content": true,
38
39
  "verify_issue_type": true,
40
+ "verify_issue_fields": false,
39
41
  "verify_milestone": true,
40
42
  "expected_status_label_key": "inProgress",
41
43
  "expected_comment_marker_key": "artifact"
@@ -9,6 +9,7 @@
9
9
  "status",
10
10
  "created_at",
11
11
  "updated_at",
12
+ "agent_infra_version",
12
13
  "current_step",
13
14
  "assigned_to"
14
15
  ],
@@ -9,6 +9,7 @@
9
9
  "status",
10
10
  "created_at",
11
11
  "updated_at",
12
+ "agent_infra_version",
12
13
  "current_step",
13
14
  "assigned_to"
14
15
  ],