@fitlab-ai/agent-infra 0.4.0 → 0.4.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 +23 -15
- package/README.zh-CN.md +23 -15
- package/lib/defaults.json +5 -9
- package/lib/init.js +1 -6
- package/lib/update.js +0 -55
- package/package.json +1 -1
- package/templates/.agents/QUICKSTART.md +17 -7
- package/templates/.agents/QUICKSTART.zh-CN.md +23 -13
- package/templates/.agents/README.md +33 -27
- package/templates/.agents/README.zh-CN.md +35 -29
- package/templates/.agents/skills/analyze-task/SKILL.md +1 -4
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/block-task/SKILL.md +1 -5
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +1 -4
- package/templates/.agents/skills/check-task/SKILL.md +1 -5
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/close-codescan/SKILL.md +1 -4
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/close-dependabot/SKILL.md +1 -4
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/commit/SKILL.md +26 -198
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +26 -197
- package/templates/.agents/skills/commit/reference/commit-message.md +60 -0
- package/templates/.agents/skills/commit/reference/commit-message.zh-CN.md +60 -0
- package/templates/.agents/skills/commit/reference/copyright-check.md +39 -0
- package/templates/.agents/skills/commit/reference/copyright-check.zh-CN.md +39 -0
- package/templates/.agents/skills/commit/reference/task-status-update.md +88 -0
- package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +88 -0
- package/templates/.agents/skills/complete-task/SKILL.md +1 -6
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +1 -4
- package/templates/.agents/skills/create-issue/SKILL.md +32 -251
- package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +33 -252
- package/templates/.agents/skills/create-issue/reference/label-and-type.md +77 -0
- package/templates/.agents/skills/create-issue/reference/label-and-type.zh-CN.md +77 -0
- package/templates/.agents/skills/create-issue/reference/template-matching.md +45 -0
- package/templates/.agents/skills/create-issue/reference/template-matching.zh-CN.md +45 -0
- package/templates/.agents/skills/create-pr/SKILL.md +39 -221
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +39 -220
- package/templates/.agents/skills/create-pr/reference/branch-strategy.md +29 -0
- package/templates/.agents/skills/create-pr/reference/branch-strategy.zh-CN.md +29 -0
- package/templates/.agents/skills/create-pr/reference/pr-body-template.md +86 -0
- package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +86 -0
- package/templates/.agents/skills/create-release-note/SKILL.md +10 -13
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +10 -12
- package/templates/.agents/skills/create-task/SKILL.md +2 -5
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +2 -4
- package/templates/.agents/skills/implement-task/SKILL.md +47 -176
- package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +43 -170
- package/templates/.agents/skills/implement-task/reference/implementation-rules.md +58 -0
- package/templates/.agents/skills/implement-task/reference/implementation-rules.zh-CN.md +58 -0
- package/templates/.agents/skills/implement-task/reference/report-template.md +63 -0
- package/templates/.agents/skills/implement-task/reference/report-template.zh-CN.md +63 -0
- package/templates/.agents/skills/import-codescan/SKILL.md +1 -4
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/import-dependabot/SKILL.md +1 -4
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/import-issue/SKILL.md +2 -3
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +2 -3
- package/templates/.agents/skills/init-labels/SKILL.md +1 -4
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +1 -4
- package/templates/.agents/skills/init-milestones/SKILL.md +1 -3
- package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/plan-task/SKILL.md +1 -5
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/refine-task/SKILL.md +40 -162
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +38 -158
- package/templates/.agents/skills/refine-task/reference/fix-workflow.md +76 -0
- package/templates/.agents/skills/refine-task/reference/fix-workflow.zh-CN.md +76 -0
- package/templates/.agents/skills/refine-task/reference/report-template.md +38 -0
- package/templates/.agents/skills/refine-task/reference/report-template.zh-CN.md +38 -0
- package/templates/.agents/skills/refine-title/SKILL.md +1 -4
- package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/release/SKILL.md +10 -12
- package/templates/.agents/skills/release/SKILL.zh-CN.md +10 -11
- package/templates/.agents/skills/review-task/SKILL.md +37 -239
- package/templates/.agents/skills/review-task/SKILL.zh-CN.md +37 -238
- package/templates/.agents/skills/review-task/reference/output-templates.md +72 -0
- package/templates/.agents/skills/review-task/reference/output-templates.zh-CN.md +72 -0
- package/templates/.agents/skills/review-task/reference/report-template.md +63 -0
- package/templates/.agents/skills/review-task/reference/report-template.zh-CN.md +63 -0
- package/templates/.agents/skills/review-task/reference/review-criteria.md +24 -0
- package/templates/.agents/skills/review-task/reference/review-criteria.zh-CN.md +24 -0
- package/templates/.agents/skills/sync-issue/SKILL.md +34 -490
- package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +34 -489
- package/templates/.agents/skills/sync-issue/reference/comment-publish.md +84 -0
- package/templates/.agents/skills/sync-issue/reference/comment-publish.zh-CN.md +84 -0
- package/templates/.agents/skills/sync-issue/reference/label-sync.md +62 -0
- package/templates/.agents/skills/sync-issue/reference/label-sync.zh-CN.md +62 -0
- package/templates/.agents/skills/sync-issue/reference/milestone-sync.md +37 -0
- package/templates/.agents/skills/sync-issue/reference/milestone-sync.zh-CN.md +37 -0
- package/templates/.agents/skills/sync-pr/SKILL.md +37 -284
- package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +41 -288
- package/templates/.agents/skills/sync-pr/reference/comment-publish.md +82 -0
- package/templates/.agents/skills/sync-pr/reference/comment-publish.zh-CN.md +82 -0
- package/templates/.agents/skills/sync-pr/reference/delivery-detection.md +54 -0
- package/templates/.agents/skills/sync-pr/reference/delivery-detection.zh-CN.md +54 -0
- package/templates/.agents/skills/test/SKILL.md +1 -3
- package/templates/.agents/skills/test/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/test-integration/SKILL.md +1 -4
- package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/update-agent-infra/SKILL.md +2 -6
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +2 -4
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +45 -55
- package/templates/.agents/skills/upgrade-dependency/SKILL.md +1 -4
- package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +1 -3
- package/templates/.claude/commands/analyze-task.md +1 -1
- package/templates/.claude/commands/analyze-task.zh-CN.md +1 -1
- package/templates/.claude/commands/block-task.md +2 -1
- package/templates/.claude/commands/block-task.zh-CN.md +2 -1
- package/templates/.claude/commands/check-task.md +2 -1
- package/templates/.claude/commands/check-task.zh-CN.md +2 -1
- package/templates/.claude/commands/close-codescan.md +2 -1
- package/templates/.claude/commands/close-codescan.zh-CN.md +2 -1
- package/templates/.claude/commands/close-dependabot.md +2 -1
- package/templates/.claude/commands/close-dependabot.zh-CN.md +2 -1
- package/templates/.claude/commands/commit.md +1 -1
- package/templates/.claude/commands/commit.zh-CN.md +1 -1
- package/templates/.claude/commands/complete-task.md +1 -1
- package/templates/.claude/commands/complete-task.zh-CN.md +1 -1
- package/templates/.claude/commands/create-issue.md +1 -1
- package/templates/.claude/commands/create-issue.zh-CN.md +1 -1
- package/templates/.claude/commands/create-pr.md +2 -2
- package/templates/.claude/commands/create-pr.zh-CN.md +2 -2
- package/templates/.claude/commands/create-release-note.md +2 -1
- package/templates/.claude/commands/create-release-note.zh-CN.md +2 -1
- package/templates/.claude/commands/create-task.md +1 -1
- package/templates/.claude/commands/create-task.zh-CN.md +1 -1
- package/templates/.claude/commands/implement-task.md +1 -1
- package/templates/.claude/commands/implement-task.zh-CN.md +1 -1
- package/templates/.claude/commands/import-codescan.md +1 -0
- package/templates/.claude/commands/import-codescan.zh-CN.md +2 -1
- package/templates/.claude/commands/import-dependabot.md +1 -0
- package/templates/.claude/commands/import-dependabot.zh-CN.md +2 -1
- package/templates/.claude/commands/import-issue.md +1 -1
- package/templates/.claude/commands/import-issue.zh-CN.md +1 -1
- package/templates/.claude/commands/init-labels.md +1 -0
- package/templates/.claude/commands/init-labels.zh-CN.md +2 -1
- package/templates/.claude/commands/init-milestones.md +2 -1
- package/templates/.claude/commands/init-milestones.zh-CN.md +2 -1
- package/templates/.claude/commands/plan-task.md +1 -1
- package/templates/.claude/commands/plan-task.zh-CN.md +1 -1
- package/templates/.claude/commands/refine-task.zh-CN.md +1 -1
- package/templates/.claude/commands/refine-title.md +2 -1
- package/templates/.claude/commands/refine-title.zh-CN.md +2 -1
- package/templates/.claude/commands/release.md +2 -1
- package/templates/.claude/commands/release.zh-CN.md +2 -1
- package/templates/.claude/commands/review-task.md +1 -1
- package/templates/.claude/commands/review-task.zh-CN.md +1 -1
- package/templates/.claude/commands/sync-issue.md +1 -1
- package/templates/.claude/commands/sync-issue.zh-CN.md +1 -1
- package/templates/.claude/commands/sync-pr.md +2 -2
- package/templates/.claude/commands/sync-pr.zh-CN.md +2 -2
- package/templates/.claude/commands/test-integration.md +2 -1
- package/templates/.claude/commands/test-integration.zh-CN.md +2 -1
- package/templates/.claude/commands/test.md +1 -1
- package/templates/.claude/commands/test.zh-CN.md +1 -1
- package/templates/.claude/commands/update-agent-infra.md +2 -1
- package/templates/.claude/commands/update-agent-infra.zh-CN.md +2 -1
- package/templates/.claude/commands/upgrade-dependency.md +2 -1
- package/templates/.claude/commands/upgrade-dependency.zh-CN.md +2 -1
- package/templates/.gemini/commands/_project_/analyze-task.toml +1 -1
- package/templates/.gemini/commands/_project_/analyze-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/block-task.toml +1 -1
- package/templates/.gemini/commands/_project_/block-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/check-task.toml +1 -1
- package/templates/.gemini/commands/_project_/check-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/close-codescan.toml +1 -1
- package/templates/.gemini/commands/_project_/close-codescan.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/close-dependabot.toml +1 -1
- package/templates/.gemini/commands/_project_/close-dependabot.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/commit.toml +1 -1
- package/templates/.gemini/commands/_project_/commit.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/complete-task.toml +1 -1
- package/templates/.gemini/commands/_project_/complete-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/create-issue.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/create-pr.toml +1 -1
- package/templates/.gemini/commands/_project_/create-pr.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/create-release-note.toml +1 -1
- package/templates/.gemini/commands/_project_/create-release-note.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/create-task.toml +1 -1
- package/templates/.gemini/commands/_project_/create-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/implement-task.toml +1 -1
- package/templates/.gemini/commands/_project_/implement-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/import-codescan.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/import-dependabot.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/import-issue.toml +1 -1
- package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/init-milestones.toml +1 -1
- package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/plan-task.toml +1 -1
- package/templates/.gemini/commands/_project_/plan-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/refine-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/refine-title.toml +1 -1
- package/templates/.gemini/commands/_project_/refine-title.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/release.toml +1 -1
- package/templates/.gemini/commands/_project_/release.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/review-task.toml +1 -1
- package/templates/.gemini/commands/_project_/review-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/sync-issue.toml +1 -1
- package/templates/.gemini/commands/_project_/sync-issue.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/sync-pr.toml +2 -2
- package/templates/.gemini/commands/_project_/sync-pr.zh-CN.toml +2 -2
- package/templates/.gemini/commands/_project_/test-integration.toml +1 -1
- package/templates/.gemini/commands/_project_/test-integration.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/test.toml +1 -1
- package/templates/.gemini/commands/_project_/test.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/update-agent-infra.toml +1 -1
- package/templates/.gemini/commands/_project_/update-agent-infra.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/upgrade-dependency.toml +1 -1
- package/templates/.gemini/commands/_project_/upgrade-dependency.zh-CN.toml +1 -1
- package/templates/.github/hooks/check-version-format.sh +29 -0
- package/templates/.github/hooks/pre-commit +8 -0
- package/templates/.opencode/commands/analyze-task.md +1 -1
- package/templates/.opencode/commands/analyze-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/block-task.md +1 -1
- package/templates/.opencode/commands/block-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/check-task.md +1 -1
- package/templates/.opencode/commands/check-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/close-codescan.md +1 -1
- package/templates/.opencode/commands/close-codescan.zh-CN.md +1 -1
- package/templates/.opencode/commands/close-dependabot.md +1 -1
- package/templates/.opencode/commands/close-dependabot.zh-CN.md +1 -1
- package/templates/.opencode/commands/commit.md +1 -1
- package/templates/.opencode/commands/commit.zh-CN.md +1 -1
- package/templates/.opencode/commands/complete-task.md +1 -1
- package/templates/.opencode/commands/complete-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/create-issue.zh-CN.md +1 -1
- package/templates/.opencode/commands/create-pr.md +1 -1
- package/templates/.opencode/commands/create-pr.zh-CN.md +1 -1
- package/templates/.opencode/commands/create-release-note.md +1 -1
- package/templates/.opencode/commands/create-release-note.zh-CN.md +1 -1
- package/templates/.opencode/commands/create-task.md +1 -1
- package/templates/.opencode/commands/create-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/implement-task.md +1 -1
- package/templates/.opencode/commands/implement-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/import-codescan.zh-CN.md +1 -1
- package/templates/.opencode/commands/import-dependabot.zh-CN.md +1 -1
- package/templates/.opencode/commands/import-issue.md +1 -1
- package/templates/.opencode/commands/import-issue.zh-CN.md +1 -1
- package/templates/.opencode/commands/init-labels.zh-CN.md +1 -1
- package/templates/.opencode/commands/init-milestones.md +1 -1
- package/templates/.opencode/commands/init-milestones.zh-CN.md +1 -1
- package/templates/.opencode/commands/plan-task.md +1 -1
- package/templates/.opencode/commands/plan-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/refine-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/refine-title.md +1 -1
- package/templates/.opencode/commands/refine-title.zh-CN.md +1 -1
- package/templates/.opencode/commands/release.md +1 -1
- package/templates/.opencode/commands/release.zh-CN.md +1 -1
- package/templates/.opencode/commands/review-task.md +1 -1
- package/templates/.opencode/commands/review-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/sync-issue.md +1 -1
- package/templates/.opencode/commands/sync-issue.zh-CN.md +1 -1
- package/templates/.opencode/commands/sync-pr.md +2 -2
- package/templates/.opencode/commands/sync-pr.zh-CN.md +2 -2
- package/templates/.opencode/commands/test-integration.md +1 -1
- package/templates/.opencode/commands/test-integration.zh-CN.md +1 -1
- package/templates/.opencode/commands/test.md +1 -1
- package/templates/.opencode/commands/test.zh-CN.md +1 -1
- package/templates/.opencode/commands/update-agent-infra.md +1 -1
- package/templates/.opencode/commands/update-agent-infra.zh-CN.md +1 -1
- package/templates/.opencode/commands/upgrade-dependency.md +1 -1
- package/templates/.opencode/commands/upgrade-dependency.zh-CN.md +1 -1
- package/templates/.claude/CLAUDE.md +0 -176
- package/templates/.claude/CLAUDE.zh-CN.md +0 -176
- package/templates/.claude/project-rules.md +0 -65
- package/templates/.claude/project-rules.zh-CN.md +0 -65
- package/templates/.codex/README.md +0 -38
- package/templates/.codex/README.zh-CN.md +0 -37
- package/templates/.opencode/COMMAND_STYLE_GUIDE.md +0 -232
- package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +0 -232
- package/templates/.opencode/README.md +0 -76
- package/templates/.opencode/README.zh-CN.md +0 -77
- package/templates/AGENTS.md +0 -104
- package/templates/AGENTS.zh-CN.md +0 -104
|
@@ -1,230 +1,47 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: create-issue
|
|
3
|
-
description:
|
|
4
|
-
Create a GitHub Issue from a task file.
|
|
5
|
-
Triggered when the user asks to create an Issue for a task. Argument: task-id.
|
|
3
|
+
description: "Create a GitHub Issue from a task file"
|
|
6
4
|
---
|
|
7
5
|
|
|
8
6
|
# Create Issue
|
|
9
7
|
|
|
8
|
+
Create the base GitHub Issue from `task.md` and write `issue_number` back to the task.
|
|
9
|
+
|
|
10
10
|
## Boundary / Critical Rules
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
- After executing this skill, you **must** immediately update task status in `task.md`
|
|
12
|
+
- Build the Issue title and body from `task.md` only
|
|
13
|
+
- Do not read `analysis.md`, `plan.md`, `implementation.md`, or review artifacts
|
|
14
|
+
- The only durable outputs are the GitHub Issue and the `issue_number` update in task.md
|
|
15
|
+
- After executing this skill, you **must** immediately update task.md
|
|
17
16
|
|
|
18
17
|
## Steps
|
|
19
18
|
|
|
20
19
|
### 1. Verify Prerequisites
|
|
21
20
|
|
|
22
|
-
Check
|
|
23
|
-
- `.agents/workspace/active/{task-id}/task.md`
|
|
24
|
-
|
|
25
|
-
Check that GitHub CLI is available and authenticated:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
gh auth status
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Note: `{task-id}` format is `TASK-{yyyyMMdd-HHmmss}`, e.g. `TASK-20260306-143022`
|
|
21
|
+
Check:
|
|
22
|
+
- `.agents/workspace/active/{task-id}/task.md`
|
|
23
|
+
- GitHub CLI authentication with `gh auth status`
|
|
32
24
|
|
|
33
|
-
If
|
|
34
|
-
|
|
35
|
-
If the `issue_number` field already exists in task.md front matter and its value is neither empty nor `N/A`, ask the user whether to reuse the existing Issue or create a new one.
|
|
25
|
+
If `issue_number` already exists and is not empty or `N/A`, confirm with the user before creating a replacement Issue.
|
|
36
26
|
|
|
37
27
|
### 2. Extract Task Information
|
|
38
28
|
|
|
39
|
-
|
|
40
|
-
- Task title
|
|
41
|
-
- `## Description` content
|
|
42
|
-
- `## Requirements` list
|
|
43
|
-
- `type` field
|
|
44
|
-
- `milestone` field (if present)
|
|
45
|
-
|
|
46
|
-
If the description is empty, prompt the user to update the task description first.
|
|
29
|
+
Extract the title, `## Description`, `## Requirements`, `type`, and `milestone` from task.md.
|
|
47
30
|
|
|
48
31
|
### 3. Build Issue Content
|
|
49
32
|
|
|
50
|
-
|
|
51
|
-
- **Title**: use the task title
|
|
52
|
-
- **Body values**: come from `task.md` only
|
|
53
|
-
- **Template role**: Issue templates provide structure, field labels, and default labels only
|
|
54
|
-
- **Issue Type**: prefer the template `type:` value; otherwise use a fallback mapping from task.md `type`
|
|
55
|
-
- **When no usable template exists**: fall back to the simple format
|
|
56
|
-
|
|
57
|
-
#### 3a. Detect Issue Templates
|
|
58
|
-
|
|
59
|
-
Check the project templates and ignore `config.yml`:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
rg --files .github/ISSUE_TEMPLATE -g '*.yml' -g '!config.yml'
|
|
63
|
-
```
|
|
64
|
-
|
|
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
|
-
|
|
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.
|
|
33
|
+
Detect `.github/ISSUE_TEMPLATE` files and decide whether to use a matched template path or the fallback path.
|
|
77
34
|
|
|
78
|
-
|
|
35
|
+
> Template detection, field mapping for `textarea`, `input`, `dropdown`, and `checkboxes`, and the fallback body rules live in `reference/template-matching.md`. Read `reference/template-matching.md` before building the body.
|
|
79
36
|
|
|
80
|
-
|
|
37
|
+
> Label filtering, Issue Type fallback, `issue-types` API handling, `milestone` logic, `--milestone`, and `in:` label rules live in `reference/label-and-type.md`. Read `reference/label-and-type.md` before creating the Issue.
|
|
81
38
|
|
|
82
|
-
|
|
83
|
-
- `name`
|
|
84
|
-
- `type:`
|
|
85
|
-
- `labels:`
|
|
86
|
-
- `body:`
|
|
39
|
+
### 4. Create the Issue
|
|
87
40
|
|
|
88
|
-
|
|
89
|
-
- if the template defines `type:`, record it as `{issue-type}`
|
|
90
|
-
- treat each value in `labels:` as a candidate label
|
|
91
|
-
- iterate over the `body:` list
|
|
92
|
-
- for `type: textarea` and `type: input` fields:
|
|
93
|
-
- use `attributes.label` as the markdown section heading
|
|
94
|
-
- fill the section content with information mapped from `task.md`
|
|
95
|
-
- for `type: markdown`: skip it; do not copy helper text from the template directly into the Issue body
|
|
96
|
-
- for `type: dropdown` and `type: checkboxes`: skip them
|
|
97
|
-
- if `task.md` does not have suitable content, write `N/A`
|
|
98
|
-
|
|
99
|
-
Suggested field mapping:
|
|
100
|
-
- fields containing `summary`, `title` -> task title
|
|
101
|
-
- fields containing `description`, `problem`, `what happened`, `issue-description`, `current-content` -> task description
|
|
102
|
-
- fields containing `solution`, `requirements`, `steps`, `suggested-content`, `impact`, `context`, `alternatives`, `expected` -> requirement list rendered as a checklist or bullet list
|
|
103
|
-
- other `textarea` / `input` fields -> prefer the task description, otherwise use `N/A`
|
|
104
|
-
|
|
105
|
-
For each candidate label from the template path, check existence first:
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
gh label list --search "{label}" --limit 20 --json name --jq '.[].name'
|
|
109
|
-
```
|
|
41
|
+
Create the Issue with `gh issue create --title "{title}" --body "{body}" ...` and omit `--label` when nothing valid remains.
|
|
110
42
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
#### 3c. Default Body Format (Fallback)
|
|
114
|
-
|
|
115
|
-
Recommended body structure:
|
|
116
|
-
|
|
117
|
-
```markdown
|
|
118
|
-
## Description
|
|
119
|
-
|
|
120
|
-
{task-description}
|
|
121
|
-
|
|
122
|
-
## Requirements
|
|
123
|
-
|
|
124
|
-
- [ ] {requirement-1}
|
|
125
|
-
- [ ] {requirement-2}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
Label mapping:
|
|
129
|
-
|
|
130
|
-
| task.md type | GitHub label |
|
|
131
|
-
|---|---|
|
|
132
|
-
| `bug`, `bugfix` | `type: bug` |
|
|
133
|
-
| `feature` | `type: feature` |
|
|
134
|
-
| `enhancement` | `type: enhancement` |
|
|
135
|
-
| `docs`, `documentation` | `type: documentation` |
|
|
136
|
-
| `dependency-upgrade` | `type: dependency-upgrade` |
|
|
137
|
-
| `task`, `chore`, `refactor`, `refactoring` | `type: task` |
|
|
138
|
-
| anything else | skip |
|
|
139
|
-
|
|
140
|
-
Issue Type fallback mapping:
|
|
141
|
-
|
|
142
|
-
| task.md type | GitHub Issue Type |
|
|
143
|
-
|---|---|
|
|
144
|
-
| `bug`, `bugfix` | `Bug` |
|
|
145
|
-
| `feature`, `enhancement` | `Feature` |
|
|
146
|
-
| `task`, `documentation`, `dependency-upgrade`, `chore`, `docs`, `refactor`, `refactoring`, and all other values | `Task` |
|
|
147
|
-
|
|
148
|
-
If the fallback path maps a label, check whether it exists first:
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
gh label list --search "{type-label}" --limit 20 --json name --jq '.[].name'
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Only keep the label when an exact matching label exists; otherwise skip it to avoid Issue creation failure.
|
|
155
|
-
|
|
156
|
-
### 4. Create Issue
|
|
157
|
-
|
|
158
|
-
Execute:
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
gh issue create --title "{title}" --body "{body}" --label "{label-1}" --label "{label-2}" --milestone "{milestone}"
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
If the previous step kept no valid labels, omit all `--label` arguments.
|
|
165
|
-
If task.md has no `milestone` field or it is empty, default to `General Backlog` as the milestone (newly created Issues are unassigned and should go into the general backlog). If `General Backlog` does not exist either, omit the `--milestone` argument.
|
|
166
|
-
|
|
167
|
-
Do not rely on `gh issue create --template`; this skill should parse `.github/ISSUE_TEMPLATE/*.yml` directly and produce the final `--body`.
|
|
168
|
-
|
|
169
|
-
Record the returned Issue URL and extract the Issue number from the trailing path segment:
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
issue_url="$(gh issue create ...)"
|
|
173
|
-
issue_number="${issue_url##*/}"
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
If `{issue-type}` has been determined, set the Issue Type after creation on a best-effort basis:
|
|
177
|
-
|
|
178
|
-
Get repository information first because the later `in:` label step can reuse it:
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
repo="$(gh repo view --json nameWithOwner --jq '.nameWithOwner')"
|
|
182
|
-
owner="${repo%%/*}"
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
Query the organization's available Issue Types:
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
gh api "orgs/$owner/issue-types" --jq '.[].name'
|
|
189
|
-
```
|
|
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
|
-
|
|
223
|
-
Tolerance requirements:
|
|
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
|
|
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
|
|
227
|
-
- if the milestone name is invalid or unavailable, warn and skip it instead of aborting the whole Issue creation flow
|
|
43
|
+
If an Issue Type was selected, set it with:
|
|
44
|
+
`gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{issue-type}" --silent`
|
|
228
45
|
|
|
229
46
|
### 5. Update Task Status
|
|
230
47
|
|
|
@@ -234,69 +51,33 @@ Get the current time:
|
|
|
234
51
|
date "+%Y-%m-%d %H:%M:%S"
|
|
235
52
|
```
|
|
236
53
|
|
|
237
|
-
|
|
238
|
-
- Add or update `issue_number`: `{issue-number}`
|
|
239
|
-
- `updated_at`: {current time}
|
|
240
|
-
- **Append** to `## Activity Log` (do NOT overwrite previous entries):
|
|
241
|
-
```
|
|
242
|
-
- {yyyy-MM-dd HH:mm:ss} — **Create Issue** by {agent} — Issue #{issue-number} created
|
|
243
|
-
```
|
|
54
|
+
Write back `issue_number`, update `updated_at`, and append the Create Issue Activity Log entry.
|
|
244
55
|
|
|
245
56
|
### 6. Inform User
|
|
246
57
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
Output format:
|
|
250
|
-
```
|
|
251
|
-
Issue created for task {task-id}.
|
|
252
|
-
|
|
253
|
-
Issue details:
|
|
254
|
-
- Number: #{issue-number}
|
|
255
|
-
- URL: {issue-url}
|
|
256
|
-
- Labels: {applied-labels or skipped}
|
|
257
|
-
- in: Labels: {applied-in-labels or skipped}
|
|
258
|
-
- Issue Type: {issue-type | failed to set | skipped}
|
|
259
|
-
- Milestone: {milestone or skipped}
|
|
260
|
-
|
|
261
|
-
Output:
|
|
262
|
-
- `issue_number` written back to task.md
|
|
263
|
-
|
|
264
|
-
Next step - sync task progress to the Issue:
|
|
265
|
-
- Claude Code / OpenCode: /sync-issue {task-id}
|
|
266
|
-
- Gemini CLI: /{{project}}:sync-issue {task-id}
|
|
267
|
-
- Codex CLI: $sync-issue {task-id}
|
|
268
|
-
```
|
|
58
|
+
Show the Issue number, URL, labels, Issue Type, milestone result, confirm that `issue_number` was written back, and include the next `sync-issue` command in every TUI format.
|
|
269
59
|
|
|
270
60
|
## Completion Checklist
|
|
271
61
|
|
|
272
62
|
- [ ] Created the GitHub Issue
|
|
273
|
-
- [ ]
|
|
274
|
-
- [ ] Used template structure when available, otherwise used the fallback format
|
|
275
|
-
- [ ] Built the Issue title and body from `task.md` only
|
|
276
|
-
- [ ] Handled `type:` / Issue Type and `milestone` when available
|
|
277
|
-
- [ ] Processed `in:` labels using LLM relevance judgment
|
|
63
|
+
- [ ] Used `task.md` as the only content source
|
|
278
64
|
- [ ] Recorded `issue_number` in task.md
|
|
279
|
-
- [ ] Updated `updated_at`
|
|
280
|
-
- [ ]
|
|
281
|
-
- [ ] Informed the user of the next step (must include all TUI command formats)
|
|
282
|
-
- [ ] **Did not read analysis/design/implementation artifacts to build the Issue**
|
|
65
|
+
- [ ] Updated `updated_at` and appended the Activity Log entry
|
|
66
|
+
- [ ] Included all TUI formats for the next `sync-issue` step
|
|
283
67
|
|
|
284
68
|
## STOP
|
|
285
69
|
|
|
286
|
-
|
|
70
|
+
Stop after the checklist. Do not start detailed progress sync here.
|
|
287
71
|
|
|
288
72
|
## Notes
|
|
289
73
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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
|
|
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
|
|
74
|
+
- `create-issue` creates the base Issue; `sync-issue` publishes detailed progress later
|
|
75
|
+
- If no valid labels survive filtering, create the Issue without labels instead of failing
|
|
76
|
+
- If Issue Type or milestone setup fails, continue and record the fallback outcome
|
|
296
77
|
|
|
297
78
|
## Error Handling
|
|
298
79
|
|
|
299
|
-
- Task not found:
|
|
300
|
-
-
|
|
301
|
-
- Empty description
|
|
302
|
-
-
|
|
80
|
+
- Task not found: `Task {task-id} not found`
|
|
81
|
+
- GitHub CLI unavailable or unauthenticated
|
|
82
|
+
- Empty description in task.md
|
|
83
|
+
- Issue creation failure
|
|
@@ -1,230 +1,47 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: create-issue
|
|
3
|
-
description:
|
|
4
|
-
从任务文件创建 GitHub Issue。
|
|
5
|
-
当用户要求为任务创建 Issue 时触发。参数:task-id。
|
|
3
|
+
description: "从任务文件创建 GitHub Issue"
|
|
6
4
|
---
|
|
7
5
|
|
|
8
6
|
# 创建 Issue
|
|
9
7
|
|
|
8
|
+
仅从 `task.md` 创建基础 GitHub Issue,并把 `issue_number` 回写到任务文件。
|
|
9
|
+
|
|
10
10
|
## 行为边界 / 关键规则
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
- 执行本技能后,你**必须**立即更新 task.md 中的任务状态
|
|
12
|
+
- Issue 标题和正文只能来自 `task.md`
|
|
13
|
+
- 不要读取 `analysis.md`、`plan.md`、`implementation.md` 或审查产物
|
|
14
|
+
- 持久产物只有 GitHub Issue 本身,以及 task.md 中的 `issue_number` 更新
|
|
15
|
+
- 执行本技能后,你**必须**立即更新 task.md
|
|
17
16
|
|
|
18
17
|
## 执行步骤
|
|
19
18
|
|
|
20
19
|
### 1. 验证前置条件
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
- `.agents/workspace/active/{task-id}/task.md`
|
|
24
|
-
|
|
25
|
-
检查 GitHub CLI 可用且已认证:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
gh auth status
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
注意:`{task-id}` 格式为 `TASK-{yyyyMMdd-HHmmss}`,例如 `TASK-20260306-143022`
|
|
21
|
+
检查:
|
|
22
|
+
- `.agents/workspace/active/{task-id}/task.md`
|
|
23
|
+
- 使用 `gh auth status` 验证 GitHub CLI 认证状态
|
|
32
24
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
如果 `task.md` front matter 中已经存在 `issue_number` 字段,且其值不为空也不为 `N/A`,先询问用户是复用现有 Issue 还是重新创建。
|
|
25
|
+
如果 `issue_number` 已存在且既不为空也不为 `N/A`,创建前必须先与用户确认。
|
|
36
26
|
|
|
37
27
|
### 2. 提取任务信息
|
|
38
28
|
|
|
39
|
-
|
|
40
|
-
- 任务标题
|
|
41
|
-
- `## 描述` 内容
|
|
42
|
-
- `## 需求` 列表
|
|
43
|
-
- `type` 字段
|
|
44
|
-
- `milestone` 字段(如存在)
|
|
45
|
-
|
|
46
|
-
如果描述为空,提示用户先完善任务描述。
|
|
29
|
+
从 task.md 提取标题、`## Description`、`## Requirements`、`type` 和 `milestone`。
|
|
47
30
|
|
|
48
31
|
### 3. 构建 Issue 内容
|
|
49
32
|
|
|
50
|
-
|
|
51
|
-
- **标题**:使用任务标题
|
|
52
|
-
- **正文内容值**:仅来自 task.md
|
|
53
|
-
- **模板作用**:Issue 模板只提供结构、字段标签和默认 labels
|
|
54
|
-
- **Issue Type**:优先使用模板中的 `type:`;无模板时根据 task.md `type` 做 fallback 映射
|
|
55
|
-
- **无可用模板时**:退回简单格式(fallback / 兜底)
|
|
56
|
-
|
|
57
|
-
#### 3a. 检测 Issue 模板
|
|
58
|
-
|
|
59
|
-
检查项目中的模板文件,忽略 `config.yml`:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
rg --files .github/ISSUE_TEMPLATE -g '*.yml' -g '!config.yml'
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
如果存在模板文件,读取每个模板的顶层 `name:` 字段,构建候选列表。结合任务标题和描述,从候选列表中选择最匹配的模板。
|
|
66
|
-
|
|
67
|
-
示例候选列表:
|
|
68
|
-
- `bug_report.yml` — Bug 类模板
|
|
69
|
-
- `question.yml` — 问题咨询类模板
|
|
70
|
-
- `feature_request.yml` — 功能请求类模板
|
|
71
|
-
- `documentation.yml` — 文档问题类模板
|
|
72
|
-
- `other.yml` — 通用兜底模板
|
|
73
|
-
|
|
74
|
-
如果没有明确匹配的模板,选择最接近的一个。
|
|
75
|
-
|
|
76
|
-
以上文件名仅为示例,应以目标项目实际存在的模板为准。
|
|
33
|
+
检测 `.github/ISSUE_TEMPLATE`,决定使用模板路径还是 fallback 路径。
|
|
77
34
|
|
|
78
|
-
|
|
35
|
+
> 模板识别、`textarea`、`input`、`dropdown`、`checkboxes` 字段映射,以及 fallback 正文规则见 `reference/template-matching.md`。构建正文前先读取 `reference/template-matching.md`。
|
|
79
36
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
读取匹配模板中的顶层字段:
|
|
83
|
-
- `name`
|
|
84
|
-
- `type:`
|
|
85
|
-
- `labels:`
|
|
86
|
-
- `body:`
|
|
87
|
-
|
|
88
|
-
模板路径的处理规则:
|
|
89
|
-
- 如果模板定义了 `type:`,记录为 `{issue-type}`
|
|
90
|
-
- `labels:` 中的每个值都视为候选 label
|
|
91
|
-
- 遍历 `body:` 列表
|
|
92
|
-
- 对 `type: textarea` 和 `type: input` 字段:
|
|
93
|
-
- 使用 `attributes.label` 作为 markdown 段落标题
|
|
94
|
-
- 将 task.md 信息映射到该段内容
|
|
95
|
-
- 对 `type: markdown`:跳过,不要把模板说明文本直接复制到正文
|
|
96
|
-
- 对 `type: dropdown` 和 `type: checkboxes`:跳过
|
|
97
|
-
- 如果 task.md 中没有合适内容,写入 `N/A`
|
|
98
|
-
|
|
99
|
-
字段映射建议:
|
|
100
|
-
- 包含 `summary`、`title` 的字段 -> 使用任务标题
|
|
101
|
-
- 包含 `description`、`problem`、`what happened`、`issue-description`、`current-content` 的字段 -> 使用任务描述
|
|
102
|
-
- 包含 `solution`、`requirements`、`steps`、`suggested-content`、`impact`、`context`、`alternatives`、`expected` 的字段 -> 使用需求列表(可渲染为 checklist 或 bullet list)
|
|
103
|
-
- 其他 `textarea` / `input` 字段 -> 优先使用任务描述,否则使用 `N/A`
|
|
104
|
-
|
|
105
|
-
对模板路径中的每个候选 label,都先检查是否存在:
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
gh label list --search "{label}" --limit 20 --json name --jq '.[].name'
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
只有精确匹配的 label 才保留用于创建 Issue。
|
|
112
|
-
|
|
113
|
-
#### 3c. 默认正文格式(fallback / 兜底)
|
|
114
|
-
|
|
115
|
-
推荐正文结构:
|
|
116
|
-
|
|
117
|
-
```markdown
|
|
118
|
-
## Description
|
|
119
|
-
|
|
120
|
-
{task-description}
|
|
121
|
-
|
|
122
|
-
## Requirements
|
|
123
|
-
|
|
124
|
-
- [ ] {requirement-1}
|
|
125
|
-
- [ ] {requirement-2}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
标签映射:
|
|
129
|
-
|
|
130
|
-
| task.md type | GitHub label |
|
|
131
|
-
|---|---|
|
|
132
|
-
| `bug`、`bugfix` | `type: bug` |
|
|
133
|
-
| `feature` | `type: feature` |
|
|
134
|
-
| `enhancement` | `type: enhancement` |
|
|
135
|
-
| `docs`、`documentation` | `type: documentation` |
|
|
136
|
-
| `dependency-upgrade` | `type: dependency-upgrade` |
|
|
137
|
-
| `task`、`chore`、`refactor`、`refactoring` | `type: task` |
|
|
138
|
-
| 其他 | 跳过 |
|
|
139
|
-
|
|
140
|
-
Issue Type fallback 映射:
|
|
141
|
-
|
|
142
|
-
| task.md type | GitHub Issue Type |
|
|
143
|
-
|---|---|
|
|
144
|
-
| `bug`、`bugfix` | `Bug` |
|
|
145
|
-
| `feature`、`enhancement` | `Feature` |
|
|
146
|
-
| `task`、`documentation`、`dependency-upgrade`、`chore`、`docs`、`refactor`、`refactoring` 及其他值 | `Task` |
|
|
147
|
-
|
|
148
|
-
如果 fallback 路径映射到了 label,先检查该 label 是否存在:
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
gh label list --search "{type-label}" --limit 20 --json name --jq '.[].name'
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
只有存在精确匹配的 label 时,才在创建 Issue 时保留它;否则跳过 label,避免创建失败。
|
|
37
|
+
> `labels:` 过滤、Issue Type fallback、`issue-types` API、`milestone` 逻辑、`--milestone` 和 `in:` label 规则见 `reference/label-and-type.md`。创建 Issue 前先读取 `reference/label-and-type.md`。
|
|
155
38
|
|
|
156
39
|
### 4. 创建 Issue
|
|
157
40
|
|
|
158
|
-
|
|
41
|
+
使用 `gh issue create --title "{title}" --body "{body}" ...` 创建 Issue;如果没有有效 label,就省略 `--label`。
|
|
159
42
|
|
|
160
|
-
|
|
161
|
-
gh
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
如果前一步没有保留下任何有效 label,则省略所有 `--label` 参数。
|
|
165
|
-
如果 task.md 中没有 `milestone` 字段或值为空,默认使用 `General Backlog` 作为里程碑(新建 Issue 处于未分配状态,应归入通用积压)。如果 `General Backlog` 也不存在,则省略 `--milestone` 参数。
|
|
166
|
-
|
|
167
|
-
不要依赖 `gh issue create --template`;本技能应直接解析 `.github/ISSUE_TEMPLATE/*.yml` 并生成最终 `--body`。
|
|
168
|
-
|
|
169
|
-
记录命令输出的 Issue URL,并从末尾路径提取 Issue 编号:
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
issue_url="$(gh issue create ...)"
|
|
173
|
-
issue_number="${issue_url##*/}"
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
如果已经确定了 `{issue-type}`,在创建后以 best-effort 方式设置 Issue Type:
|
|
177
|
-
|
|
178
|
-
先获取仓库信息,后续 `in:` label 步骤也会复用:
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
repo="$(gh repo view --json nameWithOwner --jq '.nameWithOwner')"
|
|
182
|
-
owner="${repo%%/*}"
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
查询组织可用的 Issue Types:
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
gh api "orgs/$owner/issue-types" --jq '.[].name'
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
如果查询成功且 `{issue-type}` 在返回列表中,执行设置:
|
|
192
|
-
|
|
193
|
-
```bash
|
|
194
|
-
gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{issue-type}" --silent
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
验证设置结果:
|
|
198
|
-
|
|
199
|
-
```bash
|
|
200
|
-
gh api "repos/$repo/issues/{issue-number}" --jq '.type.name // empty'
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
如果验证返回的名称与 `{issue-type}` 一致,记录 `Issue Type: {issue-type}`;否则记录 `Issue Type: failed to set`。
|
|
204
|
-
|
|
205
|
-
#### 添加 `in:` labels
|
|
206
|
-
|
|
207
|
-
获取仓库中所有 `in:` 前缀的 labels:
|
|
208
|
-
|
|
209
|
-
```bash
|
|
210
|
-
gh label list --search "in:" --limit 50 --json name --jq '.[].name'
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
如果没有 `in:` labels,跳过此步骤。
|
|
214
|
-
|
|
215
|
-
如果存在 `in:` labels,结合任务上下文(标题、描述、受影响文件列表)判断每个 `in:` label 是否与当前任务相关。对判断为相关的 label,执行:
|
|
216
|
-
|
|
217
|
-
```bash
|
|
218
|
-
gh issue edit {issue-number} --add-label "in: {module}"
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
记录所有成功添加的 `in:` labels。如果没有判断为相关的 label,记录 `in: labels: skipped (no relevant labels)`。
|
|
222
|
-
|
|
223
|
-
容错要求:
|
|
224
|
-
- 如果 `orgs/$owner/issue-types` 返回 `404`、仓库 owner 不是组织,或仓库未启用 Issue Types,则跳过,不要让创建失败
|
|
225
|
-
- 如果目标 `{issue-type}` 不在可用列表中,则跳过
|
|
226
|
-
- `in:` label 添加失败时,跳过并记录,不阻止 Issue 创建流程
|
|
227
|
-
- Milestone 不存在或名称无效时,也应提示并跳过,而不是中断整个 Issue 创建流程
|
|
43
|
+
如果已经确定了 Issue Type,则执行:
|
|
44
|
+
`gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{issue-type}" --silent`
|
|
228
45
|
|
|
229
46
|
### 5. 更新任务状态
|
|
230
47
|
|
|
@@ -234,69 +51,33 @@ gh issue edit {issue-number} --add-label "in: {module}"
|
|
|
234
51
|
date "+%Y-%m-%d %H:%M:%S"
|
|
235
52
|
```
|
|
236
53
|
|
|
237
|
-
|
|
238
|
-
- 添加或更新 `issue_number`:`{issue-number}`
|
|
239
|
-
- `updated_at`:{当前时间}
|
|
240
|
-
- **追加**到 `## Activity Log`(不要覆盖之前的记录):
|
|
241
|
-
```
|
|
242
|
-
- {yyyy-MM-dd HH:mm:ss} — **Create Issue** by {agent} — Issue #{issue-number} created
|
|
243
|
-
```
|
|
54
|
+
回写 `issue_number`,更新 `updated_at`,并追加 Create Issue 的 Activity Log。
|
|
244
55
|
|
|
245
56
|
### 6. 告知用户
|
|
246
57
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
输出格式:
|
|
250
|
-
```
|
|
251
|
-
任务 {task-id} 的 Issue 已创建。
|
|
252
|
-
|
|
253
|
-
Issue 信息:
|
|
254
|
-
- 编号:#{issue-number}
|
|
255
|
-
- URL:{issue-url}
|
|
256
|
-
- Labels:{applied-labels 或 skipped}
|
|
257
|
-
- in: Labels:{applied-in-labels 或 skipped}
|
|
258
|
-
- Issue Type:{issue-type | failed to set | skipped}
|
|
259
|
-
- Milestone:{milestone 或 skipped}
|
|
260
|
-
|
|
261
|
-
产出:
|
|
262
|
-
- task.md 已回写 `issue_number`
|
|
263
|
-
|
|
264
|
-
下一步 - 同步任务进度到 Issue:
|
|
265
|
-
- Claude Code / OpenCode:/sync-issue {task-id}
|
|
266
|
-
- Gemini CLI:/{{project}}:sync-issue {task-id}
|
|
267
|
-
- Codex CLI:$sync-issue {task-id}
|
|
268
|
-
```
|
|
58
|
+
展示 Issue 编号、URL、labels、Issue Type、milestone 结果,确认 `issue_number` 已回写,并完整输出所有 TUI 里的下一步 `sync-issue` 命令。
|
|
269
59
|
|
|
270
60
|
## 完成检查清单
|
|
271
61
|
|
|
272
|
-
- [ ]
|
|
273
|
-
- [ ]
|
|
274
|
-
- [ ]
|
|
275
|
-
- [ ]
|
|
276
|
-
- [ ]
|
|
277
|
-
- [ ] 处理了 `in:` labels(LLM 判断关联性)
|
|
278
|
-
- [ ] 在 task.md 中记录了 `issue_number`
|
|
279
|
-
- [ ] 更新了 task.md 中的 `updated_at`
|
|
280
|
-
- [ ] 追加了 Activity Log 条目到 task.md
|
|
281
|
-
- [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
|
|
282
|
-
- [ ] **没有读取分析/方案/实现产物来构建 Issue**
|
|
62
|
+
- [ ] 已创建 GitHub Issue
|
|
63
|
+
- [ ] 已仅使用 `task.md` 作为内容来源
|
|
64
|
+
- [ ] 已在 task.md 中记录 `issue_number`
|
|
65
|
+
- [ ] 已更新 `updated_at` 并追加 Activity Log
|
|
66
|
+
- [ ] 已输出所有 TUI 格式的 `sync-issue` 下一步命令
|
|
283
67
|
|
|
284
68
|
## 停止
|
|
285
69
|
|
|
286
|
-
|
|
70
|
+
完成检查清单后立即停止。不要在本技能里继续做详细进度同步。
|
|
287
71
|
|
|
288
72
|
## 注意事项
|
|
289
73
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
4. **模板容错**:模板缺失、匹配失败或 YAML 异常时,退回 fallback / 兜底正文,不要让整个创建失败
|
|
294
|
-
5. **Issue Type / Milestone 容错**:Issue Type 未启用、类型不存在或 milestone 不可用时,跳过该项并继续创建
|
|
295
|
-
6. **in: Label 容错**:`in:` label 添加失败时跳过,不阻止 Issue 创建
|
|
74
|
+
- `create-issue` 只负责创建基础 Issue;详细进度由 `sync-issue` 发布
|
|
75
|
+
- 如果过滤后没有有效 label,允许不带 label 创建 Issue
|
|
76
|
+
- 如果 Issue Type 或 milestone 设置失败,继续执行并记录结果
|
|
296
77
|
|
|
297
78
|
## 错误处理
|
|
298
79
|
|
|
299
|
-
-
|
|
300
|
-
-
|
|
301
|
-
-
|
|
302
|
-
-
|
|
80
|
+
- 任务未找到:`Task {task-id} not found`
|
|
81
|
+
- GitHub CLI 不可用或未认证
|
|
82
|
+
- task.md 的描述为空
|
|
83
|
+
- 创建 Issue 失败
|