@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
|
@@ -1,122 +1,123 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: close-codescan
|
|
3
3
|
description: >
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
#
|
|
9
|
+
# Dismiss Code Scanning Alert
|
|
9
10
|
|
|
10
|
-
|
|
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
|
-
|
|
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
|
|
26
|
+
Code Scanning alert #{alert-number}
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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.
|
|
39
|
-
2.
|
|
40
|
-
3.
|
|
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
|
-
-
|
|
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
|
-
|
|
55
|
+
About to dismiss Code Scanning alert #{alert-number}:
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
Rule: {rule.id}
|
|
58
|
+
Location: {location.path}:{location.start_line}
|
|
59
|
+
Reason: {selected reason}
|
|
60
|
+
Explanation: {user explanation}
|
|
60
61
|
|
|
61
|
-
|
|
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
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
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
|
-
|
|
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
|
-
-
|
|
89
|
-
-
|
|
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
|
|
99
|
+
Code Scanning alert #{alert-number} dismissed.
|
|
99
100
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
Rule: {rule.id}
|
|
102
|
+
Location: {location.path}:{location.start_line}
|
|
103
|
+
Reason: {reason}
|
|
104
|
+
Explanation: {explanation}
|
|
104
105
|
|
|
105
|
-
|
|
106
|
+
View: {html_url}
|
|
106
107
|
|
|
107
|
-
|
|
108
|
+
Note: it can be reopened on GitHub if necessary.
|
|
108
109
|
```
|
|
109
110
|
|
|
110
|
-
##
|
|
111
|
+
## Notes
|
|
111
112
|
|
|
112
|
-
1.
|
|
113
|
-
2.
|
|
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
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
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
|
-
|
|
5
|
-
|
|
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
|
-
#
|
|
9
|
+
# Dismiss Dependabot Alert
|
|
9
10
|
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
27
|
+
Security alert #{alert-number}
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
36
|
-
CVE
|
|
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.
|
|
44
|
-
2.
|
|
45
|
-
3.
|
|
46
|
-
4.
|
|
47
|
-
5.
|
|
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
|
-
-
|
|
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
|
-
|
|
61
|
+
About to dismiss security alert #{alert-number}:
|
|
61
62
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
Alert: {summary}
|
|
64
|
+
Severity: {severity}
|
|
65
|
+
Reason: {selected reason}
|
|
66
|
+
Explanation: {user explanation}
|
|
66
67
|
|
|
67
|
-
|
|
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
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
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
|
-
|
|
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
|
-
-
|
|
97
|
-
-
|
|
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
|
-
|
|
107
|
+
Security alert #{alert-number} dismissed.
|
|
107
108
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
Alert: {summary}
|
|
110
|
+
Severity: {severity}
|
|
111
|
+
Reason: {reason}
|
|
112
|
+
Explanation: {explanation}
|
|
112
113
|
|
|
113
|
-
|
|
114
|
+
View: https://github.com/{owner}/{repo}/security/dependabot/{alert-number}
|
|
114
115
|
|
|
115
|
-
|
|
116
|
+
Note: it can be reopened on GitHub if necessary.
|
|
116
117
|
```
|
|
117
118
|
|
|
118
|
-
##
|
|
119
|
+
## Notes
|
|
119
120
|
|
|
120
|
-
1.
|
|
121
|
-
2.
|
|
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
|
-
-
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
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 `.
|
|
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
|
-
如果本次提交属于某个活动任务,且存在 `.
|
|
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 `.
|
|
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 `.
|
|
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 .
|
|
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 .
|
|
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: .
|
|
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 `.
|
|
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 .
|
|
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
|
-
检查任务是否存在于 `.
|
|
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
|
-
更新 `.
|
|
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 .
|
|
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 .
|
|
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
|
-
- 归档路径:.
|
|
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
|
-
- [ ] 将任务目录移动到 `.
|
|
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 .
|
|
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
|
-
- `.
|
|
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,
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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 `.
|
|
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
|
-
-
|
|
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
|
|