@fitlab-ai/agent-infra 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.ts +1 -1
- package/dist/bin/cli.js +1 -1
- package/dist/lib/builtin-tuis.js +45 -0
- package/dist/lib/defaults.json +3 -0
- package/dist/lib/init.js +62 -23
- package/dist/lib/prompt.js +49 -1
- package/dist/lib/sandbox/commands/enter.js +1 -1
- package/dist/lib/sandbox/commands/list-running.js +58 -13
- package/dist/lib/sandbox/commands/rebuild.js +3 -11
- package/dist/lib/sandbox/commands/rm.js +2 -0
- package/dist/lib/sandbox/image-prune.js +18 -0
- package/dist/lib/sandbox/task-resolver.js +18 -0
- package/dist/lib/update.js +59 -18
- package/lib/builtin-tuis.ts +55 -0
- package/lib/defaults.json +3 -0
- package/lib/init.ts +87 -35
- package/lib/prompt.ts +54 -1
- package/lib/sandbox/commands/enter.ts +1 -1
- package/lib/sandbox/commands/list-running.ts +69 -16
- package/lib/sandbox/commands/rebuild.ts +3 -12
- package/lib/sandbox/commands/rm.ts +3 -0
- package/lib/sandbox/image-prune.ts +23 -0
- package/lib/sandbox/task-resolver.ts +23 -1
- package/lib/update.ts +71 -30
- package/package.json +1 -1
- package/templates/.agents/README.en.md +32 -0
- package/templates/.agents/README.zh-CN.md +32 -0
- package/templates/.agents/rules/task-short-id.en.md +141 -0
- package/templates/.agents/rules/task-short-id.zh-CN.md +124 -0
- package/templates/.agents/scripts/task-short-id.js +713 -0
- package/templates/.agents/skills/analyze-task/SKILL.en.md +4 -0
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +4 -1
- package/templates/.agents/skills/block-task/SKILL.en.md +12 -0
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +12 -1
- package/templates/.agents/skills/cancel-task/SKILL.en.md +12 -0
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +12 -1
- package/templates/.agents/skills/check-task/SKILL.en.md +4 -0
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +4 -1
- package/templates/.agents/skills/close-codescan/SKILL.en.md +11 -0
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +11 -0
- package/templates/.agents/skills/close-dependabot/SKILL.en.md +11 -0
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +11 -0
- package/templates/.agents/skills/code-task/SKILL.en.md +4 -0
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +4 -1
- package/templates/.agents/skills/commit/SKILL.en.md +4 -0
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +4 -0
- package/templates/.agents/skills/complete-task/SKILL.en.md +12 -0
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +12 -1
- package/templates/.agents/skills/create-pr/SKILL.en.md +4 -0
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +4 -0
- package/templates/.agents/skills/create-task/SKILL.en.md +14 -0
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +14 -1
- package/templates/.agents/skills/import-codescan/SKILL.en.md +14 -0
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +14 -0
- package/templates/.agents/skills/import-dependabot/SKILL.en.md +14 -0
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +14 -0
- package/templates/.agents/skills/import-issue/SKILL.en.md +14 -0
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +14 -0
- package/templates/.agents/skills/plan-task/SKILL.en.md +4 -0
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +4 -1
- package/templates/.agents/skills/restore-task/SKILL.en.md +12 -0
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +12 -1
- package/templates/.agents/skills/review-analysis/SKILL.en.md +4 -0
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +4 -1
- package/templates/.agents/skills/review-code/SKILL.en.md +4 -0
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +4 -1
- package/templates/.agents/skills/review-plan/SKILL.en.md +4 -0
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +4 -1
- package/templates/.agents/skills/update-agent-infra/SKILL.en.md +1 -0
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +1 -0
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +112 -21
- package/templates/.agents/templates/task.en.md +1 -0
- package/templates/.agents/templates/task.zh-CN.md +1 -0
|
@@ -27,6 +27,10 @@ tail .agents/workspace/active/{task-id}/task.md
|
|
|
27
27
|
|
|
28
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
29
|
|
|
30
|
+
## Task id short ref
|
|
31
|
+
|
|
32
|
+
> If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
33
|
+
|
|
30
34
|
## Steps
|
|
31
35
|
|
|
32
36
|
### 1. Verify Prerequisites
|
|
@@ -27,8 +27,11 @@ tail .agents/workspace/active/{task-id}/task.md
|
|
|
27
27
|
|
|
28
28
|
状态核对完成前,禁止任何关于外部状态的断言(例如“代码没变”“测试已通过”“没有其他引用”),包括思考阶段。本门禁只提供结构下限;逐条证据配对和真实性仍需按报告模板与审查要求核对。
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## 任务入参短号别名
|
|
31
|
+
|
|
32
|
+
> 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
31
33
|
|
|
34
|
+
## 执行步骤
|
|
32
35
|
### 1. 验证前置条件
|
|
33
36
|
|
|
34
37
|
检查必要文件:
|
|
@@ -19,6 +19,10 @@ description: "Mark a task as blocked and record the reason"
|
|
|
19
19
|
|
|
20
20
|
Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
|
|
21
21
|
|
|
22
|
+
## Task id short ref
|
|
23
|
+
|
|
24
|
+
> If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
25
|
+
|
|
22
26
|
## Steps
|
|
23
27
|
|
|
24
28
|
### 1. Verify Task Exists
|
|
@@ -79,6 +83,12 @@ If a valid `issue_number` exists, set `status: blocked` by following issue-sync.
|
|
|
79
83
|
|
|
80
84
|
### 7. Verification Gate
|
|
81
85
|
|
|
86
|
+
**Release short id** (after the directory has already been moved; the script is idempotent and returns 0 even if the task isn't registered):
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
node .agents/scripts/task-short-id.js release "$task_id" || true
|
|
90
|
+
```
|
|
91
|
+
|
|
82
92
|
Run the verification gate to confirm the task artifact and sync state are valid:
|
|
83
93
|
|
|
84
94
|
```bash
|
|
@@ -116,6 +126,8 @@ Next step - check task status after unblocking:
|
|
|
116
126
|
- Codex CLI: $check-task {task-id}
|
|
117
127
|
```
|
|
118
128
|
|
|
129
|
+
|
|
130
|
+
|
|
119
131
|
## Completion Checklist
|
|
120
132
|
|
|
121
133
|
- [ ] Analyzed and documented the blocking reason
|
|
@@ -19,8 +19,11 @@ description: "标记任务为阻塞状态并记录原因"
|
|
|
19
19
|
|
|
20
20
|
版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## 任务入参短号别名
|
|
23
|
+
|
|
24
|
+
> 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
23
25
|
|
|
26
|
+
## 执行步骤
|
|
24
27
|
### 1. 验证任务存在
|
|
25
28
|
|
|
26
29
|
检查任务是否存在于 `.agents/workspace/active/{task-id}/`。
|
|
@@ -79,6 +82,12 @@ ls .agents/workspace/blocked/{task-id}/task.md
|
|
|
79
82
|
|
|
80
83
|
### 7. 完成校验
|
|
81
84
|
|
|
85
|
+
**释放短号**(先 `mv` 目录已成功,再 release;脚本幂等,未在注册表也返回 0):
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
node .agents/scripts/task-short-id.js release "$task_id" || true
|
|
89
|
+
```
|
|
90
|
+
|
|
82
91
|
运行完成校验,确认任务产物和同步状态符合规范:
|
|
83
92
|
|
|
84
93
|
```bash
|
|
@@ -116,6 +125,8 @@ node .agents/scripts/validate-artifact.js gate block-task .agents/workspace/bloc
|
|
|
116
125
|
- Codex CLI:$check-task {task-id}
|
|
117
126
|
```
|
|
118
127
|
|
|
128
|
+
|
|
129
|
+
|
|
119
130
|
## 完成检查清单
|
|
120
131
|
|
|
121
132
|
- [ ] 分析并记录了阻塞原因
|
|
@@ -13,6 +13,10 @@ description: "Cancel an unneeded task and move it"
|
|
|
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
|
+
## Task id short ref
|
|
17
|
+
|
|
18
|
+
> If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
19
|
+
|
|
16
20
|
## Steps
|
|
17
21
|
|
|
18
22
|
### 1. Verify Task Exists
|
|
@@ -92,6 +96,12 @@ The cancellation comment must include at least:
|
|
|
92
96
|
|
|
93
97
|
### 7. Verification Gate
|
|
94
98
|
|
|
99
|
+
**Release short id** (after the directory has already been moved; the script is idempotent and returns 0 even if the task isn't registered):
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
node .agents/scripts/task-short-id.js release "$task_id" || true
|
|
103
|
+
```
|
|
104
|
+
|
|
95
105
|
Run the verification gate to confirm the moved task and sync state are valid:
|
|
96
106
|
|
|
97
107
|
```bash
|
|
@@ -125,6 +135,8 @@ Next step - inspect the moved task:
|
|
|
125
135
|
- Codex CLI: $check-task {task-id}
|
|
126
136
|
```
|
|
127
137
|
|
|
138
|
+
|
|
139
|
+
|
|
128
140
|
## Completion Checklist
|
|
129
141
|
|
|
130
142
|
- [ ] Recorded the cancellation reason and updated task.md
|
|
@@ -13,8 +13,11 @@ description: "取消不再需要的任务并转移"
|
|
|
13
13
|
|
|
14
14
|
版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## 任务入参短号别名
|
|
17
|
+
|
|
18
|
+
> 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
17
19
|
|
|
20
|
+
## 执行步骤
|
|
18
21
|
### 1. 验证任务存在
|
|
19
22
|
|
|
20
23
|
依次检查以下目录:
|
|
@@ -92,6 +95,12 @@ ls .agents/workspace/completed/{task-id}/task.md
|
|
|
92
95
|
|
|
93
96
|
### 7. 完成校验
|
|
94
97
|
|
|
98
|
+
**释放短号**(先 `mv` 目录已成功,再 release;脚本幂等,未在注册表也返回 0):
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
node .agents/scripts/task-short-id.js release "$task_id" || true
|
|
102
|
+
```
|
|
103
|
+
|
|
95
104
|
运行完成校验,确认任务转移和同步状态符合规范:
|
|
96
105
|
|
|
97
106
|
```bash
|
|
@@ -125,6 +134,8 @@ node .agents/scripts/validate-artifact.js gate cancel-task .agents/workspace/com
|
|
|
125
134
|
- Codex CLI:$check-task {task-id}
|
|
126
135
|
```
|
|
127
136
|
|
|
137
|
+
|
|
138
|
+
|
|
128
139
|
## 完成检查清单
|
|
129
140
|
|
|
130
141
|
- [ ] 已记录取消原因并更新 task.md
|
|
@@ -10,6 +10,10 @@ description: "Check a task's current status and progress"
|
|
|
10
10
|
- This skill is **read-only** -- do not modify any files
|
|
11
11
|
- Always check the active, blocked, and completed directories
|
|
12
12
|
|
|
13
|
+
## Task id short ref
|
|
14
|
+
|
|
15
|
+
> If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
16
|
+
|
|
13
17
|
## Steps
|
|
14
18
|
|
|
15
19
|
### 1. Locate Task
|
|
@@ -10,8 +10,11 @@ description: "查看任务的当前状态和进度"
|
|
|
10
10
|
- 本技能是**只读**操作 —— 不修改任何文件
|
|
11
11
|
- 始终检查 active、blocked 和 completed 目录
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## 任务入参短号别名
|
|
14
|
+
|
|
15
|
+
> 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
14
16
|
|
|
17
|
+
## 执行步骤
|
|
15
18
|
### 1. 查找任务
|
|
16
19
|
|
|
17
20
|
按以下优先顺序搜索任务:
|
|
@@ -7,6 +7,10 @@ description: "Close a Code Scanning alert with a documented reason"
|
|
|
7
7
|
|
|
8
8
|
Dismiss the specified Code Scanning (CodeQL) alert and record a justified reason.
|
|
9
9
|
|
|
10
|
+
## Task id short ref
|
|
11
|
+
|
|
12
|
+
> If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
13
|
+
|
|
10
14
|
## Execution Flow
|
|
11
15
|
|
|
12
16
|
### 1. Retrieve Alert Information
|
|
@@ -81,6 +85,11 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
81
85
|
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Alert Closed** by {agent} — Code Scanning alert #{alert-number} dismissed: {reason}
|
|
82
86
|
```
|
|
83
87
|
- Archive the task
|
|
88
|
+
- **Release short id** (after the archive `mv` succeeded; the script is idempotent):
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
node .agents/scripts/task-short-id.js release "$task_id" || true
|
|
92
|
+
```
|
|
84
93
|
|
|
85
94
|
### 8. Inform User
|
|
86
95
|
|
|
@@ -117,3 +126,5 @@ Next step - complete and archive the task if a related task exists:
|
|
|
117
126
|
- Already closed: output "Alert #{number} is already {state}"
|
|
118
127
|
- Permission error: output "No permission to modify alerts"
|
|
119
128
|
- User canceled: output "Cancellation acknowledged"
|
|
129
|
+
|
|
130
|
+
|
|
@@ -7,6 +7,10 @@ description: "关闭 Code Scanning 告警并记录理由"
|
|
|
7
7
|
|
|
8
8
|
关闭指定的 Code Scanning(CodeQL)告警并记录合理的关闭理由。
|
|
9
9
|
|
|
10
|
+
## 任务入参短号别名
|
|
11
|
+
|
|
12
|
+
> 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
13
|
+
|
|
10
14
|
## 执行流程
|
|
11
15
|
|
|
12
16
|
### 1. 获取告警信息
|
|
@@ -81,6 +85,11 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
81
85
|
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Alert Closed** by {agent} — Code Scanning alert #{alert-number} dismissed: {reason}
|
|
82
86
|
```
|
|
83
87
|
- 归档任务
|
|
88
|
+
- **释放短号**(归档目录已 mv 成功,再 release;脚本幂等):
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
node .agents/scripts/task-short-id.js release "$task_id" || true
|
|
92
|
+
```
|
|
84
93
|
|
|
85
94
|
### 8. 告知用户
|
|
86
95
|
|
|
@@ -117,3 +126,5 @@ Code Scanning 告警 #{alert-number} 已关闭。
|
|
|
117
126
|
- 已关闭:提示 "Alert #{number} is already {state}"
|
|
118
127
|
- 权限错误:提示 "No permission to modify alerts"
|
|
119
128
|
- 用户取消:提示 "Cancellation acknowledged"
|
|
129
|
+
|
|
130
|
+
|
|
@@ -7,6 +7,10 @@ description: "Close a Dependabot alert with a documented reason"
|
|
|
7
7
|
|
|
8
8
|
Dismiss the specified Dependabot security alert and record a justified reason.
|
|
9
9
|
|
|
10
|
+
## Task id short ref
|
|
11
|
+
|
|
12
|
+
> If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
13
|
+
|
|
10
14
|
## Execution Flow
|
|
11
15
|
|
|
12
16
|
### 1. Retrieve Alert Information
|
|
@@ -89,6 +93,11 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
89
93
|
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Alert Closed** by {agent} — Dependabot alert #{alert-number} dismissed: {reason}
|
|
90
94
|
```
|
|
91
95
|
- Archive the task
|
|
96
|
+
- **Release short id** (after the archive `mv` succeeded; the script is idempotent):
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
node .agents/scripts/task-short-id.js release "$task_id" || true
|
|
100
|
+
```
|
|
92
101
|
|
|
93
102
|
### 8. Inform User
|
|
94
103
|
|
|
@@ -125,3 +134,5 @@ Next step - complete and archive the task if a related task exists:
|
|
|
125
134
|
- Already closed: output "Alert #{number} is already {state}"
|
|
126
135
|
- Permission error: output "No permission to modify alerts"
|
|
127
136
|
- User canceled: output "Cancellation acknowledged"
|
|
137
|
+
|
|
138
|
+
|
|
@@ -7,6 +7,10 @@ description: "关闭 Dependabot 安全告警并记录理由"
|
|
|
7
7
|
|
|
8
8
|
关闭指定的 Dependabot 安全告警并记录合理的关闭理由。
|
|
9
9
|
|
|
10
|
+
## 任务入参短号别名
|
|
11
|
+
|
|
12
|
+
> 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
13
|
+
|
|
10
14
|
## 执行流程
|
|
11
15
|
|
|
12
16
|
### 1. 获取告警信息
|
|
@@ -89,6 +93,11 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
89
93
|
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Alert Closed** by {agent} — Dependabot alert #{alert-number} dismissed: {reason}
|
|
90
94
|
```
|
|
91
95
|
- 归档任务
|
|
96
|
+
- **释放短号**(归档目录已 mv 成功,再 release;脚本幂等):
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
node .agents/scripts/task-short-id.js release "$task_id" || true
|
|
100
|
+
```
|
|
92
101
|
|
|
93
102
|
### 8. 告知用户
|
|
94
103
|
|
|
@@ -125,3 +134,5 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
125
134
|
- 已关闭:提示 "Alert #{number} is already {state}"
|
|
126
135
|
- 权限错误:提示 "No permission to modify alerts"
|
|
127
136
|
- 用户取消:提示 "Cancellation acknowledged"
|
|
137
|
+
|
|
138
|
+
|
|
@@ -29,6 +29,10 @@ ls -la .agents/workspace/active/{task-id}/
|
|
|
29
29
|
tail .agents/workspace/active/{task-id}/task.md
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
## Task id short ref
|
|
33
|
+
|
|
34
|
+
> If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
35
|
+
|
|
32
36
|
## Steps
|
|
33
37
|
|
|
34
38
|
### 1. Verify Prerequisites
|
|
@@ -42,8 +42,11 @@ tail .agents/workspace/active/{task-id}/task.md
|
|
|
42
42
|
|
|
43
43
|
状态核对完成前,禁止任何关于外部状态的断言(例如“代码没变”“测试已通过”“没有其他引用”),包括思考阶段。本门禁只提供结构下限;逐条证据配对和真实性仍需按报告模板与审查要求核对。
|
|
44
44
|
|
|
45
|
-
##
|
|
45
|
+
## 任务入参短号别名
|
|
46
|
+
|
|
47
|
+
> 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
46
48
|
|
|
49
|
+
## 执行步骤
|
|
47
50
|
### 1. 验证前置条件
|
|
48
51
|
|
|
49
52
|
先检查:
|
|
@@ -17,6 +17,10 @@ When updating related `task.md` frontmatter, read `.agents/rules/version-stamp.m
|
|
|
17
17
|
| "`git add -A` is faster." | `git add -A` and `git add .` are forbidden; stage only explicitly listed files to avoid including unrelated changes. |
|
|
18
18
|
| "This file has a copyright header, but the year can wait." | If you changed it, update the copyright year using `date +%Y`; this is a hard pre-commit check. |
|
|
19
19
|
|
|
20
|
+
## Task id short ref
|
|
21
|
+
|
|
22
|
+
> If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
23
|
+
|
|
20
24
|
## 1. Check Local Modifications (CRITICAL)
|
|
21
25
|
|
|
22
26
|
Before any edit, inspect:
|
|
@@ -17,6 +17,10 @@ description: "提交当前变更到 Git"
|
|
|
17
17
|
| 「`git add -A` 更省事」 | 禁止 `git add -A`/`git add .`;只暂存明确列出的文件,避免带入无关改动。 |
|
|
18
18
|
| 「改了带版权头的文件,年份先不动」 | 改了就更新版权年份(动态取 `date +%Y`),这是提交前的硬性检查。 |
|
|
19
19
|
|
|
20
|
+
## 任务入参短号别名
|
|
21
|
+
|
|
22
|
+
> 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
23
|
+
|
|
20
24
|
## 1. 检查本地修改(关键)
|
|
21
25
|
|
|
22
26
|
在任何编辑前先检查:
|
|
@@ -26,6 +26,10 @@ tail .agents/workspace/active/{task-id}/task.md
|
|
|
26
26
|
|
|
27
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
28
|
|
|
29
|
+
## Task id short ref
|
|
30
|
+
|
|
31
|
+
> If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
32
|
+
|
|
29
33
|
## Steps
|
|
30
34
|
|
|
31
35
|
### 1. Verify Task Exists
|
|
@@ -119,6 +123,12 @@ If a valid `issue_number` exists:
|
|
|
119
123
|
|
|
120
124
|
### 7. Verification Gate
|
|
121
125
|
|
|
126
|
+
**Release short id** (after the directory has already been moved; the script is idempotent and returns 0 even if the task isn't registered):
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
node .agents/scripts/task-short-id.js release "$task_id" || true
|
|
130
|
+
```
|
|
131
|
+
|
|
122
132
|
Run the verification gate to confirm the task artifact and sync state are valid:
|
|
123
133
|
|
|
124
134
|
```bash
|
|
@@ -149,6 +159,8 @@ Deliverables:
|
|
|
149
159
|
- {List of key outputs: files modified, tests added, etc.}
|
|
150
160
|
```
|
|
151
161
|
|
|
162
|
+
|
|
163
|
+
|
|
152
164
|
## Completion Checklist
|
|
153
165
|
|
|
154
166
|
- [ ] Verified all workflow steps are complete
|
|
@@ -26,8 +26,11 @@ tail .agents/workspace/active/{task-id}/task.md
|
|
|
26
26
|
|
|
27
27
|
状态核对完成前,禁止任何关于外部状态的断言(例如“代码没变”“测试已通过”“没有其他引用”),包括思考阶段。本门禁只提供结构下限;逐条证据配对和真实性仍需按报告模板与审查要求核对。
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## 任务入参短号别名
|
|
30
|
+
|
|
31
|
+
> 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
30
32
|
|
|
33
|
+
## 执行步骤
|
|
31
34
|
### 1. 验证任务存在
|
|
32
35
|
|
|
33
36
|
检查任务是否存在于 `.agents/workspace/active/{task-id}/`。
|
|
@@ -119,6 +122,12 @@ ls .agents/workspace/completed/{task-id}/task.md
|
|
|
119
122
|
|
|
120
123
|
### 7. 完成校验
|
|
121
124
|
|
|
125
|
+
**释放短号**(先 `mv` 目录已成功,再 release;脚本幂等,未在注册表也返回 0):
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
node .agents/scripts/task-short-id.js release "$task_id" || true
|
|
129
|
+
```
|
|
130
|
+
|
|
122
131
|
运行完成校验,确认任务产物和同步状态符合规范:
|
|
123
132
|
|
|
124
133
|
```bash
|
|
@@ -149,6 +158,8 @@ node .agents/scripts/validate-artifact.js gate complete-task .agents/workspace/c
|
|
|
149
158
|
- {关键产出列表:修改的文件、添加的测试等}
|
|
150
159
|
```
|
|
151
160
|
|
|
161
|
+
|
|
162
|
+
|
|
152
163
|
## 完成检查清单
|
|
153
164
|
|
|
154
165
|
- [ ] 验证了所有工作流步骤已完成
|
|
@@ -11,6 +11,10 @@ Create a Pull Request and, when task-related, sync the essential metadata and re
|
|
|
11
11
|
|
|
12
12
|
Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
|
|
13
13
|
|
|
14
|
+
## Task id short ref
|
|
15
|
+
|
|
16
|
+
> If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
17
|
+
|
|
14
18
|
## Execution Flow
|
|
15
19
|
|
|
16
20
|
### Pre-gate: Project-level PR Flow Check
|
|
@@ -11,6 +11,10 @@ description: "创建 Pull Request 到目标分支"
|
|
|
11
11
|
|
|
12
12
|
版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
|
|
13
13
|
|
|
14
|
+
## 任务入参短号别名
|
|
15
|
+
|
|
16
|
+
> 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
17
|
+
|
|
14
18
|
## 执行流程
|
|
15
19
|
|
|
16
20
|
### 前置门控:项目级 PR 流程检查
|
|
@@ -22,6 +22,10 @@ After executing this skill, you **must** immediately update task status in task.
|
|
|
22
22
|
|
|
23
23
|
Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
|
|
24
24
|
|
|
25
|
+
## Task id short ref
|
|
26
|
+
|
|
27
|
+
> If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
28
|
+
|
|
25
29
|
## Steps
|
|
26
30
|
|
|
27
31
|
### 1. Parse the User Description
|
|
@@ -126,6 +130,14 @@ Handle the result:
|
|
|
126
130
|
|
|
127
131
|
### 5. Verification Gate
|
|
128
132
|
|
|
133
|
+
**Allocate short id first** (writes `short_id` back to task.md and the registry entry; the validation gate will read it):
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
node .agents/scripts/task-short-id.js alloc "$task_id"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
If this fails (non-zero exit), follow the message — archive some active tasks or raise `task.shortIdLength` — and do NOT continue.
|
|
140
|
+
|
|
129
141
|
Run the verification gate to confirm the task artifact and sync state are valid:
|
|
130
142
|
|
|
131
143
|
```bash
|
|
@@ -210,6 +222,8 @@ Next step - run requirements analysis:
|
|
|
210
222
|
For later platform sync: after fixing auth / network / template issues, manually run the Issue creation flow in `.agents/rules/create-issue.md` for this task; or manually create/find an Issue and write `issue_number` into task.md so later skills can take over cascade sync.
|
|
211
223
|
```
|
|
212
224
|
|
|
225
|
+
|
|
226
|
+
|
|
213
227
|
## Completion Checklist
|
|
214
228
|
|
|
215
229
|
- [ ] Created the task file `.agents/workspace/active/{task-id}/task.md`
|
|
@@ -22,8 +22,11 @@ description: "根据自然语言描述创建任务"
|
|
|
22
22
|
|
|
23
23
|
版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## 任务入参短号别名
|
|
26
|
+
|
|
27
|
+
> 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
26
28
|
|
|
29
|
+
## 执行步骤
|
|
27
30
|
### 1. 解析用户描述
|
|
28
31
|
|
|
29
32
|
从自然语言描述中提取:
|
|
@@ -126,6 +129,14 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
126
129
|
|
|
127
130
|
### 5. 完成校验
|
|
128
131
|
|
|
132
|
+
**先调用短号分配**(保证 `short_id` 写回 task.md + 注册表 entry 已在;完成校验阶段会读取):
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
node .agents/scripts/task-short-id.js alloc "$task_id"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
如失败(退出码非 0),按提示「归档若干任务」或「调高 task.shortIdLength」处理;不要继续执行后续步骤。
|
|
139
|
+
|
|
129
140
|
运行完成校验,确认任务产物和同步状态符合规范:
|
|
130
141
|
|
|
131
142
|
```bash
|
|
@@ -210,6 +221,8 @@ Issue 创建失败:
|
|
|
210
221
|
后续如需平台同步:修复认证/网络/模板问题后,可按 `.agents/rules/create-issue.md` 对当前任务手动执行一次 Issue 创建;或手动创建/查找 Issue,并把 `issue_number` 写入 task.md,后续技能会接管级联同步。
|
|
211
222
|
```
|
|
212
223
|
|
|
224
|
+
|
|
225
|
+
|
|
213
226
|
## 完成检查清单
|
|
214
227
|
|
|
215
228
|
- [ ] 创建了任务文件 `.agents/workspace/active/{task-id}/task.md`
|
|
@@ -13,6 +13,10 @@ Import the specified Code Scanning (CodeQL) alert and create a remediation task.
|
|
|
13
13
|
- Do NOT auto-commit. Never execute `git commit` or `git add` automatically
|
|
14
14
|
- After executing this skill, you **must** immediately update task status in task.md
|
|
15
15
|
|
|
16
|
+
## Task id short ref
|
|
17
|
+
|
|
18
|
+
> If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
19
|
+
|
|
16
20
|
## Execution Flow
|
|
17
21
|
|
|
18
22
|
### 1. Retrieve Alert Information
|
|
@@ -58,6 +62,14 @@ Update task.md: `current_step` -> `requirement-analysis`.
|
|
|
58
62
|
|
|
59
63
|
### 4. Verification Gate
|
|
60
64
|
|
|
65
|
+
**Allocate short id first** (writes `short_id` back to task.md and the registry entry; the validation gate will read it):
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
node .agents/scripts/task-short-id.js alloc "$task_id"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
If this fails (non-zero exit), follow the message — archive some active tasks or raise `task.shortIdLength` — and do NOT continue.
|
|
72
|
+
|
|
61
73
|
Run the verification gate to confirm the task artifact and sync state are valid:
|
|
62
74
|
|
|
63
75
|
```bash
|
|
@@ -94,6 +106,8 @@ Next step:
|
|
|
94
106
|
- Codex CLI: $analyze-task {task-id}
|
|
95
107
|
```
|
|
96
108
|
|
|
109
|
+
|
|
110
|
+
|
|
97
111
|
## Completion Checklist
|
|
98
112
|
|
|
99
113
|
- [ ] Retrieved and recorded the key alert information
|
|
@@ -13,6 +13,10 @@ description: "导入 Code Scanning 告警并创建修复任务"
|
|
|
13
13
|
- 不要自动提交。绝不自动执行 `git commit` 或 `git add`
|
|
14
14
|
- 执行本技能后,你**必须**立即更新 task.md 中的任务状态
|
|
15
15
|
|
|
16
|
+
## 任务入参短号别名
|
|
17
|
+
|
|
18
|
+
> 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
19
|
+
|
|
16
20
|
## 执行流程
|
|
17
21
|
|
|
18
22
|
### 1. 获取告警信息
|
|
@@ -58,6 +62,14 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
58
62
|
|
|
59
63
|
### 4. 完成校验
|
|
60
64
|
|
|
65
|
+
**先调用短号分配**(保证 `short_id` 写回 task.md + 注册表 entry 已在;完成校验阶段会读取):
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
node .agents/scripts/task-short-id.js alloc "$task_id"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
如失败(退出码非 0),按提示「归档若干任务」或「调高 task.shortIdLength」处理;不要继续执行后续步骤。
|
|
72
|
+
|
|
61
73
|
运行完成校验,确认任务产物和同步状态符合规范:
|
|
62
74
|
|
|
63
75
|
```bash
|
|
@@ -94,6 +106,8 @@ Code Scanning 告警 #{alert-number} 已导入。
|
|
|
94
106
|
- Codex CLI:$analyze-task {task-id}
|
|
95
107
|
```
|
|
96
108
|
|
|
109
|
+
|
|
110
|
+
|
|
97
111
|
## 完成检查清单
|
|
98
112
|
|
|
99
113
|
- [ ] 获取并记录了告警关键信息
|
|
@@ -13,6 +13,10 @@ Import the specified Dependabot security alert and create a remediation task.
|
|
|
13
13
|
- Do NOT auto-commit. Never execute `git commit` or `git add` automatically
|
|
14
14
|
- After executing this skill, you **must** immediately update task status in task.md
|
|
15
15
|
|
|
16
|
+
## Task id short ref
|
|
17
|
+
|
|
18
|
+
> If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
19
|
+
|
|
16
20
|
## Execution Flow
|
|
17
21
|
|
|
18
22
|
### 1. Retrieve Alert Information
|
|
@@ -59,6 +63,14 @@ Update task.md: `current_step` -> `requirement-analysis`.
|
|
|
59
63
|
|
|
60
64
|
### 4. Verification Gate
|
|
61
65
|
|
|
66
|
+
**Allocate short id first** (writes `short_id` back to task.md and the registry entry; the validation gate will read it):
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
node .agents/scripts/task-short-id.js alloc "$task_id"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
If this fails (non-zero exit), follow the message — archive some active tasks or raise `task.shortIdLength` — and do NOT continue.
|
|
73
|
+
|
|
62
74
|
Run the verification gate to confirm the task artifact and sync state are valid:
|
|
63
75
|
|
|
64
76
|
```bash
|
|
@@ -98,6 +110,8 @@ Next step:
|
|
|
98
110
|
- Codex CLI: $analyze-task {task-id}
|
|
99
111
|
```
|
|
100
112
|
|
|
113
|
+
|
|
114
|
+
|
|
101
115
|
## Completion Checklist
|
|
102
116
|
|
|
103
117
|
- [ ] Retrieved and recorded the key alert information
|
|
@@ -13,6 +13,10 @@ description: "导入 Dependabot 安全告警并创建修复任务"
|
|
|
13
13
|
- 不要自动提交。绝不自动执行 `git commit` 或 `git add`
|
|
14
14
|
- 执行本技能后,你**必须**立即更新 task.md 中的任务状态
|
|
15
15
|
|
|
16
|
+
## 任务入参短号别名
|
|
17
|
+
|
|
18
|
+
> 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
19
|
+
|
|
16
20
|
## 执行流程
|
|
17
21
|
|
|
18
22
|
### 1. 获取告警信息
|
|
@@ -59,6 +63,14 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
59
63
|
|
|
60
64
|
### 4. 完成校验
|
|
61
65
|
|
|
66
|
+
**先调用短号分配**(保证 `short_id` 写回 task.md + 注册表 entry 已在;完成校验阶段会读取):
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
node .agents/scripts/task-short-id.js alloc "$task_id"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
如失败(退出码非 0),按提示「归档若干任务」或「调高 task.shortIdLength」处理;不要继续执行后续步骤。
|
|
73
|
+
|
|
62
74
|
运行完成校验,确认任务产物和同步状态符合规范:
|
|
63
75
|
|
|
64
76
|
```bash
|
|
@@ -98,6 +110,8 @@ node .agents/scripts/validate-artifact.js gate import-dependabot .agents/workspa
|
|
|
98
110
|
- Codex CLI:$analyze-task {task-id}
|
|
99
111
|
```
|
|
100
112
|
|
|
113
|
+
|
|
114
|
+
|
|
101
115
|
## 完成检查清单
|
|
102
116
|
|
|
103
117
|
- [ ] 获取并记录了告警关键信息
|