@fitlab-ai/agent-infra 0.3.1 → 0.4.0
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 +29 -39
- package/README.zh-CN.md +29 -39
- package/bin/cli.js +1 -1
- package/lib/defaults.json +3 -12
- package/lib/init.js +13 -24
- package/lib/paths.js +3 -42
- package/lib/update.js +98 -32
- package/lib/version.js +2 -1
- package/package.json +2 -1
- package/templates/.agents/QUICKSTART.md +7 -7
- package/templates/.agents/QUICKSTART.zh-CN.md +7 -7
- package/templates/.agents/README.md +16 -4
- package/templates/.agents/README.zh-CN.md +16 -4
- package/templates/.agents/skills/analyze-task/SKILL.md +106 -105
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +6 -6
- package/templates/.agents/skills/block-task/SKILL.md +8 -8
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +8 -8
- package/templates/.agents/skills/check-task/SKILL.md +3 -3
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/close-codescan/SKILL.md +64 -63
- package/templates/.agents/skills/close-dependabot/SKILL.md +71 -70
- package/templates/.agents/skills/commit/SKILL.md +1 -1
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/complete-task/SKILL.md +7 -7
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +7 -7
- package/templates/.agents/skills/create-issue/SKILL.md +57 -12
- package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +57 -12
- package/templates/.agents/skills/create-pr/SKILL.md +44 -7
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +44 -7
- package/templates/.agents/skills/create-release-note/SKILL.md +18 -11
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +18 -11
- package/templates/.agents/skills/create-task/SKILL.md +80 -78
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +11 -10
- package/templates/.agents/skills/implement-task/SKILL.md +15 -18
- package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +15 -18
- package/templates/.agents/skills/import-codescan/SKILL.md +54 -53
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-dependabot/SKILL.md +57 -56
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/import-issue/SKILL.md +58 -58
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/init-labels/SKILL.md +8 -0
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +8 -0
- package/templates/.agents/skills/plan-task/SKILL.md +151 -149
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +6 -6
- package/templates/.agents/skills/refine-task/SKILL.md +3 -3
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/release/SKILL.md +55 -14
- package/templates/.agents/skills/release/SKILL.zh-CN.md +55 -14
- package/templates/.agents/skills/review-task/SKILL.md +9 -9
- package/templates/.agents/skills/review-task/SKILL.zh-CN.md +9 -9
- package/templates/.agents/skills/sync-issue/SKILL.md +258 -279
- package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +34 -56
- package/templates/.agents/skills/sync-pr/SKILL.md +8 -28
- package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +7 -27
- package/templates/.agents/skills/update-agent-infra/SKILL.md +6 -6
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +6 -6
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +61 -116
- package/templates/.agents/templates/handoff.md +1 -1
- package/templates/.agents/templates/handoff.zh-CN.md +1 -1
- package/templates/.agents/workflows/bug-fix.yaml +71 -71
- package/templates/.agents/workflows/bug-fix.zh-CN.yaml +1 -1
- package/templates/.agents/workflows/feature-development.yaml +71 -71
- package/templates/.agents/workflows/feature-development.zh-CN.yaml +1 -1
- package/templates/.agents/workflows/refactoring.yaml +76 -76
- package/templates/.agents/workflows/refactoring.zh-CN.yaml +1 -1
- package/templates/{.agent-workspace → .agents/workspace}/README.md +1 -1
- package/templates/{.agent-workspace → .agents/workspace}/README.zh-CN.md +1 -1
- package/templates/.claude/CLAUDE.md +14 -1
- package/templates/.claude/CLAUDE.zh-CN.md +14 -1
- package/templates/.claude/hooks/check-version-format.sh +44 -0
- package/templates/.claude/settings.json +14 -0
- package/templates/.opencode/COMMAND_STYLE_GUIDE.md +6 -6
- package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +6 -6
- package/templates/AGENTS.md +14 -1
- package/templates/AGENTS.zh-CN.md +14 -1
- package/templates/.editorconfig +0 -15
- package/templates/.github/ISSUE_TEMPLATE/01_bug_report.yml +0 -149
- package/templates/.github/ISSUE_TEMPLATE/02_question.yml +0 -101
- package/templates/.github/ISSUE_TEMPLATE/03_feature_request.yml +0 -131
- package/templates/.github/ISSUE_TEMPLATE/04_documentation.yml +0 -165
- package/templates/.github/ISSUE_TEMPLATE/05_other.yml +0 -147
- package/templates/.github/ISSUE_TEMPLATE/config.yml +0 -11
- package/templates/.github/PULL_REQUEST_TEMPLATE.md +0 -123
- package/templates/.github/dependabot.yml +0 -17
- package/templates/.github/hooks/check-utf8-encoding.sh +0 -25
- package/templates/.github/release.yml +0 -27
- package/templates/.github/workflows/pr-title-check.yml +0 -42
- package/templates/.mailmap +0 -4
- package/templates/CONTRIBUTING.md +0 -126
- package/templates/CONTRIBUTING.zh-CN.md +0 -124
- package/templates/SECURITY.md +0 -131
- package/templates/SECURITY.zh-CN.md +0 -131
|
@@ -17,17 +17,17 @@ description: >
|
|
|
17
17
|
- 纯数字(如 `123`)或 `#` + 数字(如 `#123`)-> 视为 issue number
|
|
18
18
|
- `TASK-` 开头 -> 视为 task-id(现有格式)
|
|
19
19
|
|
|
20
|
-
如果参数是 issue number,使用 Bash 搜索关联任务(注意:`.
|
|
20
|
+
如果参数是 issue number,使用 Bash 搜索关联任务(注意:`.agents/workspace` 是隐藏目录,Grep/Glob 工具会跳过,必须使用 Bash):
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
grep -rl "^issue_number: {issue-number}$" \
|
|
24
|
-
.
|
|
25
|
-
.
|
|
26
|
-
.
|
|
24
|
+
.agents/workspace/active/ \
|
|
25
|
+
.agents/workspace/blocked/ \
|
|
26
|
+
.agents/workspace/completed/ \
|
|
27
27
|
2>/dev/null | head -1
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
- 如果返回文件路径(如 `.
|
|
30
|
+
- 如果返回文件路径(如 `.agents/workspace/completed/TASK-xxx/task.md`),从路径中提取 `{task-id}` 和任务目录,继续执行步骤 2
|
|
31
31
|
- 如果无返回,提示 `No task found associated with Issue #{issue-number}`
|
|
32
32
|
|
|
33
33
|
如果参数是 task-id,继续执行步骤 2 的现有逻辑。
|
|
@@ -35,9 +35,9 @@ grep -rl "^issue_number: {issue-number}$" \
|
|
|
35
35
|
### 2. 验证任务存在
|
|
36
36
|
|
|
37
37
|
对于 `task-id` 路径,按优先顺序搜索任务:
|
|
38
|
-
- `.
|
|
39
|
-
- `.
|
|
40
|
-
- `.
|
|
38
|
+
- `.agents/workspace/active/{task-id}/task.md`
|
|
39
|
+
- `.agents/workspace/blocked/{task-id}/task.md`
|
|
40
|
+
- `.agents/workspace/completed/{task-id}/task.md`
|
|
41
41
|
|
|
42
42
|
注意:`{task-id}` 格式为 `TASK-{yyyyMMdd-HHmmss}`,例如 `TASK-20260306-143022`
|
|
43
43
|
|
|
@@ -105,17 +105,7 @@ gh pr view {pr-number} --json state,mergedAt
|
|
|
105
105
|
|
|
106
106
|
根据返回结果识别 PR 是 `OPEN`、`MERGED` 还是其他状态。
|
|
107
107
|
|
|
108
|
-
**d)
|
|
109
|
-
|
|
110
|
-
执行:
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
gh issue view {issue-number} --json state
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
记录 Issue 当前是 `OPEN` 还是 `CLOSED`。
|
|
117
|
-
|
|
118
|
-
**e) 综合判定交付模式**
|
|
108
|
+
**d) 综合判定交付模式**
|
|
119
109
|
|
|
120
110
|
按以下优先级确定摘要模式:
|
|
121
111
|
|
|
@@ -149,30 +139,7 @@ gh label list --search "type:" --limit 1 --json name --jq 'length'
|
|
|
149
139
|
- 返回 `0` -> 说明标准 label 体系缺失。先执行 `init-labels` 技能(幂等),然后重新执行本步骤
|
|
150
140
|
- 返回非 `0` -> 继续后续 label 同步
|
|
151
141
|
|
|
152
|
-
**b) 同步
|
|
153
|
-
|
|
154
|
-
根据 task.md 的 `type` 字段按下表映射:
|
|
155
|
-
|
|
156
|
-
| task.md type | GitHub label |
|
|
157
|
-
|---|---|
|
|
158
|
-
| bug、bugfix | `type: bug` |
|
|
159
|
-
| feature | `type: feature` |
|
|
160
|
-
| enhancement | `type: enhancement` |
|
|
161
|
-
| refactor、refactoring | `type: enhancement` |
|
|
162
|
-
| documentation | `type: documentation` |
|
|
163
|
-
| dependency-upgrade | `type: dependency-upgrade` |
|
|
164
|
-
| task | `type: task` |
|
|
165
|
-
| 其他 | 跳过 |
|
|
166
|
-
|
|
167
|
-
如果映射到具体 label,执行:
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
gh issue edit {issue-number} --add-label "{type-label}"
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
未映射到标准 type label 时跳过,不创建新 label。
|
|
174
|
-
|
|
175
|
-
**c) 同步 status label**
|
|
142
|
+
**b) 同步 status label**
|
|
176
143
|
|
|
177
144
|
先读取 Issue 上已有的 `status:` labels:
|
|
178
145
|
|
|
@@ -203,7 +170,7 @@ gh issue edit {issue-number} --remove-label "{status-label}"
|
|
|
203
170
|
gh issue edit {issue-number} --add-label "{status-label}"
|
|
204
171
|
```
|
|
205
172
|
|
|
206
|
-
**
|
|
173
|
+
**c) 同步 in: label**
|
|
207
174
|
|
|
208
175
|
从实现报告(优先)或 `analysis.md` 中提取受影响文件路径:
|
|
209
176
|
- 优先读取 `implementation.md` 与 `implementation-r*.md` 中 `## 修改文件` / `## 新建文件` 的文件列表
|
|
@@ -226,7 +193,7 @@ gh issue edit {issue-number} --add-label "in: {module}"
|
|
|
226
193
|
|
|
227
194
|
5. **只添加,不移除**现有的 `in:` labels
|
|
228
195
|
|
|
229
|
-
**
|
|
196
|
+
**d) 同步 Issue Type 字段**
|
|
230
197
|
|
|
231
198
|
根据 task.md 的 `type` 字段映射 GitHub 原生 Issue Type:
|
|
232
199
|
|
|
@@ -408,11 +375,13 @@ summary_comment_id="$(
|
|
|
408
375
|
)"
|
|
409
376
|
```
|
|
410
377
|
|
|
378
|
+
在步骤 9 结束前,基于上述已发布/未发布结果,预先判断 `has_unpublished_artifacts`:是否存在任何尚未发布的非 `summary` 产物。该判断在步骤 10 执行期间保持不变,仅用于决定 `summary` 是原地更新还是删除后在尾部重建。
|
|
379
|
+
|
|
411
380
|
幂等要求:
|
|
412
381
|
- 第一次执行时,只发布当前已存在产物对应的文件评论
|
|
413
382
|
- 第二次执行时,必须跳过已发布文件,只补发新增产物(例如 `implementation-r2`、`review-r2`)
|
|
414
383
|
- 如果所有产物文件评论都已发布,且 `summary` 内容没有变化,则本次不发布任何新评论
|
|
415
|
-
- 如果 `summary`
|
|
384
|
+
- 如果 `summary` 已发布但交付状态发生变化:当本次有新产物发布时,删除旧 `summary` 并在尾部重建;当本次无新产物发布时,原地更新原评论
|
|
416
385
|
|
|
417
386
|
### 10. 按时间线逐条发布上下文文件
|
|
418
387
|
|
|
@@ -473,16 +442,14 @@ summary_comment_id="$(
|
|
|
473
442
|
|---|---|
|
|
474
443
|
| 分支 | `{branch 或 N/A}` |
|
|
475
444
|
| Commit | [`{commit-short}`](https://github.com/{owner}/{repo}/commit/{commit-hash}) 或 `N/A` |
|
|
476
|
-
| PR | [#{pr-number}](https://github.com/{owner}/{repo}/pull/{pr-number}) 或 `N/A` |
|
|
477
|
-
| Issue | `{issue-state}` |
|
|
478
445
|
|
|
479
446
|
---
|
|
480
447
|
*由 AI 自动生成 · 内部追踪:{task-id}*
|
|
481
448
|
```
|
|
482
449
|
|
|
483
450
|
模式化状态描述要求:
|
|
484
|
-
- 模式 A:`✅
|
|
485
|
-
- 模式 B:`PR
|
|
451
|
+
- 模式 A:`✅ 已完成`
|
|
452
|
+
- 模式 B:`PR 阶段`
|
|
486
453
|
- 模式 C:`开发中,当前步骤为 {current_step}`
|
|
487
454
|
|
|
488
455
|
**b) 跳过已发布或缺失的产物**
|
|
@@ -502,19 +469,30 @@ EOF
|
|
|
502
469
|
)"
|
|
503
470
|
```
|
|
504
471
|
|
|
505
|
-
**d)
|
|
472
|
+
**d) 发布或重建 summary 评论**
|
|
473
|
+
|
|
474
|
+
`summary` 必须始终保持为最后一条评论。根据以下条件决定处理方式:
|
|
506
475
|
|
|
507
|
-
|
|
476
|
+
- `summary` 不存在:按步骤 10c 发布新的 `summary` 评论
|
|
477
|
+
- `summary` 已存在且 `has_unpublished_artifacts=true`:先删除旧 `summary` 评论,再按步骤 10c 发布新的 `summary` 评论
|
|
478
|
+
- `summary` 已存在且 `has_unpublished_artifacts=false` 且新生成内容与已有内容不同:原地更新原评论
|
|
479
|
+
- `summary` 已存在且 `has_unpublished_artifacts=false` 且内容相同:不做任何操作
|
|
480
|
+
|
|
481
|
+
删除旧 `summary` 评论时,执行:
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
gh api "repos/$repo/issues/comments/{summary_comment_id}" -X DELETE
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
原地更新已有 `summary` 评论时,执行:
|
|
508
488
|
|
|
509
489
|
```bash
|
|
510
|
-
gh api "repos/$repo/issues/comments/{
|
|
490
|
+
gh api "repos/$repo/issues/comments/{summary_comment_id}" -X PATCH -f body="$(cat <<'EOF'
|
|
511
491
|
{comment-body}
|
|
512
492
|
EOF
|
|
513
493
|
)"
|
|
514
494
|
```
|
|
515
495
|
|
|
516
|
-
如果内容相同,则不做任何操作。
|
|
517
|
-
|
|
518
496
|
**e) 零操作场景**
|
|
519
497
|
|
|
520
498
|
如果所有产物都已同步,且 `summary` 无需更新:
|
|
@@ -545,7 +523,7 @@ date "+%Y-%m-%d %H:%M:%S"
|
|
|
545
523
|
- 更新评论:{数量}
|
|
546
524
|
- 已跳过步骤:{步骤列表或 `无`}
|
|
547
525
|
- 当前状态:{状态}
|
|
548
|
-
- Labels:
|
|
526
|
+
- Labels:status={status-label 或 cleared},in:={新增数量}
|
|
549
527
|
- Issue Type:{Bug / Feature / Task / skipped}
|
|
550
528
|
- Milestone:{preserved / assigned / fallback / skipped}
|
|
551
529
|
- Development:{已追加 Closes 关联 / 已存在关联 / 无 PR,跳过}
|
|
@@ -14,9 +14,9 @@ Sync task progress to the related Pull Request. Argument: task-id.
|
|
|
14
14
|
### 1. Verify the Task Exists
|
|
15
15
|
|
|
16
16
|
Search for the task in this order:
|
|
17
|
-
- `.
|
|
18
|
-
- `.
|
|
19
|
-
- `.
|
|
17
|
+
- `.agents/workspace/active/{task-id}/task.md`
|
|
18
|
+
- `.agents/workspace/completed/{task-id}/task.md`
|
|
19
|
+
- `.agents/workspace/blocked/{task-id}/task.md`
|
|
20
20
|
|
|
21
21
|
Note: `{task-id}` format is `TASK-{yyyyMMdd-HHmmss}`, for example `TASK-20260306-143022`
|
|
22
22
|
|
|
@@ -84,7 +84,7 @@ Do not create new type labels.
|
|
|
84
84
|
### 6. Sync `in:` Labels
|
|
85
85
|
|
|
86
86
|
Extract affected modules from implementation reports first, or analysis as fallback:
|
|
87
|
-
- prefer file paths listed under `##
|
|
87
|
+
- prefer file paths listed under `## Modified Files`, especially `### New Files` / `### Modified Files`, in `implementation.md` and `implementation-r{N}.md`
|
|
88
88
|
- if implementation reports do not exist yet, fall back to affected files from analysis
|
|
89
89
|
|
|
90
90
|
For each file path:
|
|
@@ -197,19 +197,7 @@ EOF
|
|
|
197
197
|
|
|
198
198
|
5. If task.md does not contain `issue_number`, record `Development: N/A`
|
|
199
199
|
|
|
200
|
-
### 9.
|
|
201
|
-
|
|
202
|
-
If task.md contains `issue_number`, run:
|
|
203
|
-
|
|
204
|
-
```bash
|
|
205
|
-
gh issue view {issue-number} --json state
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
Record whether the Issue is `OPEN` or `CLOSED`.
|
|
209
|
-
|
|
210
|
-
If task.md does not contain `issue_number`, record `Issue: N/A`.
|
|
211
|
-
|
|
212
|
-
### 10. Create or Update the Single Idempotent Review Summary
|
|
200
|
+
### 9. Create or Update the Single Idempotent Review Summary
|
|
213
201
|
|
|
214
202
|
Reuse the repository coordinates resolved in step 4, then fetch existing PR comments:
|
|
215
203
|
|
|
@@ -242,7 +230,6 @@ Summary requirements:
|
|
|
242
230
|
- each key technical decision must be self-contained; do not reference internal document labels or jargon such as `Option A/B`
|
|
243
231
|
- build a review-history table from `review.md`, `review-r{N}.md`, `refinement.md`, and `refinement-r{N}.md`
|
|
244
232
|
- extract test results from `implementation.md` or `refinement.md`
|
|
245
|
-
- include Issue state in the relationship table
|
|
246
233
|
|
|
247
234
|
Recommended review-history columns:
|
|
248
235
|
- `Round`
|
|
@@ -276,12 +263,6 @@ Candidate comment format:
|
|
|
276
263
|
|
|
277
264
|
- {test-summary}
|
|
278
265
|
|
|
279
|
-
### Relationships
|
|
280
|
-
|
|
281
|
-
| Type | Content |
|
|
282
|
-
|------|---------|
|
|
283
|
-
| Issue | #{issue-number} ({state}) or `N/A` |
|
|
284
|
-
|
|
285
266
|
---
|
|
286
267
|
*Generated by AI · Internal Tracking: {task-id}*
|
|
287
268
|
```
|
|
@@ -309,7 +290,7 @@ EOF
|
|
|
309
290
|
)"
|
|
310
291
|
```
|
|
311
292
|
|
|
312
|
-
###
|
|
293
|
+
### 10. Update Task Status
|
|
313
294
|
|
|
314
295
|
Get the current time:
|
|
315
296
|
|
|
@@ -323,7 +304,7 @@ Add or update `last_synced_to_pr_at` in task.md with `{current-time}`.
|
|
|
323
304
|
- {yyyy-MM-dd HH:mm:ss} — **Sync to PR** by {agent} — PR metadata synced, summary {created|updated|skipped} on PR #{pr-number}
|
|
324
305
|
```
|
|
325
306
|
|
|
326
|
-
###
|
|
307
|
+
### 11. Inform the User
|
|
327
308
|
|
|
328
309
|
```
|
|
329
310
|
Progress synced to PR #{pr-number}.
|
|
@@ -333,7 +314,6 @@ Synchronized:
|
|
|
333
314
|
- Milestone: {milestone-result}
|
|
334
315
|
- Development: {development-result}
|
|
335
316
|
- Summary: {created|updated|skipped}
|
|
336
|
-
- Issue: {OPEN|CLOSED|N/A}
|
|
337
317
|
|
|
338
318
|
View: https://github.com/{owner}/{repo}/pull/{pr-number}
|
|
339
319
|
```
|
|
@@ -343,7 +323,7 @@ View: https://github.com/{owner}/{repo}/pull/{pr-number}
|
|
|
343
323
|
1. `sync-pr` is reviewer-facing. Keep one summary comment only, rather than publishing every artifact round to the PR.
|
|
344
324
|
2. PR metadata sync must be safe to repeat. Re-runs should fill gaps without creating noise.
|
|
345
325
|
3. Because Pull Requests share the Issue comments API, create the summary comment through `issues/{pr-number}/comments`.
|
|
346
|
-
4. If `issue_number` is missing, record `Development: N/A`
|
|
326
|
+
4. If `issue_number` is missing, record `Development: N/A` instead of failing the whole flow.
|
|
347
327
|
|
|
348
328
|
## Error Handling
|
|
349
329
|
|
|
@@ -14,9 +14,9 @@ description: >
|
|
|
14
14
|
### 1. 验证任务存在
|
|
15
15
|
|
|
16
16
|
按优先顺序搜索任务:
|
|
17
|
-
- `.
|
|
18
|
-
- `.
|
|
19
|
-
- `.
|
|
17
|
+
- `.agents/workspace/active/{task-id}/task.md`
|
|
18
|
+
- `.agents/workspace/completed/{task-id}/task.md`
|
|
19
|
+
- `.agents/workspace/blocked/{task-id}/task.md`
|
|
20
20
|
|
|
21
21
|
注意:`{task-id}` 格式为 `TASK-{yyyyMMdd-HHmmss}`,例如 `TASK-20260306-143022`
|
|
22
22
|
|
|
@@ -197,19 +197,7 @@ EOF
|
|
|
197
197
|
|
|
198
198
|
5. 如果 task.md 不包含 `issue_number`,记录 `Development: N/A`
|
|
199
199
|
|
|
200
|
-
### 9.
|
|
201
|
-
|
|
202
|
-
如果 task.md 包含 `issue_number`,执行:
|
|
203
|
-
|
|
204
|
-
```bash
|
|
205
|
-
gh issue view {issue-number} --json state
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
记录 Issue 当前是 `OPEN` 还是 `CLOSED`。
|
|
209
|
-
|
|
210
|
-
如果 task.md 不包含 `issue_number`,记录 `Issue: N/A`。
|
|
211
|
-
|
|
212
|
-
### 10. 生成或更新单条幂等审查摘要
|
|
200
|
+
### 9. 生成或更新单条幂等审查摘要
|
|
213
201
|
|
|
214
202
|
复用步骤 4 已获取的仓库坐标,并拉取 PR 已有评论:
|
|
215
203
|
|
|
@@ -242,7 +230,6 @@ summary_comment_id="$(
|
|
|
242
230
|
- 关键技术决策的描述必须自包含,不要引用内部文档的编号或术语(如 `方案 A/B`);审查者应能独立理解每条决策的含义
|
|
243
231
|
- 从 `review.md`、`review-r{N}.md`、`refinement.md`、`refinement-r{N}.md` 构建审查历程表格
|
|
244
232
|
- 从 `implementation.md` 或 `refinement.md` 的测试章节提取测试结果
|
|
245
|
-
- 在关联表格中记录 Issue 状态
|
|
246
233
|
|
|
247
234
|
审查历程表格建议字段:
|
|
248
235
|
- `轮次`
|
|
@@ -276,12 +263,6 @@ summary_comment_id="$(
|
|
|
276
263
|
|
|
277
264
|
- {test-summary}
|
|
278
265
|
|
|
279
|
-
### 关联
|
|
280
|
-
|
|
281
|
-
| 类型 | 内容 |
|
|
282
|
-
|------|------|
|
|
283
|
-
| Issue | #{issue-number}({state})或 `N/A` |
|
|
284
|
-
|
|
285
266
|
---
|
|
286
267
|
*由 AI 自动生成 · 内部追踪:{task-id}*
|
|
287
268
|
```
|
|
@@ -309,7 +290,7 @@ EOF
|
|
|
309
290
|
)"
|
|
310
291
|
```
|
|
311
292
|
|
|
312
|
-
###
|
|
293
|
+
### 10. 更新任务状态
|
|
313
294
|
|
|
314
295
|
获取当前时间:
|
|
315
296
|
|
|
@@ -323,7 +304,7 @@ date "+%Y-%m-%d %H:%M:%S"
|
|
|
323
304
|
- {yyyy-MM-dd HH:mm:ss} — **Sync to PR** by {agent} — PR metadata synced, summary {created|updated|skipped} on PR #{pr-number}
|
|
324
305
|
```
|
|
325
306
|
|
|
326
|
-
###
|
|
307
|
+
### 11. 告知用户
|
|
327
308
|
|
|
328
309
|
```
|
|
329
310
|
进度已同步到 PR #{pr-number}。
|
|
@@ -333,7 +314,6 @@ date "+%Y-%m-%d %H:%M:%S"
|
|
|
333
314
|
- Milestone:{milestone-result}
|
|
334
315
|
- Development:{development-result}
|
|
335
316
|
- Summary:{created|updated|skipped}
|
|
336
|
-
- Issue:{OPEN|CLOSED|N/A}
|
|
337
317
|
|
|
338
318
|
查看:https://github.com/{owner}/{repo}/pull/{pr-number}
|
|
339
319
|
```
|
|
@@ -343,7 +323,7 @@ date "+%Y-%m-%d %H:%M:%S"
|
|
|
343
323
|
1. `sync-pr` 面向代码审查者,只维护一条 reviewer-facing summary 评论,不逐轮发布完整产物。
|
|
344
324
|
2. PR 元数据同步必须可重复执行;重复执行时仅补齐缺失信息,不制造额外噪音。
|
|
345
325
|
3. 由于 Pull Request 共享 Issue 评论接口,summary 评论应使用 `issues/{pr-number}/comments` API 创建。
|
|
346
|
-
4. 如果 `issue_number` 缺失,Development
|
|
326
|
+
4. 如果 `issue_number` 缺失,Development 应记录为 `N/A`,不要让整个流程失败。
|
|
347
327
|
|
|
348
328
|
## 错误处理
|
|
349
329
|
|
|
@@ -28,12 +28,12 @@ Execute the following command to handle all deterministic steps at once:
|
|
|
28
28
|
node .agents/skills/update-agent-infra/scripts/sync-templates.js
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
The script reads `.airc.json` (including `templateSource`, default `templates/`) and automatically performs:
|
|
32
|
-
-
|
|
33
|
-
- File registry sync (`defaults.json` → `.airc.json`)
|
|
31
|
+
The script reads `.agents/.airc.json` (including `templateSource`, default `templates/`) and automatically performs:
|
|
32
|
+
- detect the template source version
|
|
33
|
+
- File registry sync (`defaults.json` → `.agents/.airc.json`)
|
|
34
34
|
- All managed files (language selection → exclude merged/ejected → placeholder rendering → overwrite)
|
|
35
35
|
- Ejected files (create only on first install)
|
|
36
|
-
- `.airc.json` update (`templateVersion`, file lists)
|
|
36
|
+
- `.agents/.airc.json` update (`templateVersion`, file lists)
|
|
37
37
|
|
|
38
38
|
The script outputs JSON to stdout. Parse and record the report.
|
|
39
39
|
|
|
@@ -46,14 +46,14 @@ The script outputs JSON to stdout. Parse and record the report.
|
|
|
46
46
|
- Each item has `target` (project-relative path) and `template` (template-root-relative path)
|
|
47
47
|
- `registryAdded`: newly added file registry entries
|
|
48
48
|
- `selfUpdate`: whether this is a self-update scenario
|
|
49
|
-
- `configUpdated`: whether `.airc.json` was updated
|
|
49
|
+
- `configUpdated`: whether `.agents/.airc.json` was updated
|
|
50
50
|
|
|
51
51
|
## Phase B: Process merged files (AI intelligent merge)
|
|
52
52
|
|
|
53
53
|
Process each item in the report's `merged.pending` list:
|
|
54
54
|
|
|
55
55
|
1. Read the template file from `<templateRoot>/<template>`
|
|
56
|
-
2. Render placeholders: replace double-brace `project` and `org` placeholders with actual values from .airc.json
|
|
56
|
+
2. Render placeholders: replace double-brace `project` and `org` placeholders with actual values from .agents/.airc.json
|
|
57
57
|
3. Read the current local file (`<project-root>/<target>`)
|
|
58
58
|
|
|
59
59
|
**If the local file does not exist** (first-time setup), write the rendered
|
|
@@ -24,12 +24,12 @@ description: >
|
|
|
24
24
|
node .agents/skills/update-agent-infra/scripts/sync-templates.js
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
脚本读取 `.airc.json`(含 `templateSource`,默认 `templates/`),自动完成:
|
|
28
|
-
-
|
|
29
|
-
- 同步文件注册表(`defaults.json` → `.airc.json`)
|
|
27
|
+
脚本读取 `.agents/.airc.json`(含 `templateSource`,默认 `templates/`),自动完成:
|
|
28
|
+
- 检测模板源版本
|
|
29
|
+
- 同步文件注册表(`defaults.json` → `.agents/.airc.json`)
|
|
30
30
|
- 处理所有 managed 文件(语言选择 → 排除 merged/ejected → 占位符渲染 → 覆盖写入)
|
|
31
31
|
- 处理 ejected 文件(仅首次安装时创建)
|
|
32
|
-
- 更新 `.airc.json`(`templateVersion`、文件列表)
|
|
32
|
+
- 更新 `.agents/.airc.json`(`templateVersion`、文件列表)
|
|
33
33
|
|
|
34
34
|
脚本输出 JSON 到 stdout,解析并记录报告内容。
|
|
35
35
|
|
|
@@ -42,14 +42,14 @@ node .agents/skills/update-agent-infra/scripts/sync-templates.js
|
|
|
42
42
|
- 每项包含 `target`(项目中的目标路径)和 `template`(模板根目录下的相对路径)
|
|
43
43
|
- `registryAdded`:新增的文件注册条目
|
|
44
44
|
- `selfUpdate`:是否为自更新模式
|
|
45
|
-
- `configUpdated`:`.airc.json` 是否已更新
|
|
45
|
+
- `configUpdated`:`.agents/.airc.json` 是否已更新
|
|
46
46
|
|
|
47
47
|
## 阶段 B:处理 merged 文件(AI 智能合并)
|
|
48
48
|
|
|
49
49
|
根据报告中 `merged.pending` 列表,逐个文件处理。对于每个条目:
|
|
50
50
|
|
|
51
51
|
1. 从 `<templateRoot>/<template>` 读取模板文件
|
|
52
|
-
2. 渲染占位符:将双花括号包裹的 `project` 和 `org` 占位符替换为 .airc.json 中的实际值
|
|
52
|
+
2. 渲染占位符:将双花括号包裹的 `project` 和 `org` 占位符替换为 .agents/.airc.json 中的实际值
|
|
53
53
|
3. 读取本地当前文件(`<项目根>/<target>`)
|
|
54
54
|
|
|
55
55
|
**如果本地文件不存在**(首次安装),直接写入渲染后的模板,跳过合并。
|