@fitlab-ai/agent-infra 0.6.2 → 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.
- package/README.md +13 -3
- package/README.zh-CN.md +10 -3
- package/bin/cli.ts +6 -1
- package/dist/bin/cli.js +6 -1
- package/dist/lib/sandbox/clipboard/bridge.js +216 -0
- package/dist/lib/sandbox/clipboard/darwin.js +73 -0
- package/dist/lib/sandbox/clipboard/index.js +9 -0
- package/dist/lib/sandbox/clipboard/keys.js +58 -0
- package/dist/lib/sandbox/clipboard/node-pty.js +13 -0
- package/dist/lib/sandbox/clipboard/paths.js +59 -0
- package/dist/lib/sandbox/commands/create.js +11 -2
- package/dist/lib/sandbox/commands/enter.js +8 -2
- package/dist/lib/sandbox/commands/ls.js +19 -4
- package/dist/lib/sandbox/commands/prune.js +176 -0
- package/dist/lib/sandbox/commands/rm.js +27 -33
- package/dist/lib/sandbox/config.js +1 -0
- package/dist/lib/sandbox/constants.js +6 -0
- package/dist/lib/sandbox/index.js +7 -1
- package/dist/lib/sandbox/managed-fs.js +25 -0
- package/dist/lib/sandbox/tools.js +1 -1
- package/dist/lib/version.js +9 -2
- package/lib/sandbox/clipboard/bridge.ts +285 -0
- package/lib/sandbox/clipboard/darwin.ts +90 -0
- package/lib/sandbox/clipboard/index.ts +13 -0
- package/lib/sandbox/clipboard/keys.ts +78 -0
- package/lib/sandbox/clipboard/node-pty.d.ts +19 -0
- package/lib/sandbox/clipboard/node-pty.ts +34 -0
- package/lib/sandbox/clipboard/paths.ts +71 -0
- package/lib/sandbox/commands/create.ts +15 -2
- package/lib/sandbox/commands/enter.ts +8 -2
- package/lib/sandbox/commands/ls.ts +28 -4
- package/lib/sandbox/commands/prune.ts +211 -0
- package/lib/sandbox/commands/rm.ts +30 -32
- package/lib/sandbox/config.ts +2 -0
- package/lib/sandbox/constants.ts +9 -0
- package/lib/sandbox/index.ts +7 -1
- package/lib/sandbox/managed-fs.ts +27 -0
- package/lib/sandbox/tools.ts +1 -1
- package/lib/version.ts +11 -4
- package/package.json +5 -1
- package/templates/.agents/README.en.md +19 -0
- package/templates/.agents/README.zh-CN.md +19 -0
- package/templates/.agents/skills/analyze-task/SKILL.en.md +26 -0
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +26 -0
- package/templates/.agents/skills/analyze-task/config/verify.en.json +51 -0
- package/templates/.agents/skills/analyze-task/config/{verify.json → verify.zh-CN.json} +6 -2
- package/templates/.agents/skills/complete-task/SKILL.en.md +15 -0
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +15 -0
- package/templates/.agents/skills/complete-task/config/{verify.json → verify.en.json} +10 -0
- package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +48 -0
- package/templates/.agents/skills/implement-task/SKILL.en.md +14 -0
- package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +14 -0
- package/templates/.agents/skills/implement-task/config/verify.en.json +51 -0
- package/templates/.agents/skills/implement-task/config/{verify.json → verify.zh-CN.json} +7 -2
- package/templates/.agents/skills/implement-task/reference/report-template.en.md +15 -0
- package/templates/.agents/skills/implement-task/reference/report-template.zh-CN.md +15 -0
- package/templates/.agents/skills/plan-task/SKILL.en.md +22 -0
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +22 -0
- package/templates/.agents/skills/plan-task/config/verify.en.json +52 -0
- package/templates/.agents/skills/plan-task/config/{verify.json → verify.zh-CN.json} +6 -2
- package/templates/.agents/skills/post-release/SKILL.en.md +1 -0
- package/templates/.agents/skills/post-release/SKILL.zh-CN.md +1 -0
- package/templates/.agents/skills/refine-task/SKILL.en.md +14 -0
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +14 -0
- package/templates/.agents/skills/refine-task/config/verify.en.json +47 -0
- package/templates/.agents/skills/refine-task/config/{verify.json → verify.zh-CN.json} +7 -2
- package/templates/.agents/skills/refine-task/reference/report-template.en.md +15 -0
- package/templates/.agents/skills/refine-task/reference/report-template.zh-CN.md +15 -0
- package/templates/.agents/skills/review-task/SKILL.en.md +14 -0
- package/templates/.agents/skills/review-task/SKILL.zh-CN.md +14 -0
- package/templates/.agents/skills/review-task/config/verify.en.json +50 -0
- package/templates/.agents/skills/review-task/config/{verify.json → verify.zh-CN.json} +5 -2
- package/templates/.agents/skills/review-task/reference/report-template.en.md +15 -0
- package/templates/.agents/skills/review-task/reference/report-template.zh-CN.md +15 -0
- package/dist/package.json +0 -5
|
@@ -13,6 +13,20 @@ description: "Analyze a task and produce a requirements document"
|
|
|
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
|
|
@@ -72,6 +86,10 @@ Create `.agents/workspace/active/{task-id}/{analysis-artifact}`.
|
|
|
72
86
|
- **Analysis round**: Round {analysis-round}
|
|
73
87
|
- **Artifact file**: `{analysis-artifact}`
|
|
74
88
|
|
|
89
|
+
## State Check
|
|
90
|
+
|
|
91
|
+
> Paste the raw Step 0 state-check command output; each command starts with `$ `.
|
|
92
|
+
|
|
75
93
|
## Requirement Source
|
|
76
94
|
|
|
77
95
|
**Source type**: {User description / Issue / Code Scanning / Dependabot / Other}
|
|
@@ -118,6 +136,14 @@ Update `.agents/workspace/active/{task-id}/task.md`:
|
|
|
118
136
|
- Record the analysis artifact for this round: `{analysis-artifact}` (Round `{analysis-round}`)
|
|
119
137
|
- If the task template contains a `## Analysis` section, update it to link to `{analysis-artifact}`
|
|
120
138
|
- Mark requirement-analysis as complete in workflow progress and include the actual round when the task template supports it
|
|
139
|
+
- Before appending the workflow Activity Log entry, re-estimate `priority` based on the analysis findings (business impact, risks, dependencies, blockers). If the re-estimated value differs from the current value in `task.md`:
|
|
140
|
+
- Overwrite the `priority` field in frontmatter with the new value
|
|
141
|
+
- Prepend an Activity Log entry recording the transition (placed before the `Requirement Analysis (Round N)` entry):
|
|
142
|
+
```
|
|
143
|
+
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Analysis Re-estimate** by {agent} — priority {old} → {new} (rationale: {short basis grounded in this analysis})
|
|
144
|
+
```
|
|
145
|
+
Both entries may share the same timestamp; ordering is conveyed by list position only.
|
|
146
|
+
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.
|
|
121
147
|
- **Append** to `## Activity Log` (do NOT overwrite previous entries):
|
|
122
148
|
```
|
|
123
149
|
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Requirement Analysis (Round {N})** by {agent} — Analysis completed → {analysis-artifact}
|
|
@@ -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. 验证前置条件
|
|
@@ -72,6 +86,10 @@ description: "分析任务并输出需求分析文档"
|
|
|
72
86
|
- **分析轮次**:Round {analysis-round}
|
|
73
87
|
- **产物文件**:`{analysis-artifact}`
|
|
74
88
|
|
|
89
|
+
## 状态核对
|
|
90
|
+
|
|
91
|
+
> 粘贴第 0 步状态核对命令原文;每条命令以 `$ ` 开头。
|
|
92
|
+
|
|
75
93
|
## 需求来源
|
|
76
94
|
|
|
77
95
|
**来源类型**:{用户描述 / Issue / Code Scanning / Dependabot / 其他}
|
|
@@ -118,6 +136,14 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
118
136
|
- 记录本轮分析产物:`{analysis-artifact}`(Round `{analysis-round}`)
|
|
119
137
|
- 如任务模板包含 `## 分析` 段落,更新为指向 `{analysis-artifact}` 的链接
|
|
120
138
|
- 在工作流进度中标记 requirement-analysis 为已完成,并注明实际轮次(如果任务模板支持)
|
|
139
|
+
- 在追加工作流 Activity Log 条目之前,基于分析结果(业务影响、风险、依赖、阻塞条件)重估 `priority`。若重估值与 `task.md` 当前值不一致:
|
|
140
|
+
- 用新值覆盖 frontmatter 的 `priority` 字段
|
|
141
|
+
- 在 `Requirement Analysis (Round N)` 条目之前追加一条转移记录:
|
|
142
|
+
```
|
|
143
|
+
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Analysis Re-estimate** by {agent} — priority {old} → {new} (rationale: {基于本轮分析的简短依据})
|
|
144
|
+
```
|
|
145
|
+
两条条目可共用同一时间戳,顺序仅通过列表位置表达。
|
|
146
|
+
若重估值与当前值一致,跳过 Re-estimate 条目。后续 Flow A 同步会读取可能更新过的 frontmatter,并自动把新值同步到 Issue。
|
|
121
147
|
- **追加**到 `## Activity Log`(不要覆盖之前的记录):
|
|
122
148
|
```
|
|
123
149
|
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Requirement Analysis (Round {N})** by {agent} — Analysis completed → {analysis-artifact}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill": "analyze-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": "requirement-analysis"
|
|
17
|
+
},
|
|
18
|
+
"artifact": {
|
|
19
|
+
"file_pattern": "analysis.md|analysis-r{N}.md",
|
|
20
|
+
"required_sections": [
|
|
21
|
+
"Requirement Source",
|
|
22
|
+
"Requirement Understanding",
|
|
23
|
+
"Related Files",
|
|
24
|
+
"Impact Assessment",
|
|
25
|
+
"Technical Risks",
|
|
26
|
+
"Effort and Complexity Assessment",
|
|
27
|
+
"State Check"
|
|
28
|
+
],
|
|
29
|
+
"freshness_minutes": 30,
|
|
30
|
+
"required_patterns": [
|
|
31
|
+
"^\\$ "
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"activity-log": {
|
|
35
|
+
"expected_action_pattern": "Requirement Analysis \\(Round \\d+\\)",
|
|
36
|
+
"freshness_minutes": 30
|
|
37
|
+
},
|
|
38
|
+
"platform-sync": {
|
|
39
|
+
"when": "issue_number_exists",
|
|
40
|
+
"expected_status_label": "status: pending-design-work",
|
|
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": "pendingDesignWork",
|
|
48
|
+
"expected_comment_marker_key": "artifact"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -23,9 +23,13 @@
|
|
|
23
23
|
"相关文件",
|
|
24
24
|
"影响评估",
|
|
25
25
|
"技术风险",
|
|
26
|
-
"工作量和复杂度评估"
|
|
26
|
+
"工作量和复杂度评估",
|
|
27
|
+
"状态核对"
|
|
27
28
|
],
|
|
28
|
-
"freshness_minutes": 30
|
|
29
|
+
"freshness_minutes": 30,
|
|
30
|
+
"required_patterns": [
|
|
31
|
+
"^\\$ "
|
|
32
|
+
]
|
|
29
33
|
},
|
|
30
34
|
"activity-log": {
|
|
31
35
|
"expected_action_pattern": "Requirement Analysis \\(Round \\d+\\)",
|
|
@@ -12,6 +12,20 @@ description: "Mark a task as completed and archive it"
|
|
|
12
12
|
|
|
13
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
14
|
|
|
15
|
+
## Step 0: State Check (pre-execution hard gate)
|
|
16
|
+
|
|
17
|
+
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.
|
|
18
|
+
|
|
19
|
+
Run these commands and paste the raw output into both the user-facing reply and this round's `## State Check` section:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git status -s
|
|
23
|
+
ls -la .agents/workspace/active/{task-id}/
|
|
24
|
+
tail .agents/workspace/active/{task-id}/task.md
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
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.
|
|
28
|
+
|
|
15
29
|
## Steps
|
|
16
30
|
|
|
17
31
|
### 1. Verify Task Exists
|
|
@@ -64,6 +78,7 @@ Update `.agents/workspace/active/{task-id}/task.md`:
|
|
|
64
78
|
- `completed_at`: {current timestamp}
|
|
65
79
|
- `updated_at`: {current timestamp}
|
|
66
80
|
- `agent_infra_version`: value from `.agents/rules/version-stamp.md`
|
|
81
|
+
- Add or update the `## State Check` section with the raw Step 0 audit command output, including `$ ` prompt lines, before `## Activity Log`
|
|
67
82
|
- Mark all workflow steps as complete
|
|
68
83
|
- Verify and check off all items in `## Completion Checklist` (change `- [ ]` to `- [x]`)
|
|
69
84
|
- **Append** to `## Activity Log` (do NOT overwrite previous entries):
|
|
@@ -12,6 +12,20 @@ description: "标记任务完成并归档"
|
|
|
12
12
|
|
|
13
13
|
版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
|
|
14
14
|
|
|
15
|
+
## 第 0 步:状态核对(执行前硬约束)
|
|
16
|
+
|
|
17
|
+
在加载 workflow / skill / rules 指令之后、做任何任务状态判断或用户可见结论之前,必须先执行状态核对。指令类文件读取不算对外动作或结论。
|
|
18
|
+
|
|
19
|
+
运行以下命令,并把原文粘贴到回复正文和本轮产物的 `## 状态核对` 段:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git status -s
|
|
23
|
+
ls -la .agents/workspace/active/{task-id}/
|
|
24
|
+
tail .agents/workspace/active/{task-id}/task.md
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
状态核对完成前,禁止任何关于外部状态的断言(例如“代码没变”“测试已通过”“没有其他引用”),包括思考阶段。本门禁只提供结构下限;逐条证据配对和真实性仍需按报告模板与审查要求核对。
|
|
28
|
+
|
|
15
29
|
## 执行步骤
|
|
16
30
|
|
|
17
31
|
### 1. 验证任务存在
|
|
@@ -64,6 +78,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
64
78
|
- `completed_at`:{当前时间戳}
|
|
65
79
|
- `updated_at`:{当前时间戳}
|
|
66
80
|
- `agent_infra_version`:按 `.agents/rules/version-stamp.md` 取值
|
|
81
|
+
- 新增或更新 `## 状态核对` 段,粘贴第 0 步审计命令原文(含 `$ ` 前缀行),放在 `## 活动日志` 之前
|
|
67
82
|
- 标记所有工作流步骤为已完成
|
|
68
83
|
- 逐项验证并勾选 `## 完成检查清单` 中的所有条目(将 `- [ ]` 改为 `- [x]`)
|
|
69
84
|
- **追加**到 `## Activity Log`(不要覆盖之前的记录):
|
|
@@ -33,6 +33,16 @@
|
|
|
33
33
|
"verify_issue_fields": false,
|
|
34
34
|
"verify_milestone": true,
|
|
35
35
|
"expected_comment_marker_key": "summary"
|
|
36
|
+
},
|
|
37
|
+
"artifact": {
|
|
38
|
+
"file_pattern": "task.md",
|
|
39
|
+
"required_sections": [
|
|
40
|
+
"State Check"
|
|
41
|
+
],
|
|
42
|
+
"required_patterns": [
|
|
43
|
+
"^\\$ "
|
|
44
|
+
],
|
|
45
|
+
"freshness_minutes": 30
|
|
36
46
|
}
|
|
37
47
|
}
|
|
38
48
|
}
|
|
@@ -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
|
+
}
|
|
@@ -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
|
|
@@ -95,6 +109,14 @@ Update `.agents/workspace/active/{task-id}/task.md`:
|
|
|
95
109
|
- Record the plan artifact for this round: `{plan-artifact}` (Round `{plan-round}`)
|
|
96
110
|
- If the task template contains a `## Design` section, update it to link to `{plan-artifact}`
|
|
97
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.
|
|
98
120
|
- **Append** to `## Activity Log` (do NOT overwrite previous entries):
|
|
99
121
|
```
|
|
100
122
|
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Technical Design (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
|
|
@@ -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. 验证前置条件
|
|
@@ -95,6 +109,14 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
95
109
|
- 记录本轮方案产物:`{plan-artifact}`(Round `{plan-round}`)
|
|
96
110
|
- 如任务模板包含 `## 设计` 段落,更新为指向 `{plan-artifact}` 的链接
|
|
97
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。
|
|
98
120
|
- **追加**到 `## Activity Log`(不要覆盖之前的记录):
|
|
99
121
|
```
|
|
100
122
|
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Technical Design (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
|
|
@@ -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
|
|
@@ -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
|