@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.
Files changed (93) hide show
  1. package/README.md +29 -39
  2. package/README.zh-CN.md +29 -39
  3. package/bin/cli.js +1 -1
  4. package/lib/defaults.json +3 -12
  5. package/lib/init.js +13 -24
  6. package/lib/paths.js +3 -42
  7. package/lib/update.js +98 -32
  8. package/lib/version.js +2 -1
  9. package/package.json +2 -1
  10. package/templates/.agents/QUICKSTART.md +7 -7
  11. package/templates/.agents/QUICKSTART.zh-CN.md +7 -7
  12. package/templates/.agents/README.md +16 -4
  13. package/templates/.agents/README.zh-CN.md +16 -4
  14. package/templates/.agents/skills/analyze-task/SKILL.md +106 -105
  15. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +6 -6
  16. package/templates/.agents/skills/block-task/SKILL.md +8 -8
  17. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +8 -8
  18. package/templates/.agents/skills/check-task/SKILL.md +3 -3
  19. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +3 -3
  20. package/templates/.agents/skills/close-codescan/SKILL.md +64 -63
  21. package/templates/.agents/skills/close-dependabot/SKILL.md +71 -70
  22. package/templates/.agents/skills/commit/SKILL.md +1 -1
  23. package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
  24. package/templates/.agents/skills/complete-task/SKILL.md +7 -7
  25. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +7 -7
  26. package/templates/.agents/skills/create-issue/SKILL.md +57 -12
  27. package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +57 -12
  28. package/templates/.agents/skills/create-pr/SKILL.md +44 -7
  29. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +44 -7
  30. package/templates/.agents/skills/create-release-note/SKILL.md +18 -11
  31. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +18 -11
  32. package/templates/.agents/skills/create-task/SKILL.md +80 -78
  33. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +11 -10
  34. package/templates/.agents/skills/implement-task/SKILL.md +15 -18
  35. package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +15 -18
  36. package/templates/.agents/skills/import-codescan/SKILL.md +54 -53
  37. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  38. package/templates/.agents/skills/import-dependabot/SKILL.md +57 -56
  39. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +3 -3
  40. package/templates/.agents/skills/import-issue/SKILL.md +58 -58
  41. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -5
  42. package/templates/.agents/skills/init-labels/SKILL.md +8 -0
  43. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +8 -0
  44. package/templates/.agents/skills/plan-task/SKILL.md +151 -149
  45. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +6 -6
  46. package/templates/.agents/skills/refine-task/SKILL.md +3 -3
  47. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +3 -3
  48. package/templates/.agents/skills/release/SKILL.md +55 -14
  49. package/templates/.agents/skills/release/SKILL.zh-CN.md +55 -14
  50. package/templates/.agents/skills/review-task/SKILL.md +9 -9
  51. package/templates/.agents/skills/review-task/SKILL.zh-CN.md +9 -9
  52. package/templates/.agents/skills/sync-issue/SKILL.md +258 -279
  53. package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +34 -56
  54. package/templates/.agents/skills/sync-pr/SKILL.md +8 -28
  55. package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +7 -27
  56. package/templates/.agents/skills/update-agent-infra/SKILL.md +6 -6
  57. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +6 -6
  58. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +61 -116
  59. package/templates/.agents/templates/handoff.md +1 -1
  60. package/templates/.agents/templates/handoff.zh-CN.md +1 -1
  61. package/templates/.agents/workflows/bug-fix.yaml +71 -71
  62. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +1 -1
  63. package/templates/.agents/workflows/feature-development.yaml +71 -71
  64. package/templates/.agents/workflows/feature-development.zh-CN.yaml +1 -1
  65. package/templates/.agents/workflows/refactoring.yaml +76 -76
  66. package/templates/.agents/workflows/refactoring.zh-CN.yaml +1 -1
  67. package/templates/{.agent-workspace → .agents/workspace}/README.md +1 -1
  68. package/templates/{.agent-workspace → .agents/workspace}/README.zh-CN.md +1 -1
  69. package/templates/.claude/CLAUDE.md +14 -1
  70. package/templates/.claude/CLAUDE.zh-CN.md +14 -1
  71. package/templates/.claude/hooks/check-version-format.sh +44 -0
  72. package/templates/.claude/settings.json +14 -0
  73. package/templates/.opencode/COMMAND_STYLE_GUIDE.md +6 -6
  74. package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +6 -6
  75. package/templates/AGENTS.md +14 -1
  76. package/templates/AGENTS.zh-CN.md +14 -1
  77. package/templates/.editorconfig +0 -15
  78. package/templates/.github/ISSUE_TEMPLATE/01_bug_report.yml +0 -149
  79. package/templates/.github/ISSUE_TEMPLATE/02_question.yml +0 -101
  80. package/templates/.github/ISSUE_TEMPLATE/03_feature_request.yml +0 -131
  81. package/templates/.github/ISSUE_TEMPLATE/04_documentation.yml +0 -165
  82. package/templates/.github/ISSUE_TEMPLATE/05_other.yml +0 -147
  83. package/templates/.github/ISSUE_TEMPLATE/config.yml +0 -11
  84. package/templates/.github/PULL_REQUEST_TEMPLATE.md +0 -123
  85. package/templates/.github/dependabot.yml +0 -17
  86. package/templates/.github/hooks/check-utf8-encoding.sh +0 -25
  87. package/templates/.github/release.yml +0 -27
  88. package/templates/.github/workflows/pr-title-check.yml +0 -42
  89. package/templates/.mailmap +0 -4
  90. package/templates/CONTRIBUTING.md +0 -126
  91. package/templates/CONTRIBUTING.zh-CN.md +0 -124
  92. package/templates/SECURITY.md +0 -131
  93. package/templates/SECURITY.zh-CN.md +0 -131
@@ -1,122 +1,123 @@
1
1
  ---
2
2
  name: close-codescan
3
3
  description: >
4
- 关闭 Code ScanningCodeQL)告警并提供有据可查的理由。
5
- 当用户要求关闭 Code Scanning 告警时触发。参数:告警编号。
4
+ Dismiss a Code Scanning (CodeQL) alert with a documented justification.
5
+ Triggered when the user asks to dismiss a Code Scanning alert.
6
+ Argument: alert number.
6
7
  ---
7
8
 
8
- # 关闭 Code Scanning 告警
9
+ # Dismiss Code Scanning Alert
9
10
 
10
- 关闭指定的 Code ScanningCodeQL)告警并记录合理的关闭理由。
11
+ Dismiss the specified Code Scanning (CodeQL) alert and record a justified reason.
11
12
 
12
- ## 执行流程
13
+ ## Execution Flow
13
14
 
14
- ### 1. 获取告警信息
15
+ ### 1. Retrieve Alert Information
15
16
 
16
17
  ```bash
17
18
  gh api repos/{owner}/{repo}/code-scanning/alerts/<alert-number>
18
19
  ```
19
20
 
20
- 验证告警处于 `open` 状态。如果已被关闭/修复,告知用户并退出。
21
+ Verify that the alert is in the `open` state. If it is already dismissed or fixed, inform the user and exit.
21
22
 
22
- ### 2. 展示告警详情
23
+ ### 2. Show Alert Details
23
24
 
24
25
  ```
25
- Code Scanning 告警 #{alert-number}
26
+ Code Scanning alert #{alert-number}
26
27
 
27
- 严重程度:{security_severity_level}
28
- 规则:{rule.id} - {rule.description}
29
- 扫描工具:{tool.name}
30
- 位置:{location.path}:{location.start_line}
31
- 消息:{message}
28
+ Severity: {security_severity_level}
29
+ Rule: {rule.id} - {rule.description}
30
+ Scanner: {tool.name}
31
+ Location: {location.path}:{location.start_line}
32
+ Message: {message}
32
33
  ```
33
34
 
34
- ### 3. 询问关闭理由
35
+ ### 3. Ask for the Dismissal Reason
35
36
 
36
- 提示用户选择理由:
37
+ Ask the user to choose a reason:
37
38
 
38
- 1. **误报 (False Positive)** - CodeQL 规则误判;代码不存在此安全问题
39
- 2. **不会修复 (Won't Fix)** - 已知问题但基于架构或业务原因不予修复
40
- 3. **测试代码 (Used in Tests)** - 仅在测试代码中出现,不影响生产环境安全
41
- 4. **取消** - 不关闭告警
39
+ 1. **False Positive** - the CodeQL rule misfired and the code does not contain the security issue
40
+ 2. **Won't Fix** - the issue is known but will not be fixed due to architectural or business reasons
41
+ 3. **Used in Tests** - the issue appears only in test code and does not affect production security
42
+ 4. **Cancel** - do not dismiss the alert
42
43
 
43
- ### 4. 要求详细说明
44
+ ### 4. Require a Detailed Explanation
44
45
 
45
- 如果用户选择关闭(非取消),要求提供详细说明:
46
- - 最少 20 个字符
47
- - 必须清楚说明为什么可以安全关闭该告警
48
- - 如果是误报,说明为什么代码不存在该安全问题
49
- - 如果是不修复,说明技术或业务原因
46
+ If the user chooses to dismiss the alert (not cancel), require a detailed explanation:
47
+ - at least 20 characters
48
+ - must clearly explain why the alert can be safely dismissed
49
+ - if it is a false positive, explain why the code does not contain the issue
50
+ - if it is won't fix, explain the technical or business reason
50
51
 
51
- ### 5. 最终确认
52
+ ### 5. Final Confirmation
52
53
 
53
54
  ```
54
- 即将关闭 Code Scanning 告警 #{alert-number}
55
+ About to dismiss Code Scanning alert #{alert-number}:
55
56
 
56
- 规则:{rule.id}
57
- 位置:{location.path}:{location.start_line}
58
- 原因:{选择的理由}
59
- 说明:{用户的说明}
57
+ Rule: {rule.id}
58
+ Location: {location.path}:{location.start_line}
59
+ Reason: {selected reason}
60
+ Explanation: {user explanation}
60
61
 
61
- 确认?(y/N)
62
+ Confirm? (y/N)
62
63
  ```
63
64
 
64
- ### 6. 执行关闭
65
+ ### 6. Execute the Dismissal
65
66
 
66
67
  ```bash
67
68
  gh api --method PATCH \
68
69
  repos/{owner}/{repo}/code-scanning/alerts/<alert-number> \
69
70
  -f state=dismissed \
70
71
  -f dismissed_reason="{api-reason}" \
71
- -f dismissed_comment="{用户的说明}"
72
+ -f dismissed_comment="{user explanation}"
72
73
  ```
73
74
 
74
- **API reason 映射**(按 GitHub Code Scanning API):
75
- - 误报 -> `false positive`
76
- - 不会修复 -> `won't fix`
77
- - 测试代码 -> `used in tests`
75
+ **API reason mapping** (per the GitHub Code Scanning API):
76
+ - False Positive -> `false positive`
77
+ - Won't Fix -> `won't fix`
78
+ - Used in Tests -> `used in tests`
78
79
 
79
- ### 7. 记录到任务(如存在)
80
+ ### 7. Record in the Task (If Any)
80
81
 
81
- 如果有关联任务(搜索 `codescan_alert_number: <alert-number>`):
82
- 获取当前时间:
82
+ If a related task exists (search for `codescan_alert_number: <alert-number>`):
83
+ Get the current time:
83
84
 
84
85
  ```bash
85
86
  date "+%Y-%m-%d %H:%M:%S"
86
87
  ```
87
88
 
88
- - 添加关闭记录到 task.md
89
- - **追加**到 `## Activity Log`(不要覆盖之前的记录):
89
+ - Add the dismissal record to task.md
90
+ - **Append** to `## Activity Log` (do NOT overwrite previous entries):
90
91
  ```
91
92
  - {yyyy-MM-dd HH:mm:ss} — **Alert Closed** by {agent} — Code Scanning alert #{alert-number} dismissed: {reason}
92
93
  ```
93
- - 归档任务
94
+ - Archive the task
94
95
 
95
- ### 8. 告知用户
96
+ ### 8. Inform User
96
97
 
97
98
  ```
98
- Code Scanning 告警 #{alert-number} 已关闭。
99
+ Code Scanning alert #{alert-number} dismissed.
99
100
 
100
- 规则:{rule.id}
101
- 位置:{location.path}:{location.start_line}
102
- 原因:{reason}
103
- 说明:{explanation}
101
+ Rule: {rule.id}
102
+ Location: {location.path}:{location.start_line}
103
+ Reason: {reason}
104
+ Explanation: {explanation}
104
105
 
105
- 查看:{html_url}
106
+ View: {html_url}
106
107
 
107
- 注意:如有需要,可在 GitHub 上重新打开。
108
+ Note: it can be reopened on GitHub if necessary.
108
109
  ```
109
110
 
110
- ## 注意事项
111
+ ## Notes
111
112
 
112
- 1. **谨慎处理高严重程度告警**:Critical/High 告警需要充分分析。建议先执行 import-codescan + analyze-task
113
- 2. **真实的理由**:关闭记录保存在 GitHub 中,可能会被审计。
114
- 3. **定期复查**:已关闭的告警应定期复查。
115
- 4. **优先修复**:关闭应作为最后手段。
113
+ 1. **Handle high-severity alerts carefully**: Critical/High alerts require thorough analysis. Prefer `import-codescan` + `analyze-task` first.
114
+ 2. **Use truthful reasons**: dismissal records are stored in GitHub and may be audited.
115
+ 3. **Review periodically**: dismissed alerts should be re-evaluated over time.
116
+ 4. **Fix first**: dismissal should be the last resort.
116
117
 
117
- ## 错误处理
118
+ ## Error Handling
118
119
 
119
- - 告警未找到:提示 "Code Scanning alert #{number} not found"
120
- - 已关闭:提示 "Alert #{number} is already {state}"
121
- - 权限错误:提示 "No permission to modify alerts"
122
- - 用户取消:提示 "Cancellation acknowledged"
120
+ - Alert not found: output "Code Scanning alert #{number} not found"
121
+ - Already closed: output "Alert #{number} is already {state}"
122
+ - Permission error: output "No permission to modify alerts"
123
+ - User canceled: output "Cancellation acknowledged"
@@ -1,130 +1,131 @@
1
1
  ---
2
2
  name: close-dependabot
3
3
  description: >
4
- 关闭 Dependabot 安全告警并提供有据可查的理由。
5
- 当用户要求关闭 Dependabot 告警时触发。参数:告警编号。
4
+ Dismiss a Dependabot security alert with a documented justification.
5
+ Triggered when the user asks to dismiss a Dependabot alert.
6
+ Argument: alert number.
6
7
  ---
7
8
 
8
- # 关闭 Dependabot 告警
9
+ # Dismiss Dependabot Alert
9
10
 
10
- 关闭指定的 Dependabot 安全告警并记录合理的关闭理由。
11
+ Dismiss the specified Dependabot security alert and record a justified reason.
11
12
 
12
- ## 执行流程
13
+ ## Execution Flow
13
14
 
14
- ### 1. 获取告警信息
15
+ ### 1. Retrieve Alert Information
15
16
 
16
17
  ```bash
17
18
  gh api repos/{owner}/{repo}/dependabot/alerts/<alert-number>
18
19
  ```
19
20
 
20
- 验证告警处于 `open` 状态。如果已被关闭/修复,告知用户并退出。
21
+ Verify that the alert is in the `open` state. If it is already dismissed or fixed, inform the user and exit.
21
22
 
22
- ### 2. 展示告警详情
23
+ ### 2. Show Alert Details
23
24
 
24
- 向用户展示关键信息:
25
+ Show the user the key information:
25
26
  ```
26
- 安全告警 #{alert-number}
27
+ Security alert #{alert-number}
27
28
 
28
- 严重程度:{severity}
29
- 漏洞:{summary}
30
- 包名:{package-name}{ecosystem}
31
- 当前版本:{current-version}
32
- 受影响版本范围:{vulnerable-version-range}
33
- 修复版本:{first-patched-version}
29
+ Severity: {severity}
30
+ Advisory: {summary}
31
+ Package: {package-name} ({ecosystem})
32
+ Current version: {current-version}
33
+ Vulnerable version range: {vulnerable-version-range}
34
+ Patched version: {first-patched-version}
34
35
 
35
- GHSA{ghsa-id}
36
- CVE{cve-id}
36
+ GHSA: {ghsa-id}
37
+ CVE: {cve-id}
37
38
  ```
38
39
 
39
- ### 3. 询问关闭理由
40
+ ### 3. Ask for the Dismissal Reason
40
41
 
41
- 提示用户选择理由:
42
+ Ask the user to choose a reason:
42
43
 
43
- 1. **误报 (False Positive)** - 漏洞代码路径在本项目中未被使用
44
- 2. **无法利用 (Not Exploitable)** - 漏洞存在但在当前上下文中无法被利用
45
- 3. **已有缓解措施 (Mitigated)** - 通过其他方式缓解了风险(配置、网络隔离等)
46
- 4. **无修复版本 (No Fix Available)** - 无修复版本且风险可接受
47
- 5. **仅开发/测试依赖 (Dev/Test Dependency Only)** - 仅在开发/测试中使用,不在生产环境中
48
- 6. **取消** - 不关闭告警
44
+ 1. **False Positive** - the vulnerable code path is not used in this project
45
+ 2. **Not Exploitable** - the vulnerability exists but cannot be exploited in the current context
46
+ 3. **Mitigated** - the risk is mitigated by other means (configuration, network isolation, etc.)
47
+ 4. **No Fix Available** - no patched version exists and the remaining risk is acceptable
48
+ 5. **Dev/Test Dependency Only** - used only in development or tests, not in production
49
+ 6. **Cancel** - do not dismiss the alert
49
50
 
50
- ### 4. 要求详细说明
51
+ ### 4. Require a Detailed Explanation
51
52
 
52
- 如果用户选择关闭(非取消),要求提供详细说明:
53
- - 最少 20 个字符
54
- - 必须清楚说明为什么可以安全关闭该告警
55
- - 应引用具体证据(代码搜索结果、配置等)
53
+ If the user chooses to dismiss the alert (not cancel), require a detailed explanation:
54
+ - at least 20 characters
55
+ - must clearly explain why the alert can be safely dismissed
56
+ - should cite concrete evidence (code search results, configuration, etc.)
56
57
 
57
- ### 5. 最终确认
58
+ ### 5. Final Confirmation
58
59
 
59
60
  ```
60
- 即将关闭安全告警 #{alert-number}
61
+ About to dismiss security alert #{alert-number}:
61
62
 
62
- 告警:{summary}
63
- 严重程度:{severity}
64
- 原因:{选择的理由}
65
- 说明:{用户的说明}
63
+ Alert: {summary}
64
+ Severity: {severity}
65
+ Reason: {selected reason}
66
+ Explanation: {user explanation}
66
67
 
67
- 确认?(y/N)
68
+ Confirm? (y/N)
68
69
  ```
69
70
 
70
- ### 6. 执行关闭
71
+ ### 6. Execute the Dismissal
71
72
 
72
73
  ```bash
73
74
  gh api --method PATCH \
74
75
  repos/{owner}/{repo}/dependabot/alerts/<alert-number> \
75
76
  -f state=dismissed \
76
77
  -f dismissed_reason="{api-reason}" \
77
- -f dismissed_comment="{用户的说明}"
78
+ -f dismissed_comment="{user explanation}"
78
79
  ```
79
80
 
80
- **API reason 映射**:
81
- - 误报 -> `not_used` `inaccurate`
82
- - 无法利用 -> `tolerable_risk`
83
- - 已有缓解措施 -> `tolerable_risk`
84
- - 无修复版本 -> `tolerable_risk`
85
- - 开发/测试依赖 -> `not_used`
81
+ **API reason mapping**:
82
+ - False Positive -> `not_used` or `inaccurate`
83
+ - Not Exploitable -> `tolerable_risk`
84
+ - Mitigated -> `tolerable_risk`
85
+ - No Fix Available -> `tolerable_risk`
86
+ - Dev/Test Dependency Only -> `not_used`
86
87
 
87
- ### 7. 记录到任务(如存在)
88
+ ### 7. Record in the Task (If Any)
88
89
 
89
- 如果有关联任务(搜索 `security_alert_number: <alert-number>`):
90
- 获取当前时间:
90
+ If a related task exists (search for `security_alert_number: <alert-number>`):
91
+ Get the current time:
91
92
 
92
93
  ```bash
93
94
  date "+%Y-%m-%d %H:%M:%S"
94
95
  ```
95
96
 
96
- - 添加关闭记录到 task.md
97
- - **追加**到 `## Activity Log`(不要覆盖之前的记录):
97
+ - Add the dismissal record to task.md
98
+ - **Append** to `## Activity Log` (do NOT overwrite previous entries):
98
99
  ```
99
100
  - {yyyy-MM-dd HH:mm:ss} — **Alert Closed** by {agent} — Dependabot alert #{alert-number} dismissed: {reason}
100
101
  ```
101
- - 归档任务
102
+ - Archive the task
102
103
 
103
- ### 8. 告知用户
104
+ ### 8. Inform User
104
105
 
105
106
  ```
106
- 安全告警 #{alert-number} 已关闭。
107
+ Security alert #{alert-number} dismissed.
107
108
 
108
- 告警:{summary}
109
- 严重程度:{severity}
110
- 原因:{reason}
111
- 说明:{explanation}
109
+ Alert: {summary}
110
+ Severity: {severity}
111
+ Reason: {reason}
112
+ Explanation: {explanation}
112
113
 
113
- 查看:https://github.com/{owner}/{repo}/security/dependabot/{alert-number}
114
+ View: https://github.com/{owner}/{repo}/security/dependabot/{alert-number}
114
115
 
115
- 注意:如有需要,可在 GitHub 上重新打开。
116
+ Note: it can be reopened on GitHub if necessary.
116
117
  ```
117
118
 
118
- ## 注意事项
119
+ ## Notes
119
120
 
120
- 1. **谨慎处理高严重程度告警**:Critical/High 告警需要在关闭前进行充分分析。建议先执行 import-dependabot + analyze-task
121
- 2. **真实的理由**:关闭记录保存在 GitHub 中,可能会被审计。
122
- 3. **定期复查**:已关闭的告警应定期复查,因为代码变更可能使关闭理由失效。
123
- 4. **优先修复**:关闭应作为最后手段。优先考虑升级、替换或缓解。
121
+ 1. **Handle high-severity alerts carefully**: Critical/High alerts require thorough analysis before dismissal. Prefer `import-dependabot` + `analyze-task` first.
122
+ 2. **Use truthful reasons**: dismissal records are stored in GitHub and may be audited.
123
+ 3. **Review periodically**: dismissed alerts should be re-evaluated because code changes may invalidate the dismissal rationale.
124
+ 4. **Fix first**: dismissal should be the last resort. Prefer upgrading, replacing, or mitigating.
124
125
 
125
- ## 错误处理
126
+ ## Error Handling
126
127
 
127
- - 告警未找到:提示 "Security alert #{number} not found"
128
- - 已关闭:提示 "Alert #{number} is already {state}"
129
- - 权限错误:提示 "No permission to modify alerts"
130
- - 用户取消:提示 "Cancellation acknowledged"
128
+ - Alert not found: output "Security alert #{number} not found"
129
+ - Already closed: output "Alert #{number} is already {state}"
130
+ - Permission error: output "No permission to modify alerts"
131
+ - User canceled: output "Cancellation acknowledged"
@@ -90,7 +90,7 @@ Generate commit message in Conventional Commits format:
90
90
 
91
91
  ### Multi-Agent Co-Authorship (If Task-Related)
92
92
 
93
- If the commit belongs to an active task and `.agent-workspace/active/{task-id}/task.md` exists:
93
+ If the commit belongs to an active task and `.agents/workspace/active/{task-id}/task.md` exists:
94
94
 
95
95
  1. Read the `## Activity Log` section from `task.md`.
96
96
  2. Extract all unique agent names from entries matching `by {agent}`. A loose pattern such as `by (\S+)` is acceptable.
@@ -89,7 +89,7 @@ git log --oneline -5
89
89
 
90
90
  ### 多 Agent 协作署名(仅任务相关提交)
91
91
 
92
- 如果本次提交属于某个活动任务,且存在 `.agent-workspace/active/{task-id}/task.md`:
92
+ 如果本次提交属于某个活动任务,且存在 `.agents/workspace/active/{task-id}/task.md`:
93
93
 
94
94
  1. 读取 `task.md` 中的 `## Activity Log` 部分。
95
95
  2. 从符合 `by {agent}` 的条目中提取所有唯一 Agent 名称;可使用较宽松的匹配模式,例如 `by (\S+)`。
@@ -19,7 +19,7 @@ description: >
19
19
 
20
20
  ### 1. Verify Task Exists
21
21
 
22
- Check that the task exists in `.agent-workspace/active/{task-id}/`.
22
+ Check that the task exists in `.agents/workspace/active/{task-id}/`.
23
23
 
24
24
  Note: `{task-id}` format is `TASK-{yyyyMMdd-HHmmss}`, e.g. `TASK-20260306-143022`
25
25
 
@@ -61,7 +61,7 @@ Get the current time:
61
61
  date "+%Y-%m-%d %H:%M:%S"
62
62
  ```
63
63
 
64
- Update `.agent-workspace/active/{task-id}/task.md`:
64
+ Update `.agents/workspace/active/{task-id}/task.md`:
65
65
  - `status`: completed
66
66
  - `completed_at`: {current timestamp}
67
67
  - `updated_at`: {current timestamp}
@@ -76,13 +76,13 @@ Update `.agent-workspace/active/{task-id}/task.md`:
76
76
  Move the task directory from active to completed:
77
77
 
78
78
  ```bash
79
- mv .agent-workspace/active/{task-id} .agent-workspace/completed/{task-id}
79
+ mv .agents/workspace/active/{task-id} .agents/workspace/completed/{task-id}
80
80
  ```
81
81
 
82
82
  ### 5. Verify Archive
83
83
 
84
84
  ```bash
85
- ls .agent-workspace/completed/{task-id}/task.md
85
+ ls .agents/workspace/completed/{task-id}/task.md
86
86
  ```
87
87
 
88
88
  Confirm the task directory was successfully moved.
@@ -111,7 +111,7 @@ Task {task-id} completed and archived.
111
111
  Task info:
112
112
  - Title: {title}
113
113
  - Completed at: {timestamp}
114
- - Archived to: .agent-workspace/completed/{task-id}/
114
+ - Archived to: .agents/workspace/completed/{task-id}/
115
115
 
116
116
  Deliverables:
117
117
  - {List of key outputs: files modified, tests added, etc.}
@@ -121,7 +121,7 @@ Deliverables:
121
121
 
122
122
  - [ ] Verified all workflow steps are complete
123
123
  - [ ] Updated task.md with completed status and timestamp
124
- - [ ] Moved task directory to `.agent-workspace/completed/`
124
+ - [ ] Moved task directory to `.agents/workspace/completed/`
125
125
  - [ ] Verified archive succeeded
126
126
  - [ ] Informed user of completion
127
127
 
@@ -135,7 +135,7 @@ Deliverables:
135
135
 
136
136
  2. **Rollback**: If a task was archived incorrectly:
137
137
  ```bash
138
- mv .agent-workspace/completed/{task-id} .agent-workspace/active/{task-id}
138
+ mv .agents/workspace/completed/{task-id} .agents/workspace/active/{task-id}
139
139
  ```
140
140
  Then update task.md status back to `active`.
141
141
 
@@ -17,7 +17,7 @@ description: >
17
17
 
18
18
  ### 1. 验证任务存在
19
19
 
20
- 检查任务是否存在于 `.agent-workspace/active/{task-id}/`。
20
+ 检查任务是否存在于 `.agents/workspace/active/{task-id}/`。
21
21
 
22
22
  注意:`{task-id}` 格式为 `TASK-{yyyyMMdd-HHmmss}`,例如 `TASK-20260306-143022`
23
23
 
@@ -59,7 +59,7 @@ Please complete the missing steps first, or use --force to override.
59
59
  date "+%Y-%m-%d %H:%M:%S"
60
60
  ```
61
61
 
62
- 更新 `.agent-workspace/active/{task-id}/task.md`:
62
+ 更新 `.agents/workspace/active/{task-id}/task.md`:
63
63
  - `status`:completed
64
64
  - `completed_at`:{当前时间戳}
65
65
  - `updated_at`:{当前时间戳}
@@ -74,13 +74,13 @@ date "+%Y-%m-%d %H:%M:%S"
74
74
  将任务目录从 active 移动到 completed:
75
75
 
76
76
  ```bash
77
- mv .agent-workspace/active/{task-id} .agent-workspace/completed/{task-id}
77
+ mv .agents/workspace/active/{task-id} .agents/workspace/completed/{task-id}
78
78
  ```
79
79
 
80
80
  ### 5. 验证归档
81
81
 
82
82
  ```bash
83
- ls .agent-workspace/completed/{task-id}/task.md
83
+ ls .agents/workspace/completed/{task-id}/task.md
84
84
  ```
85
85
 
86
86
  确认任务目录已成功移动。
@@ -109,7 +109,7 @@ ls .agent-workspace/completed/{task-id}/task.md
109
109
  任务信息:
110
110
  - 标题:{title}
111
111
  - 完成时间:{timestamp}
112
- - 归档路径:.agent-workspace/completed/{task-id}/
112
+ - 归档路径:.agents/workspace/completed/{task-id}/
113
113
 
114
114
  交付物:
115
115
  - {关键产出列表:修改的文件、添加的测试等}
@@ -119,7 +119,7 @@ ls .agent-workspace/completed/{task-id}/task.md
119
119
 
120
120
  - [ ] 验证了所有工作流步骤已完成
121
121
  - [ ] 更新了 task.md 的完成状态和时间戳
122
- - [ ] 将任务目录移动到 `.agent-workspace/completed/`
122
+ - [ ] 将任务目录移动到 `.agents/workspace/completed/`
123
123
  - [ ] 验证了归档成功
124
124
  - [ ] 告知了用户完成情况
125
125
 
@@ -133,7 +133,7 @@ ls .agent-workspace/completed/{task-id}/task.md
133
133
 
134
134
  2. **回滚**:如果任务被错误归档:
135
135
  ```bash
136
- mv .agent-workspace/completed/{task-id} .agent-workspace/active/{task-id}
136
+ mv .agents/workspace/completed/{task-id} .agents/workspace/active/{task-id}
137
137
  ```
138
138
  然后将 task.md 中的状态改回 `active`。
139
139
 
@@ -20,7 +20,7 @@ description: >
20
20
  ### 1. Verify Prerequisites
21
21
 
22
22
  Check required file:
23
- - `.agent-workspace/active/{task-id}/task.md` - Task file
23
+ - `.agents/workspace/active/{task-id}/task.md` - Task file
24
24
 
25
25
  Check that GitHub CLI is available and authenticated:
26
26
 
@@ -62,15 +62,18 @@ Check the project templates and ignore `config.yml`:
62
62
  rg --files .github/ISSUE_TEMPLATE -g '*.yml' -g '!config.yml'
63
63
  ```
64
64
 
65
- If template files exist, search the filename or top-level `name:` field using these keywords:
65
+ If template files exist, read the top-level `name:` field from each template and build a candidate list. Use the task title and description to choose the most semantically appropriate template from that list.
66
66
 
67
- | task.md type | Match keywords |
68
- |---|---|
69
- | `bug`, `bugfix` | `bug` |
70
- | `feature` | `feature` |
71
- | `enhancement` | `feature`, `enhancement` |
72
- | `docs`, `documentation` | `documentation`, `doc` |
73
- | anything else | `other` |
67
+ Example candidate list:
68
+ - `bug_report.yml` - a bug-focused template
69
+ - `question.yml` - a question or support template
70
+ - `feature_request.yml` - a feature-focused template
71
+ - `documentation.yml` - a documentation-focused template
72
+ - `other.yml` - a general fallback template
73
+
74
+ If there is no clearly matching template, choose the closest one.
75
+
76
+ These filenames are illustrative only; use the actual templates present in the target project.
74
77
 
75
78
  If there is no template, no suitable match, or YAML parsing fails, go directly to the **3c fallback path**.
76
79
 
@@ -172,16 +175,55 @@ issue_number="${issue_url##*/}"
172
175
 
173
176
  If `{issue-type}` has been determined, set the Issue Type after creation on a best-effort basis:
174
177
 
178
+ Get repository information first because the later `in:` label step can reuse it:
179
+
175
180
  ```bash
176
181
  repo="$(gh repo view --json nameWithOwner --jq '.nameWithOwner')"
177
182
  owner="${repo%%/*}"
183
+ ```
184
+
185
+ Query the organization's available Issue Types:
186
+
187
+ ```bash
178
188
  gh api "orgs/$owner/issue-types" --jq '.[].name'
179
- gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{issue-type}"
180
189
  ```
181
190
 
191
+ If the query succeeds and `{issue-type}` appears in the returned list, set it:
192
+
193
+ ```bash
194
+ gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{issue-type}" --silent
195
+ ```
196
+
197
+ Verify the result:
198
+
199
+ ```bash
200
+ gh api "repos/$repo/issues/{issue-number}" --jq '.type.name // empty'
201
+ ```
202
+
203
+ If the verification result matches `{issue-type}`, record `Issue Type: {issue-type}`; otherwise record `Issue Type: failed to set`.
204
+
205
+ #### Add `in:` labels
206
+
207
+ Get all repository labels with the `in:` prefix:
208
+
209
+ ```bash
210
+ gh label list --search "in:" --limit 50 --json name --jq '.[].name'
211
+ ```
212
+
213
+ If no `in:` labels exist, skip this step.
214
+
215
+ If `in:` labels exist, use the task context (title, description, and affected file list) to judge which labels are relevant. For each relevant label, run:
216
+
217
+ ```bash
218
+ gh issue edit {issue-number} --add-label "in: {module}"
219
+ ```
220
+
221
+ Record all successfully added `in:` labels. If none are relevant, record `in: labels: skipped (no relevant labels)`.
222
+
182
223
  Tolerance requirements:
183
224
  - if `orgs/$owner/issue-types` returns `404`, the repo owner is not an organization, or Issue Types are not enabled, skip this without failing the create flow
184
225
  - if `{issue-type}` is not in the available list, skip it
226
+ - if adding an `in:` label fails, skip it and record the failure without blocking Issue creation
185
227
  - if the milestone name is invalid or unavailable, warn and skip it instead of aborting the whole Issue creation flow
186
228
 
187
229
  ### 5. Update Task Status
@@ -192,7 +234,7 @@ Get the current time:
192
234
  date "+%Y-%m-%d %H:%M:%S"
193
235
  ```
194
236
 
195
- Update `.agent-workspace/active/{task-id}/task.md`:
237
+ Update `.agents/workspace/active/{task-id}/task.md`:
196
238
  - Add or update `issue_number`: `{issue-number}`
197
239
  - `updated_at`: {current time}
198
240
  - **Append** to `## Activity Log` (do NOT overwrite previous entries):
@@ -212,7 +254,8 @@ Issue details:
212
254
  - Number: #{issue-number}
213
255
  - URL: {issue-url}
214
256
  - Labels: {applied-labels or skipped}
215
- - Issue Type: {issue-type or skipped}
257
+ - in: Labels: {applied-in-labels or skipped}
258
+ - Issue Type: {issue-type | failed to set | skipped}
216
259
  - Milestone: {milestone or skipped}
217
260
 
218
261
  Output:
@@ -231,6 +274,7 @@ Next step - sync task progress to the Issue:
231
274
  - [ ] Used template structure when available, otherwise used the fallback format
232
275
  - [ ] Built the Issue title and body from `task.md` only
233
276
  - [ ] Handled `type:` / Issue Type and `milestone` when available
277
+ - [ ] Processed `in:` labels using LLM relevance judgment
234
278
  - [ ] Recorded `issue_number` in task.md
235
279
  - [ ] Updated `updated_at` in task.md
236
280
  - [ ] Appended an Activity Log entry to task.md
@@ -248,6 +292,7 @@ After completing the checklist, **stop immediately**. Do not sync detailed Issue
248
292
  3. **Label tolerance**: if standard labels are not initialized, skipping the label is acceptable and should not block Issue creation
249
293
  4. **Template tolerance**: if a template is missing, unmatched, or its YAML is invalid, fall back to the simple body format instead of failing the whole create flow
250
294
  5. **Issue Type / Milestone tolerance**: if Issue Types are unavailable, the target type is missing, or the milestone is unavailable, skip that part and continue creating the Issue
295
+ 6. **`in:` label tolerance**: if adding an `in:` label fails, skip it without blocking Issue creation
251
296
 
252
297
  ## Error Handling
253
298