@fitlab-ai/agent-infra 0.5.7 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +1 -1
  2. package/README.zh-CN.md +1 -1
  3. package/lib/defaults.json +4 -2
  4. package/lib/init.js +18 -1
  5. package/lib/sandbox/engine.js +19 -0
  6. package/lib/sandbox/shell.js +36 -2
  7. package/lib/update.js +14 -3
  8. package/package.json +4 -4
  9. package/templates/.agents/QUICKSTART.en.md +2 -2
  10. package/templates/.agents/QUICKSTART.zh-CN.md +2 -2
  11. package/templates/.agents/README.en.md +1 -1
  12. package/templates/.agents/README.zh-CN.md +1 -1
  13. package/templates/.agents/rules/issue-pr-commands.github.en.md +60 -0
  14. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +60 -0
  15. package/templates/.agents/rules/issue-sync.en.md +14 -0
  16. package/templates/.agents/rules/issue-sync.github.en.md +14 -0
  17. package/templates/.agents/rules/issue-sync.github.zh-CN.md +14 -0
  18. package/templates/.agents/rules/issue-sync.zh-CN.md +14 -0
  19. package/templates/.agents/rules/label-milestone-setup.github.en.md +10 -0
  20. package/templates/.agents/rules/label-milestone-setup.github.zh-CN.md +10 -0
  21. package/templates/.agents/rules/release-commands.github.en.md +16 -0
  22. package/templates/.agents/rules/release-commands.github.zh-CN.md +16 -0
  23. package/templates/.agents/scripts/platform-adapters/find-existing-task.github.js +272 -0
  24. package/templates/.agents/scripts/platform-adapters/find-existing-task.js +5 -0
  25. package/templates/.agents/scripts/platform-adapters/platform-sync.github.js +88 -8
  26. package/templates/.agents/scripts/platform-adapters/platform-sync.js +7 -0
  27. package/templates/.agents/skills/analyze-task/SKILL.en.md +3 -3
  28. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -3
  29. package/templates/.agents/skills/analyze-task/config/verify.json +3 -1
  30. package/templates/.agents/skills/block-task/config/verify.json +2 -1
  31. package/templates/.agents/skills/cancel-task/SKILL.en.md +2 -2
  32. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
  33. package/templates/.agents/skills/cancel-task/config/verify.json +2 -1
  34. package/templates/.agents/skills/close-codescan/SKILL.en.md +2 -2
  35. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +2 -2
  36. package/templates/.agents/skills/commit/SKILL.en.md +1 -1
  37. package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
  38. package/templates/.agents/skills/commit/config/verify.json +2 -1
  39. package/templates/.agents/skills/complete-task/SKILL.en.md +1 -1
  40. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +1 -1
  41. package/templates/.agents/skills/complete-task/config/verify.json +2 -1
  42. package/templates/.agents/skills/create-issue/SKILL.en.md +8 -8
  43. package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +8 -8
  44. package/templates/.agents/skills/create-issue/config/verify.json +2 -1
  45. package/templates/.agents/skills/create-issue/reference/label-and-type.en.md +3 -3
  46. package/templates/.agents/skills/create-issue/reference/label-and-type.zh-CN.md +3 -3
  47. package/templates/.agents/skills/create-issue/reference/template-matching.en.md +6 -34
  48. package/templates/.agents/skills/create-issue/reference/template-matching.zh-CN.md +8 -36
  49. package/templates/.agents/skills/create-pr/SKILL.en.md +2 -2
  50. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +2 -2
  51. package/templates/.agents/skills/create-pr/config/verify.json +2 -1
  52. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +7 -17
  53. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +27 -37
  54. package/templates/.agents/skills/create-release-note/SKILL.en.md +9 -9
  55. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +9 -9
  56. package/templates/.agents/skills/create-task/SKILL.en.md +3 -3
  57. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +3 -3
  58. package/templates/.agents/skills/implement-task/SKILL.en.md +1 -1
  59. package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +1 -1
  60. package/templates/.agents/skills/implement-task/config/verify.json +3 -1
  61. package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
  62. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  63. package/templates/.agents/skills/import-issue/SKILL.en.md +39 -9
  64. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +39 -9
  65. package/templates/.agents/skills/init-labels/SKILL.en.md +9 -9
  66. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +9 -9
  67. package/templates/.agents/skills/init-milestones/SKILL.en.md +7 -7
  68. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +7 -7
  69. package/templates/.agents/skills/plan-task/SKILL.en.md +1 -1
  70. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +1 -1
  71. package/templates/.agents/skills/plan-task/config/verify.json +3 -1
  72. package/templates/.agents/skills/refine-task/SKILL.en.md +1 -1
  73. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +1 -1
  74. package/templates/.agents/skills/refine-task/config/verify.json +3 -1
  75. package/templates/.agents/skills/restore-task/SKILL.en.md +13 -64
  76. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +13 -64
  77. package/templates/.agents/skills/review-task/SKILL.en.md +1 -1
  78. package/templates/.agents/skills/review-task/SKILL.zh-CN.md +1 -1
  79. package/templates/.agents/skills/review-task/config/verify.json +3 -1
  80. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +2 -0
  81. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +2 -0
  82. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +56 -5
  83. package/templates/.claude/commands/create-issue.en.md +1 -1
  84. package/templates/.claude/commands/create-issue.zh-CN.md +1 -1
  85. package/templates/.claude/commands/import-issue.en.md +1 -1
  86. package/templates/.claude/commands/import-issue.zh-CN.md +1 -1
  87. package/templates/.claude/commands/init-labels.en.md +1 -1
  88. package/templates/.claude/commands/init-labels.zh-CN.md +1 -1
  89. package/templates/.claude/commands/init-milestones.en.md +1 -1
  90. package/templates/.claude/commands/init-milestones.zh-CN.md +1 -1
  91. package/templates/.claude/commands/restore-task.en.md +1 -1
  92. package/templates/.claude/commands/restore-task.zh-CN.md +1 -1
  93. package/templates/.claude/hooks/check-version-format.sh +1 -1
  94. package/templates/.gemini/commands/_project_/create-issue.en.toml +1 -1
  95. package/templates/.gemini/commands/_project_/create-issue.zh-CN.toml +1 -1
  96. package/templates/.gemini/commands/_project_/import-issue.en.toml +1 -1
  97. package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +1 -1
  98. package/templates/.gemini/commands/_project_/init-labels.en.toml +2 -2
  99. package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +2 -2
  100. package/templates/.gemini/commands/_project_/init-milestones.en.toml +2 -2
  101. package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +2 -2
  102. package/templates/.gemini/commands/_project_/restore-task.en.toml +1 -1
  103. package/templates/.gemini/commands/_project_/restore-task.zh-CN.toml +1 -1
  104. package/templates/{.github/hooks → .git-hooks}/check-version-format.sh +2 -2
  105. package/templates/.github/workflows/pr-label.yml +1 -1
  106. package/templates/.opencode/commands/create-issue.en.md +1 -1
  107. package/templates/.opencode/commands/create-issue.zh-CN.md +1 -1
  108. package/templates/.opencode/commands/import-issue.en.md +1 -1
  109. package/templates/.opencode/commands/import-issue.zh-CN.md +1 -1
  110. package/templates/.opencode/commands/init-labels.en.md +1 -1
  111. package/templates/.opencode/commands/init-labels.zh-CN.md +1 -1
  112. package/templates/.opencode/commands/init-milestones.en.md +1 -1
  113. package/templates/.opencode/commands/init-milestones.zh-CN.md +1 -1
  114. package/templates/.opencode/commands/restore-task.en.md +1 -1
  115. package/templates/.opencode/commands/restore-task.zh-CN.md +1 -1
  116. /package/templates/{.github/hooks → .git-hooks}/pre-commit +0 -0
@@ -1,18 +1,18 @@
1
1
  ---
2
2
  name: create-issue
3
- description: "Create a GitHub Issue from a task file"
3
+ description: "Create an Issue from a task file"
4
4
  ---
5
5
 
6
6
  # Create Issue
7
7
 
8
- Create the base GitHub Issue from `task.md` and write `issue_number` back to the task.
8
+ Create the base Issue from `task.md` and write `issue_number` back to the task.
9
9
 
10
10
  ## Boundary / Critical Rules
11
11
 
12
12
  - Build the Issue title and body from `task.md` only
13
13
  - Issue title format: `type(scope): description` - map `type` from task.md (`feature` -> `feat`, `bugfix` -> `fix`, `refactor` -> `refactor`, `docs` -> `docs`, `chore` -> `chore`), infer scope from the affected module (omit it if unclear), and use the task title from task.md verbatim for the description (do not translate or rewrite)
14
14
  - Do not read `analysis.md`, `plan.md`, `implementation.md`, or review artifacts
15
- - The only durable outputs are the GitHub Issue and the `issue_number` update in task.md
15
+ - The only durable outputs are the Issue and the `issue_number` update in task.md
16
16
  - After executing this skill, you **must** immediately update task.md
17
17
 
18
18
  ## Steps
@@ -31,7 +31,7 @@ Extract the title, `## Description`, `## Requirements`, `type`, and `milestone`
31
31
 
32
32
  ### 3. Build Issue Content
33
33
 
34
- Detect `.github/ISSUE_TEMPLATE` files and decide whether to use a matched template path or the fallback path.
34
+ Detect Issue templates through `.agents/rules/issue-pr-commands.md` and decide whether to use a matched template path or the fallback path.
35
35
 
36
36
  > Template detection, field mapping for `textarea`, `input`, `dropdown`, and `checkboxes`, and the fallback body rules live in `reference/template-matching.md`. Read `reference/template-matching.md` before building the body.
37
37
 
@@ -57,7 +57,7 @@ Write back `issue_number`, update `updated_at`, and append the Create Issue Acti
57
57
 
58
58
  If artifact files already exist in the task directory, backfill them in this order:
59
59
 
60
- 1. `task.md` -> `<!-- sync-issue:{task-id}:task -->` comment (idempotent create or update)
60
+ 1. `task.md` -> the task comment marker defined in `.agents/rules/issue-sync.md` (idempotent create or update)
61
61
  2. Backfill existing `analysis*.md`, `plan*.md`, `implementation*.md`, `review*.md`, and `refinement*.md` files in filename order
62
62
 
63
63
  Every backfill action must follow the raw publishing, task.md sync, and chunking rules in `.agents/rules/issue-sync.md`.
@@ -94,7 +94,7 @@ Next step - run requirements analysis:
94
94
 
95
95
  ## Completion Checklist
96
96
 
97
- - [ ] Created the GitHub Issue
97
+ - [ ] Created the Issue
98
98
  - [ ] Used `task.md` as the only content source
99
99
  - [ ] Recorded `issue_number` in task.md
100
100
  - [ ] Updated `updated_at` and appended the Activity Log entry
@@ -106,13 +106,13 @@ Stop after the checklist. Do not start detailed progress sync here.
106
106
 
107
107
  ## Notes
108
108
 
109
- - `create-issue` creates the base Issue; later status, comments, and checkboxes are maintained by workflow skills and GitHub Actions
109
+ - `create-issue` creates the base Issue; later status, comments, and checkboxes are maintained by workflow skills and platform automation
110
110
  - If no valid labels survive filtering, create the Issue without labels instead of failing
111
111
  - If Issue Type or milestone setup fails, continue and record the fallback outcome
112
112
 
113
113
  ## Error Handling
114
114
 
115
115
  - Task not found: `Task {task-id} not found`
116
- - GitHub CLI unavailable or unauthenticated
116
+ - the platform CLI unavailable or unauthenticated
117
117
  - Empty description in task.md
118
118
  - Issue creation failure
@@ -1,18 +1,18 @@
1
1
  ---
2
2
  name: create-issue
3
- description: "从任务文件创建 GitHub Issue"
3
+ description: "从任务文件创建 Issue"
4
4
  ---
5
5
 
6
6
  # 创建 Issue
7
7
 
8
- 仅从 `task.md` 创建基础 GitHub Issue,并把 `issue_number` 回写到任务文件。
8
+ 仅从 `task.md` 创建基础 Issue,并把 `issue_number` 回写到任务文件。
9
9
 
10
10
  ## 行为边界 / 关键规则
11
11
 
12
12
  - Issue 标题和正文只能来自 `task.md`
13
13
  - Issue 标题格式为 `type(scope): 描述`——type 从 task.md 的 `type` 字段映射(feature→feat, bugfix→fix, refactor→refactor, docs→docs, chore→chore),scope 从受影响模块推断(无法确定时省略),描述使用 task.md 中的任务标题原文(不要翻译或改写)
14
14
  - 不要读取 `analysis.md`、`plan.md`、`implementation.md` 或审查产物
15
- - 持久产物只有 GitHub Issue 本身,以及 task.md 中的 `issue_number` 更新
15
+ - 持久产物只有 Issue 本身,以及 task.md 中的 `issue_number` 更新
16
16
  - 执行本技能后,你**必须**立即更新 task.md
17
17
 
18
18
  ## 执行步骤
@@ -31,7 +31,7 @@ description: "从任务文件创建 GitHub Issue"
31
31
 
32
32
  ### 3. 构建 Issue 内容
33
33
 
34
- 检测 `.github/ISSUE_TEMPLATE`,决定使用模板路径还是 fallback 路径。
34
+ 通过 `.agents/rules/issue-pr-commands.md` 检测 Issue 模板,决定使用模板路径还是 fallback 路径。
35
35
 
36
36
  > 模板识别、`textarea`、`input`、`dropdown`、`checkboxes` 字段映射,以及 fallback 正文规则见 `reference/template-matching.md`。构建正文前先读取 `reference/template-matching.md`。
37
37
 
@@ -57,7 +57,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
57
57
 
58
58
  如果任务目录中已存在产物文件,按以下顺序补发:
59
59
 
60
- 1. `task.md` → `<!-- sync-issue:{task-id}:task -->` 评论(幂等创建或更新)
60
+ 1. `task.md` → `.agents/rules/issue-sync.md` 中定义的 task 评论标记(幂等创建或更新)
61
61
  2. 按文件名排序补发已存在的 `analysis*.md`、`plan*.md`、`implementation*.md`、`review*.md`、`refinement*.md`
62
62
 
63
63
  所有补发动作都必须遵循 `.agents/rules/issue-sync.md` 的原文发布、task.md 同步和分片规则。
@@ -94,7 +94,7 @@ node .agents/scripts/validate-artifact.js gate create-issue .agents/workspace/ac
94
94
 
95
95
  ## 完成检查清单
96
96
 
97
- - [ ] 已创建 GitHub Issue
97
+ - [ ] 已创建 Issue
98
98
  - [ ] 已仅使用 `task.md` 作为内容来源
99
99
  - [ ] 已在 task.md 中记录 `issue_number`
100
100
  - [ ] 已更新 `updated_at` 并追加 Activity Log
@@ -106,13 +106,13 @@ node .agents/scripts/validate-artifact.js gate create-issue .agents/workspace/ac
106
106
 
107
107
  ## 注意事项
108
108
 
109
- - `create-issue` 只负责创建基础 Issue;后续状态、评论和复选框由工作流技能与 GitHub Actions 维护
109
+ - `create-issue` 只负责创建基础 Issue;后续状态、评论和复选框由工作流技能与 platform automation 维护
110
110
  - 如果过滤后没有有效 label,允许不带 label 创建 Issue
111
111
  - 如果 Issue Type 或 milestone 设置失败,继续执行并记录结果
112
112
 
113
113
  ## 错误处理
114
114
 
115
115
  - 任务未找到:`Task {task-id} not found`
116
- - GitHub CLI 不可用或未认证
116
+ - the platform CLI 不可用或未认证
117
117
  - task.md 的描述为空
118
118
  - 创建 Issue 失败
@@ -23,7 +23,8 @@
23
23
  "issue_must_exist": true,
24
24
  "verify_task_comment_content": true,
25
25
  "verify_issue_type": true,
26
- "verify_milestone": true
26
+ "verify_milestone": true,
27
+ "expected_status_label_key": "waitingForTriage"
27
28
  }
28
29
  }
29
30
  }
@@ -17,11 +17,11 @@ Recommended fallback:
17
17
  - [ ] {requirement-2}
18
18
  ```
19
19
 
20
- Map task types to GitHub labels and Issue Types, but keep only labels that actually exist.
20
+ Map task types to labels and Issue Types, but keep only labels that actually exist.
21
21
 
22
22
  Fallback label mapping:
23
23
 
24
- | task.md type | GitHub label |
24
+ | task.md type | label |
25
25
  |---|---|
26
26
  | `bug`, `bugfix` | `type: bug` |
27
27
  | `feature` | `type: feature` |
@@ -34,7 +34,7 @@ Fallback label mapping:
34
34
 
35
35
  Issue Type fallback mapping:
36
36
 
37
- | task.md type | GitHub Issue Type |
37
+ | task.md type | Issue Type |
38
38
  |---|---|
39
39
  | `bug`, `bugfix` | `Bug` |
40
40
  | `feature`, `enhancement` | `Feature` |
@@ -17,11 +17,11 @@
17
17
  - [ ] {requirement-2}
18
18
  ```
19
19
 
20
- 将任务类型映射到 GitHub label 和 Issue Type,但只保留仓库里实际存在的 label。
20
+ 将任务类型映射到 label 和 Issue Type,但只保留仓库里实际存在的 label。
21
21
 
22
22
  Fallback label 映射:
23
23
 
24
- | task.md type | GitHub label |
24
+ | task.md type | label |
25
25
  |---|---|
26
26
  | `bug`, `bugfix` | `type: bug` |
27
27
  | `feature` | `type: feature` |
@@ -34,7 +34,7 @@ Fallback label 映射:
34
34
 
35
35
  Issue Type fallback 映射:
36
36
 
37
- | task.md type | GitHub Issue Type |
37
+ | task.md type | Issue Type |
38
38
  |---|---|
39
39
  | `bug`, `bugfix` | `Bug` |
40
40
  | `feature`, `enhancement` | `Feature` |
@@ -1,45 +1,17 @@
1
1
  # Issue Template Matching
2
2
 
3
- Read this file before deciding how to build the Issue body from `.github/ISSUE_TEMPLATE`.
3
+ Read this file before deciding how to build the Issue body.
4
4
 
5
5
  ## Detect Issue Templates
6
6
 
7
- Search project templates with:
7
+ Issue template detection is platform-specific. Read `.agents/rules/issue-pr-commands.md` and follow the template detection section provided by the configured platform.
8
8
 
9
- ```bash
10
- rg --files .github/ISSUE_TEMPLATE -g '*.yml' -g '!config.yml'
11
- ```
12
-
13
- If templates exist, inspect their top-level `name:` fields and choose the best match for the task title and description.
14
-
15
- Typical candidate templates:
16
- - `bug_report.yml` for bug work
17
- - `question.yml` for question or investigation work
18
- - `feature_request.yml` for feature work
19
- - `documentation.yml` for documentation work
20
- - `other.yml` as the general fallback
9
+ If templates exist, inspect their top-level names and choose the best match for the task title and description. Use the candidate template guidance provided by the configured platform rule when available.
21
10
 
22
11
  If no template matches clearly, choose the nearest candidate. If templates are missing, unreadable, or parsing fails, fall back to the default body path.
23
12
 
24
13
  ## Build the Body from the Matched Template
25
14
 
26
- Read the matched template's:
27
- - `name`
28
- - `type:`
29
- - `labels:`
30
- - `body:`
31
-
32
- Field handling rules:
33
- - `textarea` and `input`: use `attributes.label` as the markdown heading and fill values from task.md
34
- - `markdown`: skip template explanation prose
35
- - `dropdown` and `checkboxes`: skip
36
- - when task.md lacks a suitable value, write `N/A`
37
-
38
- Suggested field mapping:
39
-
40
- | Template field hint | task.md source |
41
- |---|---|
42
- | `summary`, `title` | task title |
43
- | `description`, `problem`, `what happened`, `issue-description`, `current-content` | task description |
44
- | `solution`, `requirements`, `steps`, `suggested-content`, `impact`, `context`, `alternatives`, `expected` | requirements list |
45
- | other `textarea` / `input` fields | task description, otherwise `N/A` |
15
+ Build the body by following the field handling and field mapping guidance provided by the configured platform section in `.agents/rules/issue-pr-commands.md`.
16
+
17
+ When platform guidance is unavailable, use the default body path.
@@ -1,45 +1,17 @@
1
1
  # Issue 模板匹配
2
2
 
3
- 在决定如何从 `.github/ISSUE_TEMPLATE` 构建 Issue 正文之前先读取本文件。
3
+ 在决定如何构建 Issue 正文前先读取本文件。
4
4
 
5
- ## 探测 Issue 模板
5
+ ## 检测 Issue 模板
6
6
 
7
- 用下面的命令搜索项目模板:
7
+ Issue 模板检测属于平台相关逻辑。先读取 `.agents/rules/issue-pr-commands.md`,并按当前配置平台提供的模板检测章节执行。
8
8
 
9
- ```bash
10
- rg --files .github/ISSUE_TEMPLATE -g '*.yml' -g '!config.yml'
11
- ```
9
+ 如果存在模板,检查其顶层名称,并根据任务标题和描述选择最匹配的模板。可用时,使用当前配置平台规则提供的候选模板指引。
12
10
 
13
- 如果模板存在,检查其顶层 `name:` 字段,并为当前任务标题和描述选择最匹配的模板。
11
+ 如果没有清晰匹配,选择最接近的候选模板。模板不存在、无法读取或解析失败时,回退到默认正文路径。
14
12
 
15
- 常见候选模板:
16
- - `bug_report.yml`:用于 bug 类工作
17
- - `question.yml`:用于问题排查或调研类工作
18
- - `feature_request.yml`:用于功能类工作
19
- - `documentation.yml`:用于文档类工作
20
- - `other.yml`:通用 fallback
13
+ ## 从匹配模板构建正文
21
14
 
22
- 如果没有明显匹配的模板,选择最接近的候选项。如果模板缺失、不可读取或解析失败,就回退到默认正文路径。
15
+ 按 `.agents/rules/issue-pr-commands.md` 中当前配置平台章节提供的字段处理和字段映射指引构建正文。
23
16
 
24
- ## 使用匹配到的模板构建正文
25
-
26
- 读取匹配模板中的:
27
- - `name`
28
- - `type:`
29
- - `labels:`
30
- - `body:`
31
-
32
- 字段处理规则:
33
- - `textarea` 和 `input`:使用 `attributes.label` 作为 Markdown 标题,并从 task.md 填充值
34
- - `markdown`:跳过模板解释性文字
35
- - `dropdown` 和 `checkboxes`:跳过
36
- - 当 task.md 没有合适值时,写入 `N/A`
37
-
38
- 建议字段映射:
39
-
40
- | 模板字段提示 | task.md 来源 |
41
- |---|---|
42
- | `summary`, `title` | 任务标题 |
43
- | `description`, `problem`, `what happened`, `issue-description`, `current-content` | 任务描述 |
44
- | `solution`, `requirements`, `steps`, `suggested-content`, `impact`, `context`, `alternatives`, `expected` | 需求列表 |
45
- | 其他 `textarea` / `input` 字段 | 优先使用任务描述,否则写 `N/A` |
17
+ 如果平台指引不可用,使用默认正文路径。
@@ -26,7 +26,7 @@ Use the explicit argument when provided. Otherwise infer the target branch from
26
26
 
27
27
  ### 3. Prepare the PR Body
28
28
 
29
- Read `.github/PULL_REQUEST_TEMPLATE.md` when it exists, review recent merged PRs for style, and gather all commits between `<target-branch>` and `HEAD`.
29
+ Read the PR template through `.agents/rules/issue-pr-commands.md`, review recent merged PRs for style, and gather all commits between `<target-branch>` and `HEAD`.
30
30
 
31
31
  > Template handling, HEREDOC body generation, and `Generated with AI assistance` requirements live in `reference/pr-body-template.md`. Read `reference/pr-body-template.md` before writing the PR body.
32
32
 
@@ -101,7 +101,7 @@ Explain the created PR URL, summarize metadata sync and summary-comment results,
101
101
 
102
102
  - Review every commit in the branch, not only the latest one
103
103
  - `create-pr` must not defer type-label mapping to another skill; inline the mapping here when `{task-id}` is available
104
- - Keep the hidden summary marker as `<!-- sync-pr:{task-id}:summary -->` for compatibility with existing PR comments
104
+ - Keep the hidden summary marker as the PR summary marker defined in `.agents/rules/pr-sync.md` for compatibility with existing PR comments
105
105
  - If the current branch already has a PR, show its URL and stop without repeating sync work
106
106
  - When metadata inheritance from the Issue fails, continue with task.md and branch-based fallbacks
107
107
 
@@ -26,7 +26,7 @@ description: "创建 Pull Request 到目标分支"
26
26
 
27
27
  ### 3. 准备 PR 正文
28
28
 
29
- 读取 `.github/PULL_REQUEST_TEMPLATE.md`(如存在),参考最近合并的 PR 风格,并收集 `<target-branch>` 到 `HEAD` 的全部提交。
29
+ 通过 `.agents/rules/issue-pr-commands.md` 读取 PR 模板,参考最近合并的 PR 风格,并收集 `<target-branch>` 到 `HEAD` 的全部提交。
30
30
 
31
31
  > 模板处理、HEREDOC 正文生成和 `Generated with AI assistance` 要求见 `reference/pr-body-template.md`。编写正文前先读取 `reference/pr-body-template.md`。
32
32
 
@@ -101,7 +101,7 @@ node .agents/scripts/validate-artifact.js gate create-pr .agents/workspace/activ
101
101
 
102
102
  - 必须检查分支中的全部提交,而不是只看最后一个
103
103
  - `create-pr` 不能把 type label 映射委托给其他技能,必须在获取到 `{task-id}` 时于本技能内内联处理
104
- - 隐藏 summary 标记必须保持 `<!-- sync-pr:{task-id}:summary -->` 以兼容已有 PR 评论
104
+ - 隐藏 summary 标记必须保持为 `.agents/rules/pr-sync.md` 中定义的 PR 摘要评论标记,以兼容已有 PR 评论
105
105
  - 如果当前分支已存在 PR,直接告知用户 PR URL 并结束,不做重复同步
106
106
  - 如果从 Issue 继承元数据失败,继续使用 task.md 和分支推断兜底
107
107
 
@@ -23,7 +23,8 @@
23
23
  "verify_in_labels_match_pr": true,
24
24
  "verify_pr_type_label": true,
25
25
  "verify_pr_assignee": true,
26
- "verify_milestone": true
26
+ "verify_milestone": true,
27
+ "expected_pr_comment_marker_key": "prSummary"
27
28
  }
28
29
  }
29
30
  }
@@ -4,15 +4,11 @@ Read this file before generating the PR title and body.
4
4
 
5
5
  ## Read the PR Template
6
6
 
7
- Read `.github/PULL_REQUEST_TEMPLATE.md` from the repository. If it does not exist, use the standard format.
7
+ PR template discovery is platform-specific. Read `.agents/rules/issue-pr-commands.md` and follow the PR template section provided by the configured platform. If no template is available, use the standard format.
8
8
 
9
9
  ## Review Recent Merged PRs for Reference
10
10
 
11
- ```bash
12
- gh pr list --limit 3 --state merged --json number,title,body
13
- ```
14
-
15
- Use the recent merged PRs as style and formatting references.
11
+ Use the recent merged PR query from `.agents/rules/issue-pr-commands.md` as style and formatting reference input.
16
12
 
17
13
  ## Analyze Current Branch Changes
18
14
 
@@ -27,19 +23,13 @@ git diff <target-branch>...HEAD
27
23
 
28
24
  Read `.agents/rules/issue-pr-commands.md` before this step.
29
25
 
30
- Before syncing linked Issue metadata, complete authentication and code-hosting platform detection through that rule. Keep `gh pr list` / `gh pr create` on the current repository.
31
-
32
- Before syncing labels, verify the standard label system:
33
-
34
- ```bash
35
- gh label list --search "type:" --limit 1 --json name --jq 'length'
36
- ```
26
+ Before syncing linked Issue metadata, complete authentication and code-hosting platform detection through that rule.
37
27
 
38
- If the result is `0`, run `init-labels` before retrying metadata sync.
28
+ Before syncing labels, verify the standard label system by following the label-list command in `.agents/rules/issue-pr-commands.md`. If the result shows no standard type labels, run `init-labels` before retrying metadata sync.
39
29
 
40
30
  Type label mapping:
41
31
 
42
- | task.md type | GitHub label |
32
+ | task.md type | label |
43
33
  |---|---|
44
34
  | `bug`, `bugfix` | `type: bug` |
45
35
  | `feature` | `type: feature` |
@@ -54,7 +44,7 @@ Metadata sync order:
54
44
  1. query Issue labels and milestone via the Issue read command in `.agents/rules/issue-pr-commands.md`
55
45
  2. build `{label-args}` from the mapped type label, non-`type:` / non-`status:` Issue labels, and the current Issue `in:` labels (commit already computed them, so do not recompute them here and do not write back to the Issue)
56
46
  3. build `{milestone-arg}` by following "Phase 3: `create-pr`" in `.agents/rules/milestone-inference.md` and reusing the Issue milestone directly
57
- 4. pass `{label-args}` and `{milestone-arg}` atomically to `gh pr create` by using the create-PR command template and permission-degradation rules in `.agents/rules/issue-pr-commands.md`
47
+ 4. pass `{label-args}` and `{milestone-arg}` atomically by using the create-PR command template and permission-degradation rules in `.agents/rules/issue-pr-commands.md`
58
48
  5. ensure the PR body contains `Closes #{issue-number}` or an equivalent closing keyword
59
49
 
60
50
  If those rules say to skip the direct metadata arguments above, keep only the PR body linkage plus later comment sync.
@@ -72,7 +62,7 @@ Milestone rule:
72
62
  - Replace `{$IssueNumber}` in the template when present
73
63
  - End the PR body with `Generated with AI assistance`
74
64
 
75
- Create the PR with the "Create a PR" command template in `.agents/rules/issue-pr-commands.md`.
65
+ Create the PR with the create-PR command template in `.agents/rules/issue-pr-commands.md`.
76
66
 
77
67
  Final user output should include this follow-up path:
78
68
 
@@ -1,20 +1,16 @@
1
1
  # PR 正文模板规则
2
2
 
3
- 在生成 PR 标题和正文之前先读取本文件。
3
+ 生成 PR 标题和正文前先读取本文件。
4
4
 
5
5
  ## 读取 PR 模板
6
6
 
7
- 读取仓库中的 `.github/PULL_REQUEST_TEMPLATE.md`。如果不存在,则使用标准格式。
7
+ PR 模板发现属于平台相关逻辑。先读取 `.agents/rules/issue-pr-commands.md`,并按当前配置平台提供的 PR 模板章节执行。如果没有可用模板,则使用标准格式。
8
8
 
9
9
  ## 参考最近合并的 PR
10
10
 
11
- ```bash
12
- gh pr list --limit 3 --state merged --json number,title,body
13
- ```
11
+ 使用 `.agents/rules/issue-pr-commands.md` 中的最近合并 PR 查询命令,作为风格和格式参考输入。
14
12
 
15
- 把最近合并的 PR 当作风格和排版参考。
16
-
17
- ## 分析当前分支变更
13
+ ## 分析当前分支改动
18
14
 
19
15
  ```bash
20
16
  git status
@@ -25,21 +21,15 @@ git diff <target-branch>...HEAD
25
21
 
26
22
  ## 同步 PR 元数据
27
23
 
28
- 执行前先读取 `.agents/rules/issue-pr-commands.md`。
29
-
30
- 同步关联 Issue 元数据前,先按该规则完成认证和代码托管平台检测;`gh pr list` / `gh pr create` 仍保持作用于当前仓库。
24
+ 执行本步骤前先读取 `.agents/rules/issue-pr-commands.md`。
31
25
 
32
- 在同步 label 之前,先确认标准 label 体系已经存在:
33
-
34
- ```bash
35
- gh label list --search "type:" --limit 1 --json name --jq 'length'
36
- ```
26
+ 同步关联 Issue 元数据前,先按该规则完成认证和代码托管平台检测。
37
27
 
38
- 如果结果是 `0`,先执行 `init-labels`,再重试元数据同步。
28
+ 同步 label 前,按 `.agents/rules/issue-pr-commands.md` 中的 label 列表命令验证标准 label 体系。如果结果显示没有标准 type label,先运行 `init-labels` 再重试元数据同步。
39
29
 
40
- Type label 映射:
30
+ 类型 label 映射:
41
31
 
42
- | task.md type | GitHub label |
32
+ | task.md type | label |
43
33
  |---|---|
44
34
  | `bug`, `bugfix` | `type: bug` |
45
35
  | `feature` | `type: feature` |
@@ -51,34 +41,34 @@ Type label 映射:
51
41
  | 其他值 | 跳过 |
52
42
 
53
43
  元数据同步顺序:
54
- 1. `.agents/rules/issue-pr-commands.md` 的 Issue 读取命令查询关联 Issue labels 和 milestone
55
- 2. 构建 `{label-args}`:包含映射后的 type label、非 `type:`/`status:` 的 Issue labels,以及 Issue 当前的 `in:` labelscommit 阶段已完成计算,此处不重新计算也不反向更新 Issue)
56
- 3. 构建 `{milestone-arg}`:按 `.agents/rules/milestone-inference.md` 的「阶段 3:`create-pr`」直接复用 Issue milestone
57
- 4. 按 `.agents/rules/issue-pr-commands.md` 的创建 PR 命令模板与权限降级规则,将 `{label-args}` 和 `{milestone-arg}` 原子化传入 `gh pr create`
58
- 5. 确保 PR 正文包含 `Closes #{issue-number}` 或等价的 closing keyword
44
+ 1. 通过 `.agents/rules/issue-pr-commands.md` 的 Issue 读取命令查询 Issue labels 和 milestone
45
+ 2. 从映射出的 type label、非 `type:` / 非 `status:` 的 Issue labels,以及当前 Issue `in:` labels 构建 `{label-args}`(commit 已经计算过,不在此重算,也不写回 Issue)
46
+ 3. `.agents/rules/milestone-inference.md` "阶段 3:`create-pr`" 复用 Issue milestone 构建 `{milestone-arg}`
47
+ 4. 按 `.agents/rules/issue-pr-commands.md` 的创建 PR 命令模板与权限降级规则,将 `{label-args}` 和 `{milestone-arg}` 原子化传入
48
+ 5. 确保 PR 正文包含 `Closes #{issue-number}` 或等价关闭关键字
59
49
 
60
- 如果上述规则判定应跳过直接元数据参数写入,则只保留 PR 正文中的关联信息与后续评论同步。
50
+ 如果规则要求跳过上述直接元数据参数,则只保留 PR 正文关联和后续评论同步。
61
51
 
62
52
  Milestone 规则:
63
- - 按 `.agents/rules/milestone-inference.md` 的「阶段 3:`create-pr`」处理
64
- - PR 直接复用 Issue milestone,不再独立推断
53
+ - 按 `.agents/rules/milestone-inference.md` "阶段 3:`create-pr`" 执行
54
+ - 直接复用关联 Issue milestone,不为 PR 重新推断
65
55
 
66
56
  ## 创建 PR
67
57
 
68
- - 当当前工作属于活动任务时,从 task.md 中提取 `issue_number`
69
- - 如果存在 `issue_number`,先完成前置步骤中的代码托管平台检测,再按 `.agents/rules/issue-pr-commands.md` Issue 读取命令查询对应 Issue
70
- - 在调用 PR 创建命令前,先检查当前分支是否已经存在 PR;如果已存在,直接告知用户 PR URL 和状态并结束,不要重复同步元数据或摘要
71
- - 使用 HEREDOC 传递 PR 正文
72
- - 如果模板中存在 `{$IssueNumber}`,替换它
73
- - PR 正文结尾必须带上 `Generated with AI assistance`
58
+ - 当前工作属于 active task 时,从 task.md 提取 `issue_number`
59
+ - 如果存在 `issue_number`,先完成代码托管平台检测,再通过 `.agents/rules/issue-pr-commands.md` 查询 Issue
60
+ - 调用 PR 创建命令前,先检查当前分支是否已有 PR;若已有,报告 PR URL 和状态后停止,不重复执行元数据同步或 summary 发布
61
+ - 使用 HEREDOC 传入 PR 正文
62
+ - 模板中存在 `{$IssueNumber}` 时进行替换
63
+ - PR 正文以 `Generated with AI assistance` 结尾
74
64
 
75
- 创建 PR 时,使用 `.agents/rules/issue-pr-commands.md` 中的 “创建 PR” 命令模板。
65
+ 使用 `.agents/rules/issue-pr-commands.md` 中的创建 PR 命令模板创建 PR
76
66
 
77
- 最终用户输出必须按顺序包含以下后续动作:
67
+ 最终用户输出应包含以下后续路径:
78
68
 
79
69
  ```text
80
- 下一步:
81
- - 工作流真正结束后完成任务:
70
+ Next steps:
71
+ - complete the task after the workflow truly finishes:
82
72
  - Claude Code / OpenCode: /complete-task {task-id}
83
73
  - Gemini CLI: /agent-infra:complete-task {task-id}
84
74
  - Codex CLI: $complete-task {task-id}
@@ -128,18 +128,18 @@ If no historical release notes exist, use the following default Markdown format:
128
128
  3. Description: Use PR title, remove `type(scope):` prefix, capitalize first letter
129
129
  4. **Contributor collection**:
130
130
  - **Data sources**:
131
- - PR authors from Step 4 `gh pr list --json author`
131
+ - PR authors returned by the merged-PR query rule in `.agents/rules/release-commands.md`
132
132
  - Commit co-authors from Step 4 `git log ... --format='%(trailers:key=Co-authored-by,valueonly,unfold)'`
133
- - Issue reporters from linked Issues collected in Step 5 (`author.login` returned by `gh issue view`)
133
+ - Issue reporters from linked Issues collected in Step 5 (author login returned by `.agents/rules/release-commands.md`)
134
134
  - **Contribution count**: `PR count + co-authored commit count` for the same identity, merged across both sources
135
135
  - **Name -> `@login` mapping**:
136
- - Raw `Co-authored-by` values are `Name <email>` and must be mapped to a GitHub `@login`
137
- - Prefer email extraction: if it matches `(\d+\+)?(\S+?)@users\.noreply\.github\.com`, use the second capture group lowercased; this regex covers both `{id}+{login}@users.noreply.github.com` and `{login}@users.noreply.github.com`
136
+ - Raw `Co-authored-by` values are `Name <email>` and must be mapped to a platform `@login`
137
+ - Prefer email extraction: if it matches the platform no-reply email rule in `.agents/rules/release-commands.md`, use that rule to derive the lowercased login
138
138
  - Otherwise use a Name heuristic: take the first token before a space and lowercase it, for example `Claude Opus 4.6 (1M context)` -> `@claude`, `Codex` -> `@codex`, `Gemini` -> `@gemini`
139
139
  - If the login already appears in the PR author list, merge counts into that login so `Claude` and `@claude` do not become separate entries
140
140
  - Merge all Name variants that map to the same login before counting and sorting; for example, `Claude` and `Claude Opus 4.6 (1M context)` should both collapse into `@claude`
141
141
  - Preserve bot identities as-is, for example `dependabot[bot]`
142
- - If the login still cannot be determined reliably, output `@{lowercased first Name token}` and append `<!-- TODO(reviewer): confirm GitHub login for {original Name <email>} -->` below the `Contributors` section
142
+ - If the login still cannot be determined reliably, output `@{lowercased first Name token}` and append `<!-- TODO(reviewer): confirm platform login for {original Name <email>} -->` below the `Contributors` section
143
143
  - **Sorting**: descending by contribution count, then lexicographically by login for ties
144
144
  - **Deduplication**: use the final mapped `@login` as the key
145
145
  - **Issue reporter rules**:
@@ -156,7 +156,7 @@ Show the generated release notes to the user.
156
156
 
157
157
  Ask:
158
158
  1. Need any adjustments?
159
- 2. Create a GitHub Draft Release?
159
+ 2. Create a draft release?
160
160
 
161
161
  ### 9. Create Draft Release (If Confirmed)
162
162
 
@@ -170,7 +170,7 @@ Draft Release created.
170
170
  - Version: v{version}
171
171
  - Status: Draft
172
172
 
173
- Please review and publish on GitHub:
173
+ Please review and publish on the platform:
174
174
  1. Open the URL above
175
175
  2. Review the release notes
176
176
  3. Click "Publish release"
@@ -178,7 +178,7 @@ Please review and publish on GitHub:
178
178
 
179
179
  ## Notes
180
180
 
181
- 1. **Requires gh CLI**: Must have GitHub CLI installed and authenticated
181
+ 1. **Requires the platform CLI**: Must have the platform CLI installed and authenticated
182
182
  2. **Tags must exist**: Run the release skill first to create tags
183
183
  3. **Draft mode**: Creates a draft - won't auto-publish
184
184
  4. **Classification accuracy**: Auto-classification is based on title/scope/files; complex PRs may need manual adjustment
@@ -187,5 +187,5 @@ Please review and publish on GitHub:
187
187
 
188
188
  - Invalid version format: Prompt correct format
189
189
  - Tag not found: Suggest running the release skill first
190
- - gh not authenticated: Prompt to authenticate
190
+ - The platform CLI is not authenticated: Prompt to authenticate
191
191
  - No merged PRs found: Prompt to check tags and branch
@@ -128,18 +128,18 @@ git log v<prev-version>..v<version> \
128
128
  3. 描述:使用 PR 标题,移除 `type(scope):` 前缀,首字母大写
129
129
  4. **贡献者搜集**:
130
130
  - **数据源**:
131
- - PR author:来自步骤 4 的 `gh pr list --json author`
131
+ - PR author:来自 `.agents/rules/release-commands.md` 中已合并 PR 查询规则
132
132
  - Commit co-authors:来自步骤 4 的 `git log ... --format='%(trailers:key=Co-authored-by,valueonly,unfold)'`
133
- - Issue reporters:来自步骤 5 收集的关联 Issue author(`gh issue view` 返回的 `author.login`)
133
+ - Issue reporters:来自步骤 5 收集的关联 Issue author(由 `.agents/rules/release-commands.md` 返回)
134
134
  - **贡献数定义**:`该人的 PR 数 + 该人作为 co-author 的 commit 数`(同一身份跨来源合并计数)
135
135
  - **Name → `@login` 映射**:
136
- - `Co-authored-by` 原始格式为 `Name <email>`,需要推断对应的 GitHub `@login`
137
- - 优先从 email 提取:匹配 `(\d+\+)?(\S+?)@users\.noreply\.github\.com` 时,取第二个捕获组并转为小写;该正则同时覆盖 `{id}+{login}@users.noreply.github.com` `{login}@users.noreply.github.com`
136
+ - `Co-authored-by` 原始格式为 `Name <email>`,需要推断对应的 platform `@login`
137
+ - 优先从 email 提取:匹配 `.agents/rules/release-commands.md` 中的平台 no-reply 邮箱规则时,按该规则推导小写 login
138
138
  - 否则按 Name 启发式:取首个空格前的 token 并转为小写(例如 `Claude Opus 4.6 (1M context)` → `@claude`、`Codex` → `@codex`、`Gemini` → `@gemini`)
139
139
  - 已出现在 PR author 列表中的 login,必须按该 login 合并计数,避免把 `Claude` 和 `@claude` 拆成两个条目
140
140
  - 同一 login 的所有 Name 变体都必须归并后再计数与排序;例如 `Claude` 与 `Claude Opus 4.6 (1M context)` 都映射到 `@claude` 时,应先合并为同一个贡献者
141
141
  - Bot 身份保留原样(如 `dependabot[bot]`)
142
- - 若仍无法可靠确定 login,则输出 `@{Name 首 token 小写}`,并在 `Contributors` 段落下追加 `<!-- TODO(reviewer): 确认 {原始 Name <email>} 的 GitHub login -->`
142
+ - 若仍无法可靠确定 login,则输出 `@{Name 首 token 小写}`,并在 `Contributors` 段落下追加 `<!-- TODO(reviewer): 确认 {原始 Name <email>} 的 platform login -->`
143
143
  - **排序**:按贡献数降序;贡献数相同时按 login 字典序
144
144
  - **去重**:以最终映射后的 `@login` 为键
145
145
  - **Issue reporter 规则**:
@@ -156,7 +156,7 @@ git log v<prev-version>..v<version> \
156
156
 
157
157
  询问:
158
158
  1. 需要调整吗?
159
- 2. 是否创建 GitHub Draft Release
159
+ 2. 是否创建 draft release
160
160
 
161
161
  ### 9. 创建 Draft Release(如确认)
162
162
 
@@ -170,7 +170,7 @@ Draft Release created.
170
170
  - Version: v{version}
171
171
  - Status: Draft
172
172
 
173
- Please review and publish on GitHub:
173
+ Please review and publish on the platform:
174
174
  1. Open the URL above
175
175
  2. Review the release notes
176
176
  3. Click "Publish release"
@@ -178,7 +178,7 @@ Please review and publish on GitHub:
178
178
 
179
179
  ## 注意事项
180
180
 
181
- 1. **需要 gh CLI**:必须安装并认证 GitHub CLI
181
+ 1. **需要 the platform CLI**:必须安装并认证 the platform CLI
182
182
  2. **标签必须存在**:先执行 release 技能创建标签
183
183
  3. **草稿模式**:创建草稿 —— 不会自动发布
184
184
  4. **分类准确性**:自动分类基于标题/scope/文件;复杂的 PR 可能需要手动调整
@@ -187,5 +187,5 @@ Please review and publish on GitHub:
187
187
 
188
188
  - 版本格式无效:提示正确格式
189
189
  - 标签未找到:建议先执行 release 技能
190
- - gh 未认证:提示进行认证
190
+ - 平台 CLI 未认证:提示用户认证
191
191
  - 未找到已合并的 PR:提示检查标签和分支