@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,139 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: commit
|
|
3
|
-
description:
|
|
4
|
-
Commit current changes to Git, including copyright header year
|
|
5
|
-
check and task status update. Triggered when the user requests
|
|
6
|
-
a code commit or save changes.
|
|
3
|
+
description: "Commit the current changes to Git"
|
|
7
4
|
---
|
|
8
5
|
|
|
9
6
|
# Commit Changes
|
|
10
7
|
|
|
11
|
-
|
|
8
|
+
Create a Git commit without overwriting user work and update the related task state when needed.
|
|
12
9
|
|
|
13
|
-
##
|
|
10
|
+
## 1. Check Local Modifications (CRITICAL)
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
Before any edit, inspect:
|
|
16
13
|
|
|
17
14
|
```bash
|
|
18
15
|
git status --short
|
|
19
16
|
git diff
|
|
20
17
|
```
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
1. **Read `git diff` output carefully** - understand what the user has already changed
|
|
24
|
-
2. **Make incremental edits** on top of user modifications - do not overwrite their implementation
|
|
25
|
-
3. **If your planned edits conflict** with user modifications, ask the user first:
|
|
26
|
-
```
|
|
27
|
-
This file has local modifications:
|
|
28
|
-
- Your changes: [describe user's changes]
|
|
29
|
-
- My planned changes: [describe planned changes]
|
|
30
|
-
Please confirm how to proceed.
|
|
31
|
-
```
|
|
32
|
-
4. **Do NOT** rewrite code the user has already implemented
|
|
33
|
-
5. **Do NOT** add "improvements" the user didn't ask for
|
|
19
|
+
Respect existing user changes. If your planned edit conflicts with them, stop and ask before proceeding.
|
|
34
20
|
|
|
35
|
-
##
|
|
21
|
+
## 2. Update Copyright Headers
|
|
36
22
|
|
|
37
|
-
|
|
23
|
+
Use the current year dynamically and only update files that are already modified.
|
|
38
24
|
|
|
39
|
-
|
|
25
|
+
> The full copyright workflow lives in `reference/copyright-check.md`. Read `reference/copyright-check.md` before editing any header.
|
|
40
26
|
|
|
41
|
-
|
|
42
|
-
date +%Y
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
**Never hardcode the year.**
|
|
46
|
-
|
|
47
|
-
### Check Modified Files
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
git status --short
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### For Each Modified File
|
|
54
|
-
|
|
55
|
-
Check if the file has a copyright header:
|
|
56
|
-
```bash
|
|
57
|
-
grep "Copyright.*[0-9]\{4\}" <modified_file>
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
If it has a copyright header and the year is not current, update the year.
|
|
61
|
-
|
|
62
|
-
**Common formats**:
|
|
63
|
-
- `Copyright (C) 2024-2025` -> `Copyright (C) 2024-{CURRENT_YEAR}`
|
|
64
|
-
- `Copyright (C) 2024` -> `Copyright (C) 2024-{CURRENT_YEAR}`
|
|
65
|
-
- `Copyright (C) 2025` -> `Copyright (C) {CURRENT_YEAR}` (if already current)
|
|
66
|
-
|
|
67
|
-
### Copyright Checklist
|
|
68
|
-
|
|
69
|
-
Before executing `git commit`:
|
|
70
|
-
- [ ] Used `date +%Y` to dynamically get the current year
|
|
71
|
-
- [ ] Checked all files about to be committed
|
|
72
|
-
- [ ] Updated copyright year in all files that have copyright headers
|
|
73
|
-
- [ ] **Never** hardcoded the year
|
|
74
|
-
- [ ] **Only** updated modified files, not the entire project
|
|
75
|
-
|
|
76
|
-
## Step 2: Analyze Changes and Generate Commit Message
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
git status
|
|
80
|
-
git diff
|
|
81
|
-
git log --oneline -5
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Generate commit message in Conventional Commits format:
|
|
85
|
-
- `<type>(<scope>): <subject>` (English imperative mood, max 50 chars)
|
|
86
|
-
- Body: 2-4 bullet points explaining what and why
|
|
87
|
-
- Signature block:
|
|
88
|
-
- `Co-Authored-By: {Your Model Name} <noreply@provider.com>`
|
|
89
|
-
- If task-related, append extra `Co-Authored-By` lines for other contributing agents
|
|
90
|
-
|
|
91
|
-
### Multi-Agent Co-Authorship (If Task-Related)
|
|
92
|
-
|
|
93
|
-
If the commit belongs to an active task and `.agent-workspace/active/{task-id}/task.md` exists:
|
|
94
|
-
|
|
95
|
-
1. Read the `## Activity Log` section from `task.md`.
|
|
96
|
-
2. Extract all unique agent names from entries matching `by {agent}`. A loose pattern such as `by (\S+)` is acceptable.
|
|
97
|
-
3. Exclude `human` because the Git author is already the human user.
|
|
98
|
-
4. Map each agent to a `Co-Authored-By` line:
|
|
99
|
-
|
|
100
|
-
| Agent | Signature |
|
|
101
|
-
|-------|-----------|
|
|
102
|
-
| `claude` | `Co-Authored-By: Claude <noreply@anthropic.com>` |
|
|
103
|
-
| `codex` | `Co-Authored-By: Codex <noreply@openai.com>` |
|
|
104
|
-
| `gemini` | `Co-Authored-By: Gemini <noreply@google.com>` |
|
|
105
|
-
| `opencode` | `Co-Authored-By: OpenCode <noreply@opencode.ai>` |
|
|
106
|
-
|
|
107
|
-
5. Build the signature block with these rules:
|
|
108
|
-
- Keep the current executing agent's signature in its original position.
|
|
109
|
-
- Append other unique participating agents as additional `Co-Authored-By` lines.
|
|
110
|
-
- Do not duplicate the current agent if it already appears in `Activity Log`.
|
|
111
|
-
- For unknown agent names, use `Co-Authored-By: {Agent} <noreply@unknown>`.
|
|
112
|
-
|
|
113
|
-
If the commit is not task-related, keep the existing single-signature behavior.
|
|
114
|
-
|
|
115
|
-
## Step 3: Create Commit
|
|
27
|
+
## 3. Build the Commit Message
|
|
116
28
|
|
|
117
|
-
|
|
118
|
-
git add <specific-files>
|
|
119
|
-
git commit -m "$(cat <<'EOF'
|
|
120
|
-
<type>(<scope>): <subject>
|
|
29
|
+
Review status, diff, and recent history, then prepare a Conventional Commit with the correct co-author lines.
|
|
121
30
|
|
|
122
|
-
-
|
|
123
|
-
- <bullet point 2>
|
|
31
|
+
> Commit message rules, examples, and multi-agent co-authorship details live in `reference/commit-message.md`. Read `reference/commit-message.md` before writing the commit.
|
|
124
32
|
|
|
125
|
-
|
|
126
|
-
<additional Co-Authored-By lines for other task participants, if any>
|
|
127
|
-
EOF
|
|
128
|
-
)"
|
|
129
|
-
```
|
|
33
|
+
## 4. Create the Commit
|
|
130
34
|
|
|
131
|
-
|
|
132
|
-
- Add specific files by name - do NOT use `git add -A` or `git add .`
|
|
133
|
-
- Do NOT commit files that may contain secrets (.env, credentials, keys)
|
|
134
|
-
- For task-related commits, keep the current agent first and append the extra lines generated above
|
|
35
|
+
Stage specific files only and run `git commit` with the prepared message.
|
|
135
36
|
|
|
136
|
-
##
|
|
37
|
+
## 5. Update Task Status When Applicable
|
|
137
38
|
|
|
138
39
|
Get the current time:
|
|
139
40
|
|
|
@@ -141,93 +42,20 @@ Get the current time:
|
|
|
141
42
|
date "+%Y-%m-%d %H:%M:%S"
|
|
142
43
|
```
|
|
143
44
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
For all cases below, **append** to `## Activity Log` in task.md (do NOT overwrite previous entries):
|
|
147
|
-
```
|
|
148
|
-
- {yyyy-MM-dd HH:mm:ss} — **Commit** by {agent} — {commit hash short} {commit subject}
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
> **⚠️ Situation Check — you must inspect task state first, then choose exactly one matching case below:**
|
|
152
|
-
>
|
|
153
|
-
> - Check `task.md` for `current_step`, workflow progress, and the latest `## Activity Log` entry
|
|
154
|
-
> - Check whether the latest `review.md` / `review-r{N}.md` exists and whether the latest review passed with no issues
|
|
155
|
-
> - Check whether any follow-up repair, review, or PR creation step is still pending
|
|
156
|
-
>
|
|
157
|
-
> | Decision basis | Required case |
|
|
158
|
-
> |---------------|---------------|
|
|
159
|
-
> | All workflow steps complete + latest review passed with no issues + all tests pass | Case 1: Final Commit |
|
|
160
|
-
> | There are still incomplete steps, unresolved fixes, or waiting actions | Case 2: More Work Needed |
|
|
161
|
-
> | The purpose of this commit is to send the implementation/refinement into code review | Case 3: Ready for Review |
|
|
162
|
-
> | Code is committed, review is done, and the next action should be PR creation | Case 4: Ready for PR |
|
|
163
|
-
>
|
|
164
|
-
> **Do not mix multiple cases. You must decide first, then output the single matching next step.**
|
|
165
|
-
|
|
166
|
-
### Case 1: Final Commit (Trigger: all work is done and the next step is task archival)
|
|
167
|
-
|
|
168
|
-
If this is the last commit and all work is done:
|
|
169
|
-
|
|
170
|
-
Prerequisites:
|
|
171
|
-
- [ ] All code committed
|
|
172
|
-
- [ ] All tests pass
|
|
173
|
-
- [ ] Code review passed
|
|
174
|
-
- [ ] All workflow steps complete
|
|
175
|
-
|
|
176
|
-
Suggest next step:
|
|
177
|
-
|
|
178
|
-
> **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
|
|
179
|
-
|
|
180
|
-
```
|
|
181
|
-
Next step - complete and archive the task:
|
|
182
|
-
- Claude Code / OpenCode: /complete-task {task-id}
|
|
183
|
-
- Gemini CLI: /{{project}}:complete-task {task-id}
|
|
184
|
-
- Codex CLI: $complete-task {task-id}
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### Case 2: More Work Needed (Trigger: incomplete steps, unresolved issues, or pending collaboration remain)
|
|
45
|
+
> The full four-case status matrix, prerequisite checks, and multi-TUI next-step commands live in `reference/task-status-update.md`. Read `reference/task-status-update.md` before updating task state.
|
|
188
46
|
|
|
189
|
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
47
|
+
Append the Commit Activity Log entry and choose exactly one next-step case:
|
|
48
|
+
- final commit -> `complete-task {task-id}`
|
|
49
|
+
- more work remains -> update task.md and stop
|
|
50
|
+
- ready for review -> `review-task {task-id}`
|
|
51
|
+
- ready for PR -> `create-pr`
|
|
192
52
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
If the commit is ready for code review:
|
|
196
|
-
- Update `task.md`: set `current_step` to `code-review`
|
|
197
|
-
- Update `task.md`: set `updated_at` to current time
|
|
198
|
-
- Mark implementation step as complete in workflow progress
|
|
199
|
-
|
|
200
|
-
Suggest next step:
|
|
201
|
-
|
|
202
|
-
> **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
|
|
203
|
-
|
|
204
|
-
```
|
|
205
|
-
Next step - code review:
|
|
206
|
-
- Claude Code / OpenCode: /review-task {task-id}
|
|
207
|
-
- Gemini CLI: /{{project}}:review-task {task-id}
|
|
208
|
-
- Codex CLI: $review-task {task-id}
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### Case 4: Ready for PR (Trigger: the next action should be `create-pr`)
|
|
212
|
-
|
|
213
|
-
If the commit should become a Pull Request:
|
|
214
|
-
- Update `task.md`: set `updated_at` to current time
|
|
215
|
-
- Record PR plan in task.md
|
|
216
|
-
|
|
217
|
-
Suggest next step:
|
|
53
|
+
## Notes
|
|
218
54
|
|
|
219
|
-
|
|
55
|
+
- Never commit secrets such as `.env`, credentials, or keys
|
|
56
|
+
- Keep the current agent first in the co-author block
|
|
57
|
+
- Do not use `git add -A` or `git add .`
|
|
220
58
|
|
|
221
|
-
|
|
222
|
-
Next step - create a Pull Request:
|
|
223
|
-
- Claude Code / OpenCode: /create-pr
|
|
224
|
-
- Gemini CLI: /{{project}}:create-pr
|
|
225
|
-
- Codex CLI: $create-pr
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
## Notes
|
|
59
|
+
## Error Handling
|
|
229
60
|
|
|
230
|
-
-
|
|
231
|
-
- Ensure commit messages clearly describe the changes
|
|
232
|
-
- Follow the project's Conventional Commits conventions
|
|
233
|
-
- If task status update fails, warn the user but do not block the commit
|
|
61
|
+
- If the task status update fails, warn the user but do not block the commit
|
|
@@ -1,138 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: commit
|
|
3
|
-
description:
|
|
4
|
-
提交当前变更到 Git,包含版权头年份检查和任务状态更新。
|
|
5
|
-
当用户要求提交代码或保存变更时触发。
|
|
3
|
+
description: "提交当前变更到 Git"
|
|
6
4
|
---
|
|
7
5
|
|
|
8
6
|
# 提交代码
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
在不覆盖用户本地工作的前提下创建 Git commit,并在需要时更新关联任务状态。
|
|
11
9
|
|
|
12
|
-
##
|
|
10
|
+
## 1. 检查本地修改(关键)
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
在任何编辑前先检查:
|
|
15
13
|
|
|
16
14
|
```bash
|
|
17
15
|
git status --short
|
|
18
16
|
git diff
|
|
19
17
|
```
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
1. **仔细阅读 `git diff` 输出** —— 理解用户已经做了哪些修改
|
|
23
|
-
2. **在用户修改基础上进行增量编辑** —— 不要覆盖其实现
|
|
24
|
-
3. **如果你计划的编辑与用户修改冲突**,先询问用户:
|
|
25
|
-
```
|
|
26
|
-
This file has local modifications:
|
|
27
|
-
- Your changes: [描述用户的修改]
|
|
28
|
-
- My planned changes: [描述计划的修改]
|
|
29
|
-
Please confirm how to proceed.
|
|
30
|
-
```
|
|
31
|
-
4. **不要**重写用户已实现的代码
|
|
32
|
-
5. **不要**添加用户没有要求的"改进"
|
|
19
|
+
必须尊重现有用户改动;如果你的计划与之冲突,先停止并征求确认。
|
|
33
20
|
|
|
34
|
-
##
|
|
21
|
+
## 2. 更新版权头年份
|
|
35
22
|
|
|
36
|
-
|
|
23
|
+
动态获取当前年份,只更新已经改动过的文件。
|
|
37
24
|
|
|
38
|
-
|
|
25
|
+
> 完整版权检查流程见 `reference/copyright-check.md`。修改任何版权头前,先读取 `reference/copyright-check.md`。
|
|
39
26
|
|
|
40
|
-
|
|
41
|
-
date +%Y
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
**绝不硬编码年份。**
|
|
45
|
-
|
|
46
|
-
### 检查修改的文件
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
git status --short
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### 对每个修改的文件
|
|
53
|
-
|
|
54
|
-
检查文件是否有版权头:
|
|
55
|
-
```bash
|
|
56
|
-
grep "Copyright.*[0-9]\{4\}" <modified_file>
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
如果有版权头且年份不是当前年份,更新年份。
|
|
60
|
-
|
|
61
|
-
**常见格式**:
|
|
62
|
-
- `Copyright (C) 2024-2025` -> `Copyright (C) 2024-{CURRENT_YEAR}`
|
|
63
|
-
- `Copyright (C) 2024` -> `Copyright (C) 2024-{CURRENT_YEAR}`
|
|
64
|
-
- `Copyright (C) 2025` -> `Copyright (C) {CURRENT_YEAR}`(如果已是当前年份)
|
|
65
|
-
|
|
66
|
-
### 版权检查清单
|
|
67
|
-
|
|
68
|
-
执行 `git commit` 之前:
|
|
69
|
-
- [ ] 使用 `date +%Y` 动态获取当前年份
|
|
70
|
-
- [ ] 检查了所有即将提交的文件
|
|
71
|
-
- [ ] 更新了所有有版权头的文件的版权年份
|
|
72
|
-
- [ ] **绝不**硬编码年份
|
|
73
|
-
- [ ] **仅**更新修改的文件,而非整个项目
|
|
74
|
-
|
|
75
|
-
## 步骤 2:分析变更并生成提交信息
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
git status
|
|
79
|
-
git diff
|
|
80
|
-
git log --oneline -5
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
生成 Conventional Commits 格式的提交信息:
|
|
84
|
-
- `<type>(<scope>): <subject>`(英文祈使语气,不超过 50 字符)
|
|
85
|
-
- Body:2-4 个要点说明修改了什么以及为什么
|
|
86
|
-
- 署名块:
|
|
87
|
-
- `Co-Authored-By: {你的模型名称} <noreply@provider.com>`
|
|
88
|
-
- 如果与任务相关,追加其他贡献 Agent 的 `Co-Authored-By` 行
|
|
89
|
-
|
|
90
|
-
### 多 Agent 协作署名(仅任务相关提交)
|
|
91
|
-
|
|
92
|
-
如果本次提交属于某个活动任务,且存在 `.agent-workspace/active/{task-id}/task.md`:
|
|
93
|
-
|
|
94
|
-
1. 读取 `task.md` 中的 `## Activity Log` 部分。
|
|
95
|
-
2. 从符合 `by {agent}` 的条目中提取所有唯一 Agent 名称;可使用较宽松的匹配模式,例如 `by (\S+)`。
|
|
96
|
-
3. 排除 `human`,因为 Git author 已经是人类用户。
|
|
97
|
-
4. 将 Agent 名称映射为 `Co-Authored-By` 行:
|
|
98
|
-
|
|
99
|
-
| Agent | 署名 |
|
|
100
|
-
|-------|------|
|
|
101
|
-
| `claude` | `Co-Authored-By: Claude <noreply@anthropic.com>` |
|
|
102
|
-
| `codex` | `Co-Authored-By: Codex <noreply@openai.com>` |
|
|
103
|
-
| `gemini` | `Co-Authored-By: Gemini <noreply@google.com>` |
|
|
104
|
-
| `opencode` | `Co-Authored-By: OpenCode <noreply@opencode.ai>` |
|
|
105
|
-
|
|
106
|
-
5. 构建署名块时遵循以下规则:
|
|
107
|
-
- 保持当前执行提交的 Agent 署名在原有位置。
|
|
108
|
-
- 将其他唯一参与 Agent 作为额外的 `Co-Authored-By` 行追加。
|
|
109
|
-
- 如果当前 Agent 已在 `Activity Log` 中出现,不要重复追加。
|
|
110
|
-
- 未知 Agent 名称使用兜底格式 `Co-Authored-By: {Agent} <noreply@unknown>`。
|
|
111
|
-
|
|
112
|
-
如果本次提交与任务无关,保持原有单行署名行为不变。
|
|
113
|
-
|
|
114
|
-
## 步骤 3:创建提交
|
|
27
|
+
## 3. 生成提交信息
|
|
115
28
|
|
|
116
|
-
|
|
117
|
-
git add <specific-files>
|
|
118
|
-
git commit -m "$(cat <<'EOF'
|
|
119
|
-
<type>(<scope>): <subject>
|
|
29
|
+
检查状态、diff 和最近历史,然后按 Conventional Commits 生成 message,并补齐正确的协作署名。
|
|
120
30
|
|
|
121
|
-
-
|
|
122
|
-
- <要点 2>
|
|
31
|
+
> 提交信息规则、示例和多代理署名细节见 `reference/commit-message.md`。写 commit message 前先读取 `reference/commit-message.md`。
|
|
123
32
|
|
|
124
|
-
|
|
125
|
-
<其他任务参与者的额外 Co-Authored-By 行(如有)>
|
|
126
|
-
EOF
|
|
127
|
-
)"
|
|
128
|
-
```
|
|
33
|
+
## 4. 创建提交
|
|
129
34
|
|
|
130
|
-
|
|
131
|
-
- 按名称添加特定文件 —— 不要使用 `git add -A` 或 `git add .`
|
|
132
|
-
- 不要提交可能包含密钥的文件(.env、凭据、密钥)
|
|
133
|
-
- 对于任务相关提交,保持当前 Agent 署名在前,并在其后追加上面生成的额外署名行
|
|
35
|
+
只暂存明确列出的文件,然后执行 `git commit`。
|
|
134
36
|
|
|
135
|
-
##
|
|
37
|
+
## 5. 按需更新任务状态
|
|
136
38
|
|
|
137
39
|
获取当前时间:
|
|
138
40
|
|
|
@@ -140,93 +42,20 @@ EOF
|
|
|
140
42
|
date "+%Y-%m-%d %H:%M:%S"
|
|
141
43
|
```
|
|
142
44
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
对于以下所有情况,**追加**到 task.md 的 `## Activity Log`(不要覆盖之前的记录):
|
|
146
|
-
```
|
|
147
|
-
- {yyyy-MM-dd HH:mm:ss} — **Commit** by {agent} — {commit hash short} {commit subject}
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
> **⚠️ 情况判断 — 你必须先核对任务状态,再从下面 4 种情况中精确匹配唯一分支:**
|
|
151
|
-
>
|
|
152
|
-
> - 检查 `task.md` 的 `current_step`、工作流进度和 `## Activity Log` 最新记录
|
|
153
|
-
> - 检查是否存在最新 `review.md` / `review-r{N}.md`,以及最新审查是否为“通过且无问题”
|
|
154
|
-
> - 检查是否仍有待处理的修复、审查或 PR 创建步骤
|
|
155
|
-
>
|
|
156
|
-
> | 判断依据 | 必须选择的情况 |
|
|
157
|
-
> |---------|---------------|
|
|
158
|
-
> | 所有工作流步骤完成 + 最新审查通过且无问题 + 所有测试通过 | 情况 1:最终提交 |
|
|
159
|
-
> | 仍有未完成步骤、待修复问题或等待他人动作 | 情况 2:还有后续工作 |
|
|
160
|
-
> | 当前提交的目的就是把实现/修复结果送入代码审查 | 情况 3:准备审查 |
|
|
161
|
-
> | 代码已提交且审查已完成,下一步应创建 PR | 情况 4:准备创建 PR |
|
|
162
|
-
>
|
|
163
|
-
> **禁止同时套用多个情况。必须先判断,再输出唯一匹配的下一步。**
|
|
164
|
-
|
|
165
|
-
### 情况 1:最终提交(触发条件:所有工作已完成,下一步是归档任务)
|
|
166
|
-
|
|
167
|
-
如果这是最后一次提交且所有工作已完成:
|
|
168
|
-
|
|
169
|
-
前置条件:
|
|
170
|
-
- [ ] 所有代码已提交
|
|
171
|
-
- [ ] 所有测试通过
|
|
172
|
-
- [ ] 代码审查通过
|
|
173
|
-
- [ ] 所有工作流步骤完成
|
|
174
|
-
|
|
175
|
-
建议下一步:
|
|
176
|
-
|
|
177
|
-
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
|
|
178
|
-
|
|
179
|
-
```
|
|
180
|
-
下一步 - 完成并归档任务:
|
|
181
|
-
- Claude Code / OpenCode:/complete-task {task-id}
|
|
182
|
-
- Gemini CLI:/{{project}}:complete-task {task-id}
|
|
183
|
-
- Codex CLI:$complete-task {task-id}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### 情况 2:还有后续工作(触发条件:仍有未完成步骤、待修复项或待协作事项)
|
|
45
|
+
> 完整的 4 种状态分支、前置条件检查和多 TUI 下一步命令见 `reference/task-status-update.md`。更新任务状态前,先读取 `reference/task-status-update.md`。
|
|
187
46
|
|
|
188
|
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
47
|
+
追加 Commit 的 Activity Log,并且只能选择一个下一步分支:
|
|
48
|
+
- 最终提交 -> `complete-task {task-id}`
|
|
49
|
+
- 还有后续工作 -> 更新 task.md 后停止
|
|
50
|
+
- 准备审查 -> `review-task {task-id}`
|
|
51
|
+
- 准备创建 PR -> `create-pr`
|
|
191
52
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
如果提交已准备好进行代码审查:
|
|
195
|
-
- 更新 `task.md`:设置 `current_step` 为 `code-review`
|
|
196
|
-
- 更新 `task.md`:设置 `updated_at` 为当前时间
|
|
197
|
-
- 在工作流进度中标记 implementation 步骤为已完成
|
|
198
|
-
|
|
199
|
-
建议下一步:
|
|
200
|
-
|
|
201
|
-
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
|
|
202
|
-
|
|
203
|
-
```
|
|
204
|
-
下一步 - 代码审查:
|
|
205
|
-
- Claude Code / OpenCode:/review-task {task-id}
|
|
206
|
-
- Gemini CLI:/{{project}}:review-task {task-id}
|
|
207
|
-
- Codex CLI:$review-task {task-id}
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### 情况 4:准备创建 PR(触发条件:下一步应执行 `create-pr`)
|
|
211
|
-
|
|
212
|
-
如果提交应该创建 Pull Request:
|
|
213
|
-
- 更新 `task.md`:设置 `updated_at` 为当前时间
|
|
214
|
-
- 在 task.md 中记录 PR 计划
|
|
215
|
-
|
|
216
|
-
建议下一步:
|
|
53
|
+
## 注意事项
|
|
217
54
|
|
|
218
|
-
|
|
55
|
+
- 不要提交 `.env`、凭据、密钥等敏感文件
|
|
56
|
+
- 协作署名中当前代理必须排在最前面
|
|
57
|
+
- 不要使用 `git add -A` 或 `git add .`
|
|
219
58
|
|
|
220
|
-
|
|
221
|
-
下一步 - 创建 Pull Request:
|
|
222
|
-
- Claude Code / OpenCode:/create-pr
|
|
223
|
-
- Gemini CLI:/{{project}}:create-pr
|
|
224
|
-
- Codex CLI:$create-pr
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
## 注意事项
|
|
59
|
+
## 错误处理
|
|
228
60
|
|
|
229
|
-
-
|
|
230
|
-
- 确保提交信息清晰描述变更内容
|
|
231
|
-
- 遵循项目的 Conventional Commits 规范
|
|
232
|
-
- 如果任务状态更新失败,警告用户但不要阻止提交
|
|
61
|
+
- 如果任务状态更新失败,警告用户,但不要因此阻止提交
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Commit Message Rules
|
|
2
|
+
|
|
3
|
+
Read this file before staging files or composing the commit message.
|
|
4
|
+
|
|
5
|
+
## Analyze Changes and Generate the Commit Message
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git status
|
|
9
|
+
git diff
|
|
10
|
+
git log --oneline -5
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Generate a Conventional Commit:
|
|
14
|
+
- `<type>(<scope>): <subject>`
|
|
15
|
+
- imperative English subject, under 50 characters
|
|
16
|
+
- 2-4 body bullets describing what changed and why
|
|
17
|
+
|
|
18
|
+
### Multi-Agent Co-Authorship
|
|
19
|
+
|
|
20
|
+
If the commit belongs to an active task:
|
|
21
|
+
1. read `## Activity Log` in task.md
|
|
22
|
+
2. collect unique agent names from `by {agent}`
|
|
23
|
+
3. exclude `human`
|
|
24
|
+
4. map agents to `Co-Authored-By` lines
|
|
25
|
+
|
|
26
|
+
| Agent | Co-Authored-By line |
|
|
27
|
+
|---|---|
|
|
28
|
+
| `claude` | `Co-Authored-By: Claude <noreply@anthropic.com>` |
|
|
29
|
+
| `codex` | `Co-Authored-By: Codex <noreply@openai.com>` |
|
|
30
|
+
| `gemini` | `Co-Authored-By: Gemini <noreply@google.com>` |
|
|
31
|
+
| `opencode` | `Co-Authored-By: OpenCode <noreply@opencode.ai>` |
|
|
32
|
+
|
|
33
|
+
Build the co-author block with these rules:
|
|
34
|
+
1. keep the current executing agent first
|
|
35
|
+
2. append other unique participating agents after it
|
|
36
|
+
3. if the current agent already appears in Activity Log, do not add a duplicate line
|
|
37
|
+
4. de-duplicate all additional `Co-Authored-By` lines
|
|
38
|
+
5. map unknown agents to `Co-Authored-By: {Agent} <noreply@unknown>`
|
|
39
|
+
|
|
40
|
+
## Create the Commit
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git add <specific-files>
|
|
44
|
+
git commit -m "$(cat <<'EOF'
|
|
45
|
+
<type>(<scope>): <subject>
|
|
46
|
+
|
|
47
|
+
- <bullet point 1>
|
|
48
|
+
- <bullet point 2>
|
|
49
|
+
|
|
50
|
+
Co-Authored-By: {Your Model Name} <noreply@provider.com>
|
|
51
|
+
<additional Co-Authored-By lines>
|
|
52
|
+
EOF
|
|
53
|
+
)"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Important:
|
|
57
|
+
- add specific files only
|
|
58
|
+
- do not use `git add -A` or `git add .`
|
|
59
|
+
- do not include secrets
|
|
60
|
+
- keep the current agent first in the co-author block
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# 提交信息规则
|
|
2
|
+
|
|
3
|
+
在暂存文件或编写 commit message 之前先读取本文件。
|
|
4
|
+
|
|
5
|
+
## 分析变更并生成提交信息
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git status
|
|
9
|
+
git diff
|
|
10
|
+
git log --oneline -5
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
生成 Conventional Commit:
|
|
14
|
+
- `<type>(<scope>): <subject>`
|
|
15
|
+
- `subject` 必须使用英文祈使句,且不超过 50 个字符
|
|
16
|
+
- 正文使用 2-4 条 bullet,说明改了什么以及为什么改
|
|
17
|
+
|
|
18
|
+
### 多 Agent 共同署名
|
|
19
|
+
|
|
20
|
+
如果该提交属于一个活动中的任务:
|
|
21
|
+
1. 读取 task.md 中的 `## Activity Log`
|
|
22
|
+
2. 从 `by {agent}` 中收集去重后的 agent 名称
|
|
23
|
+
3. 排除 `human`
|
|
24
|
+
4. 将 agent 映射为 `Co-Authored-By` 行
|
|
25
|
+
|
|
26
|
+
| Agent | Co-Authored-By 行 |
|
|
27
|
+
|---|---|
|
|
28
|
+
| `claude` | `Co-Authored-By: Claude <noreply@anthropic.com>` |
|
|
29
|
+
| `codex` | `Co-Authored-By: Codex <noreply@openai.com>` |
|
|
30
|
+
| `gemini` | `Co-Authored-By: Gemini <noreply@google.com>` |
|
|
31
|
+
| `opencode` | `Co-Authored-By: OpenCode <noreply@opencode.ai>` |
|
|
32
|
+
|
|
33
|
+
按以下规则构建 co-author 区块:
|
|
34
|
+
1. 当前执行的 agent 必须放在第一行
|
|
35
|
+
2. 其余参与过的唯一 agent 追加在后面
|
|
36
|
+
3. 如果当前 agent 已经出现在 Activity Log 中,不要重复追加同一行
|
|
37
|
+
4. 所有额外的 `Co-Authored-By` 行都要去重
|
|
38
|
+
5. 未知 agent 统一映射为 `Co-Authored-By: {Agent} <noreply@unknown>`
|
|
39
|
+
|
|
40
|
+
## 创建提交
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git add <specific-files>
|
|
44
|
+
git commit -m "$(cat <<'EOF'
|
|
45
|
+
<type>(<scope>): <subject>
|
|
46
|
+
|
|
47
|
+
- <bullet point 1>
|
|
48
|
+
- <bullet point 2>
|
|
49
|
+
|
|
50
|
+
Co-Authored-By: {Your Model Name} <noreply@provider.com>
|
|
51
|
+
<additional Co-Authored-By lines>
|
|
52
|
+
EOF
|
|
53
|
+
)"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
重要约束:
|
|
57
|
+
- 只能添加明确指定的文件
|
|
58
|
+
- 不要使用 `git add -A` 或 `git add .`
|
|
59
|
+
- 不要提交任何敏感信息
|
|
60
|
+
- co-author 区块必须把当前 agent 放在第一行
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Copyright Check
|
|
2
|
+
|
|
3
|
+
Read this file before editing any copyright header.
|
|
4
|
+
|
|
5
|
+
## Update Copyright Header Years
|
|
6
|
+
|
|
7
|
+
### Get Current Year
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
date +%Y
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Check Modified Files
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
git status --short
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### For Each Modified File
|
|
20
|
+
|
|
21
|
+
Check whether the file contains a copyright header:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
grep "Copyright.*[0-9]\{4\}" <modified_file>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If a header exists and the year is outdated, update it using the current year.
|
|
28
|
+
|
|
29
|
+
Common update patterns:
|
|
30
|
+
- `Copyright (C) 2024-2025` -> `Copyright (C) 2024-{CURRENT_YEAR}`
|
|
31
|
+
- `Copyright (C) 2024` -> `Copyright (C) 2024-{CURRENT_YEAR}`
|
|
32
|
+
- `Copyright (C) 2025` -> `Copyright (C) {CURRENT_YEAR}` when the file already uses the current year
|
|
33
|
+
|
|
34
|
+
### Copyright Checklist
|
|
35
|
+
|
|
36
|
+
- [ ] Use `date +%Y`
|
|
37
|
+
- [ ] Check every modified file
|
|
38
|
+
- [ ] Update only modified files
|
|
39
|
+
- [ ] Never hardcode the current year
|