@fitlab-ai/agent-infra 0.7.6 → 0.7.7
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 +11 -3
- package/dist/bin/cli.js +10 -3
- package/dist/lib/sandbox/commands/ls.js +4 -33
- package/dist/lib/sandbox/commands/show.js +67 -0
- package/dist/lib/sandbox/index.js +7 -0
- package/dist/lib/task/commands/issue-body.js +94 -0
- package/dist/lib/task/commands/log.js +92 -9
- package/dist/lib/task/index.js +8 -0
- package/dist/lib/task/issue-form.js +66 -0
- package/dist/lib/task/sections.js +44 -0
- package/lib/sandbox/commands/ls.ts +4 -36
- package/lib/sandbox/commands/show.ts +80 -0
- package/lib/sandbox/index.ts +7 -0
- package/lib/task/commands/issue-body.ts +102 -0
- package/lib/task/commands/log.ts +96 -9
- package/lib/task/index.ts +8 -0
- package/lib/task/issue-form.ts +77 -0
- package/lib/task/sections.ts +44 -0
- package/package.json +3 -2
- package/templates/.agents/README.en.md +3 -1
- package/templates/.agents/README.zh-CN.md +3 -1
- package/templates/.agents/rules/create-issue.github.en.md +20 -29
- package/templates/.agents/rules/create-issue.github.zh-CN.md +20 -29
- package/templates/.agents/rules/issue-pr-commands.github.en.md +6 -0
- package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +6 -0
- package/templates/.agents/rules/next-step-output.en.md +26 -1
- package/templates/.agents/rules/next-step-output.zh-CN.md +26 -1
- package/templates/.agents/rules/task-management.en.md +2 -0
- package/templates/.agents/rules/task-management.zh-CN.md +2 -0
- package/templates/.agents/skills/analyze-task/SKILL.en.md +3 -1
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/archive-tasks/SKILL.en.md +3 -1
- package/templates/.agents/skills/archive-tasks/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/block-task/SKILL.en.md +3 -1
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/cancel-task/SKILL.en.md +3 -1
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/check-task/SKILL.en.md +30 -81
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +30 -80
- package/templates/.agents/skills/close-codescan/SKILL.en.md +3 -1
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/close-dependabot/SKILL.en.md +3 -1
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/code-task/SKILL.en.md +3 -1
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/code-task/reference/dual-mode.en.md +7 -2
- package/templates/.agents/skills/code-task/reference/dual-mode.zh-CN.md +7 -2
- package/templates/.agents/skills/code-task/scripts/detect-mode.js +6 -14
- package/templates/.agents/skills/commit/SKILL.en.md +27 -5
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +27 -5
- package/templates/.agents/skills/complete-task/SKILL.en.md +3 -1
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/create-pr/SKILL.en.md +3 -1
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/create-release-note/SKILL.en.md +3 -1
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/create-task/SKILL.en.md +3 -1
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/import-codescan/SKILL.en.md +3 -1
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/import-dependabot/SKILL.en.md +3 -1
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/import-issue/SKILL.en.md +19 -2
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +19 -2
- package/templates/.agents/skills/init-labels/SKILL.en.md +3 -1
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/init-milestones/SKILL.en.md +3 -1
- package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/plan-task/SKILL.en.md +3 -1
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/post-release/SKILL.en.md +3 -1
- package/templates/.agents/skills/post-release/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/refine-title/SKILL.en.md +3 -1
- package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/release/SKILL.en.md +3 -1
- package/templates/.agents/skills/release/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/restore-task/SKILL.en.md +3 -1
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/review-analysis/SKILL.en.md +6 -2
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +6 -2
- package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +1 -1
- package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +1 -1
- package/templates/.agents/skills/review-analysis/reference/report-template.en.md +1 -1
- package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +1 -2
- package/templates/.agents/skills/review-code/SKILL.en.md +5 -2
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +5 -2
- package/templates/.agents/skills/review-code/reference/output-templates.en.md +1 -1
- package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +1 -1
- package/templates/.agents/skills/review-code/reference/report-template.en.md +1 -1
- package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +1 -2
- package/templates/.agents/skills/review-plan/SKILL.en.md +6 -2
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +6 -2
- package/templates/.agents/skills/review-plan/reference/output-templates.en.md +1 -1
- package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +1 -1
- package/templates/.agents/skills/review-plan/reference/report-template.en.md +1 -1
- package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +1 -2
- package/templates/.agents/skills/test/SKILL.en.md +3 -1
- package/templates/.agents/skills/test/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/test-integration/SKILL.en.md +3 -1
- package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/update-agent-infra/SKILL.en.md +3 -1
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/upgrade-dependency/SKILL.en.md +3 -1
- package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/watch-pr/SKILL.en.md +3 -1
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +3 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: close-dependabot
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Close a Dependabot alert with a documented reason.
|
|
5
|
+
Use when a Dependabot alert has been handled or dismissed and needs closing with a reason.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Dismiss Dependabot Alert
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-task
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Implement code from the technical plan and output a report.
|
|
5
|
+
Use when an approved technical plan needs implementing, or code review found issues to fix.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Code Task
|
|
@@ -10,7 +10,7 @@ node .agents/skills/code-task/scripts/detect-mode.js .agents/workspace/active/{t
|
|
|
10
10
|
|
|
11
11
|
The script scans `plan.md` / `plan-r{N}.md`, `review-plan.md` / `review-plan-r{N}.md`, `code.md` / `code-r{N}.md`, and `review-code.md` / `review-code-r{N}.md` in the task directory.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Seven Branches
|
|
14
14
|
|
|
15
15
|
> Branches are evaluated top-down in this table; the first match returns and skips later rows.
|
|
16
16
|
|
|
@@ -19,12 +19,17 @@ The script scans `plan.md` / `plan-r{N}.md`, `review-plan.md` / `review-plan-r{N
|
|
|
19
19
|
| no code artifact | `init` | 0 | initial implementation, output `code.md` |
|
|
20
20
|
| latest review-plan is approved (`Approved` or `Approved-with-issues`, i.e. `Overall Verdict: Approved` regardless of findings counts), its "Review Input" / "审查输入" entry names the same plan file as the latest `plan(-r{N})?.md` in the task directory, and its mtime is newer than the latest code artifact | `init` | 0 | plan has been approved after the latest code; enter a new implementation round, `next_round = code_max + 1`, `next_artifact = code-r{next_round}.md`. This branch fires regardless of whether review-code exists or passes. Plan and review-plan rounds are independent counters (e.g. `plan-r5` may be approved by `review-plan-r4`); the link is established via the review-plan's "Review Input" entry, not by matching round numbers. |
|
|
21
21
|
| `rev_max < code_max` | `error` | 2 | latest code round is unreviewed; run `review-code` first |
|
|
22
|
-
| `rev_max > code_max` | `error` | 2 | inconsistent state; manual inspection required |
|
|
23
22
|
| latest review-code is Approved with 0/0/0 | `refused` | 1 | already approved; do not run `code-task` again |
|
|
24
23
|
| latest review-code is Approved with major/minor findings | `fix` | 0 | optional fix mode |
|
|
25
24
|
| latest review-code is Changes Requested | `fix` | 0 | required fix mode |
|
|
26
25
|
| latest review-code is Rejected | `refused` | 1 | re-plan instead of local fixing |
|
|
27
26
|
|
|
27
|
+
> The four verdict branches above fire when `rev_max >= code_max`, decided by the latest `review-code-r{rev_max}` verdict:
|
|
28
|
+
> - `rev_max == code_max`: AI fix round (`review-code` reviews the same-numbered code artifact produced by `code-task`).
|
|
29
|
+
> - `rev_max > code_max`: human-supplemented review round — after a PR is opened a maintainer appends a `review-code-r{N}` round against the existing latest code. `fix` mode then uses `next_round = code_max + 1`.
|
|
30
|
+
>
|
|
31
|
+
> If the latest `review-code` verdict cannot be parsed, the script still returns `error` (exit 2) as the retained anomaly guard.
|
|
32
|
+
|
|
28
33
|
## Verdict Parsing
|
|
29
34
|
|
|
30
35
|
The script supports zh-CN and English review-code reports:
|
|
@@ -10,7 +10,7 @@ node .agents/skills/code-task/scripts/detect-mode.js .agents/workspace/active/{t
|
|
|
10
10
|
|
|
11
11
|
脚本扫描任务目录中的 `plan.md` / `plan-r{N}.md`、`review-plan.md` / `review-plan-r{N}.md`、`code.md` / `code-r{N}.md` 和 `review-code.md` / `review-code-r{N}.md`。
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## 7 个分支
|
|
14
14
|
|
|
15
15
|
> 分支按表中自上而下的顺序评估,命中即返回;后续分支不再判定。
|
|
16
16
|
|
|
@@ -19,12 +19,17 @@ node .agents/skills/code-task/scripts/detect-mode.js .agents/workspace/active/{t
|
|
|
19
19
|
| 无 code 产物 | `init` | 0 | 初次实现,产物为 `code.md` |
|
|
20
20
|
| 最新 review-plan 已批准(`通过` 或 `通过 + major/minor 建议`,即 `Approved` 或 `Approved-with-issues`),且其「审查输入」/「Review Input」字段引用的 plan 文件 == 任务目录中最新的 `plan(-r{N})?.md`,且最新 review-plan 的 mtime > 最新 code 的 mtime | `init` | 0 | plan 已在 code 之后被批准;进入新一轮实现,`next_round = code_max + 1`、`next_artifact = code-r{next_round}.md`。**不论 review-code 是否已审**,本分支均先命中。plan 与 review-plan 的轮次独立递增(如 `plan-r5` 可被 `review-plan-r4` 批准),通过 review-plan 的「审查输入」字段建立批准关系,不要求同号 |
|
|
21
21
|
| `rev_max < code_max` | `error` | 2 | 最新代码未审查,先运行 `review-code` |
|
|
22
|
-
| `rev_max > code_max` | `error` | 2 | 数据状态异常,需要人工检查 |
|
|
23
22
|
| 最新 review-code 为 Approved 且 0/0/0 | `refused` | 1 | 已通过,无需再次运行 `code-task` |
|
|
24
23
|
| 最新 review-code 为 Approved 但有 major/minor | `fix` | 0 | 可选修复模式 |
|
|
25
24
|
| 最新 review-code 为 Changes Requested | `fix` | 0 | 必需修复模式 |
|
|
26
25
|
| 最新 review-code 为 Rejected | `refused` | 1 | 需要重新设计,不进入局部修复 |
|
|
27
26
|
|
|
27
|
+
> 上表 4 个 verdict 分支在 `rev_max >= code_max` 时命中,均以最新 `review-code-r{rev_max}` 的结论决定:
|
|
28
|
+
> - `rev_max == code_max`:AI 修复轮(`code-task` 产出代码后由 `review-code` 审查同号产物)。
|
|
29
|
+
> - `rev_max > code_max`:人工补审轮——PR 创建后维护者追加一轮 `review-code-r{N}` 审查既有最新代码。此时 `fix` 模式的 `next_round = code_max + 1`。
|
|
30
|
+
>
|
|
31
|
+
> 若最新 `review-code` 的 verdict 无法解析,仍返回 `error`(exit 2),作为保留的异常拦截。
|
|
32
|
+
|
|
28
33
|
## verdict 解析
|
|
29
34
|
|
|
30
35
|
脚本支持中文和英文 review-code 报告:
|
|
@@ -84,20 +84,12 @@ function main() {
|
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
next_round: null,
|
|
94
|
-
next_artifact: null,
|
|
95
|
-
review_artifact: artifactName("review-code", revMax),
|
|
96
|
-
message: `Inconsistent state: review-code round ${revMax} > code round ${codeMax}. Manual inspection required.`
|
|
97
|
-
}, 2);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
87
|
+
// human-supplemented review: after a PR is opened, a maintainer may append a
|
|
88
|
+
// review-code-r{N} round against the existing latest code, so rev_max > code_max.
|
|
89
|
+
// This is NOT corruption — defer to the latest review's verdict instead of erroring.
|
|
90
|
+
// rev_max === code_max (AI fix round) and rev_max > code_max (human review round)
|
|
91
|
+
// both fall through to the verdict dispatch below; fix mode uses next_round = code_max + 1.
|
|
92
|
+
// An unparsable verdict still returns error (exit 2) as the retained anomaly guard.
|
|
101
93
|
const reviewArtifact = artifactName("review-code", revMax);
|
|
102
94
|
const verdictResult = parseVerdict(path.join(resolvedTaskDir, reviewArtifact));
|
|
103
95
|
if (!verdictResult.ok) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: commit
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Commit the current changes to Git.
|
|
5
|
+
Use when finished work needs to be turned into a Git commit.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Commit Changes
|
|
@@ -64,7 +66,27 @@ If this commit is associated with a task and a `review-code` artifact exists, re
|
|
|
64
66
|
- After committing, write `last_reviewed_commit: <new_head>` to task.md frontmatter only when `pre_head == R` and `S == F`; otherwise do not advance that field
|
|
65
67
|
- Do not scan backward to earlier Approved artifacts; the highest-round `review-code` artifact is the only authoritative source
|
|
66
68
|
|
|
67
|
-
## 5.
|
|
69
|
+
## 5. Push to the Existing PR When Applicable
|
|
70
|
+
|
|
71
|
+
After the commit is created, if the current branch already has an open Pull Request, push the new commit so the PR updates automatically. Otherwise keep the current behavior (the first push is still handled by `create-pr`). This is the push wrap-up of a user-initiated `commit`: it adds no extra commit and never pushes when there is no PR; it applies whether or not a task is associated.
|
|
72
|
+
|
|
73
|
+
> Detect whether the current branch has an open PR — and authenticate to the platform — per `.agents/rules/issue-pr-commands.md`; if that rule is unavailable or detection fails, follow the degradation below.
|
|
74
|
+
|
|
75
|
+
a. Detect whether the current branch (head) has an open PR per `.agents/rules/issue-pr-commands.md`.
|
|
76
|
+
|
|
77
|
+
b. On an open PR -> push the current branch:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
git push
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
c. Safe degradation (never block an already completed `git commit`; only warn the user):
|
|
84
|
+
- Platform unavailable / unauthenticated / detection failed / no open PR -> do not push; continue.
|
|
85
|
+
- `git push` fails (needs `git pull --rebase`, no upstream, network error) -> keep the local commit and tell the user to push manually.
|
|
86
|
+
|
|
87
|
+
Fold the push outcome (pushed / skipped(no PR) / failed) into the next step's "Update Task Status" Activity Log note or user output.
|
|
88
|
+
|
|
89
|
+
## 6. Update Task Status When Applicable
|
|
68
90
|
|
|
69
91
|
Get the current time:
|
|
70
92
|
|
|
@@ -81,7 +103,7 @@ Append the Commit Activity Log entry and choose exactly one next-step case:
|
|
|
81
103
|
- more work remains -> update task.md and stop
|
|
82
104
|
- ready for review -> `review-code {task-id}`
|
|
83
105
|
|
|
84
|
-
##
|
|
106
|
+
## 7. Sync Issue Metadata When Applicable
|
|
85
107
|
|
|
86
108
|
When `{task-id}` exists and task.md contains a valid `issue_number`, sync the linked Issue `in:` labels and requirement checkboxes. Otherwise, skip this step.
|
|
87
109
|
|
|
@@ -91,7 +113,7 @@ When `{task-id}` exists and task.md contains a valid `issue_number`, sync the li
|
|
|
91
113
|
|
|
92
114
|
Failure handling matches "Update Task Status When Applicable": warn, but do **not** block an already completed `git commit`.
|
|
93
115
|
|
|
94
|
-
##
|
|
116
|
+
## 8. Sync PR Summary When Applicable
|
|
95
117
|
|
|
96
118
|
When `{task-id}` exists and task.md contains a valid `pr_number`, refresh the PR summary comment marked with the PR summary marker defined in `.agents/rules/pr-sync.md` on the PR. Otherwise, skip this step.
|
|
97
119
|
|
|
@@ -101,7 +123,7 @@ When `{task-id}` exists and task.md contains a valid `pr_number`, refresh the PR
|
|
|
101
123
|
|
|
102
124
|
Failure handling matches "Update Task Status When Applicable": warn, but do **not** block an already completed `git commit`.
|
|
103
125
|
|
|
104
|
-
##
|
|
126
|
+
## 9. Verification Gate
|
|
105
127
|
|
|
106
128
|
If this operation is associated with `{task-id}`, run the verification gate to confirm task metadata and sync state. If there is no task context, skip this step.
|
|
107
129
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: commit
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
提交当前变更到 Git。
|
|
5
|
+
当需要把已完成的工作落为一次 Git 提交时使用。
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# 提交代码
|
|
@@ -64,7 +66,27 @@ git diff
|
|
|
64
66
|
- 提交后仅当 `pre_head == R` 且 `S == F` 时,在 task.md frontmatter 写入 `last_reviewed_commit: <new_head>`;否则不推进该字段
|
|
65
67
|
- 不向后扫描更早的 Approved 产物;最高轮 `review-code` 产物是唯一权威来源
|
|
66
68
|
|
|
67
|
-
## 5.
|
|
69
|
+
## 5. 推送到已有 PR(按需)
|
|
70
|
+
|
|
71
|
+
提交完成后,如果当前分支已存在开放的 Pull Request,则把本次提交推送上去让 PR 自动更新;否则保持现状(首次推送仍由 `create-pr` 负责)。本步骤是用户已发起 `commit` 的推送收尾,不新增自动提交,也不在无 PR 时推送;与是否关联任务无关。
|
|
72
|
+
|
|
73
|
+
> 检测当前分支是否有开放 PR、以及平台认证,统一按 `.agents/rules/issue-pr-commands.md` 执行;该规则不可用或检测失败时,按下方降级处理。
|
|
74
|
+
|
|
75
|
+
a. 按 `.agents/rules/issue-pr-commands.md` 检测当前分支(head)是否存在开放 PR。
|
|
76
|
+
|
|
77
|
+
b. 命中开放 PR -> 推送当前分支:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
git push
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
c. 安全降级(不阻塞已完成的 `git commit`,仅提示用户):
|
|
84
|
+
- 平台不可用 / 未认证 / 检测失败 / 未命中开放 PR -> 不推送,继续后续步骤。
|
|
85
|
+
- `git push` 失败(如需 `git pull --rebase`、无 upstream、网络异常)-> 保留本地提交,提示用户手动推送。
|
|
86
|
+
|
|
87
|
+
把推送结果(pushed / skipped(no PR) / failed)并入下一步「更新任务状态」的 Activity Log 说明或用户输出。
|
|
88
|
+
|
|
89
|
+
## 6. 按需更新任务状态
|
|
68
90
|
|
|
69
91
|
获取当前时间:
|
|
70
92
|
|
|
@@ -81,7 +103,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
81
103
|
- 还有后续工作 -> 更新 task.md 后停止
|
|
82
104
|
- 准备审查 -> `review-code {task-id}`
|
|
83
105
|
|
|
84
|
-
##
|
|
106
|
+
## 7. 同步 Issue 元数据(按需)
|
|
85
107
|
|
|
86
108
|
当 `{task-id}` 存在且 task.md 包含有效 `issue_number` 时,同步 `in:` label 和需求复选框到关联 Issue;否则跳过。
|
|
87
109
|
|
|
@@ -91,7 +113,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
91
113
|
|
|
92
114
|
失败处理与「按需更新任务状态」一致:警告但**不**阻塞已完成的 `git commit`。
|
|
93
115
|
|
|
94
|
-
##
|
|
116
|
+
## 8. 同步 PR 摘要(按需)
|
|
95
117
|
|
|
96
118
|
当 `{task-id}` 存在且 task.md 包含有效 `pr_number` 时,刷新 PR 上由 `.agents/rules/pr-sync.md` 中定义的 PR 摘要评论标记对应的摘要评论;否则跳过。
|
|
97
119
|
|
|
@@ -101,7 +123,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
101
123
|
|
|
102
124
|
失败处理与「按需更新任务状态」一致:警告但**不**阻塞已完成的 `git commit`。
|
|
103
125
|
|
|
104
|
-
##
|
|
126
|
+
## 9. 完成校验
|
|
105
127
|
|
|
106
128
|
如果本次操作关联了 `{task-id}`,运行完成校验,确认任务元数据和同步状态符合规范;如果没有任务上下文,跳过本步骤。
|
|
107
129
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: create-release-note
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Generate release notes from PRs and commits.
|
|
5
|
+
Use when preparing a release and you need notes compiled from PRs and commits.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Create Release Notes
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: import-codescan
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Import a Code Scanning alert and create a remediation task.
|
|
5
|
+
Use when a Code Scanning alert needs to become a tracked remediation task.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Import Code Scanning Alert
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: import-dependabot
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Import a Dependabot alert and create a remediation task.
|
|
5
|
+
Use when a Dependabot alert needs to become a tracked remediation task.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Import Dependabot Security Alert
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: import-issue
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Import an Issue and create a task.
|
|
5
|
+
Use when you want to start work from an existing Issue and track it locally.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Import Issue
|
|
@@ -40,7 +42,22 @@ This skill **creates** task.md, so there is no file to write at the start. Captu
|
|
|
40
42
|
Read `.agents/rules/issue-pr-commands.md` first, follow its prerequisite steps to complete authentication and code-hosting platform detection, then load the Issue data with its "Read an Issue" command.
|
|
41
43
|
|
|
42
44
|
Extract: issue number, title, description, and labels.
|
|
43
|
-
|
|
45
|
+
|
|
46
|
+
Derive the task title from the Issue title by stripping an optional single leading Conventional Commits prefix, following the contract below; preserve the rest of the description verbatim and in its original language. This fenced contract is the authoritative, language-neutral rule — keep it byte-for-byte identical across every `import-issue` variant:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
# title-derivation-contract
|
|
50
|
+
strip-prefix: type(scope):
|
|
51
|
+
prefix-types: feat fix docs style refactor perf test build ci chore revert
|
|
52
|
+
single-layer-only: true
|
|
53
|
+
preserve-body-colon: true
|
|
54
|
+
keep-when-no-prefix: true
|
|
55
|
+
example-strip: "feat(meta): create-pr summary" => "create-pr summary"
|
|
56
|
+
example-keep: "修复某问题" => "修复某问题"
|
|
57
|
+
example-single-layer: "feat: add A: B" => "add A: B"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Strip only the first layer, and only when the leading token is a `prefix-types` value optionally followed by `(scope)` and a `!`, then `:` and at least one space; a colon inside the description is never a prefix.
|
|
44
61
|
|
|
45
62
|
### 2. Check for an Existing Task
|
|
46
63
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: import-issue
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
从 Issue 导入并创建任务。
|
|
5
|
+
当想从既有 Issue 开工并在本地跟踪时使用。
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# 导入 Issue
|
|
@@ -40,7 +42,22 @@ description: "从 Issue 导入并创建任务"
|
|
|
40
42
|
执行前先读取 `.agents/rules/issue-pr-commands.md`,并按其中的前置步骤完成认证和代码托管平台检测;随后按其中的 “读取 Issue” 命令获取 Issue 信息。
|
|
41
43
|
|
|
42
44
|
提取:issue 编号、标题、描述、标签。
|
|
43
|
-
|
|
45
|
+
|
|
46
|
+
从 Issue 标题派生任务标题:按下方契约剥掉可选的单层前导 Conventional Commits 前缀,其余描述原文与原始语言保持不变。下方 fenced 契约是权威的、与语言无关的规则——在所有 `import-issue` 变体中保持逐字节一致:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
# title-derivation-contract
|
|
50
|
+
strip-prefix: type(scope):
|
|
51
|
+
prefix-types: feat fix docs style refactor perf test build ci chore revert
|
|
52
|
+
single-layer-only: true
|
|
53
|
+
preserve-body-colon: true
|
|
54
|
+
keep-when-no-prefix: true
|
|
55
|
+
example-strip: "feat(meta): create-pr summary" => "create-pr summary"
|
|
56
|
+
example-keep: "修复某问题" => "修复某问题"
|
|
57
|
+
example-single-layer: "feat: add A: B" => "add A: B"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
只剥第一层前缀,且仅当前导 token 是 `prefix-types` 之一、其后可带 `(scope)` 与 `!`,再接 `:` 和至少一个空格;描述正文中的冒号永远不算前缀。
|
|
44
61
|
|
|
45
62
|
### 2. 检查已有任务
|
|
46
63
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: init-labels
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Initialize the repository's standard labels taxonomy.
|
|
5
|
+
Use when setting up a repository and you need the standard label taxonomy created.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Initialize labels
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: init-milestones
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Initialize the repository's standard milestones taxonomy.
|
|
5
|
+
Use when setting up a repository and you need the standard milestone taxonomy created.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Initialize milestones
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: refine-title
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Rewrite an Issue or PR title in Conventional Commits format.
|
|
5
|
+
Use when an Issue or PR title needs rewriting into Conventional Commits format.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Refine Title
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: restore-task
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Restore local task files from platform Issue comments.
|
|
5
|
+
Use when local task files are missing and need rebuilding from platform Issue comments.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Restore Task
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review-analysis
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Review the requirement analysis artifact.
|
|
5
|
+
Use when a requirements analysis needs an independent review before planning.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Requirement Analysis Review
|
|
@@ -52,7 +54,7 @@ Record `{analysis-artifact}`, `{review-round}`, and `{review-artifact}` (`review
|
|
|
52
54
|
|
|
53
55
|
### 3. Read Analysis Context
|
|
54
56
|
|
|
55
|
-
Read `{analysis-artifact}`, `task.md`, and Issue context when available.
|
|
57
|
+
Read `{analysis-artifact}`, `task.md`, and Issue context when available. After reading, record the actually reviewed highest-round analysis artifact by filename in the report's `Review Input` field; leave it blank when it cannot be reliably determined—do not fabricate.
|
|
56
58
|
|
|
57
59
|
### 4. Perform Review
|
|
58
60
|
|
|
@@ -77,6 +79,8 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
77
79
|
Set `current_step` to `requirement-analysis-review`, refresh task metadata, and append:
|
|
78
80
|
`- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Analysis (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {review-artifact}`
|
|
79
81
|
|
|
82
|
+
`env-blocked` is the data source for the `Manual-verify` count folded into review rows in `ai task log`; do not add a parallel manual-verification field.
|
|
83
|
+
|
|
80
84
|
If task.md has a valid `issue_number`, read `.agents/rules/issue-sync.md`, sync the task comment, and publish the `{review-artifact}` comment.
|
|
81
85
|
|
|
82
86
|
### 7. Run Completion Gate
|