@fitlab-ai/agent-infra 0.5.1 → 0.5.2
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 +15 -1
- package/README.zh-CN.md +15 -1
- package/lib/defaults.json +3 -0
- package/lib/init.js +15 -5
- package/lib/render.js +77 -15
- package/lib/sandbox/commands/enter.js +22 -7
- package/lib/sandbox/runtimes/base.dockerfile +10 -0
- package/lib/update.js +19 -5
- package/package.json +2 -1
- package/templates/.agents/{README.md → README.en.md} +13 -3
- package/templates/.agents/README.zh-CN.md +13 -3
- package/templates/.agents/rules/issue-pr-commands.github.en.md +111 -0
- package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +111 -0
- package/templates/.agents/rules/label-milestone-setup.github.en.md +50 -0
- package/templates/.agents/rules/label-milestone-setup.github.zh-CN.md +50 -0
- package/templates/.agents/rules/release-commands.github.en.md +30 -0
- package/templates/.agents/rules/release-commands.github.zh-CN.md +30 -0
- package/templates/.agents/rules/security-alerts.github.en.md +43 -0
- package/templates/.agents/rules/security-alerts.github.zh-CN.md +43 -0
- package/templates/.agents/scripts/validate-artifact.js +0 -2
- package/templates/.agents/skills/cancel-task/{SKILL.md → SKILL.en.md} +7 -6
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +7 -6
- package/templates/.agents/skills/close-codescan/{SKILL.md → SKILL.en.md} +3 -11
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +3 -11
- package/templates/.agents/skills/close-dependabot/{SKILL.md → SKILL.en.md} +5 -13
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +5 -13
- package/templates/.agents/skills/create-issue/{SKILL.md → SKILL.en.md} +2 -5
- package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +2 -5
- package/templates/.agents/skills/create-issue/reference/{label-and-type.md → label-and-type.en.md} +4 -16
- package/templates/.agents/skills/create-issue/reference/label-and-type.zh-CN.md +4 -16
- package/templates/.agents/skills/create-pr/{SKILL.md → SKILL.en.md} +3 -4
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +3 -4
- package/templates/.agents/skills/create-pr/reference/{pr-body-template.md → pr-body-template.en.md} +8 -13
- package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +8 -13
- package/templates/.agents/skills/create-release-note/{SKILL.md → SKILL.en.md} +6 -18
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +6 -18
- package/templates/.agents/skills/import-codescan/{SKILL.md → SKILL.en.md} +1 -3
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/import-dependabot/{SKILL.md → SKILL.en.md} +1 -3
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/import-issue/{SKILL.md → SKILL.en.md} +2 -10
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +2 -10
- package/templates/.agents/skills/init-labels/{SKILL.md → SKILL.en.md} +9 -13
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +9 -13
- package/templates/.agents/skills/init-milestones/{SKILL.md → SKILL.en.md} +5 -6
- package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +5 -6
- package/templates/.agents/skills/refine-title/{SKILL.md → SKILL.en.md} +7 -17
- package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +6 -16
- package/templates/.agents/skills/release/{SKILL.md → SKILL.en.md} +2 -1
- package/templates/.agents/skills/release/SKILL.zh-CN.md +2 -1
- package/templates/.agents/skills/restore-task/{SKILL.md → SKILL.en.md} +5 -11
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +5 -11
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +219 -59
- /package/templates/.agents/{QUICKSTART.md → QUICKSTART.en.md} +0 -0
- /package/templates/.agents/rules/{commit-and-pr.md → commit-and-pr.en.md} +0 -0
- /package/templates/.agents/rules/{issue-sync.md → issue-sync.github.en.md} +0 -0
- /package/templates/.agents/rules/{issue-sync.zh-CN.md → issue-sync.github.zh-CN.md} +0 -0
- /package/templates/.agents/rules/{milestone-inference.md → milestone-inference.github.en.md} +0 -0
- /package/templates/.agents/rules/{milestone-inference.zh-CN.md → milestone-inference.github.zh-CN.md} +0 -0
- /package/templates/.agents/rules/{pr-sync.md → pr-sync.github.en.md} +0 -0
- /package/templates/.agents/rules/{pr-sync.zh-CN.md → pr-sync.github.zh-CN.md} +0 -0
- /package/templates/.agents/rules/{task-management.md → task-management.en.md} +0 -0
- /package/templates/.agents/skills/analyze-task/{SKILL.md → SKILL.en.md} +0 -0
- /package/templates/.agents/skills/archive-tasks/{SKILL.md → SKILL.en.md} +0 -0
- /package/templates/.agents/skills/block-task/{SKILL.md → SKILL.en.md} +0 -0
- /package/templates/.agents/skills/check-task/{SKILL.md → SKILL.en.md} +0 -0
- /package/templates/.agents/skills/commit/{SKILL.md → SKILL.en.md} +0 -0
- /package/templates/.agents/skills/commit/reference/{commit-message.md → commit-message.en.md} +0 -0
- /package/templates/.agents/skills/commit/reference/{copyright-check.md → copyright-check.en.md} +0 -0
- /package/templates/.agents/skills/commit/reference/{pr-summary-sync.md → pr-summary-sync.en.md} +0 -0
- /package/templates/.agents/skills/commit/reference/{task-status-update.md → task-status-update.en.md} +0 -0
- /package/templates/.agents/skills/complete-task/{SKILL.md → SKILL.en.md} +0 -0
- /package/templates/.agents/skills/create-issue/reference/{template-matching.md → template-matching.en.md} +0 -0
- /package/templates/.agents/skills/create-pr/reference/{branch-strategy.md → branch-strategy.en.md} +0 -0
- /package/templates/.agents/skills/create-pr/reference/{comment-publish.md → comment-publish.en.md} +0 -0
- /package/templates/.agents/skills/create-task/{SKILL.md → SKILL.en.md} +0 -0
- /package/templates/.agents/skills/implement-task/{SKILL.md → SKILL.en.md} +0 -0
- /package/templates/.agents/skills/implement-task/reference/{branch-management.md → branch-management.en.md} +0 -0
- /package/templates/.agents/skills/implement-task/reference/{implementation-rules.md → implementation-rules.en.md} +0 -0
- /package/templates/.agents/skills/implement-task/reference/{output-template.md → output-template.en.md} +0 -0
- /package/templates/.agents/skills/implement-task/reference/{report-template.md → report-template.en.md} +0 -0
- /package/templates/.agents/skills/init-labels/scripts/{init-labels.sh → init-labels.github.sh} +0 -0
- /package/templates/.agents/skills/init-milestones/scripts/{init-milestones.sh → init-milestones.github.sh} +0 -0
- /package/templates/.agents/skills/plan-task/{SKILL.md → SKILL.en.md} +0 -0
- /package/templates/.agents/skills/refine-task/{SKILL.md → SKILL.en.md} +0 -0
- /package/templates/.agents/skills/refine-task/reference/{fix-workflow.md → fix-workflow.en.md} +0 -0
- /package/templates/.agents/skills/refine-task/reference/{report-template.md → report-template.en.md} +0 -0
- /package/templates/.agents/skills/release/scripts/{manage-milestones.sh → manage-milestones.github.sh} +0 -0
- /package/templates/.agents/skills/review-task/{SKILL.md → SKILL.en.md} +0 -0
- /package/templates/.agents/skills/review-task/reference/{output-templates.md → output-templates.en.md} +0 -0
- /package/templates/.agents/skills/review-task/reference/{report-template.md → report-template.en.md} +0 -0
- /package/templates/.agents/skills/review-task/reference/{review-criteria.md → review-criteria.en.md} +0 -0
- /package/templates/.agents/skills/test/{SKILL.md → SKILL.en.md} +0 -0
- /package/templates/.agents/skills/test-integration/{SKILL.md → SKILL.en.md} +0 -0
- /package/templates/.agents/skills/update-agent-infra/{SKILL.md → SKILL.en.md} +0 -0
- /package/templates/.agents/skills/upgrade-dependency/{SKILL.md → SKILL.en.md} +0 -0
- /package/templates/.agents/templates/{handoff.md → handoff.en.md} +0 -0
- /package/templates/.agents/templates/{review-report.md → review-report.en.md} +0 -0
- /package/templates/.agents/templates/{task.md → task.en.md} +0 -0
- /package/templates/.agents/workflows/{bug-fix.yaml → bug-fix.en.yaml} +0 -0
- /package/templates/.agents/workflows/{code-review.yaml → code-review.en.yaml} +0 -0
- /package/templates/.agents/workflows/{feature-development.yaml → feature-development.en.yaml} +0 -0
- /package/templates/.agents/workflows/{refactoring.yaml → refactoring.en.yaml} +0 -0
- /package/templates/.agents/workspace/{README.md → README.en.md} +0 -0
- /package/templates/.claude/commands/{analyze-task.md → analyze-task.en.md} +0 -0
- /package/templates/.claude/commands/{archive-tasks.md → archive-tasks.en.md} +0 -0
- /package/templates/.claude/commands/{block-task.md → block-task.en.md} +0 -0
- /package/templates/.claude/commands/{cancel-task.md → cancel-task.en.md} +0 -0
- /package/templates/.claude/commands/{check-task.md → check-task.en.md} +0 -0
- /package/templates/.claude/commands/{close-codescan.md → close-codescan.en.md} +0 -0
- /package/templates/.claude/commands/{close-dependabot.md → close-dependabot.en.md} +0 -0
- /package/templates/.claude/commands/{commit.md → commit.en.md} +0 -0
- /package/templates/.claude/commands/{complete-task.md → complete-task.en.md} +0 -0
- /package/templates/.claude/commands/{create-issue.md → create-issue.en.md} +0 -0
- /package/templates/.claude/commands/{create-pr.md → create-pr.en.md} +0 -0
- /package/templates/.claude/commands/{create-release-note.md → create-release-note.en.md} +0 -0
- /package/templates/.claude/commands/{create-task.md → create-task.en.md} +0 -0
- /package/templates/.claude/commands/{implement-task.md → implement-task.en.md} +0 -0
- /package/templates/.claude/commands/{import-codescan.md → import-codescan.en.md} +0 -0
- /package/templates/.claude/commands/{import-dependabot.md → import-dependabot.en.md} +0 -0
- /package/templates/.claude/commands/{import-issue.md → import-issue.en.md} +0 -0
- /package/templates/.claude/commands/{init-labels.md → init-labels.en.md} +0 -0
- /package/templates/.claude/commands/{init-milestones.md → init-milestones.en.md} +0 -0
- /package/templates/.claude/commands/{plan-task.md → plan-task.en.md} +0 -0
- /package/templates/.claude/commands/{refine-task.md → refine-task.en.md} +0 -0
- /package/templates/.claude/commands/{refine-title.md → refine-title.en.md} +0 -0
- /package/templates/.claude/commands/{release.md → release.en.md} +0 -0
- /package/templates/.claude/commands/{restore-task.md → restore-task.en.md} +0 -0
- /package/templates/.claude/commands/{review-task.md → review-task.en.md} +0 -0
- /package/templates/.claude/commands/{test-integration.md → test-integration.en.md} +0 -0
- /package/templates/.claude/commands/{test.md → test.en.md} +0 -0
- /package/templates/.claude/commands/{update-agent-infra.md → update-agent-infra.en.md} +0 -0
- /package/templates/.claude/commands/{upgrade-dependency.md → upgrade-dependency.en.md} +0 -0
- /package/templates/.gemini/commands/_project_/{analyze-task.toml → analyze-task.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{archive-tasks.toml → archive-tasks.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{block-task.toml → block-task.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{cancel-task.toml → cancel-task.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{check-task.toml → check-task.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{close-codescan.toml → close-codescan.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{close-dependabot.toml → close-dependabot.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{commit.toml → commit.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{complete-task.toml → complete-task.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{create-issue.toml → create-issue.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{create-pr.toml → create-pr.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{create-release-note.toml → create-release-note.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{create-task.toml → create-task.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{implement-task.toml → implement-task.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{import-codescan.toml → import-codescan.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{import-dependabot.toml → import-dependabot.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{import-issue.toml → import-issue.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{init-labels.toml → init-labels.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{init-milestones.toml → init-milestones.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{plan-task.toml → plan-task.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{refine-task.toml → refine-task.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{refine-title.toml → refine-title.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{release.toml → release.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{restore-task.toml → restore-task.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{review-task.toml → review-task.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{test-integration.toml → test-integration.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{test.toml → test.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{update-agent-infra.toml → update-agent-infra.en.toml} +0 -0
- /package/templates/.gemini/commands/_project_/{upgrade-dependency.toml → upgrade-dependency.en.toml} +0 -0
- /package/templates/.opencode/commands/{analyze-task.md → analyze-task.en.md} +0 -0
- /package/templates/.opencode/commands/{archive-tasks.md → archive-tasks.en.md} +0 -0
- /package/templates/.opencode/commands/{block-task.md → block-task.en.md} +0 -0
- /package/templates/.opencode/commands/{cancel-task.md → cancel-task.en.md} +0 -0
- /package/templates/.opencode/commands/{check-task.md → check-task.en.md} +0 -0
- /package/templates/.opencode/commands/{close-codescan.md → close-codescan.en.md} +0 -0
- /package/templates/.opencode/commands/{close-dependabot.md → close-dependabot.en.md} +0 -0
- /package/templates/.opencode/commands/{commit.md → commit.en.md} +0 -0
- /package/templates/.opencode/commands/{complete-task.md → complete-task.en.md} +0 -0
- /package/templates/.opencode/commands/{create-issue.md → create-issue.en.md} +0 -0
- /package/templates/.opencode/commands/{create-pr.md → create-pr.en.md} +0 -0
- /package/templates/.opencode/commands/{create-release-note.md → create-release-note.en.md} +0 -0
- /package/templates/.opencode/commands/{create-task.md → create-task.en.md} +0 -0
- /package/templates/.opencode/commands/{implement-task.md → implement-task.en.md} +0 -0
- /package/templates/.opencode/commands/{import-codescan.md → import-codescan.en.md} +0 -0
- /package/templates/.opencode/commands/{import-dependabot.md → import-dependabot.en.md} +0 -0
- /package/templates/.opencode/commands/{import-issue.md → import-issue.en.md} +0 -0
- /package/templates/.opencode/commands/{init-labels.md → init-labels.en.md} +0 -0
- /package/templates/.opencode/commands/{init-milestones.md → init-milestones.en.md} +0 -0
- /package/templates/.opencode/commands/{plan-task.md → plan-task.en.md} +0 -0
- /package/templates/.opencode/commands/{refine-task.md → refine-task.en.md} +0 -0
- /package/templates/.opencode/commands/{refine-title.md → refine-title.en.md} +0 -0
- /package/templates/.opencode/commands/{release.md → release.en.md} +0 -0
- /package/templates/.opencode/commands/{restore-task.md → restore-task.en.md} +0 -0
- /package/templates/.opencode/commands/{review-task.md → review-task.en.md} +0 -0
- /package/templates/.opencode/commands/{test-integration.md → test-integration.en.md} +0 -0
- /package/templates/.opencode/commands/{test.md → test.en.md} +0 -0
- /package/templates/.opencode/commands/{update-agent-infra.md → update-agent-infra.en.md} +0 -0
- /package/templates/.opencode/commands/{upgrade-dependency.md → upgrade-dependency.en.md} +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Label / Milestone Platform Commands
|
|
2
|
+
|
|
3
|
+
Read this file before initializing labels, initializing milestones, or adjusting milestones during release work.
|
|
4
|
+
|
|
5
|
+
## Authentication and Repository Info
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
gh auth token
|
|
9
|
+
gh repo view --json nameWithOwner --jq '.nameWithOwner'
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Label Operations
|
|
13
|
+
|
|
14
|
+
List existing labels:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
gh label list --limit 200 --json name --jq '.[].name'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Create or update a label:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
gh label create "{name}" --color "{color}" --description "{description}" --force
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Milestone Operations
|
|
27
|
+
|
|
28
|
+
List milestones:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
gh api "repos/$repo/milestones?state=all" --paginate
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Create a milestone:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
gh api "repos/$repo/milestones" -f title="{title}" -f description="{description}" -f state="{state}"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Update a milestone:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
gh api "repos/$repo/milestones/{number}" -X PATCH -f state="{state}" -f description="{description}"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Constraints
|
|
47
|
+
|
|
48
|
+
- use label names as the idempotency key
|
|
49
|
+
- use milestone titles as the idempotency key, then milestone numbers when patching state
|
|
50
|
+
- stop or skip according to the calling skill when commands fail
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Label / Milestone 平台命令
|
|
2
|
+
|
|
3
|
+
在初始化 label、初始化 milestone,或发布流程需要调整 milestone 前先读取本文件。
|
|
4
|
+
|
|
5
|
+
## 认证与仓库信息
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
gh auth token
|
|
9
|
+
gh repo view --json nameWithOwner --jq '.nameWithOwner'
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Label 操作
|
|
13
|
+
|
|
14
|
+
列出现有 label:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
gh label list --limit 200 --json name --jq '.[].name'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
创建或更新 label:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
gh label create "{name}" --color "{color}" --description "{description}" --force
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Milestone 操作
|
|
27
|
+
|
|
28
|
+
列出 milestone:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
gh api "repos/$repo/milestones?state=all" --paginate
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
创建 milestone:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
gh api "repos/$repo/milestones" -f title="{title}" -f description="{description}" -f state="{state}"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
更新 milestone:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
gh api "repos/$repo/milestones/{number}" -X PATCH -f state="{state}" -f description="{description}"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 约束
|
|
47
|
+
|
|
48
|
+
- label 以名称作为幂等键
|
|
49
|
+
- milestone 以标题作为幂等键,必要时再结合编号更新状态
|
|
50
|
+
- 失败时按调用方规则决定停止或跳过
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Release Platform Commands
|
|
2
|
+
|
|
3
|
+
Read this file before loading release history, querying merged PRs, or creating a draft release.
|
|
4
|
+
|
|
5
|
+
## Query Releases
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
gh release list --limit {limit} --json tagName,isDraft,isPrerelease
|
|
9
|
+
gh release view "{tag}" --json body,url
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Query Merged PRs
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
gh pr list --state merged --base "{branch}" --json number,title,mergedAt,labels
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
When needed, read the linked Issue:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
gh issue view {issue-number} --json number,title,labels,url
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Create a Draft Release
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
gh release create "v{version}" --draft --title "v{version}" --notes-file "{notes-file}"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
If commands fail, stop or escalate according to the calling skill.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Release 平台命令
|
|
2
|
+
|
|
3
|
+
在读取历史 release、查询已合并 PR,或创建 draft release 前先读取本文件。
|
|
4
|
+
|
|
5
|
+
## Release 查询
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
gh release list --limit {limit} --json tagName,isDraft,isPrerelease
|
|
9
|
+
gh release view "{tag}" --json body,url
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 已合并 PR 查询
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
gh pr list --state merged --base "{branch}" --json number,title,mergedAt,labels
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
必要时读取关联 Issue:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
gh issue view {issue-number} --json number,title,labels,url
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 创建 Draft Release
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
gh release create "v{version}" --draft --title "v{version}" --notes-file "{notes-file}"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
失败时按调用方规则停止或提示人工介入。
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Security Alert Platform Commands
|
|
2
|
+
|
|
3
|
+
Read this file before importing or dismissing Dependabot or Code Scanning alerts.
|
|
4
|
+
|
|
5
|
+
## Dependabot Alerts
|
|
6
|
+
|
|
7
|
+
Read an alert:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
gh api "repos/{owner}/{repo}/dependabot/alerts/{number}"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Dismiss an alert:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
gh api --method PATCH "repos/{owner}/{repo}/dependabot/alerts/{number}" \
|
|
17
|
+
-f state="dismissed" \
|
|
18
|
+
-f dismissed_reason="{reason}" \
|
|
19
|
+
-f dismissed_comment="{comment}"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Code Scanning Alerts
|
|
23
|
+
|
|
24
|
+
Read an alert:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
gh api "repos/{owner}/{repo}/code-scanning/alerts/{number}"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Dismiss an alert:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
gh api --method PATCH "repos/{owner}/{repo}/code-scanning/alerts/{number}" \
|
|
34
|
+
-f state="dismissed" \
|
|
35
|
+
-f dismissed_reason="{reason}" \
|
|
36
|
+
-f dismissed_comment="{comment}"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Constraints
|
|
40
|
+
|
|
41
|
+
- read the current alert state before deciding whether to continue
|
|
42
|
+
- validate dismissal reasons in the calling skill before sending them
|
|
43
|
+
- stop or escalate according to the calling skill when API calls fail
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# 安全告警平台命令
|
|
2
|
+
|
|
3
|
+
在导入或关闭 Dependabot / Code Scanning 告警前先读取本文件。
|
|
4
|
+
|
|
5
|
+
## Dependabot 告警
|
|
6
|
+
|
|
7
|
+
读取告警:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
gh api "repos/{owner}/{repo}/dependabot/alerts/{number}"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
关闭告警:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
gh api --method PATCH "repos/{owner}/{repo}/dependabot/alerts/{number}" \
|
|
17
|
+
-f state="dismissed" \
|
|
18
|
+
-f dismissed_reason="{reason}" \
|
|
19
|
+
-f dismissed_comment="{comment}"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Code Scanning 告警
|
|
23
|
+
|
|
24
|
+
读取告警:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
gh api "repos/{owner}/{repo}/code-scanning/alerts/{number}"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
关闭告警:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
gh api --method PATCH "repos/{owner}/{repo}/code-scanning/alerts/{number}" \
|
|
34
|
+
-f state="dismissed" \
|
|
35
|
+
-f dismissed_reason="{reason}" \
|
|
36
|
+
-f dismissed_comment="{comment}"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 约束
|
|
40
|
+
|
|
41
|
+
- 先读取当前告警状态,再决定是否继续
|
|
42
|
+
- 关闭理由必须由调用方校验后再传入
|
|
43
|
+
- API 失败时按调用方规则停止或提示人工介入
|
|
@@ -9,7 +9,7 @@ description: "Cancel an unneeded task and archive it"
|
|
|
9
9
|
|
|
10
10
|
- This command terminates a task that no longer needs to continue and archives it into `completed/`
|
|
11
11
|
- Cancel only when the task no longer needs implementation, review, or follow-up work
|
|
12
|
-
- When a valid `issue_number` exists,
|
|
12
|
+
- When a valid `issue_number` exists, Issue sync is required
|
|
13
13
|
|
|
14
14
|
## Steps
|
|
15
15
|
|
|
@@ -27,7 +27,7 @@ Handling rules:
|
|
|
27
27
|
|
|
28
28
|
### 2. Choose the Cancellation Label
|
|
29
29
|
|
|
30
|
-
Infer the
|
|
30
|
+
Infer the Issue closing label from the cancellation reason:
|
|
31
31
|
- `status: superseded`: reason implies duplicate, replaced, merged into, or already covered by another Issue or PR
|
|
32
32
|
- `status: invalid`: reason implies invalid report, no real problem, cannot reproduce, or no issue after investigation
|
|
33
33
|
- `status: declined`: reason implies not planned, deprioritized, or explicitly rejected
|
|
@@ -72,6 +72,7 @@ Confirm the task directory was moved successfully.
|
|
|
72
72
|
Check whether `task.md` contains a valid `issue_number`. If not, skip this step.
|
|
73
73
|
|
|
74
74
|
> Issue sync rules live in `.agents/rules/issue-sync.md`. Read that file before syncing.
|
|
75
|
+
> Read `.agents/rules/issue-pr-commands.md` before closing the Issue.
|
|
75
76
|
|
|
76
77
|
If a valid `issue_number` exists:
|
|
77
78
|
- Replace all `status:` labels with the label inferred in Step 2
|
|
@@ -80,7 +81,7 @@ If a valid `issue_number` exists:
|
|
|
80
81
|
- Remove all assignees
|
|
81
82
|
- Publish a cancellation comment using the marker `<!-- sync-issue:{task-id}:cancel -->`
|
|
82
83
|
- Create or update the `<!-- sync-issue:{task-id}:task -->` comment using the task-comment sync rules from `.agents/rules/issue-sync.md`
|
|
83
|
-
- Close the Issue
|
|
84
|
+
- Close the Issue by following the "Close an Issue" command in `.agents/rules/issue-pr-commands.md`, using the fixed reason `not planned`
|
|
84
85
|
|
|
85
86
|
The cancellation comment must include at least:
|
|
86
87
|
- the cancellation reason
|
|
@@ -112,7 +113,7 @@ Output format:
|
|
|
112
113
|
Task {task-id} cancelled and archived.
|
|
113
114
|
|
|
114
115
|
Cancellation reason: {reason}
|
|
115
|
-
|
|
116
|
+
Status label: {status-label or skipped}
|
|
116
117
|
Archived to: .agents/workspace/completed/{task-id}/
|
|
117
118
|
|
|
118
119
|
Next step - inspect the archived task:
|
|
@@ -125,7 +126,7 @@ Next step - inspect the archived task:
|
|
|
125
126
|
|
|
126
127
|
- [ ] Recorded the cancellation reason and updated task.md
|
|
127
128
|
- [ ] Moved the task directory into `.agents/workspace/completed/`
|
|
128
|
-
- [ ] Completed
|
|
129
|
+
- [ ] Completed Issue sync when an Issue exists
|
|
129
130
|
- [ ] Ran and passed the verification gate
|
|
130
131
|
- [ ] Showed the full next-step command set to the user
|
|
131
132
|
|
|
@@ -139,4 +140,4 @@ Next step - inspect the archived task:
|
|
|
139
140
|
|
|
140
141
|
- Task not found: `Task {task-id} not found`
|
|
141
142
|
- Task already archived: inform the user it is already in `completed/`
|
|
142
|
-
- Issue sync failed: keep the local archive result and tell the user manual
|
|
143
|
+
- Issue sync failed: keep the local archive result and tell the user manual platform follow-up is required
|
|
@@ -9,7 +9,7 @@ description: "取消不再需要的任务并归档"
|
|
|
9
9
|
|
|
10
10
|
- 本命令用于终止一个不再需要继续执行的任务,并归档到 `completed/`
|
|
11
11
|
- 只有在确认该任务无需继续实现、审查或修复时才可取消
|
|
12
|
-
- 有效 `issue_number` 存在时,
|
|
12
|
+
- 有效 `issue_number` 存在时,Issue 同步属于必做项
|
|
13
13
|
|
|
14
14
|
## 执行步骤
|
|
15
15
|
|
|
@@ -27,7 +27,7 @@ description: "取消不再需要的任务并归档"
|
|
|
27
27
|
|
|
28
28
|
### 2. 判断取消标签
|
|
29
29
|
|
|
30
|
-
根据取消原因推断
|
|
30
|
+
根据取消原因推断 Issue 关闭标签:
|
|
31
31
|
- `status: superseded`:原因包含“重复”、“替代”、“合并到”、“已由 #123 / PR 替代”等语义
|
|
32
32
|
- `status: invalid`:原因包含“误报”、“不存在”、“无法复现”、“排查后无问题”等语义
|
|
33
33
|
- `status: declined`:原因包含“不做”、“暂不实现”、“优先级调整”、“方案否决”等语义
|
|
@@ -72,6 +72,7 @@ ls .agents/workspace/completed/{task-id}/task.md
|
|
|
72
72
|
检查 `task.md` 中是否存在有效的 `issue_number`。如果没有,跳过此步骤。
|
|
73
73
|
|
|
74
74
|
> Issue 同步规则见 `.agents/rules/issue-sync.md`。执行同步前先读取该文件。
|
|
75
|
+
> 关闭 Issue 前先读取 `.agents/rules/issue-pr-commands.md`。
|
|
75
76
|
|
|
76
77
|
如果存在有效的 `issue_number`:
|
|
77
78
|
- 替换所有 `status:` labels,并设置步骤 2 推断出的标签
|
|
@@ -80,7 +81,7 @@ ls .agents/workspace/completed/{task-id}/task.md
|
|
|
80
81
|
- 移除全部 assignees
|
|
81
82
|
- 发布取消评论,隐藏标记使用 `<!-- sync-issue:{task-id}:cancel -->`
|
|
82
83
|
- 使用 `.agents/rules/issue-sync.md` 的 task.md 评论同步规则创建或更新 `<!-- sync-issue:{task-id}:task -->` 评论
|
|
83
|
-
- 关闭 Issue
|
|
84
|
+
- 关闭 Issue:按 `.agents/rules/issue-pr-commands.md` 中的“关闭 Issue”命令执行,关闭原因固定为 `not planned`
|
|
84
85
|
|
|
85
86
|
取消评论至少包含:
|
|
86
87
|
- 取消原因
|
|
@@ -112,7 +113,7 @@ node .agents/scripts/validate-artifact.js gate cancel-task .agents/workspace/com
|
|
|
112
113
|
任务 {task-id} 已取消并归档。
|
|
113
114
|
|
|
114
115
|
取消原因:{reason}
|
|
115
|
-
|
|
116
|
+
状态标签:{status-label 或 skipped}
|
|
116
117
|
归档路径:.agents/workspace/completed/{task-id}/
|
|
117
118
|
|
|
118
119
|
下一步 - 查看归档任务:
|
|
@@ -125,7 +126,7 @@ GitHub 标签:{status-label 或 skipped}
|
|
|
125
126
|
|
|
126
127
|
- [ ] 已记录取消原因并更新 task.md
|
|
127
128
|
- [ ] 已将任务目录移动到 `.agents/workspace/completed/`
|
|
128
|
-
- [ ] 已在存在 Issue 时完成
|
|
129
|
+
- [ ] 已在存在 Issue 时完成 Issue 同步
|
|
129
130
|
- [ ] 已运行 gate 校验并通过
|
|
130
131
|
- [ ] 已向用户展示完整的下一步命令
|
|
131
132
|
|
|
@@ -139,4 +140,4 @@ GitHub 标签:{status-label 或 skipped}
|
|
|
139
140
|
|
|
140
141
|
- 任务未找到:`Task {task-id} not found`
|
|
141
142
|
- 任务已归档:提示任务已在 `completed/` 中
|
|
142
|
-
- Issue
|
|
143
|
+
- Issue 同步失败:保留本地归档结果,并告知用户需要人工补齐平台操作
|
|
@@ -11,9 +11,7 @@ Dismiss the specified Code Scanning (CodeQL) alert and record a justified reason
|
|
|
11
11
|
|
|
12
12
|
### 1. Retrieve Alert Information
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
gh api repos/{owner}/{repo}/code-scanning/alerts/<alert-number>
|
|
16
|
-
```
|
|
14
|
+
Read `.agents/rules/security-alerts.md` before this step, then use its Code Scanning alert read command to fetch the alert details.
|
|
17
15
|
|
|
18
16
|
Verify that the alert is in the `open` state. If it is already dismissed or fixed, inform the user and exit.
|
|
19
17
|
|
|
@@ -61,13 +59,7 @@ Confirm? (y/N)
|
|
|
61
59
|
|
|
62
60
|
### 6. Execute the Dismissal
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
gh api --method PATCH \
|
|
66
|
-
repos/{owner}/{repo}/code-scanning/alerts/<alert-number> \
|
|
67
|
-
-f state=dismissed \
|
|
68
|
-
-f dismissed_reason="{api-reason}" \
|
|
69
|
-
-f dismissed_comment="{user explanation}"
|
|
70
|
-
```
|
|
62
|
+
Dismiss the alert by following the Code Scanning dismiss command in `.agents/rules/security-alerts.md`, passing the mapped `{api-reason}` and the user's explanation.
|
|
71
63
|
|
|
72
64
|
**API reason mapping** (per the GitHub Code Scanning API):
|
|
73
65
|
- False Positive -> `false positive`
|
|
@@ -115,7 +107,7 @@ Next step - complete and archive the task if a related task exists:
|
|
|
115
107
|
## Notes
|
|
116
108
|
|
|
117
109
|
1. **Handle high-severity alerts carefully**: Critical/High alerts require thorough analysis. Prefer `import-codescan` + `analyze-task` first.
|
|
118
|
-
2. **Use truthful reasons**: dismissal records are stored
|
|
110
|
+
2. **Use truthful reasons**: dismissal records are stored on the platform and may be audited.
|
|
119
111
|
3. **Review periodically**: dismissed alerts should be re-evaluated over time.
|
|
120
112
|
4. **Fix first**: dismissal should be the last resort.
|
|
121
113
|
|
|
@@ -11,9 +11,7 @@ description: "关闭 Code Scanning 告警并记录理由"
|
|
|
11
11
|
|
|
12
12
|
### 1. 获取告警信息
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
gh api repos/{owner}/{repo}/code-scanning/alerts/<alert-number>
|
|
16
|
-
```
|
|
14
|
+
执行前先读取 `.agents/rules/security-alerts.md`,并按其中的 Code Scanning 告警读取命令获取告警详情。
|
|
17
15
|
|
|
18
16
|
验证告警处于 `open` 状态。如果已被关闭/修复,告知用户并退出。
|
|
19
17
|
|
|
@@ -61,13 +59,7 @@ Code Scanning 告警 #{alert-number}
|
|
|
61
59
|
|
|
62
60
|
### 6. 执行关闭
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
gh api --method PATCH \
|
|
66
|
-
repos/{owner}/{repo}/code-scanning/alerts/<alert-number> \
|
|
67
|
-
-f state=dismissed \
|
|
68
|
-
-f dismissed_reason="{api-reason}" \
|
|
69
|
-
-f dismissed_comment="{用户的说明}"
|
|
70
|
-
```
|
|
62
|
+
按 `.agents/rules/security-alerts.md` 中的 Code Scanning 告警关闭命令执行关闭操作,并传入映射后的 `{api-reason}` 与用户说明。
|
|
71
63
|
|
|
72
64
|
**API reason 映射**(按 GitHub Code Scanning API):
|
|
73
65
|
- 误报 -> `false positive`
|
|
@@ -115,7 +107,7 @@ Code Scanning 告警 #{alert-number} 已关闭。
|
|
|
115
107
|
## 注意事项
|
|
116
108
|
|
|
117
109
|
1. **谨慎处理高严重程度告警**:Critical/High 告警需要充分分析。建议先执行 import-codescan + analyze-task。
|
|
118
|
-
2.
|
|
110
|
+
2. **真实的理由**:关闭记录保存在平台中,可能会被审计。
|
|
119
111
|
3. **定期复查**:已关闭的告警应定期复查。
|
|
120
112
|
4. **优先修复**:关闭应作为最后手段。
|
|
121
113
|
|
|
@@ -11,9 +11,7 @@ Dismiss the specified Dependabot security alert and record a justified reason.
|
|
|
11
11
|
|
|
12
12
|
### 1. Retrieve Alert Information
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
gh api repos/{owner}/{repo}/dependabot/alerts/<alert-number>
|
|
16
|
-
```
|
|
14
|
+
Read `.agents/rules/security-alerts.md` before this step, then use its Dependabot alert read command to fetch the alert details.
|
|
17
15
|
|
|
18
16
|
Verify that the alert is in the `open` state. If it is already dismissed or fixed, inform the user and exit.
|
|
19
17
|
|
|
@@ -67,13 +65,7 @@ Confirm? (y/N)
|
|
|
67
65
|
|
|
68
66
|
### 6. Execute the Dismissal
|
|
69
67
|
|
|
70
|
-
|
|
71
|
-
gh api --method PATCH \
|
|
72
|
-
repos/{owner}/{repo}/dependabot/alerts/<alert-number> \
|
|
73
|
-
-f state=dismissed \
|
|
74
|
-
-f dismissed_reason="{api-reason}" \
|
|
75
|
-
-f dismissed_comment="{user explanation}"
|
|
76
|
-
```
|
|
68
|
+
Dismiss the alert by following the Dependabot dismiss command in `.agents/rules/security-alerts.md`, passing the mapped `{api-reason}` and the user's explanation.
|
|
77
69
|
|
|
78
70
|
**API reason mapping**:
|
|
79
71
|
- False Positive -> `not_used` or `inaccurate`
|
|
@@ -110,9 +102,9 @@ Severity: {severity}
|
|
|
110
102
|
Reason: {reason}
|
|
111
103
|
Explanation: {explanation}
|
|
112
104
|
|
|
113
|
-
View:
|
|
105
|
+
View: {alert-url}
|
|
114
106
|
|
|
115
|
-
Note: it can be reopened on
|
|
107
|
+
Note: it can be reopened on the platform if necessary.
|
|
116
108
|
|
|
117
109
|
Next step - complete and archive the task if a related task exists:
|
|
118
110
|
- Claude Code / OpenCode: /complete-task {task-id}
|
|
@@ -123,7 +115,7 @@ Next step - complete and archive the task if a related task exists:
|
|
|
123
115
|
## Notes
|
|
124
116
|
|
|
125
117
|
1. **Handle high-severity alerts carefully**: Critical/High alerts require thorough analysis before dismissal. Prefer `import-dependabot` + `analyze-task` first.
|
|
126
|
-
2. **Use truthful reasons**: dismissal records are stored
|
|
118
|
+
2. **Use truthful reasons**: dismissal records are stored on the platform and may be audited.
|
|
127
119
|
3. **Review periodically**: dismissed alerts should be re-evaluated because code changes may invalidate the dismissal rationale.
|
|
128
120
|
4. **Fix first**: dismissal should be the last resort. Prefer upgrading, replacing, or mitigating.
|
|
129
121
|
|
|
@@ -11,9 +11,7 @@ description: "关闭 Dependabot 安全告警并记录理由"
|
|
|
11
11
|
|
|
12
12
|
### 1. 获取告警信息
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
gh api repos/{owner}/{repo}/dependabot/alerts/<alert-number>
|
|
16
|
-
```
|
|
14
|
+
执行前先读取 `.agents/rules/security-alerts.md`,并按其中的 Dependabot 告警读取命令获取告警详情。
|
|
17
15
|
|
|
18
16
|
验证告警处于 `open` 状态。如果已被关闭/修复,告知用户并退出。
|
|
19
17
|
|
|
@@ -67,13 +65,7 @@ CVE:{cve-id}
|
|
|
67
65
|
|
|
68
66
|
### 6. 执行关闭
|
|
69
67
|
|
|
70
|
-
|
|
71
|
-
gh api --method PATCH \
|
|
72
|
-
repos/{owner}/{repo}/dependabot/alerts/<alert-number> \
|
|
73
|
-
-f state=dismissed \
|
|
74
|
-
-f dismissed_reason="{api-reason}" \
|
|
75
|
-
-f dismissed_comment="{用户的说明}"
|
|
76
|
-
```
|
|
68
|
+
按 `.agents/rules/security-alerts.md` 中的 Dependabot 告警关闭命令执行关闭操作,并传入映射后的 `{api-reason}` 与用户说明。
|
|
77
69
|
|
|
78
70
|
**API reason 映射**:
|
|
79
71
|
- 误报 -> `not_used` 或 `inaccurate`
|
|
@@ -110,9 +102,9 @@ date "+%Y-%m-%d %H:%M:%S"
|
|
|
110
102
|
原因:{reason}
|
|
111
103
|
说明:{explanation}
|
|
112
104
|
|
|
113
|
-
查看:
|
|
105
|
+
查看:{alert-url}
|
|
114
106
|
|
|
115
|
-
|
|
107
|
+
注意:如有需要,可在平台侧重新打开。
|
|
116
108
|
|
|
117
109
|
下一步 - 完成并归档任务(如有关联任务):
|
|
118
110
|
- Claude Code / OpenCode:/complete-task {task-id}
|
|
@@ -123,7 +115,7 @@ date "+%Y-%m-%d %H:%M:%S"
|
|
|
123
115
|
## 注意事项
|
|
124
116
|
|
|
125
117
|
1. **谨慎处理高严重程度告警**:Critical/High 告警需要在关闭前进行充分分析。建议先执行 import-dependabot + analyze-task。
|
|
126
|
-
2.
|
|
118
|
+
2. **真实的理由**:关闭记录保存在平台中,可能会被审计。
|
|
127
119
|
3. **定期复查**:已关闭的告警应定期复查,因为代码变更可能使关闭理由失效。
|
|
128
120
|
4. **优先修复**:关闭应作为最后手段。优先考虑升级、替换或缓解。
|
|
129
121
|
|
|
@@ -21,7 +21,7 @@ Create the base GitHub Issue from `task.md` and write `issue_number` back to the
|
|
|
21
21
|
|
|
22
22
|
Check:
|
|
23
23
|
- `.agents/workspace/active/{task-id}/task.md`
|
|
24
|
-
-
|
|
24
|
+
- read `.agents/rules/issue-pr-commands.md` first, then use its authentication commands to verify platform access
|
|
25
25
|
|
|
26
26
|
If `issue_number` already exists and is not empty or `N/A`, confirm with the user before creating a replacement Issue.
|
|
27
27
|
|
|
@@ -39,10 +39,7 @@ Detect `.github/ISSUE_TEMPLATE` files and decide whether to use a matched templa
|
|
|
39
39
|
|
|
40
40
|
### 4. Create the Issue
|
|
41
41
|
|
|
42
|
-
Create the Issue
|
|
43
|
-
|
|
44
|
-
If an Issue Type was selected, set it with:
|
|
45
|
-
`gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{issue-type}" --silent`
|
|
42
|
+
Create and enrich the Issue by following the "Create Issue" and "Set the Issue Type" sections in `.agents/rules/issue-pr-commands.md`. Omit label arguments when nothing valid remains.
|
|
46
43
|
|
|
47
44
|
### 5. Update Task Status
|
|
48
45
|
|
|
@@ -21,7 +21,7 @@ description: "从任务文件创建 GitHub Issue"
|
|
|
21
21
|
|
|
22
22
|
检查:
|
|
23
23
|
- `.agents/workspace/active/{task-id}/task.md`
|
|
24
|
-
-
|
|
24
|
+
- 执行前先读取 `.agents/rules/issue-pr-commands.md`,并按其中的认证命令验证当前平台访问能力
|
|
25
25
|
|
|
26
26
|
如果 `issue_number` 已存在且既不为空也不为 `N/A`,创建前必须先与用户确认。
|
|
27
27
|
|
|
@@ -39,10 +39,7 @@ description: "从任务文件创建 GitHub Issue"
|
|
|
39
39
|
|
|
40
40
|
### 4. 创建 Issue
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
如果已经确定了 Issue Type,则执行:
|
|
45
|
-
`gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{issue-type}" --silent`
|
|
42
|
+
按 `.agents/rules/issue-pr-commands.md` 中的 “创建 Issue” 与 “Issue Type 设置” 规则创建并补充 Issue;如果没有有效 label,就省略 label 参数。
|
|
46
43
|
|
|
47
44
|
### 5. 更新任务状态
|
|
48
45
|
|
package/templates/.agents/skills/create-issue/reference/{label-and-type.md → label-and-type.en.md}
RENAMED
|
@@ -42,29 +42,17 @@ Issue Type fallback mapping:
|
|
|
42
42
|
|
|
43
43
|
## Create the Issue
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Before creating the Issue, read `.agents/rules/issue-pr-commands.md` and use its "Create an Issue" command template.
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
gh issue create --title "{title}" --body "{body}" --label "{label-1}" --label "{label-2}" --milestone "{milestone}"
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
If no valid labels remain, omit `--label`.
|
|
47
|
+
If no valid labels remain, omit label arguments.
|
|
52
48
|
|
|
53
49
|
For milestone inference, read `.agents/rules/milestone-inference.md` and follow "Phase 1: `create-issue`" before creating the Issue.
|
|
54
50
|
|
|
55
|
-
Issue Type setup
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
gh api "orgs/$owner/issue-types" --jq '.[].name'
|
|
59
|
-
gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{issue-type}" --silent
|
|
60
|
-
```
|
|
51
|
+
Issue Type setup follows the matching commands in `.agents/rules/issue-pr-commands.md`.
|
|
61
52
|
|
|
62
53
|
`in:` labels (coarse selection):
|
|
63
54
|
|
|
64
|
-
|
|
65
|
-
gh label list --search "in:" --limit 50 --json name --jq '.[].name'
|
|
66
|
-
gh issue edit {issue-number} --add-label "in: {module}"
|
|
67
|
-
```
|
|
55
|
+
Prepare label edit arguments by following the Issue update command in `.agents/rules/issue-pr-commands.md`.
|
|
68
56
|
|
|
69
57
|
Use the returned labels to do semantic matching against the task.md title and description:
|
|
70
58
|
- add a label when the task **explicitly mentions** a module (for example, "fix CLI argument parsing" -> `in: cli`)
|
|
@@ -42,29 +42,17 @@ Issue Type fallback 映射:
|
|
|
42
42
|
|
|
43
43
|
## 创建 Issue
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
创建 Issue 时,执行前先读取 `.agents/rules/issue-pr-commands.md`,并使用其中的 “创建 Issue” 命令模板。
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
gh issue create --title "{title}" --body "{body}" --label "{label-1}" --label "{label-2}" --milestone "{milestone}"
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
如果最终没有有效 label,就省略 `--label`。
|
|
47
|
+
如果最终没有有效 label,就省略 label 参数。
|
|
52
48
|
|
|
53
49
|
Milestone 推断规则见 `.agents/rules/milestone-inference.md` 的「阶段 1:`create-issue`」。推断前先读取该文件。
|
|
54
50
|
|
|
55
|
-
Issue Type
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
gh api "orgs/$owner/issue-types" --jq '.[].name'
|
|
59
|
-
gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{issue-type}" --silent
|
|
60
|
-
```
|
|
51
|
+
Issue Type 设置同样遵循 `.agents/rules/issue-pr-commands.md` 中的对应命令。
|
|
61
52
|
|
|
62
53
|
`in:` label(粗选):
|
|
63
54
|
|
|
64
|
-
|
|
65
|
-
gh label list --search "in:" --limit 50 --json name --jq '.[].name'
|
|
66
|
-
gh issue edit {issue-number} --add-label "in: {module}"
|
|
67
|
-
```
|
|
55
|
+
执行前先按 `.agents/rules/issue-pr-commands.md` 的 Issue 更新命令准备 label 编辑参数。
|
|
68
56
|
|
|
69
57
|
从查询结果中,根据 task.md 的标题和描述进行语义匹配:
|
|
70
58
|
- 任务描述**明确提及**某个模块(如"修复 CLI 参数解析"→ `in: cli`)→ 添加
|