@fitlab-ai/agent-infra 0.3.2 → 0.4.1
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 +18 -35
- package/README.zh-CN.md +18 -35
- package/lib/defaults.json +5 -12
- package/lib/init.js +9 -25
- package/lib/paths.js +3 -42
- package/lib/update.js +43 -32
- package/package.json +2 -1
- package/templates/.agents/QUICKSTART.md +17 -7
- package/templates/.agents/QUICKSTART.zh-CN.md +17 -7
- package/templates/.agents/README.md +21 -14
- package/templates/.agents/README.zh-CN.md +21 -14
- package/templates/.agents/skills/analyze-task/SKILL.md +7 -10
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +7 -9
- package/templates/.agents/skills/block-task/SKILL.md +9 -13
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +9 -12
- package/templates/.agents/skills/check-task/SKILL.md +4 -8
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +4 -6
- 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 +8 -13
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +8 -11
- 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 +33 -224
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +32 -222
- 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 +5 -8
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +5 -7
- package/templates/.agents/skills/implement-task/SKILL.md +48 -178
- package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +44 -172
- 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 +2 -5
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +2 -4
- package/templates/.agents/skills/import-dependabot/SKILL.md +4 -7
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +4 -6
- package/templates/.agents/skills/import-issue/SKILL.md +6 -8
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +6 -8
- 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 +7 -11
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +7 -9
- package/templates/.agents/skills/refine-task/SKILL.md +38 -162
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +36 -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 +58 -19
- package/templates/.agents/skills/release/SKILL.zh-CN.md +58 -18
- 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 +32 -490
- package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +33 -490
- package/templates/.agents/skills/sync-issue/reference/comment-publish.md +88 -0
- package/templates/.agents/skills/sync-issue/reference/comment-publish.zh-CN.md +88 -0
- package/templates/.agents/skills/sync-issue/reference/delivery-detection.md +42 -0
- package/templates/.agents/skills/sync-issue/reference/delivery-detection.zh-CN.md +42 -0
- package/templates/.agents/skills/sync-issue/reference/label-sync.md +63 -0
- package/templates/.agents/skills/sync-issue/reference/label-sync.zh-CN.md +63 -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 +25 -287
- package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +29 -291
- 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 +7 -11
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +7 -9
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +59 -118
- package/templates/.agents/skills/upgrade-dependency/SKILL.md +1 -4
- package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +1 -3
- package/templates/.agents/templates/handoff.md +1 -1
- package/templates/.agents/templates/handoff.zh-CN.md +1 -1
- package/templates/.agents/workflows/bug-fix.yaml +71 -71
- package/templates/.agents/workflows/bug-fix.zh-CN.yaml +1 -1
- package/templates/.agents/workflows/feature-development.yaml +71 -71
- package/templates/.agents/workflows/feature-development.zh-CN.yaml +1 -1
- package/templates/.agents/workflows/refactoring.yaml +76 -76
- package/templates/.agents/workflows/refactoring.zh-CN.yaml +1 -1
- package/templates/{.agent-workspace → .agents/workspace}/README.md +1 -1
- package/templates/{.agent-workspace → .agents/workspace}/README.zh-CN.md +1 -1
- package/templates/.claude/CLAUDE.md +14 -52
- package/templates/.claude/CLAUDE.zh-CN.md +14 -52
- 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 +1 -1
- package/templates/.claude/commands/create-pr.zh-CN.md +1 -1
- 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 +1 -1
- package/templates/.claude/commands/sync-pr.zh-CN.md +1 -1
- 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/.claude/hooks/check-version-format.sh +44 -0
- package/templates/.claude/settings.json +14 -0
- 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 +1 -1
- package/templates/.gemini/commands/_project_/sync-pr.zh-CN.toml +1 -1
- 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/COMMAND_STYLE_GUIDE.md +6 -6
- package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +6 -6
- 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 +1 -1
- package/templates/.opencode/commands/sync-pr.zh-CN.md +1 -1
- 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/AGENTS.md +11 -3
- package/templates/AGENTS.zh-CN.md +11 -3
- package/templates/.editorconfig +0 -15
- package/templates/.github/ISSUE_TEMPLATE/01_bug_report.yml +0 -149
- package/templates/.github/ISSUE_TEMPLATE/02_question.yml +0 -101
- package/templates/.github/ISSUE_TEMPLATE/03_feature_request.yml +0 -131
- package/templates/.github/ISSUE_TEMPLATE/04_documentation.yml +0 -165
- package/templates/.github/ISSUE_TEMPLATE/05_other.yml +0 -147
- package/templates/.github/ISSUE_TEMPLATE/config.yml +0 -11
- package/templates/.github/PULL_REQUEST_TEMPLATE.md +0 -123
- package/templates/.github/dependabot.yml +0 -17
- package/templates/.github/hooks/check-utf8-encoding.sh +0 -25
- package/templates/.github/release.yml +0 -27
- package/templates/.github/workflows/pr-title-check.yml +0 -42
- package/templates/.mailmap +0 -4
- package/templates/CONTRIBUTING.md +0 -126
- package/templates/CONTRIBUTING.zh-CN.md +0 -124
- package/templates/SECURITY.md +0 -131
- package/templates/SECURITY.zh-CN.md +0 -131
|
@@ -1,296 +1,49 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sync-pr
|
|
3
|
-
description:
|
|
4
|
-
Sync task progress to the related Pull Request, including PR metadata sync and a single idempotent review summary.
|
|
5
|
-
Triggered when the user asks to sync progress to PR. Argument: task-id.
|
|
3
|
+
description: "Sync task progress to a Pull Request"
|
|
6
4
|
---
|
|
7
5
|
|
|
8
6
|
# Sync Progress to PR
|
|
9
7
|
|
|
10
|
-
Sync
|
|
8
|
+
Sync PR metadata and keep one reviewer-facing summary comment up to date.
|
|
11
9
|
|
|
12
10
|
## Execution Flow
|
|
13
11
|
|
|
14
12
|
### 1. Verify the Task Exists
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
- `.agent-workspace/active/{task-id}/task.md`
|
|
18
|
-
- `.agent-workspace/completed/{task-id}/task.md`
|
|
19
|
-
- `.agent-workspace/blocked/{task-id}/task.md`
|
|
20
|
-
|
|
21
|
-
Note: `{task-id}` format is `TASK-{yyyyMMdd-HHmmss}`, for example `TASK-20260306-143022`
|
|
14
|
+
Check `.agents/workspace/active/{task-id}/task.md` and stop if the task does not exist.
|
|
22
15
|
|
|
23
16
|
### 2. Read Task Information
|
|
24
17
|
|
|
25
|
-
Extract from task.md
|
|
26
|
-
- `pr_number` (required; if missing, prompt the user)
|
|
27
|
-
- `type`
|
|
28
|
-
- `issue_number` (if applicable)
|
|
29
|
-
- `current_step`
|
|
30
|
-
- task title, description, status
|
|
31
|
-
- `created_at`, `updated_at`, `last_synced_to_pr_at` (if present)
|
|
18
|
+
Extract `pr_number`, `issue_number`, task title, type, and the latest timestamps from task.md.
|
|
32
19
|
|
|
33
20
|
### 3. Read Context Files
|
|
34
21
|
|
|
35
|
-
|
|
36
|
-
- highest-round `plan.md` / `plan-r{N}.md` - technical plan
|
|
37
|
-
- `implementation.md`, `implementation-r{N}.md` - implementation reports
|
|
38
|
-
- `review.md`, `review-r{N}.md` - review reports
|
|
39
|
-
- `refinement.md`, `refinement-r{N}.md` - refinement reports
|
|
40
|
-
- highest-round `analysis.md` / `analysis-r{N}.md` - analysis input only as fallback for `in:` labels
|
|
41
|
-
|
|
42
|
-
### 4. Resolve Repository Coordinates and Check Whether the Label System Has Been Initialized
|
|
43
|
-
|
|
44
|
-
Resolve repository coordinates first so later milestone queries and comment sync steps can reuse them:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
repo="$(gh repo view --json nameWithOwner --jq '.nameWithOwner')"
|
|
48
|
-
owner="${repo%%/*}"
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Run:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
gh label list --search "type:" --limit 1 --json name --jq 'length'
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Rules:
|
|
58
|
-
- returns `0` -> standard labels are missing; run the `init-labels` skill first, then retry this step
|
|
59
|
-
- returns non-zero -> continue with PR metadata sync
|
|
60
|
-
|
|
61
|
-
### 5. Sync the Type Label
|
|
62
|
-
|
|
63
|
-
Map task.md `type` using this table:
|
|
64
|
-
|
|
65
|
-
| task.md type | GitHub label |
|
|
66
|
-
|---|---|
|
|
67
|
-
| bug, bugfix | `type: bug` |
|
|
68
|
-
| feature | `type: feature` |
|
|
69
|
-
| enhancement | `type: enhancement` |
|
|
70
|
-
| refactor, refactoring | `type: enhancement` |
|
|
71
|
-
| documentation | `type: documentation` |
|
|
72
|
-
| dependency-upgrade | `type: dependency-upgrade` |
|
|
73
|
-
| task | `type: task` |
|
|
74
|
-
| anything else | skip |
|
|
75
|
-
|
|
76
|
-
If the value maps to a label, run:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
gh pr edit {pr-number} --add-label "{type-label}"
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Do not create new type labels.
|
|
83
|
-
|
|
84
|
-
### 6. Sync `in:` Labels
|
|
85
|
-
|
|
86
|
-
Extract affected modules from implementation reports first, or analysis as fallback:
|
|
87
|
-
- prefer file paths listed under `## Modified Files`, especially `### New Files` / `### Modified Files`, in `implementation.md` and `implementation-r{N}.md`
|
|
88
|
-
- if implementation reports do not exist yet, fall back to affected files from analysis
|
|
89
|
-
|
|
90
|
-
For each file path:
|
|
91
|
-
1. take the first-level directory as `{module}`
|
|
92
|
-
2. deduplicate
|
|
93
|
-
3. verify that the label exists:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
gh label list --search "in: {module}" --limit 10 --json name --jq '.[].name'
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
4. only when the exact `in: {module}` label exists, run:
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
gh pr edit {pr-number} --add-label "in: {module}"
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
5. only add labels; do not remove existing `in:` labels
|
|
106
|
-
|
|
107
|
-
### 7. Sync the Milestone
|
|
108
|
-
|
|
109
|
-
Assign a line milestone to the PR using the same inference strategy as `sync-issue`.
|
|
110
|
-
|
|
111
|
-
**a) Check whether the PR already has a milestone**
|
|
112
|
-
|
|
113
|
-
Run:
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
gh pr view {pr-number} --json milestone --jq '.milestone.title // empty'
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
If the result is non-empty, preserve it and record `Milestone: {existing} (preserved)`.
|
|
120
|
-
|
|
121
|
-
**b) Check whether task.md explicitly sets `milestone`**
|
|
122
|
-
|
|
123
|
-
If frontmatter contains a non-empty `milestone`, use it as the target milestone.
|
|
124
|
-
|
|
125
|
-
**c) Infer the target line milestone**
|
|
126
|
-
|
|
127
|
-
When task.md does not explicitly set `milestone`, infer in this order:
|
|
128
|
-
|
|
129
|
-
1. Detect the current branch:
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
git branch --show-current
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
- if the branch name matches `{major}.{minor}.x`, use `{major}.{minor}.x`
|
|
136
|
-
|
|
137
|
-
2. If the current branch is `main` or `master`, detect existing release branches:
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
git branch -a | grep -oE '[0-9]+\.[0-9]+\.x' | sort -V | tail -1
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
- if the highest release branch is `X.Y.x`, target `(X+1).0.x`
|
|
144
|
-
- otherwise inspect the latest tag:
|
|
145
|
-
|
|
146
|
-
```bash
|
|
147
|
-
git tag --list 'v*' --sort=-v:refname | head -1
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
- when the latest tag parses as `X.Y.Z`, target `X.Y.x`
|
|
151
|
-
|
|
152
|
-
3. If none of the above yields a result, fall back to `General Backlog`
|
|
153
|
-
|
|
154
|
-
**d) Find and set the milestone**
|
|
155
|
-
|
|
156
|
-
Run:
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
gh api "repos/$repo/milestones" --paginate \
|
|
160
|
-
--jq '.[] | select(.title=="{target}") | .title' | head -1
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
- if the target does not exist, fall back to `General Backlog`
|
|
164
|
-
- if `General Backlog` also does not exist, record `Milestone: skipped (not found)`
|
|
165
|
-
- once a milestone title is found, run:
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
gh pr edit {pr-number} --milestone "{milestone-title}"
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### 8. Sync Development Linking
|
|
172
|
-
|
|
173
|
-
If task.md contains `issue_number`, ensure the PR body links the Issue.
|
|
174
|
-
|
|
175
|
-
1. Read the PR body:
|
|
22
|
+
Read the latest plan, implementation, review, and refinement artifacts that will inform PR metadata and the reviewer summary.
|
|
176
23
|
|
|
177
|
-
|
|
178
|
-
gh pr view {pr-number} --json body --jq '.body // ""'
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
2. Check whether the body already contains any of:
|
|
182
|
-
- `Closes #{issue-number}`
|
|
183
|
-
- `Fixes #{issue-number}`
|
|
184
|
-
- `Resolves #{issue-number}`
|
|
185
|
-
|
|
186
|
-
3. If any keyword already exists, skip the update
|
|
187
|
-
4. Otherwise append this to the end of the body:
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
gh pr edit {pr-number} --body "$(cat <<'EOF'
|
|
191
|
-
{existing-body}
|
|
192
|
-
|
|
193
|
-
Closes #{issue-number}
|
|
194
|
-
EOF
|
|
195
|
-
)"
|
|
196
|
-
```
|
|
24
|
+
### 4. Resolve Repository Coordinates and Label Readiness
|
|
197
25
|
|
|
198
|
-
|
|
26
|
+
Resolve `repo="$(gh repo view --json nameWithOwner --jq '.nameWithOwner')"` and verify whether `type:` labels have been initialized.
|
|
199
27
|
|
|
200
|
-
###
|
|
28
|
+
### 5. Sync Metadata
|
|
201
29
|
|
|
202
|
-
|
|
30
|
+
Sync the mapped type label, relevant `in:` labels, and milestone onto the PR.
|
|
203
31
|
|
|
204
|
-
|
|
205
|
-
pr_comments_jsonl="$(mktemp)"
|
|
32
|
+
> PR-state safeguards, milestone inference, and metadata skip rules for closed or merged PRs live in `reference/delivery-detection.md`. Read `reference/delivery-detection.md` before editing PR metadata.
|
|
206
33
|
|
|
207
|
-
|
|
208
|
-
--paginate \
|
|
209
|
-
--jq '.[] | {id, body}' > "$pr_comments_jsonl"
|
|
210
|
-
```
|
|
34
|
+
### 6. Sync Development Linking
|
|
211
35
|
|
|
212
|
-
|
|
36
|
+
If `issue_number` exists, ensure the PR body contains `Closes #{issue-number}` or an equivalent closing keyword.
|
|
213
37
|
|
|
214
|
-
|
|
215
|
-
<!-- sync-pr:{task-id}:summary -->
|
|
216
|
-
```
|
|
38
|
+
### 7. Publish the Reviewer Summary
|
|
217
39
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
```bash
|
|
221
|
-
summary_comment_id="$(
|
|
222
|
-
jq -r 'select(.body | contains("<!-- sync-pr:{task-id}:summary -->")) | .id' \
|
|
223
|
-
"$pr_comments_jsonl" | head -1
|
|
224
|
-
)"
|
|
225
|
-
```
|
|
40
|
+
> Hidden markers, idempotent summary comment updates, review-history formatting, and comment create/update rules live in `reference/comment-publish.md`. Read `reference/comment-publish.md` before publishing the summary.
|
|
226
41
|
|
|
227
|
-
|
|
228
|
-
-
|
|
229
|
-
|
|
230
|
-
- each key technical decision must be self-contained; do not reference internal document labels or jargon such as `Option A/B`
|
|
231
|
-
- build a review-history table from `review.md`, `review-r{N}.md`, `refinement.md`, and `refinement-r{N}.md`
|
|
232
|
-
- extract test results from `implementation.md` or `refinement.md`
|
|
42
|
+
> **Shell Safety Rules** (read before publishing comments):
|
|
43
|
+
> 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.
|
|
44
|
+
> 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 with `cat <<'EOF'` heredocs or `printf '%s\n'`.
|
|
233
45
|
|
|
234
|
-
|
|
235
|
-
- `Round`
|
|
236
|
-
- `Verdict`
|
|
237
|
-
- `Issue Counts`, for example `B:1 M:2 m:0`
|
|
238
|
-
- `Fix Status`
|
|
239
|
-
|
|
240
|
-
If no review artifacts exist yet, use a placeholder row such as `Round 1 | Pending | N/A | N/A`.
|
|
241
|
-
|
|
242
|
-
Candidate comment format:
|
|
243
|
-
|
|
244
|
-
```markdown
|
|
245
|
-
<!-- sync-pr:{task-id}:summary -->
|
|
246
|
-
## Review Summary
|
|
247
|
-
|
|
248
|
-
**Task**: {task-id}
|
|
249
|
-
**Updated At**: {current-time}
|
|
250
|
-
|
|
251
|
-
### Key Technical Decisions
|
|
252
|
-
|
|
253
|
-
- {decision-1}
|
|
254
|
-
- {decision-2}
|
|
255
|
-
|
|
256
|
-
### Review History
|
|
257
|
-
|
|
258
|
-
| Round | Verdict | Issue Counts | Fix Status |
|
|
259
|
-
|-------|---------|--------------|------------|
|
|
260
|
-
| Round 1 | Pending | N/A | N/A |
|
|
261
|
-
|
|
262
|
-
### Test Results
|
|
263
|
-
|
|
264
|
-
- {test-summary}
|
|
265
|
-
|
|
266
|
-
---
|
|
267
|
-
*Generated by AI · Internal Tracking: {task-id}*
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
Idempotency rules:
|
|
271
|
-
- if `summary_comment_id` is empty -> create a new comment
|
|
272
|
-
- if `summary_comment_id` exists and content changed -> update the existing comment
|
|
273
|
-
- if `summary_comment_id` exists and content did not change -> skip
|
|
274
|
-
|
|
275
|
-
To create a new comment, run:
|
|
276
|
-
|
|
277
|
-
```bash
|
|
278
|
-
gh api "repos/$repo/issues/{pr-number}/comments" -X POST -f body="$(cat <<'EOF'
|
|
279
|
-
{comment-body}
|
|
280
|
-
EOF
|
|
281
|
-
)"
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
To update the existing comment, run:
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
gh api "repos/$repo/issues/comments/{comment-id}" -X PATCH -f body="$(cat <<'EOF'
|
|
288
|
-
{comment-body}
|
|
289
|
-
EOF
|
|
290
|
-
)"
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### 10. Update Task Status
|
|
46
|
+
### 8. Update Task Status
|
|
294
47
|
|
|
295
48
|
Get the current time:
|
|
296
49
|
|
|
@@ -298,37 +51,22 @@ Get the current time:
|
|
|
298
51
|
date "+%Y-%m-%d %H:%M:%S"
|
|
299
52
|
```
|
|
300
53
|
|
|
301
|
-
|
|
302
|
-
- **Append** to `## Activity Log` (do NOT overwrite previous entries):
|
|
303
|
-
```
|
|
304
|
-
- {yyyy-MM-dd HH:mm:ss} — **Sync to PR** by {agent} — PR metadata synced, summary {created|updated|skipped} on PR #{pr-number}
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
### 11. Inform the User
|
|
54
|
+
Update `last_synced_to_pr_at` and append the Sync to PR Activity Log entry.
|
|
308
55
|
|
|
309
|
-
|
|
310
|
-
Progress synced to PR #{pr-number}.
|
|
311
|
-
|
|
312
|
-
Synchronized:
|
|
313
|
-
- Labels: {type-label-result}, {in-label-result}
|
|
314
|
-
- Milestone: {milestone-result}
|
|
315
|
-
- Development: {development-result}
|
|
316
|
-
- Summary: {created|updated|skipped}
|
|
56
|
+
### 9. Inform the User
|
|
317
57
|
|
|
318
|
-
|
|
319
|
-
```
|
|
58
|
+
Report the synchronized labels, milestone, development status, summary result, and PR URL.
|
|
320
59
|
|
|
321
60
|
## Notes
|
|
322
61
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
62
|
+
- The hidden summary marker must stay `<!-- sync-pr:{task-id}:summary -->`
|
|
63
|
+
- Keep exactly one summary comment for reviewers
|
|
64
|
+
- If the PR is already closed or merged, report `PR #{number} is closed/merged, metadata sync skipped`
|
|
65
|
+
- Follow the Step 7 shell safety rules when publishing comments: do not rely on command substitution inside quoted heredocs, and do not use `echo` for HTML comment markers
|
|
327
66
|
|
|
328
67
|
## Error Handling
|
|
329
68
|
|
|
330
69
|
- Task not found: `Task {task-id} not found`
|
|
331
70
|
- Missing PR number: `Task has no pr_number field`
|
|
332
71
|
- PR not found: `PR #{number} not found`
|
|
333
|
-
- PR is closed or merged: `PR #{number} is closed/merged, metadata sync skipped`
|
|
334
72
|
- GitHub CLI auth failed: `Please check GitHub CLI authentication`
|