@fitlab-ai/agent-infra 0.3.1 → 0.4.0
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 +29 -39
- package/README.zh-CN.md +29 -39
- package/bin/cli.js +1 -1
- package/lib/defaults.json +3 -12
- package/lib/init.js +13 -24
- package/lib/paths.js +3 -42
- package/lib/update.js +98 -32
- package/lib/version.js +2 -1
- package/package.json +2 -1
- package/templates/.agents/QUICKSTART.md +7 -7
- package/templates/.agents/QUICKSTART.zh-CN.md +7 -7
- package/templates/.agents/README.md +16 -4
- package/templates/.agents/README.zh-CN.md +16 -4
- package/templates/.agents/skills/analyze-task/SKILL.md +106 -105
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +6 -6
- package/templates/.agents/skills/block-task/SKILL.md +8 -8
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +8 -8
- package/templates/.agents/skills/check-task/SKILL.md +3 -3
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/close-codescan/SKILL.md +64 -63
- package/templates/.agents/skills/close-dependabot/SKILL.md +71 -70
- package/templates/.agents/skills/commit/SKILL.md +1 -1
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/complete-task/SKILL.md +7 -7
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +7 -7
- package/templates/.agents/skills/create-issue/SKILL.md +57 -12
- package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +57 -12
- package/templates/.agents/skills/create-pr/SKILL.md +44 -7
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +44 -7
- package/templates/.agents/skills/create-release-note/SKILL.md +18 -11
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +18 -11
- package/templates/.agents/skills/create-task/SKILL.md +80 -78
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +11 -10
- package/templates/.agents/skills/implement-task/SKILL.md +15 -18
- package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +15 -18
- package/templates/.agents/skills/import-codescan/SKILL.md +54 -53
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-dependabot/SKILL.md +57 -56
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/import-issue/SKILL.md +58 -58
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/init-labels/SKILL.md +8 -0
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +8 -0
- package/templates/.agents/skills/plan-task/SKILL.md +151 -149
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +6 -6
- package/templates/.agents/skills/refine-task/SKILL.md +3 -3
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/release/SKILL.md +55 -14
- package/templates/.agents/skills/release/SKILL.zh-CN.md +55 -14
- package/templates/.agents/skills/review-task/SKILL.md +9 -9
- package/templates/.agents/skills/review-task/SKILL.zh-CN.md +9 -9
- package/templates/.agents/skills/sync-issue/SKILL.md +258 -279
- package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +34 -56
- package/templates/.agents/skills/sync-pr/SKILL.md +8 -28
- package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +7 -27
- package/templates/.agents/skills/update-agent-infra/SKILL.md +6 -6
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +6 -6
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +61 -116
- 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 -1
- package/templates/.claude/CLAUDE.zh-CN.md +14 -1
- package/templates/.claude/hooks/check-version-format.sh +44 -0
- package/templates/.claude/settings.json +14 -0
- package/templates/.opencode/COMMAND_STYLE_GUIDE.md +6 -6
- package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +6 -6
- package/templates/AGENTS.md +14 -1
- package/templates/AGENTS.zh-CN.md +14 -1
- 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,150 +1,150 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
1
|
+
# Feature Development Workflow
|
|
2
|
+
# Use this workflow when implementing a new feature.
|
|
3
3
|
|
|
4
4
|
name: feature-development
|
|
5
|
-
description:
|
|
5
|
+
description: End-to-end workflow for developing a new feature.
|
|
6
6
|
|
|
7
7
|
steps:
|
|
8
8
|
- name: analysis
|
|
9
|
-
description:
|
|
9
|
+
description: Analyze feature requirements, explore the codebase, and identify impacted areas.
|
|
10
10
|
recommended_agents:
|
|
11
11
|
- claude
|
|
12
12
|
- gemini
|
|
13
13
|
tasks:
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
14
|
+
- Read and understand the feature requirements
|
|
15
|
+
- Explore the codebase to identify relevant files and modules
|
|
16
|
+
- Identify dependencies and potentially impacted areas
|
|
17
|
+
- Record findings in the task file
|
|
18
18
|
inputs:
|
|
19
|
-
-
|
|
20
|
-
-
|
|
19
|
+
- Feature requirements or issue description
|
|
20
|
+
- Project codebase
|
|
21
21
|
artifact_versioning:
|
|
22
22
|
outputs:
|
|
23
23
|
- name: analysis
|
|
24
24
|
pattern: "analysis.md | analysis-r{N}.md"
|
|
25
|
-
rule: "
|
|
25
|
+
rule: "Scan existing analysis artifacts; create analysis.md for the first round, then analysis-r{N}.md for later revisions (N = current highest round + 1)"
|
|
26
26
|
outputs:
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
27
|
+
- Updated task file (analysis section)
|
|
28
|
+
- List of impacted files
|
|
29
|
+
- Identified risks or constraints
|
|
30
30
|
|
|
31
31
|
- name: design
|
|
32
|
-
description:
|
|
32
|
+
description: Create the technical design for the feature implementation.
|
|
33
33
|
recommended_agents:
|
|
34
34
|
- claude
|
|
35
35
|
- gemini
|
|
36
36
|
tasks:
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
37
|
+
- Define interfaces and data structures
|
|
38
|
+
- Outline the implementation approach
|
|
39
|
+
- Identify edge cases and error-handling strategies
|
|
40
|
+
- Record the design in the task file
|
|
41
41
|
inputs:
|
|
42
|
-
-
|
|
43
|
-
-
|
|
42
|
+
- Analysis results from the previous step
|
|
43
|
+
- Project architecture and conventions
|
|
44
44
|
artifact_versioning:
|
|
45
45
|
inputs:
|
|
46
46
|
- name: analysis
|
|
47
47
|
pattern: "analysis.md | analysis-r{N}.md"
|
|
48
|
-
rule: "
|
|
48
|
+
rule: "Read the highest-round analysis artifact as design input"
|
|
49
49
|
outputs:
|
|
50
50
|
- name: plan
|
|
51
51
|
pattern: "plan.md | plan-r{N}.md"
|
|
52
|
-
rule: "
|
|
52
|
+
rule: "Scan existing plan artifacts; create plan.md for the first round, then plan-r{N}.md for later revisions (N = current highest round + 1)"
|
|
53
53
|
outputs:
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
54
|
+
- Updated task file (design section)
|
|
55
|
+
- Interface definitions
|
|
56
|
+
- Implementation plan
|
|
57
57
|
|
|
58
58
|
- name: implementation
|
|
59
|
-
description:
|
|
59
|
+
description: Implement the feature according to the design plan.
|
|
60
60
|
recommended_agents:
|
|
61
61
|
- codex
|
|
62
62
|
- cursor
|
|
63
63
|
tasks:
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
64
|
+
- Create a feature branch
|
|
65
|
+
- Implement the feature code
|
|
66
|
+
- Write unit tests
|
|
67
|
+
- Write integration tests when applicable
|
|
68
|
+
- Ensure the code follows project conventions
|
|
69
69
|
inputs:
|
|
70
|
-
-
|
|
71
|
-
-
|
|
70
|
+
- Technical design from the previous step
|
|
71
|
+
- Project coding standards
|
|
72
72
|
artifact_versioning:
|
|
73
73
|
outputs:
|
|
74
74
|
- name: implementation
|
|
75
75
|
pattern: "implementation.md | implementation-r{N}.md"
|
|
76
|
-
rule: "
|
|
76
|
+
rule: "Scan existing implementation artifacts; create implementation.md for the first round, then implementation-r{N}.md for later re-implementations (N = current highest round + 1)"
|
|
77
77
|
outputs:
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
78
|
+
- Feature branch with the implementation
|
|
79
|
+
- Test files
|
|
80
|
+
- Updated task file (implementation notes)
|
|
81
81
|
|
|
82
82
|
- name: review
|
|
83
|
-
description:
|
|
83
|
+
description: Review correctness, code style, and best practices in the implementation.
|
|
84
84
|
recommended_agents:
|
|
85
85
|
- claude
|
|
86
86
|
tasks:
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
87
|
+
- Review the correctness of the code changes
|
|
88
|
+
- Check adherence to project conventions
|
|
89
|
+
- Verify test coverage and quality
|
|
90
|
+
- Check for security and performance issues
|
|
91
|
+
- Create a review report
|
|
92
92
|
inputs:
|
|
93
|
-
-
|
|
94
|
-
-
|
|
93
|
+
- Implementation branch
|
|
94
|
+
- Project conventions
|
|
95
95
|
artifact_versioning:
|
|
96
96
|
inputs:
|
|
97
97
|
- name: implementation
|
|
98
98
|
pattern: "implementation.md | implementation-r{N}.md"
|
|
99
|
-
rule: "
|
|
99
|
+
rule: "Read the highest-round implementation artifact as review input"
|
|
100
100
|
outputs:
|
|
101
101
|
- name: review
|
|
102
102
|
pattern: "review.md | review-r{N}.md"
|
|
103
|
-
rule: "
|
|
103
|
+
rule: "Scan existing review artifacts; create review.md for the first round, then review-r{N}.md for later rounds (N = current highest round + 1)"
|
|
104
104
|
outputs:
|
|
105
|
-
-
|
|
106
|
-
-
|
|
105
|
+
- Review report
|
|
106
|
+
- List of issues to fix
|
|
107
107
|
|
|
108
108
|
- name: fix
|
|
109
|
-
description:
|
|
109
|
+
description: Address issues found during the review step.
|
|
110
110
|
recommended_agents:
|
|
111
111
|
- codex
|
|
112
112
|
- cursor
|
|
113
113
|
tasks:
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
114
|
+
- Fix all critical and major review findings
|
|
115
|
+
- Address minor issues and suggestions when appropriate
|
|
116
|
+
- Update tests as needed
|
|
117
|
+
- Verify that all tests pass
|
|
118
118
|
inputs:
|
|
119
|
-
-
|
|
120
|
-
-
|
|
119
|
+
- Review report
|
|
120
|
+
- Implementation branch
|
|
121
121
|
artifact_versioning:
|
|
122
122
|
inputs:
|
|
123
123
|
- name: review
|
|
124
124
|
pattern: "review.md | review-r{N}.md"
|
|
125
|
-
rule: "
|
|
125
|
+
rule: "Read the highest-round review artifact and verify that it matches the latest Code Review entry in the task.md Activity Log"
|
|
126
126
|
outputs:
|
|
127
127
|
- name: refinement
|
|
128
128
|
pattern: "refinement.md | refinement-r{N}.md"
|
|
129
|
-
rule: "
|
|
129
|
+
rule: "Scan existing refinement artifacts; create refinement.md for the first round, then refinement-r{N}.md for later rounds (N = current highest round + 1)"
|
|
130
130
|
outputs:
|
|
131
|
-
-
|
|
132
|
-
-
|
|
131
|
+
- Updated branch with fixes
|
|
132
|
+
- Updated task file
|
|
133
133
|
|
|
134
134
|
- name: commit
|
|
135
|
-
description:
|
|
135
|
+
description: Finalize the changes and create a pull request.
|
|
136
136
|
recommended_agents:
|
|
137
137
|
- claude
|
|
138
138
|
- human
|
|
139
139
|
tasks:
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
140
|
+
- Ensure all tests pass
|
|
141
|
+
- Write a clear commit message that follows project conventions
|
|
142
|
+
- Create a pull request with an appropriate description
|
|
143
|
+
- Link the PR to the relevant issue
|
|
144
|
+
- Move the task to completed
|
|
145
145
|
inputs:
|
|
146
|
-
-
|
|
147
|
-
-
|
|
146
|
+
- Final implementation branch
|
|
147
|
+
- Task file
|
|
148
148
|
outputs:
|
|
149
|
-
-
|
|
150
|
-
-
|
|
149
|
+
- Pull request
|
|
150
|
+
- Completed task file (stored in .agents/workspace/completed/)
|
|
@@ -1,154 +1,154 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
1
|
+
# Refactoring Workflow
|
|
2
|
+
# Use this workflow for code refactoring tasks.
|
|
3
3
|
|
|
4
4
|
name: refactoring
|
|
5
|
-
description:
|
|
5
|
+
description: Safe and structured workflow for code refactoring.
|
|
6
6
|
|
|
7
7
|
steps:
|
|
8
8
|
- name: analysis
|
|
9
|
-
description:
|
|
9
|
+
description: Analyze the current code and determine the refactoring scope.
|
|
10
10
|
recommended_agents:
|
|
11
11
|
- claude
|
|
12
12
|
- gemini
|
|
13
13
|
tasks:
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
14
|
+
- Identify the code to refactor and why it needs refactoring
|
|
15
|
+
- Map all dependencies and consumers of the impacted code
|
|
16
|
+
- Assess refactoring risk and complexity
|
|
17
|
+
- Identify existing test coverage for impacted areas
|
|
18
|
+
- Record findings in the task file
|
|
19
19
|
inputs:
|
|
20
|
-
-
|
|
21
|
-
-
|
|
20
|
+
- Refactoring request or issue description
|
|
21
|
+
- Project codebase
|
|
22
22
|
artifact_versioning:
|
|
23
23
|
outputs:
|
|
24
24
|
- name: analysis
|
|
25
25
|
pattern: "analysis.md | analysis-r{N}.md"
|
|
26
|
-
rule: "
|
|
26
|
+
rule: "Scan existing analysis artifacts; create analysis.md for the first round, then analysis-r{N}.md for later revisions (N = current highest round + 1)"
|
|
27
27
|
outputs:
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
28
|
+
- Scope analysis with dependency mapping
|
|
29
|
+
- Risk assessment
|
|
30
|
+
- Updated task file (analysis section)
|
|
31
31
|
|
|
32
32
|
- name: design
|
|
33
|
-
description:
|
|
33
|
+
description: Plan the refactoring approach to minimize risk.
|
|
34
34
|
recommended_agents:
|
|
35
35
|
- claude
|
|
36
36
|
tasks:
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
37
|
+
- Define the target architecture or code structure
|
|
38
|
+
- Plan incremental refactoring steps to avoid a single large change
|
|
39
|
+
- Identify intermediate states that must remain functional
|
|
40
|
+
- Plan any additional tests needed before refactoring
|
|
41
|
+
- Record the refactoring plan in the task file
|
|
42
42
|
inputs:
|
|
43
|
-
-
|
|
44
|
-
-
|
|
43
|
+
- Scope analysis from the previous step
|
|
44
|
+
- Project architecture
|
|
45
45
|
artifact_versioning:
|
|
46
46
|
inputs:
|
|
47
47
|
- name: analysis
|
|
48
48
|
pattern: "analysis.md | analysis-r{N}.md"
|
|
49
|
-
rule: "
|
|
49
|
+
rule: "Read the highest-round analysis artifact as design input"
|
|
50
50
|
outputs:
|
|
51
51
|
- name: plan
|
|
52
52
|
pattern: "plan.md | plan-r{N}.md"
|
|
53
|
-
rule: "
|
|
53
|
+
rule: "Scan existing plan artifacts; create plan.md for the first round, then plan-r{N}.md for later revisions (N = current highest round + 1)"
|
|
54
54
|
outputs:
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
55
|
+
- Refactoring plan with incremental steps
|
|
56
|
+
- List of prerequisite tests
|
|
57
|
+
- Updated task file (design section)
|
|
58
58
|
|
|
59
59
|
- name: implementation
|
|
60
|
-
description:
|
|
60
|
+
description: Execute the refactoring according to the plan.
|
|
61
61
|
recommended_agents:
|
|
62
62
|
- codex
|
|
63
63
|
- cursor
|
|
64
64
|
tasks:
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
65
|
+
- Create a refactoring branch
|
|
66
|
+
- Add prerequisite tests if they do not already exist
|
|
67
|
+
- Execute the refactoring incrementally
|
|
68
|
+
- Verify tests pass after each step
|
|
69
|
+
- Update impacted documentation or comments
|
|
70
|
+
- Ensure the code follows project conventions
|
|
71
71
|
inputs:
|
|
72
|
-
-
|
|
73
|
-
-
|
|
72
|
+
- Refactoring plan from the previous step
|
|
73
|
+
- Project coding standards
|
|
74
74
|
artifact_versioning:
|
|
75
75
|
outputs:
|
|
76
76
|
- name: implementation
|
|
77
77
|
pattern: "implementation.md | implementation-r{N}.md"
|
|
78
|
-
rule: "
|
|
78
|
+
rule: "Scan existing implementation artifacts; create implementation.md for the first round, then implementation-r{N}.md for later re-implementations (N = current highest round + 1)"
|
|
79
79
|
outputs:
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
80
|
+
- Refactoring branch with the changes
|
|
81
|
+
- Updated or new test files
|
|
82
|
+
- Updated task file (implementation notes)
|
|
83
83
|
|
|
84
84
|
- name: review
|
|
85
|
-
description:
|
|
85
|
+
description: Verify that the refactoring preserves behavior and improves code quality.
|
|
86
86
|
recommended_agents:
|
|
87
87
|
- claude
|
|
88
88
|
tasks:
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
89
|
+
- Verify functional equivalence unless behavior changes are intentional
|
|
90
|
+
- Check that all tests pass
|
|
91
|
+
- Confirm that code quality has improved
|
|
92
|
+
- Check for missed dependencies or consumers
|
|
93
|
+
- Assess performance impact when applicable
|
|
94
|
+
- Create a review report
|
|
95
95
|
inputs:
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
96
|
+
- Refactoring branch
|
|
97
|
+
- Original code for comparison
|
|
98
|
+
- Test results
|
|
99
99
|
artifact_versioning:
|
|
100
100
|
inputs:
|
|
101
101
|
- name: implementation
|
|
102
102
|
pattern: "implementation.md | implementation-r{N}.md"
|
|
103
|
-
rule: "
|
|
103
|
+
rule: "Read the highest-round implementation artifact as review input"
|
|
104
104
|
outputs:
|
|
105
105
|
- name: review
|
|
106
106
|
pattern: "review.md | review-r{N}.md"
|
|
107
|
-
rule: "
|
|
107
|
+
rule: "Scan existing review artifacts; create review.md for the first round, then review-r{N}.md for later rounds (N = current highest round + 1)"
|
|
108
108
|
outputs:
|
|
109
|
-
-
|
|
110
|
-
-
|
|
109
|
+
- Review report
|
|
110
|
+
- List of issues if any
|
|
111
111
|
|
|
112
112
|
- name: fix
|
|
113
|
-
description:
|
|
113
|
+
description: Address issues found during review.
|
|
114
114
|
recommended_agents:
|
|
115
115
|
- codex
|
|
116
116
|
- cursor
|
|
117
117
|
tasks:
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
118
|
+
- Fix issues identified in the review
|
|
119
|
+
- Update tests as needed
|
|
120
|
+
- Verify that all tests pass
|
|
121
|
+
- Ensure there are no regressions
|
|
122
122
|
inputs:
|
|
123
|
-
-
|
|
124
|
-
-
|
|
123
|
+
- Review report
|
|
124
|
+
- Refactoring branch
|
|
125
125
|
artifact_versioning:
|
|
126
126
|
inputs:
|
|
127
127
|
- name: review
|
|
128
128
|
pattern: "review.md | review-r{N}.md"
|
|
129
|
-
rule: "
|
|
129
|
+
rule: "Read the highest-round review artifact and verify that it matches the latest Code Review entry in the task.md Activity Log"
|
|
130
130
|
outputs:
|
|
131
131
|
- name: refinement
|
|
132
132
|
pattern: "refinement.md | refinement-r{N}.md"
|
|
133
|
-
rule: "
|
|
133
|
+
rule: "Scan existing refinement artifacts; create refinement.md for the first round, then refinement-r{N}.md for later rounds (N = current highest round + 1)"
|
|
134
134
|
outputs:
|
|
135
|
-
-
|
|
136
|
-
-
|
|
135
|
+
- Updated branch with fixes
|
|
136
|
+
- Updated task file
|
|
137
137
|
|
|
138
138
|
- name: commit
|
|
139
|
-
description:
|
|
139
|
+
description: Finalize the refactoring and create a pull request.
|
|
140
140
|
recommended_agents:
|
|
141
141
|
- claude
|
|
142
142
|
- human
|
|
143
143
|
tasks:
|
|
144
|
-
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
144
|
+
- Ensure all tests pass
|
|
145
|
+
- Write a clear commit message that explains the refactoring
|
|
146
|
+
- Create a pull request with a detailed change summary
|
|
147
|
+
- Link the PR to the relevant issue
|
|
148
|
+
- Move the task to completed
|
|
149
149
|
inputs:
|
|
150
|
-
-
|
|
151
|
-
-
|
|
150
|
+
- Final refactoring branch
|
|
151
|
+
- Task file
|
|
152
152
|
outputs:
|
|
153
|
-
-
|
|
154
|
-
-
|
|
153
|
+
- Pull request
|
|
154
|
+
- Completed task file (stored in .agents/workspace/completed/)
|
|
@@ -5,7 +5,7 @@ This directory is the runtime workspace for multi-AI collaboration. All contents
|
|
|
5
5
|
## Directory Structure
|
|
6
6
|
|
|
7
7
|
```
|
|
8
|
-
.
|
|
8
|
+
.agents/workspace/
|
|
9
9
|
active/ # Currently active tasks and handoff documents
|
|
10
10
|
blocked/ # Tasks that are blocked and waiting for resolution
|
|
11
11
|
completed/ # Completed tasks (kept for reference)
|
|
@@ -153,10 +153,23 @@ Co-Authored-By: Claude <noreply@anthropic.com>
|
|
|
153
153
|
This project supports Claude Code, Codex, Gemini CLI, OpenCode.
|
|
154
154
|
|
|
155
155
|
- `.agents/` - Shared collaboration config
|
|
156
|
-
- `.
|
|
156
|
+
- `.agents/workspace/` - Task workspace (git-ignored)
|
|
157
157
|
|
|
158
158
|
**Collaboration guide**: `.agents/README.md`
|
|
159
159
|
|
|
160
|
+
## Skill Authoring Conventions
|
|
161
|
+
|
|
162
|
+
When writing or updating `.agents/skills/*/SKILL.md` files, keep step numbering consistent:
|
|
163
|
+
|
|
164
|
+
1. Use consecutive integers for top-level steps: `1.`, `2.`, `3.`.
|
|
165
|
+
2. Use nested numbering only for child actions that belong to a parent step: `1.1`, `1.2`, `2.1`.
|
|
166
|
+
3. Use `a`, `b`, and `c` markers for branches, conditions, or alternative paths within the same step.
|
|
167
|
+
4. Do not use intermediate numbers such as `1.5` or `2.5`; if a new standalone step is needed, renumber the following top-level steps.
|
|
168
|
+
5. When renumbering, update every in-document step reference so the instructions remain accurate.
|
|
169
|
+
6. Extract long bash scripts into a sibling `scripts/` directory; the SKILL.md should contain only a single-line invocation (e.g., `bash .agents/skills/<skill>/scripts/<script>.sh`) and a brief summary of the script's responsibilities.
|
|
170
|
+
|
|
171
|
+
<!-- Canonical source: .agents/README.md - keep in sync -->
|
|
172
|
+
|
|
160
173
|
## Security
|
|
161
174
|
|
|
162
175
|
- Do not commit: `.env`, credentials, keys
|
|
@@ -153,10 +153,23 @@ Co-Authored-By: Claude <noreply@anthropic.com>
|
|
|
153
153
|
本项目支持 Claude Code、Codex、Gemini CLI、OpenCode。
|
|
154
154
|
|
|
155
155
|
- `.agents/` - 共享协作配置
|
|
156
|
-
- `.
|
|
156
|
+
- `.agents/workspace/` - 任务工作区(已被 git ignore)
|
|
157
157
|
|
|
158
158
|
**协作指南**:`.agents/README.md`
|
|
159
159
|
|
|
160
|
+
## Skill 编写规范
|
|
161
|
+
|
|
162
|
+
编写或维护 `.agents/skills/*/SKILL.md` 时,步骤编号遵循以下规则:
|
|
163
|
+
|
|
164
|
+
1. 顶级步骤使用连续整数:`1.`、`2.`、`3.`。
|
|
165
|
+
2. 只有父步骤下的从属动作才使用子步骤:`1.1`、`1.2`、`2.1`。
|
|
166
|
+
3. 同一步中的分支、条件或多种可能性使用 `a`、`b`、`c` 标记。
|
|
167
|
+
4. 不要使用 `1.5`、`2.5` 这类中间编号;如新增独立步骤,应整体顺延后续编号。
|
|
168
|
+
5. 调整编号时,必须同步更新文中的步骤引用,确保说明、命令和检查点一致。
|
|
169
|
+
6. 长 bash 脚本应从 SKILL.md 提取到同级 `scripts/` 目录中,SKILL.md 只保留单行调用(如 `bash .agents/skills/<skill>/scripts/<script>.sh`)和对脚本职责的概要说明。
|
|
170
|
+
|
|
171
|
+
<!-- Canonical source: .agents/README.zh-CN.md - keep in sync -->
|
|
172
|
+
|
|
160
173
|
## 安全注意事项
|
|
161
174
|
|
|
162
175
|
- 不要提交:`.env`、credentials、密钥
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
input=$(cat)
|
|
5
|
+
hook_command=$(
|
|
6
|
+
printf '%s' "$input" | node -e '
|
|
7
|
+
const chunks = [];
|
|
8
|
+
process.stdin.on("data", (chunk) => chunks.push(chunk));
|
|
9
|
+
process.stdin.on("end", () => {
|
|
10
|
+
try {
|
|
11
|
+
const payload = JSON.parse(Buffer.concat(chunks).toString());
|
|
12
|
+
process.stdout.write(payload.tool_input && payload.tool_input.command || "");
|
|
13
|
+
} catch (error) {
|
|
14
|
+
process.stdout.write("");
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
' 2>/dev/null
|
|
18
|
+
) || true
|
|
19
|
+
|
|
20
|
+
case "$hook_command" in
|
|
21
|
+
git\ commit | git\ commit\ *) ;;
|
|
22
|
+
*) exit 0 ;;
|
|
23
|
+
esac
|
|
24
|
+
|
|
25
|
+
script_dir=$(
|
|
26
|
+
CDPATH= cd -- "$(dirname -- "$0")" && pwd
|
|
27
|
+
)
|
|
28
|
+
repo_root=$(
|
|
29
|
+
CDPATH= cd -- "$script_dir/../.." && pwd
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
if sh "$repo_root/.github/hooks/check-version-format.sh"; then
|
|
33
|
+
echo "Claude hook: version check passed."
|
|
34
|
+
exit 0
|
|
35
|
+
else
|
|
36
|
+
status=$?
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
if [ "$status" -eq 1 ]; then
|
|
40
|
+
echo "Claude hook: blocking git commit (version format error)."
|
|
41
|
+
exit 2
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
exit "$status"
|
|
@@ -16,5 +16,19 @@
|
|
|
16
16
|
"Bash(sudo rm:*)",
|
|
17
17
|
"Bash(rm -rf /:*)"
|
|
18
18
|
]
|
|
19
|
+
},
|
|
20
|
+
"hooks": {
|
|
21
|
+
"PreToolUse": [
|
|
22
|
+
{
|
|
23
|
+
"matcher": "Bash",
|
|
24
|
+
"hooks": [
|
|
25
|
+
{
|
|
26
|
+
"type": "command",
|
|
27
|
+
"command": "sh .claude/hooks/check-version-format.sh",
|
|
28
|
+
"timeout": 5
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
19
33
|
}
|
|
20
34
|
}
|
|
@@ -131,9 +131,9 @@ Each step should do one thing. If a step is too complex, break it into sub-steps
|
|
|
131
131
|
1. **Verify task exists**
|
|
132
132
|
|
|
133
133
|
Search for the task file:
|
|
134
|
-
- `.
|
|
135
|
-
- `.
|
|
136
|
-
- `.
|
|
134
|
+
- `.agents/workspace/active/{task-id}/task.md`
|
|
135
|
+
- `.agents/workspace/blocked/{task-id}/task.md`
|
|
136
|
+
- `.agents/workspace/completed/{task-id}/task.md`
|
|
137
137
|
|
|
138
138
|
If not found, respond:
|
|
139
139
|
"Task {task-id} not found. Please check the task ID."
|
|
@@ -157,9 +157,9 @@ Do NOT silently continue.
|
|
|
157
157
|
|
|
158
158
|
```markdown
|
|
159
159
|
Search for the task in this order:
|
|
160
|
-
1. `.
|
|
161
|
-
2. `.
|
|
162
|
-
3. `.
|
|
160
|
+
1. `.agents/workspace/active/{task-id}/task.md`
|
|
161
|
+
2. `.agents/workspace/blocked/{task-id}/task.md`
|
|
162
|
+
3. `.agents/workspace/completed/{task-id}/task.md`
|
|
163
163
|
```
|
|
164
164
|
|
|
165
165
|
### Status update pattern
|