@fitlab-ai/agent-infra 0.4.1 → 0.4.3
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 +44 -44
- package/README.zh-CN.md +44 -44
- package/lib/defaults.json +7 -9
- package/lib/init.js +1 -0
- package/lib/update.js +13 -1
- package/package.json +3 -3
- package/templates/.agents/QUICKSTART.md +7 -7
- package/templates/.agents/QUICKSTART.zh-CN.md +13 -13
- package/templates/.agents/README.md +31 -18
- package/templates/.agents/README.zh-CN.md +33 -20
- package/templates/.agents/rules/issue-sync.md +185 -0
- package/templates/.agents/rules/issue-sync.zh-CN.md +185 -0
- package/templates/.agents/scripts/validate-artifact.js +1280 -0
- package/templates/.agents/skills/analyze-task/SKILL.md +24 -1
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +24 -1
- package/templates/.agents/skills/analyze-task/config/verify.json +41 -0
- package/templates/.agents/skills/archive-tasks/SKILL.md +40 -0
- package/templates/.agents/skills/archive-tasks/SKILL.zh-CN.md +40 -0
- package/templates/.agents/skills/archive-tasks/scripts/archive-tasks.sh +403 -0
- package/templates/.agents/skills/block-task/SKILL.md +25 -37
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +25 -37
- package/templates/.agents/skills/block-task/config/verify.json +28 -0
- package/templates/.agents/skills/close-codescan/SKILL.md +7 -0
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +7 -0
- package/templates/.agents/skills/close-dependabot/SKILL.md +7 -0
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +7 -0
- package/templates/.agents/skills/commit/SKILL.md +17 -0
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +17 -0
- package/templates/.agents/skills/commit/config/verify.json +22 -0
- package/templates/.agents/skills/commit/reference/task-status-update.md +3 -3
- package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +3 -3
- package/templates/.agents/skills/complete-task/SKILL.md +24 -10
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +24 -10
- package/templates/.agents/skills/complete-task/config/verify.json +30 -0
- package/templates/.agents/skills/create-issue/SKILL.md +41 -5
- package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +41 -5
- package/templates/.agents/skills/create-issue/config/verify.json +27 -0
- package/templates/.agents/skills/create-issue/reference/label-and-type.md +10 -11
- package/templates/.agents/skills/create-issue/reference/label-and-type.zh-CN.md +10 -11
- package/templates/.agents/skills/create-pr/SKILL.md +59 -16
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +59 -16
- package/templates/.agents/skills/create-pr/config/verify.json +26 -0
- package/templates/.agents/skills/create-pr/reference/branch-strategy.md +3 -3
- package/templates/.agents/skills/create-pr/reference/branch-strategy.zh-CN.md +3 -3
- package/templates/.agents/skills/{sync-pr → create-pr}/reference/comment-publish.md +6 -6
- package/templates/.agents/skills/{sync-pr → create-pr}/reference/comment-publish.zh-CN.md +10 -10
- package/templates/.agents/skills/create-pr/reference/pr-body-template.md +15 -6
- package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +15 -6
- package/templates/.agents/skills/create-task/SKILL.md +25 -3
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +25 -3
- package/templates/.agents/skills/create-task/config/verify.json +24 -0
- package/templates/.agents/skills/implement-task/SKILL.md +44 -8
- package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +44 -8
- package/templates/.agents/skills/implement-task/config/verify.json +41 -0
- package/templates/.agents/skills/implement-task/reference/branch-management.md +48 -0
- package/templates/.agents/skills/implement-task/reference/branch-management.zh-CN.md +49 -0
- package/templates/.agents/skills/implement-task/reference/output-template.md +20 -0
- package/templates/.agents/skills/implement-task/reference/output-template.zh-CN.md +20 -0
- package/templates/.agents/skills/import-codescan/SKILL.md +18 -7
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +18 -7
- package/templates/.agents/skills/import-codescan/config/verify.json +24 -0
- package/templates/.agents/skills/import-dependabot/SKILL.md +18 -7
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +18 -7
- package/templates/.agents/skills/import-dependabot/config/verify.json +24 -0
- package/templates/.agents/skills/import-issue/SKILL.md +19 -1
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +19 -1
- package/templates/.agents/skills/import-issue/config/verify.json +27 -0
- package/templates/.agents/skills/init-labels/SKILL.md +40 -10
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +40 -10
- package/templates/.agents/skills/init-labels/scripts/init-labels.sh +1 -22
- package/templates/.agents/skills/init-milestones/SKILL.md +13 -0
- package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +13 -0
- package/templates/.agents/skills/plan-task/SKILL.md +29 -75
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +29 -75
- package/templates/.agents/skills/plan-task/config/verify.json +42 -0
- package/templates/.agents/skills/refine-task/SKILL.md +51 -4
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +51 -4
- package/templates/.agents/skills/refine-task/config/verify.json +37 -0
- package/templates/.agents/skills/refine-title/SKILL.md +10 -2
- package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +10 -2
- package/templates/.agents/skills/restore-task/SKILL.md +159 -0
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +159 -0
- package/templates/.agents/skills/restore-task/config/verify.json +24 -0
- package/templates/.agents/skills/review-task/SKILL.md +25 -1
- package/templates/.agents/skills/review-task/SKILL.zh-CN.md +25 -1
- package/templates/.agents/skills/review-task/config/verify.json +40 -0
- package/templates/.agents/skills/update-agent-infra/SKILL.md +11 -0
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +11 -0
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +8 -10
- package/templates/.claude/commands/archive-tasks.md +9 -0
- package/templates/.claude/commands/archive-tasks.zh-CN.md +9 -0
- package/templates/.claude/commands/create-pr.md +1 -1
- package/templates/.claude/commands/create-pr.zh-CN.md +1 -1
- package/templates/.claude/commands/restore-task.md +9 -0
- package/templates/.claude/commands/restore-task.zh-CN.md +9 -0
- package/templates/.gemini/commands/_project_/archive-tasks.toml +10 -0
- package/templates/.gemini/commands/_project_/archive-tasks.zh-CN.toml +10 -0
- package/templates/.gemini/commands/_project_/restore-task.toml +8 -0
- package/templates/.gemini/commands/_project_/restore-task.zh-CN.toml +8 -0
- package/templates/.github/workflows/status-label.yml +82 -0
- package/templates/.opencode/commands/archive-tasks.md +11 -0
- package/templates/.opencode/commands/archive-tasks.zh-CN.md +11 -0
- package/templates/.opencode/commands/restore-task.md +11 -0
- package/templates/.opencode/commands/restore-task.zh-CN.md +11 -0
- package/templates/.agents/skills/sync-issue/SKILL.md +0 -91
- package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +0 -91
- package/templates/.agents/skills/sync-issue/reference/comment-publish.md +0 -88
- package/templates/.agents/skills/sync-issue/reference/comment-publish.zh-CN.md +0 -88
- package/templates/.agents/skills/sync-issue/reference/delivery-detection.md +0 -42
- package/templates/.agents/skills/sync-issue/reference/delivery-detection.zh-CN.md +0 -42
- package/templates/.agents/skills/sync-issue/reference/label-sync.md +0 -63
- package/templates/.agents/skills/sync-issue/reference/label-sync.zh-CN.md +0 -63
- package/templates/.agents/skills/sync-issue/reference/milestone-sync.md +0 -37
- package/templates/.agents/skills/sync-issue/reference/milestone-sync.zh-CN.md +0 -37
- package/templates/.agents/skills/sync-pr/SKILL.md +0 -72
- package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +0 -72
- package/templates/.agents/skills/sync-pr/reference/delivery-detection.md +0 -54
- package/templates/.agents/skills/sync-pr/reference/delivery-detection.zh-CN.md +0 -54
- package/templates/.claude/CLAUDE.md +0 -138
- package/templates/.claude/CLAUDE.zh-CN.md +0 -138
- package/templates/.claude/commands/sync-issue.md +0 -8
- package/templates/.claude/commands/sync-issue.zh-CN.md +0 -8
- package/templates/.claude/commands/sync-pr.md +0 -8
- package/templates/.claude/commands/sync-pr.zh-CN.md +0 -8
- package/templates/.claude/project-rules.md +0 -65
- package/templates/.claude/project-rules.zh-CN.md +0 -65
- package/templates/.codex/README.md +0 -38
- package/templates/.codex/README.zh-CN.md +0 -37
- package/templates/.gemini/commands/_project_/sync-issue.toml +0 -8
- package/templates/.gemini/commands/_project_/sync-issue.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/sync-pr.toml +0 -8
- package/templates/.gemini/commands/_project_/sync-pr.zh-CN.toml +0 -8
- package/templates/.opencode/COMMAND_STYLE_GUIDE.md +0 -232
- package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +0 -232
- package/templates/.opencode/README.md +0 -76
- package/templates/.opencode/README.zh-CN.md +0 -77
- package/templates/.opencode/commands/sync-issue.md +0 -11
- package/templates/.opencode/commands/sync-issue.zh-CN.md +0 -11
- package/templates/.opencode/commands/sync-pr.md +0 -11
- package/templates/.opencode/commands/sync-pr.zh-CN.md +0 -11
- package/templates/AGENTS.md +0 -112
- package/templates/AGENTS.zh-CN.md +0 -112
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill": "import-issue",
|
|
3
|
+
"checks": {
|
|
4
|
+
"task-meta": {
|
|
5
|
+
"required_fields": [
|
|
6
|
+
"id",
|
|
7
|
+
"type",
|
|
8
|
+
"workflow",
|
|
9
|
+
"status",
|
|
10
|
+
"created_at",
|
|
11
|
+
"updated_at",
|
|
12
|
+
"current_step",
|
|
13
|
+
"assigned_to"
|
|
14
|
+
],
|
|
15
|
+
"expected_step": "requirement-analysis",
|
|
16
|
+
"require_issue_number": true
|
|
17
|
+
},
|
|
18
|
+
"activity-log": {
|
|
19
|
+
"expected_action_pattern": "Import Issue",
|
|
20
|
+
"freshness_minutes": 30
|
|
21
|
+
},
|
|
22
|
+
"github-sync": {
|
|
23
|
+
"when": "issue_number_exists",
|
|
24
|
+
"issue_must_exist": true
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -29,8 +29,6 @@ bash .agents/skills/init-labels/scripts/init-labels.sh
|
|
|
29
29
|
The script is responsible for:
|
|
30
30
|
- Capturing the current label snapshot before making changes
|
|
31
31
|
- Creating or updating the standard label set with `gh label create --force`
|
|
32
|
-
- Auto-detecting top-level directories and creating one `in:` label per valid directory
|
|
33
|
-
- Falling back to `in: core` when no eligible directory is detected
|
|
34
32
|
- Reporting unmatched GitHub default labels such as `question` and `wontfix`
|
|
35
33
|
- Printing the final execution summary
|
|
36
34
|
|
|
@@ -50,25 +48,57 @@ The script manages these common label families:
|
|
|
50
48
|
| `status:` | Yes | — | PRs already have their own state flow (Open/Draft/Merged/Closed); Issues use `status:` labels for project tracking |
|
|
51
49
|
| `in:` | Yes | Yes | Both Issues and PRs need module-based filtering |
|
|
52
50
|
|
|
53
|
-
### 4.
|
|
51
|
+
### 4. Configure the `in:` Label Mapping
|
|
54
52
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
Check whether `.agents/.airc.json` already contains a `labels.in` field.
|
|
54
|
+
|
|
55
|
+
#### 4.1 Existing mapping
|
|
56
|
+
|
|
57
|
+
Show the current mapping and ask whether it should be updated.
|
|
58
|
+
- if no: continue to step 4.3
|
|
59
|
+
- if yes: continue to step 4.2
|
|
60
|
+
|
|
61
|
+
#### 4.2 Missing mapping or user-requested update
|
|
62
|
+
|
|
63
|
+
1. Scan top-level project directories while excluding hidden and generated folders.
|
|
64
|
+
2. Analyze the directory contents and suggest meaningful module groupings.
|
|
65
|
+
3. Show the proposed `in:` label mapping and refine it through the user's natural-language feedback.
|
|
66
|
+
4. If the user declines configuration, generate a 1:1 fallback mapping for each top-level directory (`{dir}/`).
|
|
67
|
+
|
|
68
|
+
#### 4.3 Write the mapping and create labels
|
|
69
|
+
|
|
70
|
+
1. Write the final mapping to `.agents/.airc.json` under `labels.in`.
|
|
71
|
+
2. Create one `in: {key}` label for each mapping key:
|
|
72
|
+
```bash
|
|
73
|
+
gh label create "in: {key}" --color EBF8DF --description "Module: {key}" --force
|
|
74
|
+
```
|
|
75
|
+
3. After user confirmation, delete stale `in:` labels that are no longer present in the final mapping.
|
|
60
76
|
|
|
61
77
|
### 5. Output and behavior guarantees
|
|
62
78
|
|
|
63
79
|
The summary must include:
|
|
64
80
|
- Number of common labels created or updated
|
|
65
|
-
-
|
|
81
|
+
- The written `labels.in` mapping
|
|
82
|
+
- The number of `in:` labels derived from the mapping keys
|
|
66
83
|
- Confirmation that exact-match GitHub defaults were overwritten
|
|
67
84
|
- Any unmatched GitHub default labels still present
|
|
68
85
|
|
|
69
86
|
Operational notes:
|
|
70
87
|
- The operation is idempotent because every label uses `gh label create --force`.
|
|
71
|
-
-
|
|
88
|
+
- `in:` labels are managed by the AI-guided step together with the `.airc.json` mapping.
|
|
89
|
+
|
|
90
|
+
### 6. Inform User
|
|
91
|
+
|
|
92
|
+
> **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
|
|
93
|
+
|
|
94
|
+
After summarizing the label initialization, show:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
Next step - initialize milestones (optional):
|
|
98
|
+
- Claude Code / OpenCode: /init-milestones
|
|
99
|
+
- Gemini CLI: /{{project}}:init-milestones
|
|
100
|
+
- Codex CLI: $init-milestones
|
|
101
|
+
```
|
|
72
102
|
|
|
73
103
|
## Error Handling
|
|
74
104
|
|
|
@@ -29,8 +29,6 @@ bash .agents/skills/init-labels/scripts/init-labels.sh
|
|
|
29
29
|
脚本负责:
|
|
30
30
|
- 在修改前保存当前 label 快照
|
|
31
31
|
- 使用 `gh label create --force` 创建或更新标准 label 集合
|
|
32
|
-
- 自动探测顶层目录,并为有效目录创建对应的 `in:` label
|
|
33
|
-
- 在没有可用目录时回退到 `in: core`
|
|
34
32
|
- 提示仍然存在的 GitHub 默认 labels,例如 `question` 和 `wontfix`
|
|
35
33
|
- 输出最终执行摘要
|
|
36
34
|
|
|
@@ -50,25 +48,57 @@ bash .agents/skills/init-labels/scripts/init-labels.sh
|
|
|
50
48
|
| `status:` | Yes | — | PR 有自身状态流转(Open/Draft/Merged/Closed);Issue 使用 `status:` label 标记项目管理状态 |
|
|
51
49
|
| `in:` | Yes | Yes | Issue 和 PR 均需按模块筛选 |
|
|
52
50
|
|
|
53
|
-
### 4.
|
|
51
|
+
### 4. 配置 `in:` label 映射
|
|
54
52
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
检查 `.agents/.airc.json` 中是否已有 `labels.in` 字段。
|
|
54
|
+
|
|
55
|
+
#### 4.1 已有映射
|
|
56
|
+
|
|
57
|
+
展示当前映射,询问用户是否需要更新。
|
|
58
|
+
- 不需要:跳到步骤 4.3
|
|
59
|
+
- 需要:按步骤 4.2 处理
|
|
60
|
+
|
|
61
|
+
#### 4.2 无映射或用户要求更新
|
|
62
|
+
|
|
63
|
+
1. 扫描项目顶层目录,排除隐藏目录和常见构建目录。
|
|
64
|
+
2. 分析目录内容,给出有意义的模块分组建议。
|
|
65
|
+
3. 向用户展示建议的 `in:` label 映射,并根据自然语言反馈迭代调整。
|
|
66
|
+
4. 如果用户拒绝配置,则为每个顶层目录生成 1:1 默认映射(`{dir}/`)。
|
|
67
|
+
|
|
68
|
+
#### 4.3 写入配置并创建 label
|
|
69
|
+
|
|
70
|
+
1. 将最终映射写入 `.agents/.airc.json` 的 `labels.in` 字段。
|
|
71
|
+
2. 为每个映射 key 创建 `in: {key}` label:
|
|
72
|
+
```bash
|
|
73
|
+
gh label create "in: {key}" --color EBF8DF --description "Module: {key}" --force
|
|
74
|
+
```
|
|
75
|
+
3. 询问用户确认后,清理不在最终映射中的旧 `in:` label。
|
|
60
76
|
|
|
61
77
|
### 5. 输出与行为保证
|
|
62
78
|
|
|
63
79
|
摘要必须包含:
|
|
64
80
|
- 创建或更新的通用 labels 数量
|
|
65
|
-
-
|
|
81
|
+
- 写入的 `labels.in` 映射结果
|
|
82
|
+
- 按映射 key 计算的 `in:` labels 数量
|
|
66
83
|
- 名称完全匹配的 GitHub 默认 labels 已被覆盖的说明
|
|
67
84
|
- 仍然存在的未匹配 GitHub 默认 labels
|
|
68
85
|
|
|
69
86
|
执行说明:
|
|
70
87
|
- 整个操作具备幂等性,因为每个 label 都使用 `gh label create --force`。
|
|
71
|
-
-
|
|
88
|
+
- `in:` labels 由 AI 引导步骤和 `.airc.json` 映射统一管理。
|
|
89
|
+
|
|
90
|
+
### 6. 告知用户
|
|
91
|
+
|
|
92
|
+
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
|
|
93
|
+
|
|
94
|
+
输出 labels 初始化摘要后,提示:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
下一步 - 初始化 Milestones(可选):
|
|
98
|
+
- Claude Code / OpenCode:/init-milestones
|
|
99
|
+
- Gemini CLI:/agent-infra:init-milestones
|
|
100
|
+
- Codex CLI:$init-milestones
|
|
101
|
+
```
|
|
72
102
|
|
|
73
103
|
## 错误处理
|
|
74
104
|
|
|
@@ -58,25 +58,6 @@ while IFS="$(printf '\t')" read -r name color description; do
|
|
|
58
58
|
gh label create "$name" --color "$color" --description "$description" --force
|
|
59
59
|
done < "$tmpdir/common.tsv"
|
|
60
60
|
|
|
61
|
-
project_dirs=$(
|
|
62
|
-
find . -mindepth 1 -maxdepth 1 -type d ! -name '.*' |
|
|
63
|
-
sed 's#^\./##' |
|
|
64
|
-
grep -Ev '^(node_modules|vendor|dist|build|out|target|tmp|temp|log|logs|coverage|__pycache__)$' |
|
|
65
|
-
sort -u
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
if [ -z "$project_dirs" ]; then
|
|
69
|
-
project_dirs="core"
|
|
70
|
-
fi
|
|
71
|
-
|
|
72
|
-
printf '%s\n' "$project_dirs" | while IFS= read -r dir; do
|
|
73
|
-
[ -n "$dir" ] || continue
|
|
74
|
-
gh label create "in: $dir" \
|
|
75
|
-
--color EBF8DF \
|
|
76
|
-
--description "Issues in $dir" \
|
|
77
|
-
--force
|
|
78
|
-
done
|
|
79
|
-
|
|
80
61
|
gh label list --limit 200 --json name --jq '.[].name' > "$tmpdir/final-names.txt"
|
|
81
62
|
cp "$tmpdir/final-names.txt" "$tmpdir/final.txt"
|
|
82
63
|
|
|
@@ -88,13 +69,11 @@ for label in bug documentation duplicate enhancement invalid question wontfix; d
|
|
|
88
69
|
done
|
|
89
70
|
|
|
90
71
|
common_count="$(wc -l < "$tmpdir/common.tsv" | tr -d ' ')"
|
|
91
|
-
in_count="$(printf '%s\n' "$project_dirs" | sed '/^$/d' | wc -l | tr -d ' ')"
|
|
92
72
|
|
|
93
73
|
echo "GitHub Labels initialized."
|
|
94
74
|
echo
|
|
95
75
|
echo "Summary:"
|
|
96
76
|
echo "- Common labels created or updated: $common_count"
|
|
97
|
-
echo "- in: labels created or updated: $in_count"
|
|
98
77
|
echo "- Exact-match GitHub defaults overwritten: good first issue, help wanted"
|
|
99
78
|
|
|
100
79
|
if [ -s "$tmpdir/unmatched-defaults.txt" ]; then
|
|
@@ -108,4 +87,4 @@ echo
|
|
|
108
87
|
echo "Notes:"
|
|
109
88
|
echo "- theme: labels were intentionally not created."
|
|
110
89
|
echo "- The operation is idempotent because every label uses gh label create --force."
|
|
111
|
-
echo "-
|
|
90
|
+
echo "- in: labels are managed by the AI-guided step in the SKILL."
|
|
@@ -61,6 +61,19 @@ Operational notes:
|
|
|
61
61
|
- Historical `X.Y.Z` tags create `X.Y.x` milestones as open and `X.Y.Z` milestones as closed.
|
|
62
62
|
- Repositories with many tags may hit the GitHub API rate limit.
|
|
63
63
|
|
|
64
|
+
### 5. Inform User
|
|
65
|
+
|
|
66
|
+
> **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
|
|
67
|
+
|
|
68
|
+
After summarizing the milestone initialization, show:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
Next step - initialize labels (optional):
|
|
72
|
+
- Claude Code / OpenCode: /init-labels
|
|
73
|
+
- Gemini CLI: /{{project}}:init-labels
|
|
74
|
+
- Codex CLI: $init-labels
|
|
75
|
+
```
|
|
76
|
+
|
|
64
77
|
## Error Handling
|
|
65
78
|
|
|
66
79
|
- `gh` not found: prompt "GitHub CLI (`gh`) is not installed"
|
|
@@ -61,6 +61,19 @@ bash .agents/skills/init-milestones/scripts/init-milestones.sh "$ARGUMENTS"
|
|
|
61
61
|
- 历史 `X.Y.Z` tag 会生成开启状态的 `X.Y.x` 和关闭状态的 `X.Y.Z`。
|
|
62
62
|
- 标签较多的仓库可能触发 GitHub API rate limit。
|
|
63
63
|
|
|
64
|
+
### 5. 告知用户
|
|
65
|
+
|
|
66
|
+
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
|
|
67
|
+
|
|
68
|
+
输出 milestones 初始化摘要后,提示:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
下一步 - 初始化 Labels(可选):
|
|
72
|
+
- Claude Code / OpenCode:/init-labels
|
|
73
|
+
- Gemini CLI:/agent-infra:init-labels
|
|
74
|
+
- Codex CLI:$init-labels
|
|
75
|
+
```
|
|
76
|
+
|
|
64
77
|
## 错误处理
|
|
65
78
|
|
|
66
79
|
- 未找到 `gh`:提示 "GitHub CLI (`gh`) is not installed"
|
|
@@ -66,10 +66,11 @@ Follow the `technical-design` step in `.agents/workflows/feature-development.yam
|
|
|
66
66
|
- [ ] Assess impact and risks
|
|
67
67
|
|
|
68
68
|
**Design principles**:
|
|
69
|
-
1. **
|
|
70
|
-
2. **
|
|
71
|
-
3. **
|
|
72
|
-
4. **
|
|
69
|
+
1. **Architectural soundness**: choose the structurally correct approach; diff size is not the primary criterion. Do not pile changes onto an unsound structure just to keep the diff small
|
|
70
|
+
2. **Simplicity**: given a sound architecture, prefer the simplest approach and avoid over-engineering
|
|
71
|
+
3. **Consistency**: follow existing code patterns and conventions
|
|
72
|
+
4. **Testability**: design for straightforward testing
|
|
73
|
+
5. **Reversibility**: prefer changes that are easy to roll back
|
|
73
74
|
|
|
74
75
|
### 6. Output Plan Document
|
|
75
76
|
|
|
@@ -95,7 +96,30 @@ Update `.agents/workspace/active/{task-id}/task.md`:
|
|
|
95
96
|
- {yyyy-MM-dd HH:mm:ss} — **Technical Design (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
|
|
96
97
|
```
|
|
97
98
|
|
|
98
|
-
|
|
99
|
+
If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
|
|
100
|
+
- Read `.agents/rules/issue-sync.md` before syncing
|
|
101
|
+
- Set `status: pending-design-work`
|
|
102
|
+
- Publish the `{plan-artifact}` comment
|
|
103
|
+
- Create or update the `<!-- sync-issue:{task-id}:task -->` comment (follow the task.md comment sync rule in issue-sync.md)
|
|
104
|
+
|
|
105
|
+
### 8. Verification Gate
|
|
106
|
+
|
|
107
|
+
Run the verification gate to confirm the task artifact and sync state are valid:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
node .agents/scripts/validate-artifact.js gate plan-task .agents/workspace/active/{task-id} {plan-artifact} --format text
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Handle the result as follows:
|
|
114
|
+
- exit code 0 (all checks passed) -> continue to the "Inform User" step
|
|
115
|
+
- exit code 1 (validation failed) -> fix the reported issues and run the gate again
|
|
116
|
+
- exit code 2 (network blocked) -> stop and tell the user that human intervention is required
|
|
117
|
+
|
|
118
|
+
Keep the gate output in your reply as fresh evidence. Do not claim completion without output from this run.
|
|
119
|
+
|
|
120
|
+
### 9. Inform User
|
|
121
|
+
|
|
122
|
+
> Execute this step only after the verification gate passes.
|
|
99
123
|
|
|
100
124
|
> **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
|
|
101
125
|
|
|
@@ -122,76 +146,6 @@ Next step - implement the task:
|
|
|
122
146
|
- Codex CLI: $implement-task {task-id}
|
|
123
147
|
```
|
|
124
148
|
|
|
125
|
-
## Output Template
|
|
126
|
-
|
|
127
|
-
```markdown
|
|
128
|
-
# Technical Plan
|
|
129
|
-
|
|
130
|
-
- **Plan round**: Round {plan-round}
|
|
131
|
-
- **Artifact file**: `{plan-artifact}`
|
|
132
|
-
|
|
133
|
-
## Problem Understanding
|
|
134
|
-
{Summarize the problem to solve and the key constraints}
|
|
135
|
-
|
|
136
|
-
## Constraints
|
|
137
|
-
- {Constraint 1}
|
|
138
|
-
- {Constraint 2}
|
|
139
|
-
|
|
140
|
-
## Option Comparison
|
|
141
|
-
|
|
142
|
-
### Option A: {Name}
|
|
143
|
-
- **Approach**: {Description}
|
|
144
|
-
- **Pros**: {Advantages}
|
|
145
|
-
- **Cons**: {Drawbacks}
|
|
146
|
-
|
|
147
|
-
### Option B: {Name}
|
|
148
|
-
- **Approach**: {Description}
|
|
149
|
-
- **Pros**: {Advantages}
|
|
150
|
-
- **Cons**: {Drawbacks}
|
|
151
|
-
|
|
152
|
-
### Decision
|
|
153
|
-
{Which option was chosen and why}
|
|
154
|
-
|
|
155
|
-
## Technical Approach
|
|
156
|
-
{Detailed description of the selected approach}
|
|
157
|
-
|
|
158
|
-
## Implementation Steps
|
|
159
|
-
|
|
160
|
-
### Step 1: {Title}
|
|
161
|
-
- **File**: `{file-path}`
|
|
162
|
-
- **Action**: {What to do}
|
|
163
|
-
- **Details**: {Specific details}
|
|
164
|
-
|
|
165
|
-
### Step 2: {Title}
|
|
166
|
-
...
|
|
167
|
-
|
|
168
|
-
## File List
|
|
169
|
-
|
|
170
|
-
### New Files
|
|
171
|
-
- `{file-path}` - {Purpose}
|
|
172
|
-
|
|
173
|
-
### Modified Files
|
|
174
|
-
- `{file-path}` - {Planned changes}
|
|
175
|
-
|
|
176
|
-
## Verification Strategy
|
|
177
|
-
|
|
178
|
-
### Unit Tests
|
|
179
|
-
- {Test case 1}
|
|
180
|
-
- {Test case 2}
|
|
181
|
-
|
|
182
|
-
### Manual Validation
|
|
183
|
-
- {Validation step}
|
|
184
|
-
|
|
185
|
-
## Impact Assessment
|
|
186
|
-
- Breaking change: {Yes/No - details}
|
|
187
|
-
- Performance impact: {Assessment}
|
|
188
|
-
- Security considerations: {Assessment}
|
|
189
|
-
|
|
190
|
-
## Risk Control
|
|
191
|
-
- {Risk 1}: {Mitigation}
|
|
192
|
-
- {Risk 2}: {Mitigation}
|
|
193
|
-
```
|
|
194
|
-
|
|
195
149
|
## Completion Checklist
|
|
196
150
|
|
|
197
151
|
- [ ] Read and understood the requirements analysis
|
|
@@ -66,10 +66,11 @@ description: "为任务设计技术方案和实施计划"
|
|
|
66
66
|
- [ ] 评估方案的影响和风险
|
|
67
67
|
|
|
68
68
|
**设计原则**:
|
|
69
|
-
1.
|
|
70
|
-
2.
|
|
71
|
-
3.
|
|
72
|
-
4.
|
|
69
|
+
1. **架构合理性**:选择结构正确的方案,改动大小不是首要依据。不要为了减少 diff 而在不合理的结构上叠加
|
|
70
|
+
2. **简洁性**:在架构合理的前提下,优先选择最简方案,避免过度设计
|
|
71
|
+
3. **一致性**:遵循现有代码模式和规范
|
|
72
|
+
4. **可测试性**:设计易于测试的方案
|
|
73
|
+
5. **可逆性**:优先选择易于回退的变更
|
|
73
74
|
|
|
74
75
|
### 6. 输出计划文档
|
|
75
76
|
|
|
@@ -95,7 +96,30 @@ date "+%Y-%m-%d %H:%M:%S"
|
|
|
95
96
|
- {yyyy-MM-dd HH:mm:ss} — **Technical Design (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
|
|
96
97
|
```
|
|
97
98
|
|
|
98
|
-
|
|
99
|
+
如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
|
|
100
|
+
- 执行前先读取 `.agents/rules/issue-sync.md`
|
|
101
|
+
- 设置 `status: pending-design-work`
|
|
102
|
+
- 发布 `{plan-artifact}` 评论
|
|
103
|
+
- 创建或更新 `<!-- sync-issue:{task-id}:task -->` 评论(按 issue-sync.md 的 task.md 评论同步规则)
|
|
104
|
+
|
|
105
|
+
### 8. 完成校验
|
|
106
|
+
|
|
107
|
+
运行完成校验,确认任务产物和同步状态符合规范:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
node .agents/scripts/validate-artifact.js gate plan-task .agents/workspace/active/{task-id} {plan-artifact} --format text
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
处理结果:
|
|
114
|
+
- 退出码 0(全部通过)-> 继续到「告知用户」步骤
|
|
115
|
+
- 退出码 1(校验失败)-> 根据输出修复问题后重新运行校验
|
|
116
|
+
- 退出码 2(网络中断)-> 停止执行并告知用户需要人工介入
|
|
117
|
+
|
|
118
|
+
将校验输出保留在回复中作为当次验证输出。没有当次校验输出,不得声明完成。
|
|
119
|
+
|
|
120
|
+
### 9. 告知用户
|
|
121
|
+
|
|
122
|
+
> 仅在校验通过后执行本步骤。
|
|
99
123
|
|
|
100
124
|
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
|
|
101
125
|
|
|
@@ -122,76 +146,6 @@ date "+%Y-%m-%d %H:%M:%S"
|
|
|
122
146
|
- Codex CLI:$implement-task {task-id}
|
|
123
147
|
```
|
|
124
148
|
|
|
125
|
-
## 输出模板
|
|
126
|
-
|
|
127
|
-
```markdown
|
|
128
|
-
# 技术方案
|
|
129
|
-
|
|
130
|
-
- **方案轮次**:Round {plan-round}
|
|
131
|
-
- **产物文件**:`{plan-artifact}`
|
|
132
|
-
|
|
133
|
-
## 问题理解
|
|
134
|
-
{总结需要解决的问题和关键约束}
|
|
135
|
-
|
|
136
|
-
## 约束条件
|
|
137
|
-
- {约束 1}
|
|
138
|
-
- {约束 2}
|
|
139
|
-
|
|
140
|
-
## 方案对比
|
|
141
|
-
|
|
142
|
-
### 方案 A:{名称}
|
|
143
|
-
- **方法**:{描述}
|
|
144
|
-
- **优点**:{优势}
|
|
145
|
-
- **缺点**:{劣势}
|
|
146
|
-
|
|
147
|
-
### 方案 B:{名称}
|
|
148
|
-
- **方法**:{描述}
|
|
149
|
-
- **优点**:{优势}
|
|
150
|
-
- **缺点**:{劣势}
|
|
151
|
-
|
|
152
|
-
### 决策
|
|
153
|
-
{选择哪个方案以及原因}
|
|
154
|
-
|
|
155
|
-
## 技术方法
|
|
156
|
-
{所选方案的详细描述}
|
|
157
|
-
|
|
158
|
-
## 实施步骤
|
|
159
|
-
|
|
160
|
-
### 步骤 1:{标题}
|
|
161
|
-
- **文件**:`{file-path}`
|
|
162
|
-
- **操作**:{要做什么}
|
|
163
|
-
- **详情**:{具体细节}
|
|
164
|
-
|
|
165
|
-
### 步骤 2:{标题}
|
|
166
|
-
...
|
|
167
|
-
|
|
168
|
-
## 文件清单
|
|
169
|
-
|
|
170
|
-
### 新建文件
|
|
171
|
-
- `{file-path}` - {用途}
|
|
172
|
-
|
|
173
|
-
### 修改文件
|
|
174
|
-
- `{file-path}` - {修改内容}
|
|
175
|
-
|
|
176
|
-
## 验证策略
|
|
177
|
-
|
|
178
|
-
### 单元测试
|
|
179
|
-
- {测试用例 1}
|
|
180
|
-
- {测试用例 2}
|
|
181
|
-
|
|
182
|
-
### 手动验证
|
|
183
|
-
- {验证步骤}
|
|
184
|
-
|
|
185
|
-
## 影响评估
|
|
186
|
-
- 破坏性变更:{是/否 - 详情}
|
|
187
|
-
- 性能影响:{评估}
|
|
188
|
-
- 安全考量:{评估}
|
|
189
|
-
|
|
190
|
-
## 风险控制
|
|
191
|
-
- {风险 1}:{缓解措施}
|
|
192
|
-
- {风险 2}:{缓解措施}
|
|
193
|
-
```
|
|
194
|
-
|
|
195
149
|
## 完成检查清单
|
|
196
150
|
|
|
197
151
|
- [ ] 阅读并理解了需求分析
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill": "plan-task",
|
|
3
|
+
"checks": {
|
|
4
|
+
"task-meta": {
|
|
5
|
+
"required_fields": [
|
|
6
|
+
"id",
|
|
7
|
+
"type",
|
|
8
|
+
"workflow",
|
|
9
|
+
"status",
|
|
10
|
+
"created_at",
|
|
11
|
+
"updated_at",
|
|
12
|
+
"current_step",
|
|
13
|
+
"assigned_to"
|
|
14
|
+
],
|
|
15
|
+
"expected_step": "technical-design"
|
|
16
|
+
},
|
|
17
|
+
"artifact": {
|
|
18
|
+
"file_pattern": "plan.md|plan-r{N}.md",
|
|
19
|
+
"required_sections": [
|
|
20
|
+
"问题理解",
|
|
21
|
+
"约束条件",
|
|
22
|
+
"方案对比",
|
|
23
|
+
"技术方法",
|
|
24
|
+
"实施步骤",
|
|
25
|
+
"文件清单",
|
|
26
|
+
"验证策略"
|
|
27
|
+
],
|
|
28
|
+
"freshness_minutes": 30
|
|
29
|
+
},
|
|
30
|
+
"activity-log": {
|
|
31
|
+
"expected_action_pattern": "Technical Design \\(Round \\d+\\)",
|
|
32
|
+
"freshness_minutes": 30
|
|
33
|
+
},
|
|
34
|
+
"github-sync": {
|
|
35
|
+
"when": "issue_number_exists",
|
|
36
|
+
"expected_status_label": "status: pending-design-work",
|
|
37
|
+
"expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
|
|
38
|
+
"verify_comment_content": true,
|
|
39
|
+
"verify_task_comment_content": true
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -54,12 +54,59 @@ Get the current time:
|
|
|
54
54
|
date "+%Y-%m-%d %H:%M:%S"
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
Update task.md
|
|
58
|
-
|
|
57
|
+
Update task.md:
|
|
58
|
+
- review the `## Requirements` section and only change items from `- [ ]` to `- [x]` when they are newly satisfied by this round's fixes and passing tests
|
|
59
|
+
- append:
|
|
60
|
+
`- {yyyy-MM-dd HH:mm:ss} — **Refinement (Round {N}, for {review-artifact})** by {agent} — Fixed {n} blockers, {n} major, {n} minor issues → {refinement-artifact}`
|
|
59
61
|
|
|
60
|
-
|
|
62
|
+
If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
|
|
63
|
+
- Read `.agents/rules/issue-sync.md` before syncing
|
|
64
|
+
- Set `status: in-progress`
|
|
65
|
+
- Refine `in:` labels from the branch diff by following `.agents/rules/issue-sync.md` (add/remove when a mapping exists, add-only when it does not)
|
|
66
|
+
- Sync checked `## Requirements` items to the Issue body
|
|
67
|
+
- Publish the `{refinement-artifact}` comment
|
|
68
|
+
- Create or update the `<!-- sync-issue:{task-id}:task -->` comment (follow the task.md comment sync rule in issue-sync.md)
|
|
61
69
|
|
|
62
|
-
|
|
70
|
+
### 7. Verification Gate
|
|
71
|
+
|
|
72
|
+
Run the verification gate to confirm the task artifact and sync state are valid:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
node .agents/scripts/validate-artifact.js gate refine-task .agents/workspace/active/{task-id} {refinement-artifact} --format text
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Handle the result as follows:
|
|
79
|
+
- exit code 0 (all checks passed) -> continue to the "Inform User" step
|
|
80
|
+
- exit code 1 (validation failed) -> fix the reported issues and run the gate again
|
|
81
|
+
- exit code 2 (network blocked) -> stop and tell the user that human intervention is required
|
|
82
|
+
|
|
83
|
+
Keep the gate output in your reply as fresh evidence. Do not claim completion without output from this run.
|
|
84
|
+
|
|
85
|
+
### 8. Inform User
|
|
86
|
+
|
|
87
|
+
> Execute this step only after the verification gate passes.
|
|
88
|
+
|
|
89
|
+
> **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
|
|
90
|
+
|
|
91
|
+
After summarizing the fixes, choose the next step based on severity:
|
|
92
|
+
|
|
93
|
+
If the round fixed any Blocker or Major issues (recommended):
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Next step - code review:
|
|
97
|
+
- Claude Code / OpenCode: /review-task {task-id}
|
|
98
|
+
- Gemini CLI: /{{project}}:review-task {task-id}
|
|
99
|
+
- Codex CLI: $review-task {task-id}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
If the round fixed Minor issues only (low risk):
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
Next step - commit changes:
|
|
106
|
+
- Claude Code / OpenCode: /commit
|
|
107
|
+
- Gemini CLI: /{{project}}:commit
|
|
108
|
+
- Codex CLI: $commit
|
|
109
|
+
```
|
|
63
110
|
|
|
64
111
|
## Completion Checklist
|
|
65
112
|
|