@fitlab-ai/agent-infra 0.5.6 → 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.
- package/README.md +92 -4
- package/README.zh-CN.md +92 -4
- package/bin/cli.js +28 -4
- package/lib/defaults.json +5 -2
- package/lib/init.js +86 -5
- package/lib/prompt.js +28 -1
- package/lib/render.js +1 -1
- package/lib/sandbox/commands/rm.js +6 -4
- package/lib/sandbox/commands/vm.js +43 -16
- package/lib/sandbox/config.js +5 -0
- package/lib/sandbox/engine.js +144 -16
- package/lib/sandbox/shell.js +36 -2
- package/lib/sandbox/task-resolver.js +13 -6
- package/lib/update.js +14 -3
- package/package.json +5 -5
- package/templates/.agents/QUICKSTART.en.md +19 -2
- package/templates/.agents/QUICKSTART.zh-CN.md +19 -2
- package/templates/.agents/README.en.md +71 -2
- package/templates/.agents/README.zh-CN.md +71 -2
- package/templates/.agents/rules/issue-pr-commands.en.md +5 -0
- package/templates/.agents/rules/issue-pr-commands.github.en.md +60 -0
- package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +60 -0
- package/templates/.agents/rules/issue-pr-commands.zh-CN.md +5 -0
- package/templates/.agents/rules/issue-sync.en.md +19 -0
- package/templates/.agents/rules/issue-sync.github.en.md +14 -0
- package/templates/.agents/rules/issue-sync.github.zh-CN.md +14 -0
- package/templates/.agents/rules/issue-sync.zh-CN.md +19 -0
- package/templates/.agents/rules/label-milestone-setup.en.md +5 -0
- package/templates/.agents/rules/label-milestone-setup.github.en.md +10 -0
- package/templates/.agents/rules/label-milestone-setup.github.zh-CN.md +10 -0
- package/templates/.agents/rules/label-milestone-setup.zh-CN.md +5 -0
- package/templates/.agents/rules/milestone-inference.en.md +5 -0
- package/templates/.agents/rules/milestone-inference.zh-CN.md +5 -0
- package/templates/.agents/rules/pr-sync.en.md +5 -0
- package/templates/.agents/rules/pr-sync.zh-CN.md +5 -0
- package/templates/.agents/rules/release-commands.en.md +5 -0
- package/templates/.agents/rules/release-commands.github.en.md +16 -0
- package/templates/.agents/rules/release-commands.github.zh-CN.md +16 -0
- package/templates/.agents/rules/release-commands.zh-CN.md +5 -0
- package/templates/.agents/rules/security-alerts.en.md +5 -0
- package/templates/.agents/rules/security-alerts.zh-CN.md +5 -0
- package/templates/.agents/scripts/platform-adapters/find-existing-task.github.js +272 -0
- package/templates/.agents/scripts/platform-adapters/find-existing-task.js +5 -0
- package/templates/.agents/scripts/platform-adapters/platform-sync.github.js +88 -8
- package/templates/.agents/scripts/platform-adapters/platform-sync.js +13 -0
- package/templates/.agents/skills/analyze-task/SKILL.en.md +5 -5
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/analyze-task/config/verify.json +3 -1
- package/templates/.agents/skills/block-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/block-task/config/verify.json +2 -1
- package/templates/.agents/skills/cancel-task/SKILL.en.md +3 -3
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/cancel-task/config/verify.json +2 -1
- package/templates/.agents/skills/check-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/close-codescan/SKILL.en.md +3 -3
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/close-dependabot/SKILL.en.md +1 -1
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/commit/SKILL.en.md +2 -2
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/commit/config/verify.json +2 -1
- package/templates/.agents/skills/complete-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/complete-task/config/verify.json +2 -1
- package/templates/.agents/skills/create-issue/SKILL.en.md +10 -10
- package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +10 -10
- package/templates/.agents/skills/create-issue/config/verify.json +2 -1
- package/templates/.agents/skills/create-issue/reference/label-and-type.en.md +3 -3
- package/templates/.agents/skills/create-issue/reference/label-and-type.zh-CN.md +3 -3
- package/templates/.agents/skills/create-issue/reference/template-matching.en.md +6 -34
- package/templates/.agents/skills/create-issue/reference/template-matching.zh-CN.md +8 -36
- package/templates/.agents/skills/create-pr/SKILL.en.md +3 -3
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/create-pr/config/verify.json +2 -1
- package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +7 -17
- package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +27 -37
- package/templates/.agents/skills/create-release-note/SKILL.en.md +16 -9
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +16 -9
- package/templates/.agents/skills/create-task/SKILL.en.md +5 -5
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/implement-task/SKILL.en.md +3 -3
- package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/implement-task/config/verify.json +3 -1
- package/templates/.agents/skills/import-codescan/SKILL.en.md +3 -3
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/import-dependabot/SKILL.en.md +2 -2
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/import-issue/SKILL.en.md +41 -11
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +41 -11
- package/templates/.agents/skills/init-labels/SKILL.en.md +10 -10
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +10 -10
- package/templates/.agents/skills/init-labels/scripts/init-labels.sh +6 -0
- package/templates/.agents/skills/init-milestones/SKILL.en.md +8 -8
- package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +8 -8
- package/templates/.agents/skills/init-milestones/scripts/init-milestones.sh +6 -0
- package/templates/.agents/skills/plan-task/SKILL.en.md +3 -3
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/plan-task/config/verify.json +3 -1
- package/templates/.agents/skills/post-release/SKILL.en.md +95 -0
- package/templates/.agents/skills/post-release/SKILL.zh-CN.md +95 -0
- package/templates/.agents/skills/refine-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/refine-task/config/verify.json +3 -1
- package/templates/.agents/skills/refine-title/SKILL.en.md +1 -1
- package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/release/SKILL.en.md +6 -1
- package/templates/.agents/skills/release/SKILL.zh-CN.md +6 -1
- package/templates/.agents/skills/release/scripts/manage-milestones.sh +6 -0
- package/templates/.agents/skills/restore-task/SKILL.en.md +13 -64
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +13 -64
- package/templates/.agents/skills/review-task/SKILL.en.md +3 -3
- package/templates/.agents/skills/review-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/review-task/config/verify.json +3 -1
- package/templates/.agents/skills/test/SKILL.en.md +1 -1
- package/templates/.agents/skills/test/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/test-integration/SKILL.en.md +1 -1
- package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/update-agent-infra/SKILL.en.md +12 -2
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +6 -2
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +344 -16
- package/templates/.agents/skills/upgrade-dependency/SKILL.en.md +1 -1
- package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +1 -1
- package/templates/.agents/templates/task.en.md +2 -2
- package/templates/.agents/templates/task.zh-CN.md +2 -2
- package/templates/.claude/commands/create-issue.en.md +1 -1
- package/templates/.claude/commands/create-issue.zh-CN.md +1 -1
- package/templates/.claude/commands/import-issue.en.md +1 -1
- package/templates/.claude/commands/import-issue.zh-CN.md +1 -1
- package/templates/.claude/commands/init-labels.en.md +1 -1
- package/templates/.claude/commands/init-labels.zh-CN.md +1 -1
- package/templates/.claude/commands/init-milestones.en.md +1 -1
- package/templates/.claude/commands/init-milestones.zh-CN.md +1 -1
- package/templates/.claude/commands/post-release.en.md +8 -0
- package/templates/.claude/commands/post-release.zh-CN.md +8 -0
- package/templates/.claude/commands/restore-task.en.md +1 -1
- package/templates/.claude/commands/restore-task.zh-CN.md +1 -1
- package/templates/.claude/hooks/check-version-format.sh +1 -1
- package/templates/.gemini/commands/_project_/create-issue.en.toml +1 -1
- package/templates/.gemini/commands/_project_/create-issue.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/import-issue.en.toml +1 -1
- package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/init-labels.en.toml +2 -2
- package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +2 -2
- package/templates/.gemini/commands/_project_/init-milestones.en.toml +2 -2
- package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +2 -2
- package/templates/.gemini/commands/_project_/post-release.en.toml +6 -0
- package/templates/.gemini/commands/_project_/post-release.zh-CN.toml +6 -0
- package/templates/.gemini/commands/_project_/restore-task.en.toml +1 -1
- package/templates/.gemini/commands/_project_/restore-task.zh-CN.toml +1 -1
- package/templates/{.github/hooks → .git-hooks}/check-version-format.sh +2 -2
- package/templates/.github/workflows/pr-label.yml +1 -1
- package/templates/.opencode/commands/create-issue.en.md +1 -1
- package/templates/.opencode/commands/create-issue.zh-CN.md +1 -1
- package/templates/.opencode/commands/import-issue.en.md +1 -1
- package/templates/.opencode/commands/import-issue.zh-CN.md +1 -1
- package/templates/.opencode/commands/init-labels.en.md +1 -1
- package/templates/.opencode/commands/init-labels.zh-CN.md +1 -1
- package/templates/.opencode/commands/init-milestones.en.md +1 -1
- package/templates/.opencode/commands/init-milestones.zh-CN.md +1 -1
- package/templates/.opencode/commands/post-release.en.md +9 -0
- package/templates/.opencode/commands/post-release.zh-CN.md +9 -0
- package/templates/.opencode/commands/restore-task.en.md +1 -1
- package/templates/.opencode/commands/restore-task.zh-CN.md +1 -1
- /package/templates/{.github/hooks → .git-hooks}/pre-commit +0 -0
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
| `status:` | Yes | — | PR 有自身状态流转(Open / Draft / Merged / Closed);Issue 使用 `status:` label 标记等待反馈、已确认等项目管理状态 |
|
|
109
109
|
| `in:` | Yes | Yes | Issue 和 PR 均可按模块筛选 |
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
使用 `/init-labels` 命令可通过平台适配器一次性创建标准 labels。
|
|
112
112
|
|
|
113
113
|
## 私有平台扩展
|
|
114
114
|
|
|
@@ -120,6 +120,27 @@
|
|
|
120
120
|
4. 如果你维护的是模板源码分支或私有 fork,需要先补齐对应的 `.{platform}.` 模板变体,再把该平台标识加入模板同步逻辑。
|
|
121
121
|
5. 在正式推广前,先用一个测试任务完整验证工作流和 gate 校验。
|
|
122
122
|
|
|
123
|
+
## 外部模板与 Skill 源
|
|
124
|
+
|
|
125
|
+
团队可以在 `.agents/.airc.json` 中配置外部模板源和共享 skill 源,用于接入私有平台模板、私有规则和团队维护的自定义 skill:
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"templates": {
|
|
130
|
+
"sources": [
|
|
131
|
+
{ "type": "local", "path": "~/private-templates" }
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"skills": {
|
|
135
|
+
"sources": [
|
|
136
|
+
{ "type": "local", "path": "~/private-skills" }
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
模板源优先级为内置模板优先,外部模板只做补充;多个外部模板源之间,后面的 source 覆盖前面的 source。同步报告会在 `templateSources.conflicts` 中列出被忽略的同名文件。外部模板和 skill 可能包含会被 AI 工作流执行的脚本,只配置可信路径。
|
|
143
|
+
|
|
123
144
|
## 自定义 Skills
|
|
124
145
|
|
|
125
146
|
项目可以在内置任务工作流之外增加自己的 skill。
|
|
@@ -156,7 +177,7 @@ args: "<task-id>" # 可选
|
|
|
156
177
|
{
|
|
157
178
|
"skills": {
|
|
158
179
|
"sources": [
|
|
159
|
-
{ "type": "local", "path": "~/
|
|
180
|
+
{ "type": "local", "path": "~/private-skills" }
|
|
160
181
|
]
|
|
161
182
|
}
|
|
162
183
|
}
|
|
@@ -172,6 +193,54 @@ args: "<task-id>" # 可选
|
|
|
172
193
|
- 自定义 source 不能覆盖内置 skill;如果与内置 skill 同名,会跳过该 source skill
|
|
173
194
|
- 如果项目必须接管某个内置 skill 或命令,请使用 `files.ejected`
|
|
174
195
|
|
|
196
|
+
## 自定义 TUI 配置
|
|
197
|
+
|
|
198
|
+
当团队使用的 AI TUI 不属于内置命令目标时,可以在 `.agents/.airc.json` 顶层配置 `customTUIs` 数组。该配置用于让 agent-infra 输出正确的下一步命令,并通过学习自定义 TUI 目录中的既有命令文件,为项目自定义 skill 生成同格式命令。
|
|
199
|
+
|
|
200
|
+
| 字段 | 必填 | 含义 |
|
|
201
|
+
|------|------|------|
|
|
202
|
+
| `name` | 是 | 报告和下一步提示中展示的工具名称,例如 `Acme TUI`。 |
|
|
203
|
+
| `dir` | 是 | 相对项目根目录的命令目录,例如 `.acme/commands`。路径必须位于项目根目录内。 |
|
|
204
|
+
| `invoke` | 是 | 面向用户展示的命令模板,用于生成下一步提示。 |
|
|
205
|
+
|
|
206
|
+
`invoke` 支持的占位符:
|
|
207
|
+
|
|
208
|
+
| 占位符 | 替换为 | 示例 |
|
|
209
|
+
|--------|--------|------|
|
|
210
|
+
| `${skillName}` | skill 命令名,例如 `review-task` 或 `commit`。 | `acme ${skillName}` -> `acme review-task` |
|
|
211
|
+
| `${projectName}` | `.airc.json` 中的 `project` 值,适用于带命名空间的命令。 | `/${projectName}:${skillName}` -> `/agent-infra:review-task` |
|
|
212
|
+
|
|
213
|
+
不带命名空间的自定义 TUI:
|
|
214
|
+
|
|
215
|
+
```json
|
|
216
|
+
{
|
|
217
|
+
"customTUIs": [
|
|
218
|
+
{
|
|
219
|
+
"name": "Acme TUI",
|
|
220
|
+
"dir": ".acme/commands",
|
|
221
|
+
"invoke": "acme ${skillName}"
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
带命名空间的自定义 TUI:
|
|
228
|
+
|
|
229
|
+
```json
|
|
230
|
+
{
|
|
231
|
+
"project": "agent-infra",
|
|
232
|
+
"customTUIs": [
|
|
233
|
+
{
|
|
234
|
+
"name": "Internal Gemini",
|
|
235
|
+
"dir": ".internal-gemini/commands",
|
|
236
|
+
"invoke": "/${projectName}:${skillName}"
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
`customTUIs` 每个条目对应一个自定义 TUI。若希望 `update-agent-infra` 为自定义 skill 生成命令文件,请在 `dir` 中保留至少一个引用内置 skill 路径的既有命令文件,例如 `.agents/skills/analyze-task/SKILL.md`;agent-infra 会以该文件作为格式参考。
|
|
243
|
+
|
|
175
244
|
## Skill 编写规范
|
|
176
245
|
|
|
177
246
|
编写或维护 `.agents/skills/*/SKILL.md` 及其模板时,步骤编号遵循以下规则:
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Issue and PR Commands
|
|
2
|
+
|
|
3
|
+
This code platform does not provide built-in issue or pull request commands.
|
|
4
|
+
|
|
5
|
+
Platform-specific automation is skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates. Keep local task artifacts as the source of truth, or install a platform-specific template pack before running the workflow.
|
|
@@ -22,6 +22,44 @@ Before any later `gh issue` or `gh api "repos/..."` call, follow `.agents/rules/
|
|
|
22
22
|
- keep `gh pr *` commands on the current repository without adding `-R`
|
|
23
23
|
- keep organization-scoped commands such as `gh api "orgs/{owner}/..."` unchanged
|
|
24
24
|
|
|
25
|
+
## Issue Template Detection
|
|
26
|
+
|
|
27
|
+
Detect GitHub Issue Forms with:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
rg --files .github/ISSUE_TEMPLATE -g '*.yml' -g '!config.yml'
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Read matching form files locally before creating the Issue. If the directory is missing or no form matches the task, use the caller's fallback body format.
|
|
34
|
+
|
|
35
|
+
Typical candidate templates:
|
|
36
|
+
- `bug_report.yml` for bug work
|
|
37
|
+
- `question.yml` for question or investigation work
|
|
38
|
+
- `feature_request.yml` for feature work
|
|
39
|
+
- `documentation.yml` for documentation work
|
|
40
|
+
- `other.yml` as the general fallback
|
|
41
|
+
|
|
42
|
+
For GitHub Issue Forms, inspect the matched form's:
|
|
43
|
+
- `name`
|
|
44
|
+
- `type:`
|
|
45
|
+
- `labels:`
|
|
46
|
+
- `body:`
|
|
47
|
+
|
|
48
|
+
Field handling rules:
|
|
49
|
+
- `textarea` and `input`: use `attributes.label` as the markdown heading and fill values from task.md
|
|
50
|
+
- `markdown`: skip template explanation prose
|
|
51
|
+
- `dropdown` and `checkboxes`: skip
|
|
52
|
+
- when task.md lacks a suitable value, write `N/A`
|
|
53
|
+
|
|
54
|
+
Suggested field mapping:
|
|
55
|
+
|
|
56
|
+
| Template field hint | task.md source |
|
|
57
|
+
|---|---|
|
|
58
|
+
| `summary`, `title` | task title |
|
|
59
|
+
| `description`, `problem`, `what happened`, `issue-description`, `current-content` | task description |
|
|
60
|
+
| `solution`, `requirements`, `steps`, `suggested-content`, `impact`, `context`, `alternatives`, `expected` | requirements list |
|
|
61
|
+
| other `textarea` / `input` fields | task description, otherwise `N/A` |
|
|
62
|
+
|
|
25
63
|
## Read and Create Issues
|
|
26
64
|
|
|
27
65
|
Read an Issue:
|
|
@@ -82,6 +120,28 @@ Read Issue comments or search for existing hidden markers:
|
|
|
82
120
|
gh api "repos/$upstream_repo/issues/{issue-number}/comments" --paginate
|
|
83
121
|
```
|
|
84
122
|
|
|
123
|
+
## PR Template and Metadata Helpers
|
|
124
|
+
|
|
125
|
+
Read a repository PR template when present:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
cat .github/PULL_REQUEST_TEMPLATE.md
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Review recent merged PRs for style:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
gh pr list --limit 3 --state merged --json number,title,body
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Verify that standard type labels exist before PR metadata sync:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
gh label list --search "type:" --limit 1 --json name --jq 'length'
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
If the result is `0`, run `init-labels` before retrying PR metadata sync.
|
|
144
|
+
|
|
85
145
|
## Read and Create PRs
|
|
86
146
|
|
|
87
147
|
Read a PR:
|
|
@@ -22,6 +22,44 @@ gh repo view --json nameWithOwner
|
|
|
22
22
|
- `gh pr *` 命令保持作用于当前仓库,不额外加 `-R`
|
|
23
23
|
- `gh api "orgs/{owner}/..."` 这类 org 级命令保持不变
|
|
24
24
|
|
|
25
|
+
## Issue 模板检测
|
|
26
|
+
|
|
27
|
+
使用以下命令检测 GitHub Issue Forms:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
rg --files .github/ISSUE_TEMPLATE -g '*.yml' -g '!config.yml'
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
创建 Issue 前先读取匹配的 form 文件。目录不存在或没有匹配 form 时,使用调用方定义的 fallback 正文格式。
|
|
34
|
+
|
|
35
|
+
常见候选模板:
|
|
36
|
+
- `bug_report.yml`:bug 工作
|
|
37
|
+
- `question.yml`:问题或排查工作
|
|
38
|
+
- `feature_request.yml`:功能工作
|
|
39
|
+
- `documentation.yml`:文档工作
|
|
40
|
+
- `other.yml`:通用 fallback
|
|
41
|
+
|
|
42
|
+
对 GitHub Issue Forms,检查匹配 form 的:
|
|
43
|
+
- `name`
|
|
44
|
+
- `type:`
|
|
45
|
+
- `labels:`
|
|
46
|
+
- `body:`
|
|
47
|
+
|
|
48
|
+
字段处理规则:
|
|
49
|
+
- `textarea` 和 `input`:使用 `attributes.label` 作为 markdown 标题,并从 task.md 填充值
|
|
50
|
+
- `markdown`:跳过模板说明文案
|
|
51
|
+
- `dropdown` 和 `checkboxes`:跳过
|
|
52
|
+
- task.md 缺少合适值时,写入 `N/A`
|
|
53
|
+
|
|
54
|
+
建议字段映射:
|
|
55
|
+
|
|
56
|
+
| 模板字段提示 | task.md 来源 |
|
|
57
|
+
|---|---|
|
|
58
|
+
| `summary`, `title` | 任务标题 |
|
|
59
|
+
| `description`, `problem`, `what happened`, `issue-description`, `current-content` | 任务描述 |
|
|
60
|
+
| `solution`, `requirements`, `steps`, `suggested-content`, `impact`, `context`, `alternatives`, `expected` | 需求列表 |
|
|
61
|
+
| 其他 `textarea` / `input` 字段 | 任务描述,否则 `N/A` |
|
|
62
|
+
|
|
25
63
|
## Issue 读取与创建
|
|
26
64
|
|
|
27
65
|
读取 Issue:
|
|
@@ -82,6 +120,28 @@ gh issue close {issue-number} -R "$upstream_repo" --reason "{reason}"
|
|
|
82
120
|
gh api "repos/$upstream_repo/issues/{issue-number}/comments" --paginate
|
|
83
121
|
```
|
|
84
122
|
|
|
123
|
+
## PR 模板与元数据辅助命令
|
|
124
|
+
|
|
125
|
+
存在仓库 PR 模板时读取:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
cat .github/PULL_REQUEST_TEMPLATE.md
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
参考最近合并的 PR 风格:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
gh pr list --limit 3 --state merged --json number,title,body
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
PR 元数据同步前验证标准 type labels 是否存在:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
gh label list --search "type:" --limit 1 --json name --jq 'length'
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
如果结果是 `0`,先运行 `init-labels`,再重试 PR 元数据同步。
|
|
144
|
+
|
|
85
145
|
## PR 读取与创建
|
|
86
146
|
|
|
87
147
|
读取 PR:
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Issue Sync
|
|
2
|
+
|
|
3
|
+
## Marker Registry
|
|
4
|
+
|
|
5
|
+
These hidden markers are the canonical registry for Issue synchronization:
|
|
6
|
+
|
|
7
|
+
| Key | Marker |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `task` | `<!-- sync-issue:{task-id}:task -->` |
|
|
10
|
+
| `artifact` | `<!-- sync-issue:{task-id}:{artifact-stem} -->` |
|
|
11
|
+
| `artifactChunk` | `<!-- sync-issue:{task-id}:{artifact-stem}:{part}/{total} -->` |
|
|
12
|
+
| `summary` | `<!-- sync-issue:{task-id}:summary -->` |
|
|
13
|
+
| `cancel` | `<!-- sync-issue:{task-id}:cancel -->` |
|
|
14
|
+
|
|
15
|
+
Callers should refer to the marker key in skill prose and keep concrete marker strings in this rule or the platform adapter defaults.
|
|
16
|
+
|
|
17
|
+
This code platform does not provide built-in issue synchronization.
|
|
18
|
+
|
|
19
|
+
Issue metadata, labels, milestones, assignees, and comments are skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates and platform adapters. Continue writing local task artifacts normally.
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Issue Sync Rules
|
|
2
2
|
|
|
3
|
+
## Marker Registry
|
|
4
|
+
|
|
5
|
+
These hidden markers are the canonical registry for Issue synchronization:
|
|
6
|
+
|
|
7
|
+
| Key | Marker |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `task` | `<!-- sync-issue:{task-id}:task -->` |
|
|
10
|
+
| `artifact` | `<!-- sync-issue:{task-id}:{artifact-stem} -->` |
|
|
11
|
+
| `artifactChunk` | `<!-- sync-issue:{task-id}:{artifact-stem}:{part}/{total} -->` |
|
|
12
|
+
| `summary` | `<!-- sync-issue:{task-id}:summary -->` |
|
|
13
|
+
| `cancel` | `<!-- sync-issue:{task-id}:cancel -->` |
|
|
14
|
+
|
|
15
|
+
Callers should refer to the marker key in skill prose and keep concrete marker strings in this rule or the platform adapter defaults.
|
|
16
|
+
|
|
3
17
|
Read this file before a task skill updates a GitHub Issue.
|
|
4
18
|
|
|
5
19
|
## Upstream Repository Detection
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Issue 同步规则
|
|
2
2
|
|
|
3
|
+
## Marker 注册表
|
|
4
|
+
|
|
5
|
+
以下隐藏标记是 Issue 同步的唯一权威注册表:
|
|
6
|
+
|
|
7
|
+
| Key | Marker |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `task` | `<!-- sync-issue:{task-id}:task -->` |
|
|
10
|
+
| `artifact` | `<!-- sync-issue:{task-id}:{artifact-stem} -->` |
|
|
11
|
+
| `artifactChunk` | `<!-- sync-issue:{task-id}:{artifact-stem}:{part}/{total} -->` |
|
|
12
|
+
| `summary` | `<!-- sync-issue:{task-id}:summary -->` |
|
|
13
|
+
| `cancel` | `<!-- sync-issue:{task-id}:cancel -->` |
|
|
14
|
+
|
|
15
|
+
Skill 正文应引用 marker key,具体 marker 字符串只保留在本规则或平台适配器默认值中。
|
|
16
|
+
|
|
3
17
|
在任务技能需要更新 GitHub Issue 时先读取本文件。
|
|
4
18
|
|
|
5
19
|
## Upstream 仓库检测
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Issue 同步
|
|
2
|
+
|
|
3
|
+
## Marker 注册表
|
|
4
|
+
|
|
5
|
+
以下隐藏标记是 Issue 同步的唯一权威注册表:
|
|
6
|
+
|
|
7
|
+
| Key | Marker |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `task` | `<!-- sync-issue:{task-id}:task -->` |
|
|
10
|
+
| `artifact` | `<!-- sync-issue:{task-id}:{artifact-stem} -->` |
|
|
11
|
+
| `artifactChunk` | `<!-- sync-issue:{task-id}:{artifact-stem}:{part}/{total} -->` |
|
|
12
|
+
| `summary` | `<!-- sync-issue:{task-id}:summary -->` |
|
|
13
|
+
| `cancel` | `<!-- sync-issue:{task-id}:cancel -->` |
|
|
14
|
+
|
|
15
|
+
Skill 正文应引用 marker key,具体 marker 字符串只保留在本规则或平台适配器默认值中。
|
|
16
|
+
|
|
17
|
+
当前代码平台未内置 Issue 同步支持。
|
|
18
|
+
|
|
19
|
+
自定义平台会跳过 Issue 元数据、标签、里程碑、负责人和评论同步,除非你提供匹配的 `.{platform}.zh-CN.md` 规则模板和平台适配器。请继续正常写入本地任务产物。
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Label and Milestone Setup
|
|
2
|
+
|
|
3
|
+
This code platform does not provide built-in label or milestone setup.
|
|
4
|
+
|
|
5
|
+
Initialization of remote labels and milestones is skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates and scripts. Local task workflow files remain usable without remote metadata setup.
|
|
@@ -43,6 +43,16 @@ Update a milestone:
|
|
|
43
43
|
gh api "repos/$repo/milestones/{number}" -X PATCH -f state="{state}" -f description="{description}"
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
## Error Prompt Templates
|
|
47
|
+
|
|
48
|
+
Use these normalized prompts when the GitHub setup scripts fail:
|
|
49
|
+
|
|
50
|
+
| Condition | Prompt |
|
|
51
|
+
|---|---|
|
|
52
|
+
| CLI missing | GitHub CLI (`gh`) is not installed |
|
|
53
|
+
| Authentication failed | `GitHub CLI is not authenticated` |
|
|
54
|
+
| API rate limit | `GitHub API rate limit reached, please retry later` |
|
|
55
|
+
|
|
46
56
|
## Constraints
|
|
47
57
|
|
|
48
58
|
- use label names as the idempotency key
|
|
@@ -43,6 +43,16 @@ gh api "repos/$repo/milestones" -f title="{title}" -f description="{description}
|
|
|
43
43
|
gh api "repos/$repo/milestones/{number}" -X PATCH -f state="{state}" -f description="{description}"
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
## 错误提示模板
|
|
47
|
+
|
|
48
|
+
GitHub 初始化脚本失败时使用以下标准提示:
|
|
49
|
+
|
|
50
|
+
| 条件 | 提示 |
|
|
51
|
+
|---|---|
|
|
52
|
+
| CLI 缺失 | GitHub CLI (`gh`) is not installed |
|
|
53
|
+
| 认证失败 | `GitHub CLI is not authenticated` |
|
|
54
|
+
| API 限流 | `GitHub API rate limit reached, please retry later` |
|
|
55
|
+
|
|
46
56
|
## 约束
|
|
47
57
|
|
|
48
58
|
- label 以名称作为幂等键
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Milestone Inference
|
|
2
|
+
|
|
3
|
+
This code platform does not provide built-in milestone inference.
|
|
4
|
+
|
|
5
|
+
Milestone narrowing and reuse are skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates. Do not block task progress when no platform-specific milestone implementation is available.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# PR Sync
|
|
2
|
+
|
|
3
|
+
This code platform does not provide built-in pull request synchronization.
|
|
4
|
+
|
|
5
|
+
PR creation, metadata updates, labels, milestones, assignees, and summary comments are skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates and adapters. Keep local task artifacts up to date.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Release Commands
|
|
2
|
+
|
|
3
|
+
This code platform does not provide built-in release commands.
|
|
4
|
+
|
|
5
|
+
Remote release automation is skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates and scripts. Continue using local release artifacts or your platform-specific release process.
|
|
@@ -21,6 +21,22 @@ When needed, read the linked Issue:
|
|
|
21
21
|
gh issue view {issue-number} --json number,title,labels,url
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
## Contributor Mapping Helpers
|
|
25
|
+
|
|
26
|
+
Merged PR queries used for release notes should include authors when contributors are needed:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
gh pr list --state merged --base "{branch}" --json number,title,mergedAt,labels,author
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Linked Issue queries used for reporter attribution should include the author:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
gh issue view {issue-number} --json number,title,labels,url,author
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Map GitHub no-reply emails with this rule: if `Name <email>` contains an email matching `(\d+\+)?(\S+?)@users\.noreply\.github\.com`, use the second capture group lowercased as the login. This covers both `{id}+{login}@users.noreply.github.com` and `{login}@users.noreply.github.com`.
|
|
39
|
+
|
|
24
40
|
## Create a Draft Release
|
|
25
41
|
|
|
26
42
|
```bash
|
|
@@ -21,6 +21,22 @@ gh pr list --state merged --base "{branch}" --json number,title,mergedAt,labels
|
|
|
21
21
|
gh issue view {issue-number} --json number,title,labels,url
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
## Contributor 映射辅助规则
|
|
25
|
+
|
|
26
|
+
release notes 需要 contributors 时,已合并 PR 查询应包含 author:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
gh pr list --state merged --base "{branch}" --json number,title,mergedAt,labels,author
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
关联 Issue 用于 reporter 归因时,查询应包含 author:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
gh issue view {issue-number} --json number,title,labels,url,author
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
GitHub no-reply 邮箱映射规则:如果 `Name <email>` 中的 email 匹配 `(\d+\+)?(\S+?)@users\.noreply\.github\.com`,使用第二个捕获组的小写形式作为 login。该规则同时覆盖 `{id}+{login}@users.noreply.github.com` 和 `{login}@users.noreply.github.com`。
|
|
39
|
+
|
|
24
40
|
## 创建 Draft Release
|
|
25
41
|
|
|
26
42
|
```bash
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Security Alerts
|
|
2
|
+
|
|
3
|
+
This code platform does not provide built-in security alert integration.
|
|
4
|
+
|
|
5
|
+
Code scanning and dependency alert import or close actions are skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates and adapters. Track security work through local task artifacts or a platform-specific integration.
|