@fitlab-ai/agent-infra 0.6.2-alpha.1 → 0.6.3

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 (82) hide show
  1. package/README.md +13 -3
  2. package/README.zh-CN.md +10 -3
  3. package/bin/cli.ts +6 -1
  4. package/dist/bin/cli.js +6 -1
  5. package/dist/lib/sandbox/clipboard/bridge.js +216 -0
  6. package/dist/lib/sandbox/clipboard/darwin.js +73 -0
  7. package/dist/lib/sandbox/clipboard/index.js +9 -0
  8. package/dist/lib/sandbox/clipboard/keys.js +58 -0
  9. package/dist/lib/sandbox/clipboard/node-pty.js +13 -0
  10. package/dist/lib/sandbox/clipboard/paths.js +59 -0
  11. package/dist/lib/sandbox/commands/create.js +38 -21
  12. package/dist/lib/sandbox/commands/enter.js +8 -2
  13. package/dist/lib/sandbox/commands/ls.js +19 -4
  14. package/dist/lib/sandbox/commands/prune.js +176 -0
  15. package/dist/lib/sandbox/commands/rm.js +27 -33
  16. package/dist/lib/sandbox/config.js +1 -0
  17. package/dist/lib/sandbox/constants.js +6 -0
  18. package/dist/lib/sandbox/credentials.js +43 -24
  19. package/dist/lib/sandbox/index.js +7 -1
  20. package/dist/lib/sandbox/managed-fs.js +25 -0
  21. package/dist/lib/sandbox/tools.js +1 -1
  22. package/dist/lib/version.js +9 -2
  23. package/lib/sandbox/clipboard/bridge.ts +285 -0
  24. package/lib/sandbox/clipboard/darwin.ts +90 -0
  25. package/lib/sandbox/clipboard/index.ts +13 -0
  26. package/lib/sandbox/clipboard/keys.ts +78 -0
  27. package/lib/sandbox/clipboard/node-pty.d.ts +19 -0
  28. package/lib/sandbox/clipboard/node-pty.ts +34 -0
  29. package/lib/sandbox/clipboard/paths.ts +71 -0
  30. package/lib/sandbox/commands/create.ts +44 -21
  31. package/lib/sandbox/commands/enter.ts +8 -2
  32. package/lib/sandbox/commands/ls.ts +28 -4
  33. package/lib/sandbox/commands/prune.ts +211 -0
  34. package/lib/sandbox/commands/rm.ts +30 -32
  35. package/lib/sandbox/config.ts +2 -0
  36. package/lib/sandbox/constants.ts +9 -0
  37. package/lib/sandbox/credentials.ts +49 -26
  38. package/lib/sandbox/index.ts +7 -1
  39. package/lib/sandbox/managed-fs.ts +27 -0
  40. package/lib/sandbox/tools.ts +1 -1
  41. package/lib/version.ts +11 -4
  42. package/package.json +5 -1
  43. package/templates/.agents/README.en.md +19 -0
  44. package/templates/.agents/README.zh-CN.md +19 -0
  45. package/templates/.agents/rules/create-issue.github.en.md +3 -3
  46. package/templates/.agents/rules/create-issue.github.zh-CN.md +3 -3
  47. package/templates/.agents/skills/analyze-task/SKILL.en.md +29 -0
  48. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +29 -0
  49. package/templates/.agents/skills/analyze-task/config/verify.en.json +51 -0
  50. package/templates/.agents/skills/analyze-task/config/{verify.json → verify.zh-CN.json} +6 -2
  51. package/templates/.agents/skills/complete-task/SKILL.en.md +16 -0
  52. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +16 -0
  53. package/templates/.agents/skills/complete-task/config/{verify.json → verify.en.json} +10 -0
  54. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +48 -0
  55. package/templates/.agents/skills/create-pr/config/verify.json +1 -0
  56. package/templates/.agents/skills/create-task/SKILL.en.md +3 -3
  57. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +3 -3
  58. package/templates/.agents/skills/implement-task/SKILL.en.md +14 -0
  59. package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +14 -0
  60. package/templates/.agents/skills/implement-task/config/verify.en.json +51 -0
  61. package/templates/.agents/skills/implement-task/config/{verify.json → verify.zh-CN.json} +7 -2
  62. package/templates/.agents/skills/implement-task/reference/report-template.en.md +15 -0
  63. package/templates/.agents/skills/implement-task/reference/report-template.zh-CN.md +15 -0
  64. package/templates/.agents/skills/plan-task/SKILL.en.md +24 -0
  65. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +24 -0
  66. package/templates/.agents/skills/plan-task/config/verify.en.json +52 -0
  67. package/templates/.agents/skills/plan-task/config/{verify.json → verify.zh-CN.json} +6 -2
  68. package/templates/.agents/skills/post-release/SKILL.en.md +1 -0
  69. package/templates/.agents/skills/post-release/SKILL.zh-CN.md +1 -0
  70. package/templates/.agents/skills/refine-task/SKILL.en.md +14 -0
  71. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +14 -0
  72. package/templates/.agents/skills/refine-task/config/verify.en.json +47 -0
  73. package/templates/.agents/skills/refine-task/config/{verify.json → verify.zh-CN.json} +7 -2
  74. package/templates/.agents/skills/refine-task/reference/report-template.en.md +15 -0
  75. package/templates/.agents/skills/refine-task/reference/report-template.zh-CN.md +15 -0
  76. package/templates/.agents/skills/review-task/SKILL.en.md +14 -0
  77. package/templates/.agents/skills/review-task/SKILL.zh-CN.md +14 -0
  78. package/templates/.agents/skills/review-task/config/verify.en.json +50 -0
  79. package/templates/.agents/skills/review-task/config/{verify.json → verify.zh-CN.json} +5 -2
  80. package/templates/.agents/skills/review-task/reference/report-template.en.md +15 -0
  81. package/templates/.agents/skills/review-task/reference/report-template.zh-CN.md +15 -0
  82. package/dist/package.json +0 -5
@@ -0,0 +1,48 @@
1
+ {
2
+ "skill": "complete-task",
3
+ "checks": {
4
+ "task-meta": {
5
+ "required_fields": [
6
+ "id",
7
+ "type",
8
+ "workflow",
9
+ "status",
10
+ "created_at",
11
+ "updated_at",
12
+ "agent_infra_version",
13
+ "current_step",
14
+ "assigned_to",
15
+ "completed_at"
16
+ ],
17
+ "expected_status": "completed",
18
+ "require_completed_at": true
19
+ },
20
+ "activity-log": {
21
+ "expected_action_pattern": "Completed",
22
+ "freshness_minutes": 30
23
+ },
24
+ "completion-checklist": {
25
+ "require_all_checked": true
26
+ },
27
+ "platform-sync": {
28
+ "when": "issue_number_exists",
29
+ "expected_comment_marker": "<!-- sync-issue:{task-id}:summary -->",
30
+ "verify_task_comment_content": true,
31
+ "sync_checked_requirements": true,
32
+ "verify_issue_type": true,
33
+ "verify_issue_fields": false,
34
+ "verify_milestone": true,
35
+ "expected_comment_marker_key": "summary"
36
+ },
37
+ "artifact": {
38
+ "file_pattern": "task.md",
39
+ "required_sections": [
40
+ "状态核对"
41
+ ],
42
+ "required_patterns": [
43
+ "^\\$ "
44
+ ],
45
+ "freshness_minutes": 30
46
+ }
47
+ }
48
+ }
@@ -24,6 +24,7 @@
24
24
  "verify_in_labels_match_pr": true,
25
25
  "verify_pr_type_label": true,
26
26
  "verify_pr_assignee": true,
27
+ "verify_issue_fields": true,
27
28
  "verify_milestone": true,
28
29
  "expected_pr_comment_marker_key": "prSummary"
29
30
  }
@@ -78,8 +78,8 @@ created_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
78
78
  updated_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
79
79
  agent_infra_version: {agent_infra_version}
80
80
  created_by: human
81
- priority: # optional; Urgent | High | Medium | Low
82
- effort: # optional; High | Medium | Low
81
+ priority: # required; inferred by the AI from the title/description; Urgent | High | Medium | Low
82
+ effort: # required; inferred by the AI from the title/description; High | Medium | Low
83
83
  start_date: # optional; YYYY-MM-DD
84
84
  target_date: # optional; YYYY-MM-DD
85
85
  current_step: requirement-analysis
@@ -87,7 +87,7 @@ assigned_to: {current AI agent}
87
87
  ```
88
88
 
89
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.
90
+ priority / effort are required: the AI infers them from the task title and description (candidates in `.agents/rules/issue-fields.md`; normalize localized input). Leave start_date / target_date empty at creation - analyze-task / plan-task fill them later; do not invent dates.
91
91
 
92
92
  ### 3. Update Task Status
93
93
 
@@ -78,8 +78,8 @@ created_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
78
78
  updated_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
79
79
  agent_infra_version: {agent_infra_version}
80
80
  created_by: human
81
- priority: # 可选;Urgent | High | Medium | Low
82
- effort: # 可选;High | Medium | Low
81
+ priority: # 必填;由 AI 从标题/描述推断;Urgent | High | Medium | Low
82
+ effort: # 必填;由 AI 从标题/描述推断;High | Medium | Low
83
83
  start_date: # 可选;YYYY-MM-DD
84
84
  target_date: # 可选;YYYY-MM-DD
85
85
  current_step: requirement-analysis
@@ -87,7 +87,7 @@ assigned_to: {当前 AI 代理}
87
87
  ```
88
88
 
89
89
  注意:`created_by` 为 `human`,因为任务来源于用户的描述。
90
- 可选 Issue 字段元数据在创建任务时可留空;不要臆测日期。
90
+ priority / effort 必填:由 AI 从任务标题与描述推断后填入(候选值见 `.agents/rules/issue-fields.md`;中文输入按本地化映射规范化)。start_date / target_date 创建时保持留空,由 analyze-task / plan-task 阶段填入;不要臆测日期。
91
91
 
92
92
  ### 3. 更新任务状态
93
93
 
@@ -27,6 +27,20 @@ Before implementing, stop if any of these thoughts appear. They are violations:
27
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
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
29
 
30
+ ## Step 0: State Check (pre-execution hard gate)
31
+
32
+ After loading workflow / skill / rules instructions, and before any task-state judgment or user-visible conclusion, run the state check first. Reading instruction files does not count as an external-state action or conclusion.
33
+
34
+ Run these commands and paste the raw output into both the user-facing reply and this round's `## State Check` section:
35
+
36
+ ```bash
37
+ git status -s
38
+ ls -la .agents/workspace/active/{task-id}/
39
+ tail .agents/workspace/active/{task-id}/task.md
40
+ ```
41
+
42
+ Before the state check is complete, do not make external-state assertions such as "the code is unchanged", "tests passed", or "there are no other references", including in reasoning. This gate is only a structural floor; evidence pairing and authenticity still require the report template and review discipline.
43
+
30
44
  ## Steps
31
45
 
32
46
  ### 1. Verify Prerequisites
@@ -27,6 +27,20 @@ description: "根据技术方案实施任务并输出报告"
27
27
  | 「方案这里不合理,顺手改更好」 | 偏离 `{plan-artifact}` 必须在报告中记录原因;有异议先停下确认,不擅自改方向。 |
28
28
  | 「测试过了,顺便提交一下」 | 本技能绝不执行 `git add`/`git commit`,提交是用户显式发起的独立步骤。 |
29
29
 
30
+ ## 第 0 步:状态核对(执行前硬约束)
31
+
32
+ 在加载 workflow / skill / rules 指令之后、做任何任务状态判断或用户可见结论之前,必须先执行状态核对。指令类文件读取不算对外动作或结论。
33
+
34
+ 运行以下命令,并把原文粘贴到回复正文和本轮产物的 `## 状态核对` 段:
35
+
36
+ ```bash
37
+ git status -s
38
+ ls -la .agents/workspace/active/{task-id}/
39
+ tail .agents/workspace/active/{task-id}/task.md
40
+ ```
41
+
42
+ 状态核对完成前,禁止任何关于外部状态的断言(例如“代码没变”“测试已通过”“没有其他引用”),包括思考阶段。本门禁只提供结构下限;逐条证据配对和真实性仍需按报告模板与审查要求核对。
43
+
30
44
  ## 执行步骤
31
45
 
32
46
  ### 1. 验证前置条件
@@ -0,0 +1,51 @@
1
+ {
2
+ "skill": "implement-task",
3
+ "checks": {
4
+ "task-meta": {
5
+ "required_fields": [
6
+ "id",
7
+ "type",
8
+ "workflow",
9
+ "status",
10
+ "created_at",
11
+ "updated_at",
12
+ "agent_infra_version",
13
+ "current_step",
14
+ "assigned_to"
15
+ ],
16
+ "expected_step": "implementation"
17
+ },
18
+ "artifact": {
19
+ "file_pattern": "implementation.md|implementation-r{N}.md",
20
+ "required_sections": [
21
+ "Modified Files",
22
+ "Key Code Explanation",
23
+ "Test Results",
24
+ "Differences from Plan",
25
+ "Items for Review",
26
+ "State Check",
27
+ "Evidence"
28
+ ],
29
+ "freshness_minutes": 30,
30
+ "required_patterns": [
31
+ "^\\$ "
32
+ ]
33
+ },
34
+ "activity-log": {
35
+ "expected_action_pattern": "Implementation \\(Round \\d+\\)",
36
+ "freshness_minutes": 30
37
+ },
38
+ "platform-sync": {
39
+ "when": "issue_number_exists",
40
+ "expected_status_label": "status: in-progress",
41
+ "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
42
+ "verify_comment_content": true,
43
+ "verify_task_comment_content": true,
44
+ "verify_issue_type": true,
45
+ "verify_issue_fields": false,
46
+ "verify_milestone": true,
47
+ "expected_status_label_key": "inProgress",
48
+ "expected_comment_marker_key": "artifact"
49
+ }
50
+ }
51
+ }
@@ -22,9 +22,14 @@
22
22
  "关键代码说明",
23
23
  "测试结果",
24
24
  "与方案的差异",
25
- "供审查关注的内容"
25
+ "供审查关注的内容",
26
+ "状态核对",
27
+ "证据原文"
26
28
  ],
27
- "freshness_minutes": 30
29
+ "freshness_minutes": 30,
30
+ "required_patterns": [
31
+ "^\\$ "
32
+ ]
28
33
  },
29
34
  "activity-log": {
30
35
  "expected_action_pattern": "Implementation \\(Round \\d+\\)",
@@ -10,6 +10,10 @@ Use this structure when creating `implementation.md` or `implementation-r{N}.md`
10
10
  - **Implementation Round**: Round {implementation-round}
11
11
  - **Artifact File**: `{implementation-artifact}`
12
12
 
13
+ ## State Check
14
+
15
+ > Paste the raw state-check command output; each command starts with `$ `.
16
+
13
17
  ## Modified Files
14
18
 
15
19
  ### New Files
@@ -43,6 +47,17 @@ Use this structure when creating `implementation.md` or `implementation-r{N}.md`
43
47
  {test-run-output}
44
48
  ```
45
49
 
50
+
51
+ ## Evidence
52
+
53
+ > Pair each "I verified X" claim with the corresponding raw tool output; the gate only checks that this section exists and at least one `$ ` line is present.
54
+
55
+ - Claim: {verified claim}
56
+ ```text
57
+ $ {command}
58
+ {raw output}
59
+ ```
60
+
46
61
  ## Differences from Plan
47
62
 
48
63
  {describe any deviation from the approved plan}
@@ -10,6 +10,10 @@
10
10
  - **实现轮次**: Round {implementation-round}
11
11
  - **产物文件**: `{implementation-artifact}`
12
12
 
13
+ ## 状态核对
14
+
15
+ > 粘贴状态核对命令原文;每条命令以 `$ ` 开头。
16
+
13
17
  ## 变更文件
14
18
 
15
19
  ### 新建文件
@@ -43,6 +47,17 @@
43
47
  {test-run-output}
44
48
  ```
45
49
 
50
+
51
+ ## 证据原文
52
+
53
+ > 每条“我验证了 X”断言都要配对对应 tool output 原文;gate 仅校验本段存在和至少一行 `$ `。
54
+
55
+ - 断言:{verified claim}
56
+ ```text
57
+ $ {command}
58
+ {raw output}
59
+ ```
60
+
46
61
  ## 与方案的差异
47
62
 
48
63
  {describe any deviation from the approved plan}
@@ -13,6 +13,20 @@ description: "Design a technical plan for a task"
13
13
 
14
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
15
 
16
+ ## Step 0: State Check (pre-execution hard gate)
17
+
18
+ After loading workflow / skill / rules instructions, and before any task-state judgment or user-visible conclusion, run the state check first. Reading instruction files does not count as an external-state action or conclusion.
19
+
20
+ Run these commands and paste the raw output into both the user-facing reply and this round's `## State Check` section:
21
+
22
+ ```bash
23
+ git status -s
24
+ ls -la .agents/workspace/active/{task-id}/
25
+ tail .agents/workspace/active/{task-id}/task.md
26
+ ```
27
+
28
+ Before the state check is complete, do not make external-state assertions such as "the code is unchanged", "tests passed", or "there are no other references", including in reasoning. This gate is only a structural floor; evidence pairing and authenticity still require the report template and review discipline.
29
+
16
30
  ## Steps
17
31
 
18
32
  ### 1. Verify Prerequisites
@@ -91,9 +105,18 @@ Update `.agents/workspace/active/{task-id}/task.md`:
91
105
  - `assigned_to`: {current AI agent}
92
106
  - `updated_at`: {current time}
93
107
  - `agent_infra_version`: value from `.agents/rules/version-stamp.md`
108
+ - If `target_date` is empty, write an estimated completion date based on the effort estimate (`YYYY-MM-DD`); leave it empty without blocking when no reasonable estimate exists; keep any existing value
94
109
  - Record the plan artifact for this round: `{plan-artifact}` (Round `{plan-round}`)
95
110
  - If the task template contains a `## Design` section, update it to link to `{plan-artifact}`
96
111
  - Mark technical-design as complete in workflow progress and include the actual round when the task template supports it
112
+ - Before appending the workflow Activity Log entry, re-estimate `effort` based on the technical plan (number of implementation steps, files touched, test matrix scope, integration surface). If the re-estimated value differs from the current value in `task.md`:
113
+ - Overwrite the `effort` field in frontmatter with the new value
114
+ - Prepend an Activity Log entry recording the transition (placed before the `Technical Design (Round N)` entry):
115
+ ```
116
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Plan Re-estimate** by {agent} — effort {old} → {new} (rationale: {short basis grounded in this plan})
117
+ ```
118
+ Both entries may share the same timestamp; ordering is conveyed by list position only.
119
+ If the re-estimated value matches the current value, skip the Re-estimate entry. The Flow A sync that follows reads the possibly updated frontmatter and propagates the new value to the Issue automatically.
97
120
  - **Append** to `## Activity Log` (do NOT overwrite previous entries):
98
121
  ```
99
122
  - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Technical Design (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
@@ -104,6 +127,7 @@ If task.md contains a valid `issue_number`, perform these sync actions (skip and
104
127
  - Set `status: pending-design-work` by following issue-sync.md
105
128
  - Create or update the task comment marker defined in `.agents/rules/issue-sync.md` (follow the task.md comment sync rule in issue-sync.md)
106
129
  - Publish the `{plan-artifact}` comment
130
+ - Read `.agents/rules/issue-fields.md` and follow Flow A to sync every non-empty Issue field (`priority`/`effort`/`start_date`/`target_date`) from `task.md` to the Issue (idempotent; skip without blocking when `has_push=false` or the fetch/write fails)
107
131
 
108
132
  ### 8. Verification Gate
109
133
 
@@ -13,6 +13,20 @@ description: "为任务设计技术方案和实施计划"
13
13
 
14
14
  版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
15
15
 
16
+ ## 第 0 步:状态核对(执行前硬约束)
17
+
18
+ 在加载 workflow / skill / rules 指令之后、做任何任务状态判断或用户可见结论之前,必须先执行状态核对。指令类文件读取不算对外动作或结论。
19
+
20
+ 运行以下命令,并把原文粘贴到回复正文和本轮产物的 `## 状态核对` 段:
21
+
22
+ ```bash
23
+ git status -s
24
+ ls -la .agents/workspace/active/{task-id}/
25
+ tail .agents/workspace/active/{task-id}/task.md
26
+ ```
27
+
28
+ 状态核对完成前,禁止任何关于外部状态的断言(例如“代码没变”“测试已通过”“没有其他引用”),包括思考阶段。本门禁只提供结构下限;逐条证据配对和真实性仍需按报告模板与审查要求核对。
29
+
16
30
  ## 执行步骤
17
31
 
18
32
  ### 1. 验证前置条件
@@ -91,9 +105,18 @@ date "+%Y-%m-%d %H:%M:%S%:z"
91
105
  - `assigned_to`:{当前 AI 代理}
92
106
  - `updated_at`:{当前时间}
93
107
  - `agent_infra_version`:按 `.agents/rules/version-stamp.md` 取值
108
+ - 若 `target_date` 为空,基于工作量评估写入预估完成日(`YYYY-MM-DD`);无法合理预估时保持留空、不阻塞;已有值则保留
94
109
  - 记录本轮方案产物:`{plan-artifact}`(Round `{plan-round}`)
95
110
  - 如任务模板包含 `## 设计` 段落,更新为指向 `{plan-artifact}` 的链接
96
111
  - 在工作流进度中标记 technical-design 为已完成,并注明实际轮次(如果任务模板支持)
112
+ - 在追加工作流 Activity Log 条目之前,基于技术方案(实施步骤数、涉及文件、测试矩阵范围、集成面)重估 `effort`。若重估值与 `task.md` 当前值不一致:
113
+ - 用新值覆盖 frontmatter 的 `effort` 字段
114
+ - 在 `Technical Design (Round N)` 条目之前追加一条转移记录:
115
+ ```
116
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Plan Re-estimate** by {agent} — effort {old} → {new} (rationale: {基于本轮方案的简短依据})
117
+ ```
118
+ 两条条目可共用同一时间戳,顺序仅通过列表位置表达。
119
+ 若重估值与当前值一致,跳过 Re-estimate 条目。后续 Flow A 同步会读取可能更新过的 frontmatter,并自动把新值同步到 Issue。
97
120
  - **追加**到 `## Activity Log`(不要覆盖之前的记录):
98
121
  ```
99
122
  - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Technical Design (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
@@ -104,6 +127,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
104
127
  - 按 issue-sync.md 设置 `status: pending-design-work`
105
128
  - 创建或更新 `.agents/rules/issue-sync.md` 中定义的 task 评论标记(按 issue-sync.md 的 task.md 评论同步规则)
106
129
  - 发布 `{plan-artifact}` 评论
130
+ - 读取 `.agents/rules/issue-fields.md`,按流程 A 把 `task.md` 中所有非空的 Issue 字段(`priority`/`effort`/`start_date`/`target_date`)同步到 Issue(幂等;`has_push=false` 或取数/写入失败时跳过,不阻断)
107
131
 
108
132
  ### 8. 完成校验
109
133
 
@@ -0,0 +1,52 @@
1
+ {
2
+ "skill": "plan-task",
3
+ "checks": {
4
+ "task-meta": {
5
+ "required_fields": [
6
+ "id",
7
+ "type",
8
+ "workflow",
9
+ "status",
10
+ "created_at",
11
+ "updated_at",
12
+ "agent_infra_version",
13
+ "current_step",
14
+ "assigned_to"
15
+ ],
16
+ "expected_step": "technical-design"
17
+ },
18
+ "artifact": {
19
+ "file_pattern": "plan.md|plan-r{N}.md",
20
+ "required_sections": [
21
+ "Problem Understanding",
22
+ "Constraints",
23
+ "Option Comparison",
24
+ "Technical Approach",
25
+ "Implementation Steps",
26
+ "File List",
27
+ "Verification Strategy",
28
+ "State Check"
29
+ ],
30
+ "freshness_minutes": 30,
31
+ "required_patterns": [
32
+ "^\\$ "
33
+ ]
34
+ },
35
+ "activity-log": {
36
+ "expected_action_pattern": "Technical Design \\(Round \\d+\\)",
37
+ "freshness_minutes": 30
38
+ },
39
+ "platform-sync": {
40
+ "when": "issue_number_exists",
41
+ "expected_status_label": "status: pending-design-work",
42
+ "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
43
+ "verify_comment_content": true,
44
+ "verify_task_comment_content": true,
45
+ "verify_issue_type": true,
46
+ "verify_issue_fields": false,
47
+ "verify_milestone": true,
48
+ "expected_status_label_key": "pendingDesignWork",
49
+ "expected_comment_marker_key": "artifact"
50
+ }
51
+ }
52
+ }
@@ -24,9 +24,13 @@
24
24
  "技术方法",
25
25
  "实施步骤",
26
26
  "文件清单",
27
- "验证策略"
27
+ "验证策略",
28
+ "状态核对"
28
29
  ],
29
- "freshness_minutes": 30
30
+ "freshness_minutes": 30,
31
+ "required_patterns": [
32
+ "^\\$ "
33
+ ]
30
34
  },
31
35
  "activity-log": {
32
36
  "expected_action_pattern": "Technical Design \\(Round \\d+\\)",
@@ -54,6 +54,7 @@ git status --short
54
54
  <!-- TODO: Add project-specific follow-up tasks such as demo capture, docs publishing, or downstream notifications -->
55
55
 
56
56
  - Examples: record a terminal demo, refresh a docs site, notify downstream teams, update release dashboards
57
+ - If a task here displays or captures the just-released version (e.g., recording a CLI demo), move it **before** Step 3 — otherwise it will reflect the next development version, not the release
57
58
  - If there are no extra tasks, remove this step in the project-specific copy
58
59
 
59
60
  ### 6. Create the Follow-up Commit
@@ -54,6 +54,7 @@ git status --short
54
54
  <!-- TODO: 添加项目特定的发布后任务,例如录制演示、发布文档站或通知下游 -->
55
55
 
56
56
  - 示例:录制终端演示、刷新文档站、通知下游团队、更新发布面板
57
+ - 如果这一步里的任务需要显示或捕获刚发布的版本号(例如录制 CLI 演示),把它挪到**第 3 步「准备下一个开发版本」之前**——否则会反映下一个开发版本号,而不是 released 版本号
57
58
  - 如果没有额外任务,请在项目特化版本中删除此步骤
58
59
 
59
60
  ### 6. 创建后处理提交
@@ -24,6 +24,20 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
24
24
  | "I can clean up nearby code while I am here." | Scope is limited to review findings; changes outside that scope are out of bounds. |
25
25
  | "Clearing env-blocked items makes the report look better." | env-blocked findings are outside the repair scope; preserve and label them truthfully, and never use no-op edits to pad the fix count. |
26
26
 
27
+ ## Step 0: State Check (pre-execution hard gate)
28
+
29
+ After loading workflow / skill / rules instructions, and before any task-state judgment or user-visible conclusion, run the state check first. Reading instruction files does not count as an external-state action or conclusion.
30
+
31
+ Run these commands and paste the raw output into both the user-facing reply and this round's `## State Check` section:
32
+
33
+ ```bash
34
+ git status -s
35
+ ls -la .agents/workspace/active/{task-id}/
36
+ tail .agents/workspace/active/{task-id}/task.md
37
+ ```
38
+
39
+ Before the state check is complete, do not make external-state assertions such as "the code is unchanged", "tests passed", or "there are no other references", including in reasoning. This gate is only a structural floor; evidence pairing and authenticity still require the report template and review discipline.
40
+
27
41
  ## Steps
28
42
 
29
43
  ### 1. Verify Prerequisites
@@ -24,6 +24,20 @@ description: "处理代码审查反馈并修复问题"
24
24
  | 「顺手把旁边也优化了」 | 范围严格限定在审查项内,范围外改动属于越界。 |
25
25
  | 「env-blocked 项清掉报告好看」 | env-blocked 不在修复范围,必须如实保留并标注,禁止 no-op 改动充数。 |
26
26
 
27
+ ## 第 0 步:状态核对(执行前硬约束)
28
+
29
+ 在加载 workflow / skill / rules 指令之后、做任何任务状态判断或用户可见结论之前,必须先执行状态核对。指令类文件读取不算对外动作或结论。
30
+
31
+ 运行以下命令,并把原文粘贴到回复正文和本轮产物的 `## 状态核对` 段:
32
+
33
+ ```bash
34
+ git status -s
35
+ ls -la .agents/workspace/active/{task-id}/
36
+ tail .agents/workspace/active/{task-id}/task.md
37
+ ```
38
+
39
+ 状态核对完成前,禁止任何关于外部状态的断言(例如“代码没变”“测试已通过”“没有其他引用”),包括思考阶段。本门禁只提供结构下限;逐条证据配对和真实性仍需按报告模板与审查要求核对。
40
+
27
41
  ## 执行步骤
28
42
 
29
43
  ### 1. 验证前置条件
@@ -0,0 +1,47 @@
1
+ {
2
+ "skill": "refine-task",
3
+ "checks": {
4
+ "task-meta": {
5
+ "required_fields": [
6
+ "id",
7
+ "type",
8
+ "workflow",
9
+ "status",
10
+ "created_at",
11
+ "updated_at",
12
+ "agent_infra_version",
13
+ "current_step",
14
+ "assigned_to"
15
+ ]
16
+ },
17
+ "artifact": {
18
+ "file_pattern": "refinement.md|refinement-r{N}.md",
19
+ "required_sections": [
20
+ "Review Feedback Handling",
21
+ "Test Results After Refinement",
22
+ "State Check",
23
+ "Evidence"
24
+ ],
25
+ "freshness_minutes": 30,
26
+ "required_patterns": [
27
+ "^\\$ "
28
+ ]
29
+ },
30
+ "activity-log": {
31
+ "expected_action_pattern": "Refinement \\(Round \\d+, for .+\\)",
32
+ "freshness_minutes": 30
33
+ },
34
+ "platform-sync": {
35
+ "when": "issue_number_exists",
36
+ "expected_status_label": "status: in-progress",
37
+ "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
38
+ "verify_comment_content": true,
39
+ "verify_task_comment_content": true,
40
+ "verify_issue_type": true,
41
+ "verify_issue_fields": false,
42
+ "verify_milestone": true,
43
+ "expected_status_label_key": "inProgress",
44
+ "expected_comment_marker_key": "artifact"
45
+ }
46
+ }
47
+ }
@@ -18,9 +18,14 @@
18
18
  "file_pattern": "refinement.md|refinement-r{N}.md",
19
19
  "required_sections": [
20
20
  "审查反馈处理",
21
- "修复后的测试结果"
21
+ "修复后的测试结果",
22
+ "状态核对",
23
+ "证据原文"
22
24
  ],
23
- "freshness_minutes": 30
25
+ "freshness_minutes": 30,
26
+ "required_patterns": [
27
+ "^\\$ "
28
+ ]
24
29
  },
25
30
  "activity-log": {
26
31
  "expected_action_pattern": "Refinement \\(Round \\d+, for .+\\)",
@@ -12,6 +12,10 @@ Use this structure when writing `refinement.md` or `refinement-r{N}.md`.
12
12
  - **Review Input**: `{review-artifact}`
13
13
  - **Implementation Context**: `{implementation-artifact}`
14
14
 
15
+ ## State Check
16
+
17
+ > Paste the raw state-check command output; each command starts with `$ `.
18
+
15
19
  ### Review Feedback Handling
16
20
 
17
21
  #### Blocker Fixes
@@ -43,6 +47,17 @@ Use this structure when writing `refinement.md` or `refinement-r{N}.md`.
43
47
  #### Unresolved Issues
44
48
  - {issue}: {reason}
45
49
 
50
+
51
+ ## Evidence
52
+
53
+ > Pair each "I verified X" claim with the corresponding raw tool output; the gate only checks that this section exists and at least one `$ ` line is present.
54
+
55
+ - Claim: {verified claim}
56
+ ```text
57
+ $ {command}
58
+ {raw output}
59
+ ```
60
+
46
61
  ### Test Results After Refinement
47
62
  - All tests passing: {yes/no}
48
63
  - Test output: {summary}
@@ -12,6 +12,10 @@
12
12
  - **审查输入**: `{review-artifact}`
13
13
  - **实现上下文**: `{implementation-artifact}`
14
14
 
15
+ ## 状态核对
16
+
17
+ > 粘贴状态核对命令原文;每条命令以 `$ ` 开头。
18
+
15
19
  ### 审查反馈处理
16
20
 
17
21
  #### 阻塞项修复
@@ -43,6 +47,17 @@
43
47
  #### 未解决问题
44
48
  - {issue}: {reason}
45
49
 
50
+
51
+ ## 证据原文
52
+
53
+ > 每条“我验证了 X”断言都要配对对应 tool output 原文;gate 仅校验本段存在和至少一行 `$ `。
54
+
55
+ - 断言:{verified claim}
56
+ ```text
57
+ $ {command}
58
+ {raw output}
59
+ ```
60
+
46
61
  ### 修复后的测试结果
47
62
  - 所有测试通过: {yes/no}
48
63
  - 测试输出: {summary}
@@ -22,6 +22,20 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
22
22
  | "It looks mostly fine, so approve it." | The verdict must be backed by blocker/major/minor counts, and every finding must cite file:line; do not approve from impression. |
23
23
  | "The test change looks reasonable, so I can skim it." | Before reviewing test changes, check `.agents/rules/testing-discipline.md` item by item (see the step 4 gate). |
24
24
 
25
+ ## Step 0: State Check (pre-execution hard gate)
26
+
27
+ After loading workflow / skill / rules instructions, and before any task-state judgment or user-visible conclusion, run the state check first. Reading instruction files does not count as an external-state action or conclusion.
28
+
29
+ Run these commands and paste the raw output into both the user-facing reply and this round's `## State Check` section:
30
+
31
+ ```bash
32
+ git status -s
33
+ ls -la .agents/workspace/active/{task-id}/
34
+ tail .agents/workspace/active/{task-id}/task.md
35
+ ```
36
+
37
+ Before the state check is complete, do not make external-state assertions such as "the code is unchanged", "tests passed", or "there are no other references", including in reasoning. This gate is only a structural floor; evidence pairing and authenticity still require the report template and review discipline.
38
+
25
39
  ## Steps
26
40
 
27
41
  ### 1. Verify Prerequisites