@fitlab-ai/agent-infra 0.5.7 → 0.5.9
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 +44 -4
- package/README.zh-CN.md +44 -4
- package/lib/defaults.json +4 -2
- package/lib/init.js +18 -1
- package/lib/sandbox/commands/vm.js +7 -1
- package/lib/sandbox/constants.js +3 -0
- package/lib/sandbox/engine.js +57 -3
- package/lib/sandbox/runtimes/base.dockerfile +9 -2
- package/lib/sandbox/shell.js +36 -2
- package/lib/update.js +14 -3
- package/package.json +6 -4
- package/templates/.agents/QUICKSTART.en.md +2 -2
- package/templates/.agents/QUICKSTART.zh-CN.md +2 -2
- package/templates/.agents/README.en.md +1 -1
- package/templates/.agents/README.zh-CN.md +1 -1
- package/templates/.agents/rules/create-issue.en.md +5 -0
- package/templates/.agents/rules/create-issue.github.en.md +178 -0
- package/templates/.agents/rules/create-issue.github.zh-CN.md +178 -0
- package/templates/.agents/rules/create-issue.zh-CN.md +5 -0
- package/templates/.agents/rules/issue-pr-commands.github.en.md +60 -0
- package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +60 -0
- package/templates/.agents/rules/issue-sync.en.md +14 -0
- package/templates/.agents/rules/issue-sync.github.en.md +15 -1
- package/templates/.agents/rules/issue-sync.github.zh-CN.md +15 -1
- package/templates/.agents/rules/issue-sync.zh-CN.md +14 -0
- package/templates/.agents/rules/label-milestone-setup.github.en.md +10 -0
- package/templates/.agents/rules/label-milestone-setup.github.zh-CN.md +10 -0
- package/templates/.agents/rules/milestone-inference.github.en.md +2 -2
- package/templates/.agents/rules/milestone-inference.github.zh-CN.md +2 -2
- package/templates/.agents/rules/release-commands.github.en.md +16 -0
- package/templates/.agents/rules/release-commands.github.zh-CN.md +16 -0
- package/templates/.agents/scripts/platform-adapters/find-existing-task.github.js +272 -0
- package/templates/.agents/scripts/platform-adapters/find-existing-task.js +5 -0
- package/templates/.agents/scripts/platform-adapters/platform-sync.github.js +134 -9
- package/templates/.agents/scripts/platform-adapters/platform-sync.js +7 -0
- package/templates/.agents/skills/analyze-task/SKILL.en.md +3 -3
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/analyze-task/config/verify.json +3 -1
- package/templates/.agents/skills/block-task/config/verify.json +2 -1
- package/templates/.agents/skills/cancel-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/cancel-task/config/verify.json +2 -1
- package/templates/.agents/skills/close-codescan/SKILL.en.md +2 -2
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/commit/SKILL.en.md +1 -1
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/commit/config/verify.json +2 -1
- package/templates/.agents/skills/complete-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/complete-task/config/verify.json +2 -1
- package/templates/.agents/skills/create-pr/SKILL.en.md +2 -2
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/create-pr/config/verify.json +2 -1
- package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +7 -17
- package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +27 -37
- package/templates/.agents/skills/create-release-note/SKILL.en.md +9 -9
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +9 -9
- package/templates/.agents/skills/create-task/SKILL.en.md +70 -12
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +71 -13
- package/templates/.agents/skills/create-task/config/verify.json +6 -1
- package/templates/.agents/skills/implement-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/implement-task/config/verify.json +3 -1
- package/templates/.agents/skills/implement-task/reference/implementation-rules.en.md +7 -12
- package/templates/.agents/skills/implement-task/reference/implementation-rules.zh-CN.md +7 -12
- package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-issue/SKILL.en.md +40 -10
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +40 -10
- package/templates/.agents/skills/init-labels/SKILL.en.md +9 -9
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +9 -9
- package/templates/.agents/skills/init-milestones/SKILL.en.md +7 -7
- package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +7 -7
- package/templates/.agents/skills/plan-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/plan-task/config/verify.json +3 -1
- package/templates/.agents/skills/refine-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/refine-task/config/verify.json +3 -1
- package/templates/.agents/skills/refine-task/reference/fix-workflow.en.md +2 -2
- package/templates/.agents/skills/refine-task/reference/fix-workflow.zh-CN.md +2 -2
- package/templates/.agents/skills/restore-task/SKILL.en.md +13 -64
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +13 -64
- package/templates/.agents/skills/review-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/review-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/review-task/config/verify.json +3 -1
- package/templates/.agents/skills/test/SKILL.en.md +45 -6
- package/templates/.agents/skills/test/SKILL.zh-CN.md +45 -6
- package/templates/.agents/skills/update-agent-infra/SKILL.en.md +2 -0
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +2 -0
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +56 -5
- package/templates/.claude/commands/import-issue.en.md +1 -1
- package/templates/.claude/commands/import-issue.zh-CN.md +1 -1
- package/templates/.claude/commands/init-labels.en.md +1 -1
- package/templates/.claude/commands/init-labels.zh-CN.md +1 -1
- package/templates/.claude/commands/init-milestones.en.md +1 -1
- package/templates/.claude/commands/init-milestones.zh-CN.md +1 -1
- package/templates/.claude/commands/restore-task.en.md +1 -1
- package/templates/.claude/commands/restore-task.zh-CN.md +1 -1
- package/templates/.claude/hooks/check-version-format.sh +1 -1
- package/templates/.gemini/commands/_project_/import-issue.en.toml +1 -1
- package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/init-labels.en.toml +2 -2
- package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +2 -2
- package/templates/.gemini/commands/_project_/init-milestones.en.toml +2 -2
- package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +2 -2
- package/templates/.gemini/commands/_project_/restore-task.en.toml +1 -1
- package/templates/.gemini/commands/_project_/restore-task.zh-CN.toml +1 -1
- package/templates/{.github/hooks → .git-hooks}/check-version-format.sh +2 -2
- package/templates/.github/workflows/pr-label.yml +1 -1
- package/templates/.opencode/commands/import-issue.en.md +1 -1
- package/templates/.opencode/commands/import-issue.zh-CN.md +1 -1
- package/templates/.opencode/commands/init-labels.en.md +1 -1
- package/templates/.opencode/commands/init-labels.zh-CN.md +1 -1
- package/templates/.opencode/commands/init-milestones.en.md +1 -1
- package/templates/.opencode/commands/init-milestones.zh-CN.md +1 -1
- package/templates/.opencode/commands/restore-task.en.md +1 -1
- package/templates/.opencode/commands/restore-task.zh-CN.md +1 -1
- package/templates/.agents/skills/create-issue/SKILL.en.md +0 -118
- package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +0 -118
- package/templates/.agents/skills/create-issue/config/verify.json +0 -29
- package/templates/.agents/skills/create-issue/reference/label-and-type.en.md +0 -71
- package/templates/.agents/skills/create-issue/reference/label-and-type.zh-CN.md +0 -71
- package/templates/.agents/skills/create-issue/reference/template-matching.en.md +0 -45
- package/templates/.agents/skills/create-issue/reference/template-matching.zh-CN.md +0 -45
- package/templates/.claude/commands/create-issue.en.md +0 -8
- package/templates/.claude/commands/create-issue.zh-CN.md +0 -8
- package/templates/.gemini/commands/_project_/create-issue.en.toml +0 -8
- package/templates/.gemini/commands/_project_/create-issue.zh-CN.toml +0 -8
- package/templates/.opencode/commands/create-issue.en.md +0 -11
- package/templates/.opencode/commands/create-issue.zh-CN.md +0 -11
- /package/templates/{.github/hooks → .git-hooks}/pre-commit +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: init-milestones
|
|
3
|
-
description: "初始化仓库的
|
|
3
|
+
description: "初始化仓库的 milestones 体系"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# 初始化
|
|
6
|
+
# 初始化 milestones
|
|
7
7
|
|
|
8
|
-
一次性初始化仓库的标准
|
|
8
|
+
一次性初始化仓库的标准 milestones 体系。
|
|
9
9
|
|
|
10
10
|
## 执行流程
|
|
11
11
|
|
|
@@ -75,10 +75,10 @@ bash .agents/skills/init-milestones/scripts/init-milestones.sh "$ARGUMENTS"
|
|
|
75
75
|
|
|
76
76
|
## 错误处理
|
|
77
77
|
|
|
78
|
-
-
|
|
79
|
-
- 认证失败:提示 "
|
|
80
|
-
- 仓库访问失败:提示 "Unable to access the current repository with
|
|
78
|
+
- 未找到平台 CLI:提示 "the platform CLI is not installed"
|
|
79
|
+
- 认证失败:提示 "the platform CLI is not authenticated"
|
|
80
|
+
- 仓库访问失败:提示 "Unable to access the current repository with the platform CLI"
|
|
81
81
|
- 版本解析失败:提示 "Unable to determine current version baseline"
|
|
82
82
|
- `--history` 模式下未找到任何 `v*` git tags:提示 "No history tags found matching v*; only standard milestones will be created"
|
|
83
83
|
- 权限不足:提示 "No permission to manage milestones in this repository"
|
|
84
|
-
- API 限流:提示 "
|
|
84
|
+
- API 限流:提示 "platform API rate limit reached, please retry later"
|
|
@@ -99,7 +99,7 @@ Update `.agents/workspace/active/{task-id}/task.md`:
|
|
|
99
99
|
If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
|
|
100
100
|
- Read `.agents/rules/issue-sync.md` before syncing, and complete upstream repository detection plus permission detection
|
|
101
101
|
- Set `status: pending-design-work` by following issue-sync.md
|
|
102
|
-
- Create or update the
|
|
102
|
+
- 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)
|
|
103
103
|
- Publish the `{plan-artifact}` comment
|
|
104
104
|
|
|
105
105
|
### 8. Verification Gate
|
|
@@ -99,7 +99,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
99
99
|
如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
|
|
100
100
|
- 执行前先读取 `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测
|
|
101
101
|
- 按 issue-sync.md 设置 `status: pending-design-work`
|
|
102
|
-
- 创建或更新
|
|
102
|
+
- 创建或更新 `.agents/rules/issue-sync.md` 中定义的 task 评论标记(按 issue-sync.md 的 task.md 评论同步规则)
|
|
103
103
|
- 发布 `{plan-artifact}` 评论
|
|
104
104
|
|
|
105
105
|
### 8. 完成校验
|
|
@@ -38,7 +38,9 @@
|
|
|
38
38
|
"verify_comment_content": true,
|
|
39
39
|
"verify_task_comment_content": true,
|
|
40
40
|
"verify_issue_type": true,
|
|
41
|
-
"verify_milestone": true
|
|
41
|
+
"verify_milestone": true,
|
|
42
|
+
"expected_status_label_key": "pendingDesignWork",
|
|
43
|
+
"expected_comment_marker_key": "artifact"
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
}
|
|
@@ -62,7 +62,7 @@ Update task.md:
|
|
|
62
62
|
If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
|
|
63
63
|
- Read `.agents/rules/issue-sync.md` before syncing, and complete upstream repository detection plus permission detection
|
|
64
64
|
- Set `status: in-progress` by following issue-sync.md
|
|
65
|
-
- Create or update the
|
|
65
|
+
- 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)
|
|
66
66
|
- Publish the `{refinement-artifact}` comment
|
|
67
67
|
|
|
68
68
|
### 7. Verification Gate
|
|
@@ -62,7 +62,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
62
62
|
如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
|
|
63
63
|
- 执行前先读取 `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测
|
|
64
64
|
- 按 issue-sync.md 设置 `status: in-progress`
|
|
65
|
-
- 创建或更新
|
|
65
|
+
- 创建或更新 `.agents/rules/issue-sync.md` 中定义的 task 评论标记(按 issue-sync.md 的 task.md 评论同步规则)
|
|
66
66
|
- 发布 `{refinement-artifact}` 评论
|
|
67
67
|
|
|
68
68
|
### 7. 完成校验
|
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
"verify_comment_content": true,
|
|
33
33
|
"verify_task_comment_content": true,
|
|
34
34
|
"verify_issue_type": true,
|
|
35
|
-
"verify_milestone": true
|
|
35
|
+
"verify_milestone": true,
|
|
36
|
+
"expected_status_label_key": "inProgress",
|
|
37
|
+
"expected_comment_marker_key": "artifact"
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
}
|
|
@@ -26,11 +26,11 @@ For each fix:
|
|
|
26
26
|
1. read the affected files
|
|
27
27
|
2. apply the smallest necessary change
|
|
28
28
|
3. verify the change addresses the review feedback
|
|
29
|
-
4. run the
|
|
29
|
+
4. run the project's **smoke subset** for immediate feedback (see the `test` skill)
|
|
30
30
|
|
|
31
31
|
## Run Test Verification
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Before writing the refinement report, run the project's **core subset** as final verification and confirm that all required tests still pass. If the project does not have layered scripts, fall back to the full project test command.
|
|
34
34
|
|
|
35
35
|
## Choose the Next-Step Branch
|
|
36
36
|
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
1. 读取受影响文件
|
|
27
27
|
2. 施加最小必要改动
|
|
28
28
|
3. 验证改动确实解决了审查反馈
|
|
29
|
-
4.
|
|
29
|
+
4. 运行项目测试的 **smoke 子集**做即时反馈(参见 `test` skill)
|
|
30
30
|
|
|
31
31
|
## 运行测试验证
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
写 refinement 报告前,运行项目测试的 **core 子集**做最终验证,确保所有必需测试仍然通过。如果项目没有分层 script,回退到完整项目测试命令。
|
|
34
34
|
|
|
35
35
|
## 选择下一步分支
|
|
36
36
|
|
|
@@ -9,7 +9,7 @@ Restore local task workspace files from platform Issue comments that contain syn
|
|
|
9
9
|
|
|
10
10
|
## Boundary / Critical Rules
|
|
11
11
|
|
|
12
|
-
- Restore files only from comments
|
|
12
|
+
- Restore files only from comments that match the marker registry in `.agents/rules/issue-sync.md`
|
|
13
13
|
- Restore into `.agents/workspace/active/{task-id}/` by default
|
|
14
14
|
- Stop immediately if the target directory already exists and ask the user to resolve the conflict first
|
|
15
15
|
- After executing this skill, you **must** immediately update the restored `task.md`
|
|
@@ -31,16 +31,11 @@ Read all Issue comments by following the "Read Issue comments" command in `.agen
|
|
|
31
31
|
|
|
32
32
|
### 3. Determine the task-id and Files to Restore
|
|
33
33
|
|
|
34
|
-
Filter comments by
|
|
35
|
-
|
|
36
|
-
```html
|
|
37
|
-
<!-- sync-issue:{task-id}:{file-stem} -->
|
|
38
|
-
<!-- sync-issue:{task-id}:{file-stem}:{part}/{total} -->
|
|
39
|
-
```
|
|
34
|
+
Filter comments by the task, artifact, and chunked artifact markers defined in `.agents/rules/issue-sync.md`.
|
|
40
35
|
|
|
41
36
|
Rules:
|
|
42
37
|
- when `{task-id}` was provided, match only that task
|
|
43
|
-
- when `{task-id}` was omitted, infer it from the
|
|
38
|
+
- when `{task-id}` was omitted, infer it from the task comment marker first
|
|
44
39
|
- if you cannot determine a unique task-id, stop and tell the user
|
|
45
40
|
- ignore `summary` marker comments because they are complete-task aggregate output rather than restorable local task files
|
|
46
41
|
- map `{file-stem}` back to filenames:
|
|
@@ -58,7 +53,7 @@ Read `.agents/rules/issue-sync.md` before executing this step.
|
|
|
58
53
|
For each file:
|
|
59
54
|
- collect its single comment or chunked comments
|
|
60
55
|
- for `task.md` comments, reverse the `<details>` frontmatter wrapper described in issue-sync.md before reassembling the file body
|
|
61
|
-
- when
|
|
56
|
+
- when a chunk marker includes part and total indexes, sort by part and verify the set is complete
|
|
62
57
|
- extract the file body by removing the hidden marker, heading, and footer
|
|
63
58
|
- concatenate chunk bodies into the final file content
|
|
64
59
|
|
|
@@ -88,66 +83,20 @@ Update the restored `task.md`:
|
|
|
88
83
|
- `status`: `active`
|
|
89
84
|
- `assigned_to`: {current AI agent}
|
|
90
85
|
- `updated_at`: {current time}
|
|
91
|
-
- keep the original `current_step`
|
|
92
|
-
- append this entry to `## Activity Log`:
|
|
93
|
-
```
|
|
94
|
-
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Restore Task** by {agent} — Restored task from Issue #{issue-number}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### 7. Verification Gate
|
|
98
|
-
|
|
99
|
-
Run the verification gate:
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
node .agents/scripts/validate-artifact.js gate restore-task .agents/workspace/active/{task-id} --format text
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Handle the result as follows:
|
|
106
|
-
- exit code 0 (all checks passed) -> continue to the "Inform User" step
|
|
107
|
-
- exit code 1 (validation failed) -> fix the reported issues and run the gate again
|
|
108
|
-
- exit code 2 (network blocked) -> stop and tell the user that human intervention is required
|
|
109
86
|
|
|
110
|
-
|
|
87
|
+
Append an Activity Log entry indicating the task was restored from the platform Issue.
|
|
111
88
|
|
|
112
|
-
###
|
|
89
|
+
### 7. Inform User
|
|
113
90
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
> **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name).
|
|
117
|
-
|
|
118
|
-
Output format:
|
|
119
|
-
|
|
120
|
-
```text
|
|
121
|
-
Task {task-id} was restored from Issue #{issue-number}.
|
|
122
|
-
|
|
123
|
-
Summary:
|
|
124
|
-
- Restored files: {count}
|
|
125
|
-
- Task directory: .agents/workspace/active/{task-id}/
|
|
126
|
-
- Current step: {current_step}
|
|
127
|
-
|
|
128
|
-
Next step - check task status:
|
|
129
|
-
- Claude Code / OpenCode: /check-task {task-id}
|
|
130
|
-
- Gemini CLI: /{{project}}:check-task {task-id}
|
|
131
|
-
- Codex CLI: $check-task {task-id}
|
|
132
|
-
```
|
|
91
|
+
Report the restored task id, restored file count, and the active task directory.
|
|
133
92
|
|
|
134
93
|
## Completion Checklist
|
|
135
94
|
|
|
136
|
-
- [ ] Fetched
|
|
137
|
-
- [ ] Restored
|
|
138
|
-
- [ ] Updated
|
|
139
|
-
- [ ]
|
|
140
|
-
- [ ] Showed the next-step commands in every TUI format, including any custom TUIs
|
|
141
|
-
|
|
142
|
-
## STOP
|
|
143
|
-
|
|
144
|
-
Stop after completing the checklist. Do not continue the workflow automatically.
|
|
95
|
+
- [ ] Fetched Issue comments from the platform
|
|
96
|
+
- [ ] Restored task files locally
|
|
97
|
+
- [ ] Updated restored task metadata
|
|
98
|
+
- [ ] Reported the restored directory
|
|
145
99
|
|
|
146
|
-
|
|
100
|
+
### 8. Stop
|
|
147
101
|
|
|
148
|
-
|
|
149
|
-
- Platform CLI unavailable or unauthenticated
|
|
150
|
-
- No sync-marked comments found
|
|
151
|
-
- Unable to determine a unique `task-id`
|
|
152
|
-
- Target directory already exists
|
|
153
|
-
- Missing chunks or incomplete chunk ordering
|
|
102
|
+
Stop after the completion checklist. Do not commit automatically.
|
|
@@ -9,7 +9,7 @@ description: "从平台 Issue 评论还原本地任务文件"
|
|
|
9
9
|
|
|
10
10
|
## 行为边界 / 关键规则
|
|
11
11
|
|
|
12
|
-
-
|
|
12
|
+
- 只从匹配 `.agents/rules/issue-sync.md` 标记注册表的评论恢复文件
|
|
13
13
|
- 默认恢复到 `.agents/workspace/active/{task-id}/`
|
|
14
14
|
- 如果目标目录已存在,立即停止并提示用户先处理目录冲突
|
|
15
15
|
- 执行本技能后,你**必须**立即更新恢复出的 `task.md`
|
|
@@ -31,16 +31,11 @@ description: "从平台 Issue 评论还原本地任务文件"
|
|
|
31
31
|
|
|
32
32
|
### 3. 确定 task-id 与待恢复文件
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
```html
|
|
37
|
-
<!-- sync-issue:{task-id}:{file-stem} -->
|
|
38
|
-
<!-- sync-issue:{task-id}:{file-stem}:{part}/{total} -->
|
|
39
|
-
```
|
|
34
|
+
按 `.agents/rules/issue-sync.md` 中定义的 task、artifact 和分片 artifact 标记筛选评论。
|
|
40
35
|
|
|
41
36
|
处理规则:
|
|
42
37
|
- 用户提供了 `{task-id}` 时,仅匹配该任务
|
|
43
|
-
- 未提供时,优先从
|
|
38
|
+
- 未提供时,优先从 task 评论标记推断
|
|
44
39
|
- 若找不到唯一 task-id,立即停止并告知用户
|
|
45
40
|
- 忽略 `summary` 标记评论;它是 complete-task 的聚合产物,不对应本地任务文件
|
|
46
41
|
- 将 `{file-stem}` 映射回文件名:
|
|
@@ -58,7 +53,7 @@ description: "从平台 Issue 评论还原本地任务文件"
|
|
|
58
53
|
对每个文件执行:
|
|
59
54
|
- 收集单条评论或分片评论
|
|
60
55
|
- 对 `task.md` 评论按 issue-sync.md 中的 `<details>` frontmatter 格式反向拆解,提取 frontmatter 后再与正文拼合
|
|
61
|
-
-
|
|
56
|
+
- 如分片标记中存在 part 和 total 序号,按 part 升序排序并校验分片完整
|
|
62
57
|
- 从评论正文中提取文件内容,去掉隐藏标记、标题和页脚
|
|
63
58
|
- 拼接得到最终文件内容
|
|
64
59
|
|
|
@@ -88,66 +83,20 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
88
83
|
- `status`:`active`
|
|
89
84
|
- `assigned_to`:{当前 AI 代理}
|
|
90
85
|
- `updated_at`:{当前时间}
|
|
91
|
-
- 保留原 `current_step`
|
|
92
|
-
- 在 `## 活动日志` 追加:
|
|
93
|
-
```
|
|
94
|
-
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Restore Task** by {agent} — Restored task from Issue #{issue-number}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### 7. 完成校验
|
|
98
|
-
|
|
99
|
-
运行完成校验:
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
node .agents/scripts/validate-artifact.js gate restore-task .agents/workspace/active/{task-id} --format text
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
处理结果:
|
|
106
|
-
- 退出码 0(全部通过)-> 继续到「告知用户」步骤
|
|
107
|
-
- 退出码 1(校验失败)-> 根据输出修复问题后重新运行校验
|
|
108
|
-
- 退出码 2(网络中断)-> 停止执行并告知用户需要人工介入
|
|
109
86
|
|
|
110
|
-
|
|
87
|
+
追加 Activity Log,说明任务已从平台 Issue 还原。
|
|
111
88
|
|
|
112
|
-
###
|
|
89
|
+
### 7. 告知用户
|
|
113
90
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
|
|
117
|
-
|
|
118
|
-
输出格式:
|
|
119
|
-
|
|
120
|
-
```text
|
|
121
|
-
任务 {task-id} 已从 Issue #{issue-number} 还原。
|
|
122
|
-
|
|
123
|
-
摘要:
|
|
124
|
-
- 恢复文件:{数量}
|
|
125
|
-
- 任务目录:.agents/workspace/active/{task-id}/
|
|
126
|
-
- 当前步骤:{current_step}
|
|
127
|
-
|
|
128
|
-
下一步 - 查看任务状态:
|
|
129
|
-
- Claude Code / OpenCode:/check-task {task-id}
|
|
130
|
-
- Gemini CLI:/{{project}}:check-task {task-id}
|
|
131
|
-
- Codex CLI:$check-task {task-id}
|
|
132
|
-
```
|
|
91
|
+
报告已恢复的 task id、恢复文件数量和 active task 目录。
|
|
133
92
|
|
|
134
93
|
## 完成检查清单
|
|
135
94
|
|
|
136
|
-
- [ ]
|
|
137
|
-
- [ ]
|
|
138
|
-
- [ ]
|
|
139
|
-
- [ ]
|
|
140
|
-
- [ ] 已向用户展示所有 TUI 格式的下一步命令(含自定义 TUI)
|
|
141
|
-
|
|
142
|
-
## 停止
|
|
143
|
-
|
|
144
|
-
完成检查清单后立即停止。不要自动继续执行工作流。
|
|
95
|
+
- [ ] 已从平台获取 Issue 评论
|
|
96
|
+
- [ ] 已恢复本地任务文件
|
|
97
|
+
- [ ] 已更新恢复出的任务元数据
|
|
98
|
+
- [ ] 已报告恢复目录
|
|
145
99
|
|
|
146
|
-
|
|
100
|
+
### 8. 停止
|
|
147
101
|
|
|
148
|
-
|
|
149
|
-
- 平台 CLI 未认证
|
|
150
|
-
- 找不到带 sync 标记的评论
|
|
151
|
-
- 无法唯一确定 `task-id`
|
|
152
|
-
- 目标目录已存在
|
|
153
|
-
- 分片缺失或顺序不完整
|
|
102
|
+
完成检查清单后立即停止。不要自动提交。
|
|
@@ -56,7 +56,7 @@ Update task.md and append:
|
|
|
56
56
|
If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
|
|
57
57
|
- Read `.agents/rules/issue-sync.md` before syncing, and complete upstream repository detection plus permission detection
|
|
58
58
|
- Set `status: in-progress` by following issue-sync.md
|
|
59
|
-
- Create or update the
|
|
59
|
+
- 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)
|
|
60
60
|
- Publish the `{review-artifact}` comment
|
|
61
61
|
|
|
62
62
|
### 7. Verification Gate
|
|
@@ -56,7 +56,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
56
56
|
如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
|
|
57
57
|
- 执行前先读取 `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测
|
|
58
58
|
- 按 issue-sync.md 设置 `status: in-progress`
|
|
59
|
-
- 创建或更新
|
|
59
|
+
- 创建或更新 `.agents/rules/issue-sync.md` 中定义的 task 评论标记(按 issue-sync.md 的 task.md 评论同步规则)
|
|
60
60
|
- 发布 `{review-artifact}` 评论
|
|
61
61
|
|
|
62
62
|
### 7. 完成校验
|
|
@@ -36,7 +36,9 @@
|
|
|
36
36
|
"verify_comment_content": true,
|
|
37
37
|
"verify_task_comment_content": true,
|
|
38
38
|
"verify_issue_type": true,
|
|
39
|
-
"verify_milestone": true
|
|
39
|
+
"verify_milestone": true,
|
|
40
|
+
"expected_status_label_key": "inProgress",
|
|
41
|
+
"expected_comment_marker_key": "artifact"
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
}
|
|
@@ -21,16 +21,55 @@ Execute the project's full test workflow including compilation checks and unit t
|
|
|
21
21
|
|
|
22
22
|
Confirm no compilation errors.
|
|
23
23
|
|
|
24
|
-
## 2. Run
|
|
24
|
+
## 2. Run Unit Tests by Layer
|
|
25
|
+
|
|
26
|
+
This project uses three test layers as an optional optimization; if the test suite is small, all layers may map to the same full test command.
|
|
27
|
+
|
|
28
|
+
### smoke (target <5s)
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# TODO: Replace with this project's smoke subset command
|
|
32
|
+
# npm run test:smoke (Node.js)
|
|
33
|
+
# pytest -m "not slow" (Python)
|
|
34
|
+
# go test -short ./... (Go)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Use for:
|
|
38
|
+
- implement-task / refine-task inner loops
|
|
39
|
+
- save-and-run / frequent feedback
|
|
40
|
+
- project structure, configuration, and template contract checks
|
|
41
|
+
|
|
42
|
+
### core (target <15s)
|
|
25
43
|
|
|
26
44
|
```bash
|
|
27
|
-
# TODO: Replace with
|
|
28
|
-
# npm test
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
# go test ./... (Go)
|
|
45
|
+
# TODO: Replace with this project's core subset command
|
|
46
|
+
# npm run test:core (Node.js)
|
|
47
|
+
# pytest -m "not contract" (Python)
|
|
48
|
+
# go test ./... (Go)
|
|
32
49
|
```
|
|
33
50
|
|
|
51
|
+
Use for:
|
|
52
|
+
- pre-commit hook (automatic)
|
|
53
|
+
- final verification before writing implementation.md / refinement.md
|
|
54
|
+
- local gate before pushing a PR
|
|
55
|
+
|
|
56
|
+
### full (complete test suite)
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# TODO: Replace with this project's full test command
|
|
60
|
+
# npm test (Node.js)
|
|
61
|
+
# mvn test (Maven)
|
|
62
|
+
# pytest (Python)
|
|
63
|
+
# go test ./... (Go)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Use for:
|
|
67
|
+
- before release / tag
|
|
68
|
+
- CI
|
|
69
|
+
- final gate before merging to main
|
|
70
|
+
|
|
71
|
+
If the project is not layered yet, smoke / core / full may all map to the same full test command; layering is a feedback-speed optimization, not a prerequisite for using the collaboration workflow.
|
|
72
|
+
|
|
34
73
|
## 3. Output Results
|
|
35
74
|
|
|
36
75
|
Report test result summary:
|
|
@@ -21,16 +21,55 @@ description: "执行项目完整测试流程"
|
|
|
21
21
|
|
|
22
22
|
确认无编译错误。
|
|
23
23
|
|
|
24
|
-
## 2.
|
|
24
|
+
## 2. 运行单元测试(按层级选择)
|
|
25
|
+
|
|
26
|
+
本项目把测试分为三层(可选优化);如果项目测试规模较小,可以全部映射到同一个完整测试命令。
|
|
27
|
+
|
|
28
|
+
### smoke(目标 <5s)
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# TODO: 替换为本项目的 smoke 子集命令
|
|
32
|
+
# npm run test:smoke (Node.js)
|
|
33
|
+
# pytest -m "not slow" (Python)
|
|
34
|
+
# go test -short ./... (Go)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
适用场景:
|
|
38
|
+
- implement-task / refine-task 内循环
|
|
39
|
+
- 保存即跑 / 频繁反馈
|
|
40
|
+
- 仅断言项目结构、配置、模板契约
|
|
41
|
+
|
|
42
|
+
### core(目标 <15s)
|
|
25
43
|
|
|
26
44
|
```bash
|
|
27
|
-
# TODO:
|
|
28
|
-
# npm test
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
# go test ./... (Go)
|
|
45
|
+
# TODO: 替换为本项目的 core 子集命令
|
|
46
|
+
# npm run test:core (Node.js)
|
|
47
|
+
# pytest -m "not contract" (Python)
|
|
48
|
+
# go test ./... (Go)
|
|
32
49
|
```
|
|
33
50
|
|
|
51
|
+
适用场景:
|
|
52
|
+
- pre-commit hook(自动调用)
|
|
53
|
+
- 写 implementation.md / refinement.md 报告前的最终验证
|
|
54
|
+
- 推送 PR 前的本地把关
|
|
55
|
+
|
|
56
|
+
### full(完整测试)
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# TODO: 替换为本项目的完整测试命令
|
|
60
|
+
# npm test (Node.js)
|
|
61
|
+
# mvn test (Maven)
|
|
62
|
+
# pytest (Python)
|
|
63
|
+
# go test ./... (Go)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
适用场景:
|
|
67
|
+
- release / tag 前
|
|
68
|
+
- CI
|
|
69
|
+
- main 合并前的最终把关
|
|
70
|
+
|
|
71
|
+
如果项目暂不分层,smoke / core / full 可以全部映射到同一个完整测试命令;分层是反馈速度优化项,不是使用协作工作流的前置条件。
|
|
72
|
+
|
|
34
73
|
## 3. 输出结果
|
|
35
74
|
|
|
36
75
|
报告测试结果摘要:
|
|
@@ -45,6 +45,8 @@ The script outputs JSON to stdout. Parse and record the report.
|
|
|
45
45
|
list these in the report so users know which files were ignored because a
|
|
46
46
|
built-in template or later external source won
|
|
47
47
|
- `managed.written` / `managed.created`: updated / newly created managed files
|
|
48
|
+
- `managed.removed`: deleted managed files (including old paths removed during template migrations)
|
|
49
|
+
- `managed.skippedPlatform`: managed / merged entries skipped because they belong to a different platform
|
|
48
50
|
- `merged.pending`: list of merged files for AI to process
|
|
49
51
|
- Each item has `target` (project-relative path) and `template` (template-root-relative path)
|
|
50
52
|
- `registryAdded`: newly added file registry entries
|
|
@@ -37,6 +37,8 @@ node .agents/skills/update-agent-infra/scripts/sync-templates.js
|
|
|
37
37
|
- `templateRoot`:模板文件根目录绝对路径
|
|
38
38
|
- `templateSources.conflicts`:外部模板源冲突列表;报告中必须显式展示,说明哪些文件因内置模板或后续外部源获胜而被忽略
|
|
39
39
|
- `managed.written` / `managed.created`:已更新/新建的 managed 文件
|
|
40
|
+
- `managed.removed`:被删除的 managed 文件(包括模板迁移时移除的旧路径)
|
|
41
|
+
- `managed.skippedPlatform`:因归属其他平台而被跳过的 managed / merged 条目
|
|
40
42
|
- `merged.pending`:需要 AI 处理的 merged 文件列表
|
|
41
43
|
- 每项包含 `target`(项目中的目标路径)和 `template`(模板根目录下的相对路径)
|
|
42
44
|
- `registryAdded`:新增的文件注册条目
|