@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,24 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sync-issue
|
|
3
|
-
description:
|
|
4
|
-
Sync task progress to comments on the related GitHub Issue.
|
|
5
|
-
Triggered when the user asks to sync progress to an Issue.
|
|
6
|
-
Argument: task-id or issue-number.
|
|
3
|
+
description: "Sync task progress to a GitHub Issue"
|
|
7
4
|
---
|
|
8
5
|
|
|
9
6
|
# Sync Progress to Issue
|
|
10
7
|
|
|
11
|
-
Sync task
|
|
8
|
+
Sync the task state, summary comment, and published artifacts to the related GitHub Issue.
|
|
12
9
|
|
|
13
10
|
## Execution Flow
|
|
14
11
|
|
|
15
12
|
### 1. Parse the Argument
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
- plain number (`123`) or `#` + number (`#123`) -> treat as an issue number
|
|
19
|
-
- Starts with `TASK-` -> treat as a task-id (current format)
|
|
20
|
-
|
|
21
|
-
If the argument is an issue number, use Bash to search for the related task (note: `.agents/workspace` is a hidden directory, so Grep/Glob tools may skip it; you must use Bash):
|
|
14
|
+
Accept either `task-id` or issue number input. For issue-number input, resolve the task with:
|
|
22
15
|
|
|
23
16
|
```bash
|
|
24
17
|
grep -rl "^issue_number: {issue-number}$" \
|
|
@@ -28,479 +21,51 @@ grep -rl "^issue_number: {issue-number}$" \
|
|
|
28
21
|
2>/dev/null | head -1
|
|
29
22
|
```
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
- If nothing is returned, output `No task found associated with Issue #{issue-number}`
|
|
33
|
-
|
|
34
|
-
If the argument is a task-id, continue with the normal Step 2 flow.
|
|
24
|
+
If no task matches, output `No task found associated with Issue #{issue-number}`.
|
|
35
25
|
|
|
36
26
|
### 2. Verify the Task Exists
|
|
37
27
|
|
|
38
|
-
|
|
39
|
-
- `.agents/workspace/active/{task-id}/task.md`
|
|
40
|
-
- `.agents/workspace/blocked/{task-id}/task.md`
|
|
41
|
-
- `.agents/workspace/completed/{task-id}/task.md`
|
|
42
|
-
|
|
43
|
-
Note: `{task-id}` format is `TASK-{yyyyMMdd-HHmmss}`, for example `TASK-20260306-143022`
|
|
44
|
-
|
|
45
|
-
If Step 1 already found a matching task through the issue number, use that task directory directly for the remaining steps without scanning again.
|
|
28
|
+
Search active, blocked, and completed task directories and lock onto the matching task folder before continuing.
|
|
46
29
|
|
|
47
30
|
### 3. Read Task Information
|
|
48
31
|
|
|
49
|
-
Extract from task.md
|
|
50
|
-
- `issue_number` (required; if missing, prompt the user)
|
|
51
|
-
- `type`
|
|
52
|
-
- task title, description, and status
|
|
53
|
-
- `current_step`, `created_at`, `updated_at`, and `last_synced_at` (if present)
|
|
32
|
+
Extract `issue_number`, `type`, task title, status, `current_step`, and timestamp fields from task.md.
|
|
54
33
|
|
|
55
34
|
### 4. Read Context Files
|
|
56
35
|
|
|
57
|
-
|
|
58
|
-
- highest-round `analysis.md` / `analysis-r{N}.md` - requirements analysis
|
|
59
|
-
- highest-round `plan.md` / `plan-r{N}.md` - technical plan
|
|
60
|
-
- `implementation.md`, `implementation-r*.md` - implementation reports
|
|
61
|
-
- `refinement.md`, `refinement-r*.md` - refinement reports
|
|
62
|
-
- `review.md`, `review-r*.md` - review reports
|
|
63
|
-
|
|
64
|
-
### 5. Detect Delivery Status
|
|
65
|
-
|
|
66
|
-
Run the following checks in order. If any step fails, fall back to "Mode C: In development". Do not invent anything you cannot verify.
|
|
67
|
-
|
|
68
|
-
Before starting detection, first resolve repository coordinates and the absolute URL prefix:
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
repo="$(gh repo view --json nameWithOwner --jq '.nameWithOwner')"
|
|
72
|
-
owner="${repo%%/*}"
|
|
73
|
-
repo_url="https://github.com/$repo"
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
**a) Extract the commit hash**
|
|
77
|
-
|
|
78
|
-
Match the last `**Commit** by` record in `## Activity Log` in task.md. The Activity Log format is:
|
|
79
|
-
|
|
80
|
-
```text
|
|
81
|
-
**Commit** by {agent} — {hash} {subject}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Extract the first word as the commit hash. If none is found, mark it as "no commit".
|
|
85
|
-
|
|
86
|
-
**b) Detect whether the commit is on a protected branch**
|
|
87
|
-
|
|
88
|
-
If a commit hash exists, run:
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
git branch -a --contains {commit-hash} 2>/dev/null
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
Decision rules:
|
|
95
|
-
- output contains `main` or `master` -> merged into the main branch; record the branch name
|
|
96
|
-
- output matches a `{major}.{minor}.x` branch name -> merged into a release branch; record the branch name
|
|
97
|
-
- neither matches -> not merged into a protected branch
|
|
98
|
-
|
|
99
|
-
**c) Detect the linked PR**
|
|
100
|
-
|
|
101
|
-
Check the `pr_number` field in task.md. If it exists, run:
|
|
102
|
-
|
|
103
|
-
```bash
|
|
104
|
-
gh pr view {pr-number} --json state,mergedAt
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
Use the result to determine whether the PR is `OPEN`, `MERGED`, or another state.
|
|
108
|
-
|
|
109
|
-
**d) Determine the delivery mode**
|
|
110
|
-
|
|
111
|
-
Choose the summary mode with this priority:
|
|
112
|
-
|
|
113
|
-
| Condition | Mode |
|
|
114
|
-
|---|---|
|
|
115
|
-
| commit is already on a protected branch | Mode A: Completed |
|
|
116
|
-
| PR exists and its state is `OPEN` or `MERGED` | Mode B: PR stage |
|
|
117
|
-
| anything else | Mode C: In development |
|
|
118
|
-
|
|
119
|
-
The priority must be `Mode A > Mode B > Mode C`. Even if a PR exists, treat it as "Completed" when the commit is already on a protected branch.
|
|
120
|
-
|
|
121
|
-
All later commit and PR links must use absolute URLs:
|
|
122
|
-
- `https://github.com/{owner}/{repo}/commit/{commit-hash}`
|
|
123
|
-
- `https://github.com/{owner}/{repo}/pull/{pr-number}`
|
|
124
|
-
|
|
125
|
-
Do not use relative paths such as `../../commit/...` or `../../pull/...`.
|
|
126
|
-
|
|
127
|
-
### 6. Sync Labels and Issue Type
|
|
128
|
-
|
|
129
|
-
Sync Issue labels based on the detection result from Step 5.
|
|
130
|
-
|
|
131
|
-
**a) Check whether the label system has been initialized**
|
|
132
|
-
|
|
133
|
-
Run:
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
gh label list --search "type:" --limit 1 --json name --jq 'length'
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
Decision rules:
|
|
140
|
-
- returns `0` -> the standard label system is missing; run the `init-labels` skill first (idempotent), then retry this step
|
|
141
|
-
- returns non-zero -> continue with label sync
|
|
142
|
-
|
|
143
|
-
**b) Sync the `status:` label**
|
|
144
|
-
|
|
145
|
-
First read existing `status:` labels on the Issue:
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
gh issue view {issue-number} --json labels --jq '.labels[].name | select(startswith("status:"))'
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
Remove each existing `status:` label:
|
|
36
|
+
Read the highest-round `analysis.md` / `analysis-r{N}.md`, `plan.md` / `plan-r{N}.md`, and the current implementation, refinement, and review artifacts that still exist.
|
|
152
37
|
|
|
153
|
-
|
|
154
|
-
gh issue edit {issue-number} --remove-label "{status-label}"
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
Then decide whether to add a new `status:` label using this priority:
|
|
158
|
-
|
|
159
|
-
| Condition | Action |
|
|
160
|
-
|---|---|
|
|
161
|
-
| task is under the `blocked/` directory | add `status: blocked` |
|
|
162
|
-
| Mode A: Completed | do not add a new status label |
|
|
163
|
-
| Mode B: PR is MERGED | do not add a new status label |
|
|
164
|
-
| Mode B: PR is OPEN | add `status: in-progress` |
|
|
165
|
-
| Mode C + `current_step` ∈ {`requirement-analysis`, `technical-design`} | add `status: pending-design-work` |
|
|
166
|
-
| Mode C + `current_step` ∈ {`implementation`, `code-review`, `refinement`} | add `status: in-progress` |
|
|
167
|
-
|
|
168
|
-
If a new label needs to be added, run:
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
gh issue edit {issue-number} --add-label "{status-label}"
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
**c) Sync the `in:` label**
|
|
175
|
-
|
|
176
|
-
Extract affected file paths from implementation reports first, or from `analysis.md` as a fallback:
|
|
177
|
-
- prefer file paths listed under `## Modified Files`, especially `### New Files` / `### Modified Files`, in `implementation.md` and `implementation-r{N}.md`
|
|
178
|
-
- if no implementation report exists, fall back to the affected file list in the analysis report
|
|
179
|
-
|
|
180
|
-
For each file path:
|
|
181
|
-
1. take the first-level directory as the module name
|
|
182
|
-
2. deduplicate
|
|
183
|
-
3. check whether the corresponding label exists in the repository:
|
|
184
|
-
|
|
185
|
-
```bash
|
|
186
|
-
gh label list --search "in: {module}" --limit 10 --json name --jq '.[].name'
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
4. only when the exact `in: {module}` label exists, run:
|
|
190
|
-
|
|
191
|
-
```bash
|
|
192
|
-
gh issue edit {issue-number} --add-label "in: {module}"
|
|
193
|
-
```
|
|
38
|
+
### 5. Sync Labels and Issue Type
|
|
194
39
|
|
|
195
|
-
|
|
40
|
+
> Label initialization, `status:` replacement rules, `in:` label discovery, and the `issue-types` mapping logic live in `reference/label-sync.md`. Read `reference/label-sync.md` before editing Issue metadata.
|
|
196
41
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
Map the `type` field in task.md to the native GitHub Issue Type:
|
|
200
|
-
|
|
201
|
-
| task.md type | GitHub Issue Type |
|
|
202
|
-
|---|---|
|
|
203
|
-
| `bug`, `bugfix` | `Bug` |
|
|
204
|
-
| `feature`, `enhancement` | `Feature` |
|
|
205
|
-
| `task`, `documentation`, `dependency-upgrade`, `chore`, `docs`, `refactor`, `refactoring`, and any other value | `Task` |
|
|
206
|
-
|
|
207
|
-
First query the Issue Types available in the organization:
|
|
208
|
-
|
|
209
|
-
```bash
|
|
210
|
-
gh api "orgs/$owner/issue-types" --jq '.[].name'
|
|
211
|
-
```
|
|
42
|
+
### 6. Sync Development Linking
|
|
212
43
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
```bash
|
|
216
|
-
gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{name}"
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
Fault-tolerance requirements:
|
|
220
|
-
- If the API returns `404`, the repo owner is not an organization, or Issue Types are not enabled for the repo, record `Issue Type: skipped (not enabled)` and continue; do not fail the whole sync
|
|
221
|
-
- If the target type does not exist, record `Issue Type: skipped (type not available)`
|
|
222
|
-
- Do not try to create new Issue Types; only use names that already exist in the organization
|
|
223
|
-
|
|
224
|
-
### 7. Sync Development
|
|
225
|
-
|
|
226
|
-
If task.md contains `pr_number`, ensure the PR body links the current Issue.
|
|
227
|
-
|
|
228
|
-
1. Read the PR body:
|
|
229
|
-
|
|
230
|
-
```bash
|
|
231
|
-
gh pr view {pr-number} --json body --jq '.body // ""'
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
2. Check whether the body already contains any of:
|
|
44
|
+
If `pr_number` exists, make sure the PR body contains one of:
|
|
235
45
|
- `Closes #{issue-number}`
|
|
236
46
|
- `Fixes #{issue-number}`
|
|
237
47
|
- `Resolves #{issue-number}`
|
|
238
48
|
|
|
239
|
-
|
|
240
|
-
4. Otherwise append this to the end of the body:
|
|
49
|
+
### 7. Sync the Milestone
|
|
241
50
|
|
|
242
|
-
|
|
243
|
-
gh pr edit {pr-number} --body "$(cat <<'EOF'
|
|
244
|
-
{existing-body}
|
|
51
|
+
> Milestone inheritance, line-branch inference, and `General Backlog` fallback rules live in `reference/milestone-sync.md`. Read `reference/milestone-sync.md` before editing the Issue milestone.
|
|
245
52
|
|
|
246
|
-
|
|
247
|
-
EOF
|
|
248
|
-
)"
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
5. If task.md does not contain `pr_number`, record `Development: N/A`
|
|
252
|
-
|
|
253
|
-
### 8. Sync the Milestone
|
|
53
|
+
### 8. Sync Requirement Checkboxes
|
|
254
54
|
|
|
255
|
-
|
|
55
|
+
Extract checked `- [x]` items from the `## Requirements` section of task.md; if none exist, skip this step.
|
|
56
|
+
Read the current Issue body with `gh issue view {issue-number} --json body --jq '.body'`.
|
|
57
|
+
Match by checkbox text and replace only `- [ ] {text}` with `- [x] {text}` in the Issue body; keep existing `- [x]` items, unmatched items, and non-requirement checkboxes unchanged.
|
|
58
|
+
Only when the body actually changes, update the full body with `gh api` PATCH and build the request payload with `cat <<'EOF'` heredoc.
|
|
256
59
|
|
|
257
|
-
|
|
60
|
+
### 9. Publish Context Artifacts
|
|
258
61
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
```bash
|
|
262
|
-
gh issue view {issue-number} --json milestone --jq '.milestone.title // empty'
|
|
263
|
-
```
|
|
62
|
+
> Existing-comment discovery, hidden markers, the artifact timeline, and summary comment ordering live in `reference/comment-publish.md`. Read `reference/comment-publish.md` before publishing Issue comments.
|
|
264
63
|
|
|
265
|
-
|
|
64
|
+
> **Shell Safety Rules** (read before publishing comments):
|
|
65
|
+
> 1. `{comment-body}` must be replaced with **actual inline text**. Read the file with the Read tool first, then paste the full content into the heredoc body. **Do NOT** use `$(cat ...)`, `$(< ...)`, `$(...)`, or `${...}` inside `<<'EOF'`. Quoted heredocs suppress all command substitution and variable expansion, so those expressions will be output as literal text.
|
|
66
|
+
> 2. When constructing strings that contain `<!-- -->`, **do NOT use `echo`**. In bash/zsh, `echo` escapes `!` as `\!`, which makes hidden markers visible. Build all comment content and the Step 8 Issue body update with `cat <<'EOF'` heredocs or `printf '%s\n'`.
|
|
266
67
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
If the frontmatter in task.md contains a non-empty `milestone` field, use it as the target milestone.
|
|
270
|
-
This field should contain a line milestone title or `General Backlog`; do not automatically set a specific version milestone here.
|
|
271
|
-
|
|
272
|
-
**c) Infer the target line milestone**
|
|
273
|
-
|
|
274
|
-
When task.md does not explicitly set `milestone`, infer it in this order:
|
|
275
|
-
|
|
276
|
-
1. Detect the current branch:
|
|
277
|
-
|
|
278
|
-
```bash
|
|
279
|
-
git branch --show-current
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
- If the branch name matches `{major}.{minor}.x`, the target milestone is the same line milestone `{major}.{minor}.x`
|
|
283
|
-
|
|
284
|
-
2. If the current branch is `main` or `master`, detect existing release branches:
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
git branch -a | grep -oE '[0-9]+\.[0-9]+\.x' | sort -V | tail -1
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
- If the highest release branch is `X.Y.x`, the target milestone is `(X+1).0.x`
|
|
291
|
-
- If no release branch exists, read the latest tag:
|
|
292
|
-
|
|
293
|
-
```bash
|
|
294
|
-
git tag --list 'v*' --sort=-v:refname | head -1
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
- When the latest tag exists and can be parsed as `X.Y.Z`, the target milestone is `X.Y.x`
|
|
298
|
-
|
|
299
|
-
3. If none of the above yields a result, fall back to `General Backlog`
|
|
300
|
-
|
|
301
|
-
**d) Find the target milestone number**
|
|
302
|
-
|
|
303
|
-
Run:
|
|
304
|
-
|
|
305
|
-
```bash
|
|
306
|
-
gh api "repos/$repo/milestones" --paginate \
|
|
307
|
-
--jq '.[] | select(.title=="{target}") | .number'
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
- If the target milestone does not exist, fall back to `General Backlog`
|
|
311
|
-
- If `General Backlog` also does not exist, record `Milestone: skipped (not found)` and skip assignment
|
|
312
|
-
|
|
313
|
-
**e) Assign the Issue to the milestone**
|
|
314
|
-
|
|
315
|
-
Once a target milestone number is found, run:
|
|
316
|
-
|
|
317
|
-
```bash
|
|
318
|
-
gh api "repos/$repo/issues/{issue-number}" -X PATCH -F milestone={milestone-number}
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
Record:
|
|
322
|
-
- `Milestone: {target} (assigned)` or
|
|
323
|
-
- `Milestone: General Backlog (fallback)`
|
|
324
|
-
|
|
325
|
-
### 9. Fetch Existing Comments and Build the Published Artifact Set
|
|
326
|
-
|
|
327
|
-
Fetch all Issue comments in one pass, then build the set of published artifact stems from hidden markers and construct the local timeline of artifacts to publish.
|
|
328
|
-
|
|
329
|
-
First fetch comments (preserving comment id and body):
|
|
330
|
-
|
|
331
|
-
```bash
|
|
332
|
-
comments_jsonl="$(mktemp)"
|
|
333
|
-
|
|
334
|
-
gh api "repos/$repo/issues/{issue-number}/comments" \
|
|
335
|
-
--paginate \
|
|
336
|
-
--jq '.[] | {id, body}' > "$comments_jsonl"
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
Extract all Activity Log records in `task.md` that end with `→ {filename}`.
|
|
340
|
-
|
|
341
|
-
Parsing rules:
|
|
342
|
-
- Use the regex `/→\s+(\S+\.md)\s*$/` to extract filenames
|
|
343
|
-
- remove the `.md` suffix to get `{file-stem}`
|
|
344
|
-
- build the artifact timeline in Activity Log order
|
|
345
|
-
- append `summary` as a fixed final artifact at the end of the timeline
|
|
346
|
-
- `summary` is always last
|
|
347
|
-
|
|
348
|
-
Only include files that still exist in the task directory in the publish set. Skip missing files without error.
|
|
349
|
-
|
|
350
|
-
The first line of every sync comment must include a hidden marker:
|
|
351
|
-
|
|
352
|
-
```html
|
|
353
|
-
<!-- sync-issue:{task-id}:{file-stem} -->
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
Where `{file-stem}` is the filename without the `.md` suffix, for example `analysis`, `plan`, `implementation`, `implementation-r2`, or `review-r3`. `summary` still uses the literal `summary`.
|
|
357
|
-
|
|
358
|
-
Timeline example:
|
|
359
|
-
`analysis → plan → implementation → review → refinement → analysis-r2 → plan-r2 → implementation-r2 → review-r2 → summary`
|
|
360
|
-
|
|
361
|
-
For each `{file-stem}`, determine whether it has already been published with a local check:
|
|
362
|
-
|
|
363
|
-
```bash
|
|
364
|
-
grep -qF "<!-- sync-issue:{task-id}:{file-stem} -->" "$comments_jsonl"
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
- match found: this artifact has already been published and should be skipped by default
|
|
368
|
-
- no match: this artifact has not been published yet and can create a new comment
|
|
369
|
-
|
|
370
|
-
For the `summary` artifact, also extract the comment id for later updates:
|
|
371
|
-
|
|
372
|
-
```bash
|
|
373
|
-
summary_comment_id="$(
|
|
374
|
-
jq -r 'select(.body | contains("<!-- sync-issue:{task-id}:summary -->")) | .id' \
|
|
375
|
-
"$comments_jsonl" | head -1
|
|
376
|
-
)"
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
Before finishing Step 9, precompute `has_unpublished_artifacts` from the published/unpublished results above: whether any non-`summary` artifact remains unpublished. Keep this value fixed during Step 10. It is only used to decide whether `summary` should be updated in place or deleted and rebuilt at the end.
|
|
380
|
-
|
|
381
|
-
Idempotency requirements:
|
|
382
|
-
- On the first run, publish comments only for artifacts that currently exist
|
|
383
|
-
- On the second run, skip already published files and only publish new artifacts (for example `implementation-r2`, `review-r2`)
|
|
384
|
-
- If all artifact file comments have already been published and the `summary` content has not changed, publish no new comments
|
|
385
|
-
- If `summary` is already published but the delivery state has changed: delete the old `summary` and recreate it at the end when new artifacts are published this run; otherwise update the existing comment in place when no new artifacts are published
|
|
386
|
-
|
|
387
|
-
### 10. Publish Context Files One by One in Timeline Order
|
|
388
|
-
|
|
389
|
-
Process the sorted artifact list from Step 9 one item at a time. Do not fall back to a fixed 5-step order, and do not merge multiple rounds of the same artifact type into a single comment.
|
|
390
|
-
|
|
391
|
-
**a) Prepare comment content for each artifact**
|
|
392
|
-
|
|
393
|
-
- `analysis`: publish the full text of `analysis.md`
|
|
394
|
-
- `plan`: publish the full text of `plan.md`
|
|
395
|
-
- `analysis-r{N}`, `plan-r{N}`: publish one comment per file, using the artifact's original content as the comment body
|
|
396
|
-
- `implementation`, `implementation-r{N}`: publish one comment per file, using the corresponding implementation report as-is
|
|
397
|
-
- `refinement`, `refinement-r{N}`: publish one comment per file, using the corresponding refinement report as-is
|
|
398
|
-
- `review`, `review-r{N}`: publish one comment per file, using the corresponding review report as-is
|
|
399
|
-
- `summary`: generate a concise delivery summary that includes only the current delivery state and absolute GitHub links
|
|
400
|
-
|
|
401
|
-
All artifacts except `summary` must publish the original content directly. Do not compress them into another summary.
|
|
402
|
-
|
|
403
|
-
Use the same format for every comment:
|
|
404
|
-
|
|
405
|
-
```markdown
|
|
406
|
-
<!-- sync-issue:{task-id}:{file-stem} -->
|
|
407
|
-
## {artifact title}
|
|
408
|
-
|
|
409
|
-
{original content or summary content}
|
|
410
|
-
|
|
411
|
-
---
|
|
412
|
-
*Generated by AI · Internal tracking: {task-id}*
|
|
413
|
-
```
|
|
414
|
-
|
|
415
|
-
Recommended title mapping:
|
|
416
|
-
- `analysis` -> `Requirements Analysis`
|
|
417
|
-
- `analysis-r2` -> `Requirements Analysis (Round 2)`
|
|
418
|
-
- `analysis-r{N}` -> `Requirements Analysis (Round {N})`
|
|
419
|
-
- `plan` -> `Technical Plan`
|
|
420
|
-
- `plan-r2` -> `Technical Plan (Round 2)`
|
|
421
|
-
- `plan-r{N}` -> `Technical Plan (Round {N})`
|
|
422
|
-
- `implementation` -> `Implementation Report (Round 1)`
|
|
423
|
-
- `implementation-r2` -> `Implementation Report (Round 2)`
|
|
424
|
-
- `implementation-r{N}` -> `Implementation Report (Round {N})`
|
|
425
|
-
- `refinement` -> `Refinement Report (Round 1)`
|
|
426
|
-
- `refinement-r2` -> `Refinement Report (Round 2)`
|
|
427
|
-
- `refinement-r{N}` -> `Refinement Report (Round {N})`
|
|
428
|
-
- `review` -> `Review Report (Round 1)`
|
|
429
|
-
- `review-r2` -> `Review Report (Round 2)`
|
|
430
|
-
- `review-r{N}` -> `Review Report (Round {N})`
|
|
431
|
-
- `summary` -> `Delivery Summary`
|
|
432
|
-
|
|
433
|
-
Recommended `summary` comment format:
|
|
434
|
-
|
|
435
|
-
```markdown
|
|
436
|
-
<!-- sync-issue:{task-id}:summary -->
|
|
437
|
-
## Delivery Summary
|
|
438
|
-
|
|
439
|
-
**Updated at**: {current time}
|
|
440
|
-
**Status**: {formatted status description}
|
|
441
|
-
|
|
442
|
-
| Type | Content |
|
|
443
|
-
|---|---|
|
|
444
|
-
| Branch | `{branch or N/A}` |
|
|
445
|
-
| Commit | [`{commit-short}`](https://github.com/{owner}/{repo}/commit/{commit-hash}) or `N/A` |
|
|
446
|
-
|
|
447
|
-
---
|
|
448
|
-
*Generated by AI · Internal tracking: {task-id}*
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
Formatted status description rules:
|
|
452
|
-
- Mode A: `✅ Completed`
|
|
453
|
-
- Mode B: `PR stage`
|
|
454
|
-
- Mode C: `In development, current step is {current_step}`
|
|
455
|
-
|
|
456
|
-
**b) Skip already-published or missing artifacts**
|
|
457
|
-
|
|
458
|
-
- For `analysis.md`, `plan.md`, `implementation*.md`, and `review*.md`: skip directly if the corresponding file does not exist, without error
|
|
459
|
-
- For any artifact: skip by default if its marker already exists
|
|
460
|
-
- For `summary`: regenerate candidate content even if its marker already exists, so you can compare whether an update is needed
|
|
461
|
-
|
|
462
|
-
**c) Publish a new comment**
|
|
463
|
-
|
|
464
|
-
When an artifact has not been published yet, run:
|
|
465
|
-
|
|
466
|
-
```bash
|
|
467
|
-
gh issue comment {issue-number} --body "$(cat <<'EOF'
|
|
468
|
-
{comment-body}
|
|
469
|
-
EOF
|
|
470
|
-
)"
|
|
471
|
-
```
|
|
472
|
-
|
|
473
|
-
**d) Publish or rebuild the `summary` comment**
|
|
474
|
-
|
|
475
|
-
`summary` must always remain the last comment. Choose the handling strategy with these rules:
|
|
476
|
-
|
|
477
|
-
- `summary` does not exist: publish a new `summary` comment using Step 10c
|
|
478
|
-
- `summary` exists and `has_unpublished_artifacts=true`: delete the old `summary` comment first, then publish a new `summary` comment using Step 10c
|
|
479
|
-
- `summary` exists, `has_unpublished_artifacts=false`, and the newly generated content differs from the existing one: update the existing comment in place
|
|
480
|
-
- `summary` exists, `has_unpublished_artifacts=false`, and the content is the same: do nothing
|
|
481
|
-
|
|
482
|
-
To delete the old `summary` comment, run:
|
|
483
|
-
|
|
484
|
-
```bash
|
|
485
|
-
gh api "repos/$repo/issues/comments/{summary_comment_id}" -X DELETE
|
|
486
|
-
```
|
|
487
|
-
|
|
488
|
-
To update an existing `summary` comment in place, run:
|
|
489
|
-
|
|
490
|
-
```bash
|
|
491
|
-
gh api "repos/$repo/issues/comments/{summary_comment_id}" -X PATCH -f body="$(cat <<'EOF'
|
|
492
|
-
{comment-body}
|
|
493
|
-
EOF
|
|
494
|
-
)"
|
|
495
|
-
```
|
|
496
|
-
|
|
497
|
-
**e) No-op scenario**
|
|
498
|
-
|
|
499
|
-
If all artifacts are already synced and `summary` does not need an update:
|
|
500
|
-
- publish no new comments
|
|
501
|
-
- explicitly tell the user at the end: `All artifacts are already synced, no new content`
|
|
502
|
-
|
|
503
|
-
### 11. Update Task Status
|
|
68
|
+
### 10. Update Task Status
|
|
504
69
|
|
|
505
70
|
Get the current time:
|
|
506
71
|
|
|
@@ -508,42 +73,21 @@ Get the current time:
|
|
|
508
73
|
date "+%Y-%m-%d %H:%M:%S"
|
|
509
74
|
```
|
|
510
75
|
|
|
511
|
-
|
|
512
|
-
- **Append** to `## Activity Log` (do NOT overwrite previous entries):
|
|
513
|
-
```
|
|
514
|
-
- {yyyy-MM-dd HH:mm:ss} — **Sync to Issue** by {agent} — Progress synced to Issue #{issue-number}
|
|
515
|
-
```
|
|
76
|
+
Update `last_synced_at` in task.md and append the Sync to Issue Activity Log entry.
|
|
516
77
|
|
|
517
|
-
###
|
|
78
|
+
### 11. Inform User
|
|
518
79
|
|
|
519
|
-
|
|
520
|
-
Progress synced to Issue #{issue-number}.
|
|
521
|
-
|
|
522
|
-
Sync result:
|
|
523
|
-
- New comments published: {count}
|
|
524
|
-
- Comments updated: {count}
|
|
525
|
-
- Steps skipped: {step list or `none`}
|
|
526
|
-
- Current status: {status}
|
|
527
|
-
- Labels: status={status-label or cleared}, in:={added count}
|
|
528
|
-
- Issue Type: {Bug / Feature / Task / skipped}
|
|
529
|
-
- Milestone: {preserved / assigned / fallback / skipped}
|
|
530
|
-
- Development: {Closes link appended / link already existed / no PR, skipped}
|
|
531
|
-
|
|
532
|
-
View: https://github.com/{owner}/{repo}/issues/{issue-number}
|
|
533
|
-
|
|
534
|
-
If no comments were published or updated in this run, clearly state: all steps are already synced, no new content.
|
|
535
|
-
```
|
|
80
|
+
Summarize synced labels, milestone, development linkage, published comments, and include the Issue URL.
|
|
536
81
|
|
|
537
82
|
## Notes
|
|
538
83
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
4. **Avoid noise**: do not sync too frequently. Although this skill uses hidden markers for idempotency, avoid meaningless repeated syncs.
|
|
84
|
+
- The hidden comment marker format must stay `<!-- sync-issue:{task-id}:{file-stem} -->`
|
|
85
|
+
- Build the artifact timeline from Activity Log order, not a fixed `analysis -> plan -> implementation -> review -> summary` sequence
|
|
86
|
+
- Follow the Step 9 shell safety rules when publishing comments or updating the Issue body: do not rely on command substitution inside quoted heredocs, and do not use `echo` for HTML comment markers
|
|
543
87
|
|
|
544
88
|
## Error Handling
|
|
545
89
|
|
|
546
|
-
- Task not found:
|
|
547
|
-
- Missing
|
|
548
|
-
-
|
|
549
|
-
-
|
|
90
|
+
- Task not found: `Task {task-id} not found`
|
|
91
|
+
- Missing `issue_number`: `Task has no issue_number field`
|
|
92
|
+
- GitHub CLI auth failed: `Please check GitHub CLI authentication`
|
|
93
|
+
- Issue not found: `Issue #{number} not found`
|