amazingteam 3.0.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.
Files changed (164) hide show
  1. package/.ai-team/agents/architect.md +144 -0
  2. package/.ai-team/agents/ci-analyst.md +188 -0
  3. package/.ai-team/agents/developer.md +176 -0
  4. package/.ai-team/agents/planner.md +355 -0
  5. package/.ai-team/agents/qa.md +189 -0
  6. package/.ai-team/agents/reviewer.md +211 -0
  7. package/.ai-team/agents/triage.md +146 -0
  8. package/.ai-team/commands/ci-analyze.md +116 -0
  9. package/.ai-team/commands/design.md +100 -0
  10. package/.ai-team/commands/implement.md +108 -0
  11. package/.ai-team/commands/release-check.md +142 -0
  12. package/.ai-team/commands/review.md +142 -0
  13. package/.ai-team/commands/test.md +115 -0
  14. package/.ai-team/commands/triage.md +138 -0
  15. package/.ai-team/memory/architect/architecture_notes.md +67 -0
  16. package/.ai-team/memory/architect/design_rationale.md +113 -0
  17. package/.ai-team/memory/architect/module_map.md +84 -0
  18. package/.ai-team/memory/ci-analyst/failure_patterns.md +102 -0
  19. package/.ai-team/memory/ci-analyst/runbook_references.md +87 -0
  20. package/.ai-team/memory/developer/bug_investigation.md +102 -0
  21. package/.ai-team/memory/developer/build_issues.md +115 -0
  22. package/.ai-team/memory/developer/implementation_notes.md +83 -0
  23. package/.ai-team/memory/failures/failure_library.md +103 -0
  24. package/.ai-team/memory/planner/decomposition_notes.md +82 -0
  25. package/.ai-team/memory/planner/flow_rules.md +86 -0
  26. package/.ai-team/memory/planner/github_issue_patterns.md +229 -0
  27. package/.ai-team/memory/qa/regression_cases.md +101 -0
  28. package/.ai-team/memory/qa/test_strategy.md +138 -0
  29. package/.ai-team/memory/qa/validation_notes.md +110 -0
  30. package/.ai-team/memory/reviewer/quality_rules.md +105 -0
  31. package/.ai-team/memory/reviewer/recurring_risks.md +109 -0
  32. package/.ai-team/memory/reviewer/review_notes.md +124 -0
  33. package/.ai-team/memory/triage/classification_heuristics.md +82 -0
  34. package/.ai-team/memory/triage/debug_notes.md +87 -0
  35. package/.ai-team/opencode.template.jsonc +216 -0
  36. package/.ai-team/skills/bugfix-playbook/skill.md +174 -0
  37. package/.ai-team/skills/ci-failure-analysis/skill.md +176 -0
  38. package/.ai-team/skills/issue-triage/skill.md +163 -0
  39. package/.ai-team/skills/regression-checklist/skill.md +176 -0
  40. package/.ai-team/skills/release-readiness-check/skill.md +216 -0
  41. package/.ai-team/skills/repo-architecture-reader/skill.md +139 -0
  42. package/.ai-team/skills/safe-refactor-checklist/skill.md +215 -0
  43. package/.ai-team/skills/task-breakdown-and-dispatch/skill.md +151 -0
  44. package/.ai-team/skills/test-first-feature-dev/skill.md +205 -0
  45. package/.ai-team/workflows/ci.yml +81 -0
  46. package/.ai-team/workflows/nightly-ai-maintenance.yml +129 -0
  47. package/.ai-team/workflows/opencode.yml +33 -0
  48. package/.ai-team/workflows/pr-check.yml +41 -0
  49. package/.foundation/foundation.lock +38 -0
  50. package/.foundation/local-overrides.md +97 -0
  51. package/.foundation/upgrade-history.md +38 -0
  52. package/.opencode/agents/architect.md +38 -0
  53. package/.opencode/agents/ci-analyst.md +38 -0
  54. package/.opencode/agents/developer.md +43 -0
  55. package/.opencode/agents/planner.md +47 -0
  56. package/.opencode/agents/qa.md +34 -0
  57. package/.opencode/agents/reviewer.md +38 -0
  58. package/.opencode/agents/triage.md +37 -0
  59. package/.opencode/commands/auto.md +264 -0
  60. package/.opencode/commands/breakdown-issue.md +94 -0
  61. package/.opencode/commands/ci-analyze.md +15 -0
  62. package/.opencode/commands/close-parent-task.md +122 -0
  63. package/.opencode/commands/design.md +15 -0
  64. package/.opencode/commands/dispatch-next.md +102 -0
  65. package/.opencode/commands/implement.md +16 -0
  66. package/.opencode/commands/release-check.md +16 -0
  67. package/.opencode/commands/resume.md +88 -0
  68. package/.opencode/commands/review.md +15 -0
  69. package/.opencode/commands/show-blockers.md +97 -0
  70. package/.opencode/commands/summarize-parent.md +121 -0
  71. package/.opencode/commands/test.md +15 -0
  72. package/.opencode/commands/triage.md +109 -0
  73. package/.opencode/skills/bugfix-playbook/SKILL.md +81 -0
  74. package/.opencode/skills/ci-failure-analysis/SKILL.md +94 -0
  75. package/.opencode/skills/issue-triage/SKILL.md +80 -0
  76. package/.opencode/skills/regression-checklist/SKILL.md +81 -0
  77. package/.opencode/skills/release-readiness-check/SKILL.md +81 -0
  78. package/.opencode/skills/repo-architecture-reader/SKILL.md +65 -0
  79. package/.opencode/skills/safe-refactor-checklist/SKILL.md +76 -0
  80. package/.opencode/skills/task-breakdown-and-dispatch/SKILL.md +255 -0
  81. package/.opencode/skills/test-first-feature-dev/SKILL.md +78 -0
  82. package/AGENTS.md +879 -0
  83. package/CHANGELOG.md +261 -0
  84. package/LICENSE +21 -0
  85. package/README.md +1215 -0
  86. package/VERSION +1 -0
  87. package/action/__tests__/downloader.test.js +251 -0
  88. package/action/__tests__/merger.test.js +156 -0
  89. package/action/__tests__/path-resolver.test.js +199 -0
  90. package/action/__tests__/validator.test.js +310 -0
  91. package/action/action.yml +61 -0
  92. package/action/index.js +223 -0
  93. package/action/lib/downloader.js +344 -0
  94. package/action/lib/merger.js +170 -0
  95. package/action/lib/path-resolver.js +176 -0
  96. package/action/lib/setup.js +286 -0
  97. package/action/lib/validator.js +324 -0
  98. package/cli/__tests__/cli.test.js +270 -0
  99. package/cli/amazingteam.cjs +225 -0
  100. package/cli/commands/check-update.cjs +159 -0
  101. package/cli/commands/init.cjs +412 -0
  102. package/cli/commands/local.cjs +264 -0
  103. package/cli/commands/migrate.cjs +316 -0
  104. package/cli/commands/status.cjs +241 -0
  105. package/cli/commands/upgrade.cjs +213 -0
  106. package/cli/commands/validate.cjs +259 -0
  107. package/cli/commands/version.cjs +59 -0
  108. package/cli/sync.cjs +237 -0
  109. package/dist/index.js +35 -0
  110. package/docs/architecture/overview.md +138 -0
  111. package/docs/blocker_resolution_design.md +372 -0
  112. package/docs/bootstrap-model.md +356 -0
  113. package/docs/config-reference.md +458 -0
  114. package/docs/how-to-use.md +178 -0
  115. package/docs/migration-to-v3.md +355 -0
  116. package/docs/overlay-guide.md +156 -0
  117. package/docs/patterns/README.md +67 -0
  118. package/docs/quick-start-v3.md +330 -0
  119. package/docs/releases/README.md +64 -0
  120. package/docs/runbooks/ci/README.md +62 -0
  121. package/docs/runbooks/ci/build-debug.md +120 -0
  122. package/docs/runbooks/ci/flaky-tests.md +127 -0
  123. package/docs/runbooks/getting-started.md +81 -0
  124. package/docs/upgrade-policy.md +188 -0
  125. package/docs/versioning.md +199 -0
  126. package/overlays/README.md +30 -0
  127. package/overlays/ai-agent-product/.ai-team/skills/llm-integration/skill.md +99 -0
  128. package/overlays/ai-agent-product/docs/ai-agent-architecture.md +68 -0
  129. package/overlays/ai-agent-product/overlay.yaml +26 -0
  130. package/overlays/cpp-qt-desktop/.ai-team/skills/qt-signals-slots/skill.md +60 -0
  131. package/overlays/cpp-qt-desktop/docs/qt-conventions.md +64 -0
  132. package/overlays/cpp-qt-desktop/overlay.yaml +22 -0
  133. package/overlays/python-backend/.ai-team/skills/python-testing/skill.md +90 -0
  134. package/overlays/python-backend/docs/python-style.md +78 -0
  135. package/overlays/python-backend/overlay.yaml +22 -0
  136. package/overlays/web-fullstack/.ai-team/skills/frontend-testing/skill.md +70 -0
  137. package/overlays/web-fullstack/docs/frontend-conventions.md +68 -0
  138. package/overlays/web-fullstack/overlay.yaml +26 -0
  139. package/package.json +84 -0
  140. package/presets/default.yaml +161 -0
  141. package/presets/go.yaml +43 -0
  142. package/presets/python.yaml +43 -0
  143. package/presets/typescript.yaml +40 -0
  144. package/schemas/config.schema.json +239 -0
  145. package/scripts/diff_foundation_vs_project.sh +134 -0
  146. package/scripts/generate_docs.sh +200 -0
  147. package/scripts/init_project.sh +455 -0
  148. package/scripts/plan_upgrade.sh +268 -0
  149. package/scripts/upgrade_foundation.sh +365 -0
  150. package/scripts/validate-foundation.cjs +278 -0
  151. package/scripts/validate_foundation.sh +192 -0
  152. package/scripts/validate_project_setup.sh +171 -0
  153. package/tasks/README.md +94 -0
  154. package/tasks/_template/analysis.md +76 -0
  155. package/tasks/_template/design.md +121 -0
  156. package/tasks/_template/implementation.md +121 -0
  157. package/tasks/_template/release.md +119 -0
  158. package/tasks/_template/review.md +131 -0
  159. package/tasks/_template/subtasks/task.yaml +24 -0
  160. package/tasks/_template/task.yaml +75 -0
  161. package/tasks/_template/validation.md +128 -0
  162. package/templates/amazingteam.yml +81 -0
  163. package/templates/gitignore +14 -0
  164. package/templates/opencode.jsonc +216 -0
@@ -0,0 +1,458 @@
1
+ # Configuration Reference
2
+
3
+ This document describes all configuration options for `amazingteam.config.yaml`.
4
+
5
+ ---
6
+
7
+ ## Configuration File Location
8
+
9
+ Default: `amazingteam.config.yaml` in project root.
10
+
11
+ Custom location: Specify via CLI `--config` flag or Action input.
12
+
13
+ ---
14
+
15
+ ## Full Configuration Example
16
+
17
+ ```yaml
18
+ version: "1.0"
19
+
20
+ preset: "typescript"
21
+
22
+ project:
23
+ name: "my-awesome-app"
24
+ description: "My awesome application"
25
+ language: "typescript"
26
+ framework: "react"
27
+ repository: "https://github.com/org/repo"
28
+
29
+ build:
30
+ command: "npm run build"
31
+ test: "npm test"
32
+ lint: "npm run lint"
33
+ typecheck: "npm run typecheck"
34
+
35
+ rules:
36
+ test_coverage_threshold: 80
37
+ max_function_lines: 30
38
+ max_file_lines: 500
39
+ commit_convention: "conventional"
40
+
41
+ agents:
42
+ planner: true
43
+ architect: true
44
+ developer: true
45
+ qa: true
46
+ reviewer: true
47
+ triage: true
48
+ ci_analyst: true
49
+
50
+ workflows:
51
+ feature:
52
+ sequence:
53
+ - triage
54
+ - architect
55
+ - developer
56
+ - qa
57
+ - reviewer
58
+ auto_merge: false
59
+ bugfix:
60
+ sequence:
61
+ - triage
62
+ - developer
63
+ - qa
64
+ auto_merge: false
65
+
66
+ memory:
67
+ retention_days: 90
68
+ max_entries_per_role: 100
69
+
70
+ foundation:
71
+ version: "3.0.0"
72
+ registry: "https://registry.npmjs.org"
73
+
74
+ overlay:
75
+ name: "web-fullstack"
76
+ content: |
77
+ ## Custom Rules
78
+ - Use functional components
79
+ - Prefer hooks over class components
80
+ ```
81
+
82
+ ---
83
+
84
+ ## Configuration Fields
85
+
86
+ ### Top-Level Fields
87
+
88
+ | Field | Type | Required | Default | Description |
89
+ |-------|------|----------|---------|-------------|
90
+ | `version` | string | No | `"1.0"` | Config file schema version |
91
+ | `preset` | string | No | `"default"` | Preset name (default, typescript, python, go) |
92
+ | `project` | object | **Yes** | - | Project information |
93
+ | `build` | object | No | Preset default | Build commands |
94
+ | `rules` | object | No | Preset default | Coding rules |
95
+ | `agents` | object | No | All enabled | Agent configuration |
96
+ | `workflows` | object | No | Built-in defaults | Custom workflows |
97
+ | `memory` | object | No | Built-in defaults | Memory settings |
98
+ | `foundation` | object | No | Latest | Foundation version settings |
99
+ | `overlay` | object | No | None | Overlay configuration |
100
+
101
+ ---
102
+
103
+ ### project
104
+
105
+ **Required**. Project information.
106
+
107
+ | Field | Type | Required | Default | Description |
108
+ |-------|------|----------|---------|-------------|
109
+ | `name` | string | **Yes** | - | Project name |
110
+ | `description` | string | No | `""` | Project description |
111
+ | `language` | string | **Yes** | - | Primary language (typescript, python, go, etc.) |
112
+ | `framework` | string | No | `""` | Framework name (react, vue, django, etc.) |
113
+ | `repository` | string | No | Git origin | Repository URL |
114
+
115
+ **Examples:**
116
+
117
+ ```yaml
118
+ # Minimal
119
+ project:
120
+ name: "my-api"
121
+ language: "python"
122
+
123
+ # Full
124
+ project:
125
+ name: "my-fullstack-app"
126
+ description: "Full-stack web application"
127
+ language: "typescript"
128
+ framework: "react"
129
+ repository: "https://github.com/org/my-fullstack-app"
130
+ ```
131
+
132
+ ---
133
+
134
+ ### build
135
+
136
+ Build and test commands.
137
+
138
+ | Field | Type | Required | Default | Description |
139
+ |-------|------|----------|---------|-------------|
140
+ | `command` | string | No | Preset default | Build command |
141
+ | `test` | string | No | Preset default | Test command |
142
+ | `lint` | string | No | Preset default | Lint command |
143
+ | `typecheck` | string | No | Preset default | Type check command |
144
+
145
+ **Examples:**
146
+
147
+ ```yaml
148
+ # TypeScript project
149
+ build:
150
+ command: "npm run build"
151
+ test: "npm test"
152
+ lint: "npm run lint"
153
+ typecheck: "npm run typecheck"
154
+
155
+ # Python project
156
+ build:
157
+ command: "python -m build"
158
+ test: "pytest"
159
+ lint: "ruff check ."
160
+ typecheck: "mypy ."
161
+
162
+ # Go project
163
+ build:
164
+ command: "go build ./..."
165
+ test: "go test ./..."
166
+ lint: "golangci-lint run"
167
+ typecheck: "" # Go doesn't need separate typecheck
168
+ ```
169
+
170
+ ---
171
+
172
+ ### rules
173
+
174
+ Coding rules and thresholds.
175
+
176
+ | Field | Type | Required | Default | Description |
177
+ |-------|------|----------|---------|-------------|
178
+ | `test_coverage_threshold` | number | No | `80` | Minimum test coverage % |
179
+ | `max_function_lines` | number | No | `30` | Max lines per function |
180
+ | `max_file_lines` | number | No | `500` | Max lines per file |
181
+ | `commit_convention` | string | No | `"conventional"` | Commit message format |
182
+
183
+ **Examples:**
184
+
185
+ ```yaml
186
+ rules:
187
+ test_coverage_threshold: 90
188
+ max_function_lines: 25
189
+ max_file_lines: 300
190
+ commit_convention: "conventional" # or "angular", "gitmoji", "none"
191
+ ```
192
+
193
+ ---
194
+
195
+ ### agents
196
+
197
+ Enable/disable agents.
198
+
199
+ | Field | Type | Required | Default | Description |
200
+ |-------|------|----------|---------|-------------|
201
+ | `planner` | boolean | No | `true` | Enable planner agent |
202
+ | `architect` | boolean | No | `true` | Enable architect agent |
203
+ | `developer` | boolean | No | `true` | Enable developer agent |
204
+ | `qa` | boolean | No | `true` | Enable QA agent |
205
+ | `reviewer` | boolean | No | `true` | Enable reviewer agent |
206
+ | `triage` | boolean | No | `true` | Enable triage agent |
207
+ | `ci_analyst` | boolean | No | `true` | Enable CI analyst agent |
208
+
209
+ **Examples:**
210
+
211
+ ```yaml
212
+ # All enabled (default)
213
+ agents:
214
+ planner: true
215
+ architect: true
216
+ developer: true
217
+ qa: true
218
+ reviewer: true
219
+ triage: true
220
+ ci_analyst: true
221
+
222
+ # Minimal team
223
+ agents:
224
+ planner: false
225
+ architect: true
226
+ developer: true
227
+ qa: true
228
+ reviewer: false
229
+ triage: false
230
+ ci_analyst: false
231
+ ```
232
+
233
+ ---
234
+
235
+ ### workflows
236
+
237
+ Custom workflow definitions.
238
+
239
+ | Field | Type | Required | Description |
240
+ |-------|------|----------|-------------|
241
+ | `{workflow_name}` | object | No | Workflow definition |
242
+ | `{workflow_name}.sequence` | string[] | **Yes** | Ordered list of roles |
243
+ | `{workflow_name}.auto_merge` | boolean | No | Auto-merge PRs after completion |
244
+
245
+ **Built-in Workflows:**
246
+
247
+ | Name | Sequence | Description |
248
+ |------|----------|-------------|
249
+ | `feature` | triage → architect → developer → qa → reviewer | New feature development |
250
+ | `bugfix` | triage → developer → qa | Bug fixes |
251
+ | `tech-task` | triage → architect → developer → qa | Technical tasks |
252
+
253
+ **Examples:**
254
+
255
+ ```yaml
256
+ workflows:
257
+ # Override default feature workflow
258
+ feature:
259
+ sequence:
260
+ - triage
261
+ - architect
262
+ - developer
263
+ - developer # Second pass
264
+ - qa
265
+ - reviewer
266
+ auto_merge: false
267
+
268
+ # Custom quick-fix workflow
269
+ quickfix:
270
+ sequence:
271
+ - developer
272
+ - qa
273
+ auto_merge: true
274
+
275
+ # Documentation workflow
276
+ docs:
277
+ sequence:
278
+ - developer
279
+ auto_merge: true
280
+ ```
281
+
282
+ ---
283
+
284
+ ### memory
285
+
286
+ Memory system settings.
287
+
288
+ | Field | Type | Required | Default | Description |
289
+ |-------|------|----------|---------|-------------|
290
+ | `retention_days` | number | No | `90` | Days to keep memory entries |
291
+ | `max_entries_per_role` | number | No | `100` | Max entries per role |
292
+
293
+ **Examples:**
294
+
295
+ ```yaml
296
+ memory:
297
+ retention_days: 30 # Shorter retention for small projects
298
+ max_entries_per_role: 50
299
+ ```
300
+
301
+ ---
302
+
303
+ ### foundation
304
+
305
+ Foundation version and source settings.
306
+
307
+ | Field | Type | Required | Default | Description |
308
+ |-------|------|----------|---------|-------------|
309
+ | `version` | string | No | `"latest"` | Foundation version |
310
+ | `registry` | string | No | `"https://registry.npmjs.org"` | NPM registry URL |
311
+ | `github_repo` | string | No | Official repo | GitHub repo for fallback |
312
+
313
+ **Examples:**
314
+
315
+ ```yaml
316
+ # Use specific version
317
+ foundation:
318
+ version: "3.1.0"
319
+
320
+ # Use private registry
321
+ foundation:
322
+ version: "3.0.0"
323
+ registry: "https://my-private-registry.com"
324
+
325
+ # Use GitHub releases
326
+ foundation:
327
+ version: "3.0.0"
328
+ github_repo: "my-org/amazingteam"
329
+ ```
330
+
331
+ ---
332
+
333
+ ### overlay
334
+
335
+ Overlay configuration for custom rules and content.
336
+
337
+ | Field | Type | Required | Description |
338
+ |-------|------|----------|-------------|
339
+ | `name` | string | No | Built-in overlay name |
340
+ | `path` | string | No | Custom overlay path |
341
+ | `content` | string | No | Inline overlay content |
342
+
343
+ **Built-in Overlays:**
344
+
345
+ | Name | Description |
346
+ |------|-------------|
347
+ | `web-fullstack` | React/Vue/Node fullstack conventions |
348
+ | `python-backend` | Python/Django/FastAPI conventions |
349
+ | `cpp-qt-desktop` | C++/Qt desktop application conventions |
350
+
351
+ **Examples:**
352
+
353
+ ```yaml
354
+ # Use built-in overlay
355
+ overlay:
356
+ name: "web-fullstack"
357
+
358
+ # Use custom overlay from path
359
+ overlay:
360
+ path: "./my-custom-overlay"
361
+
362
+ # Inline overlay content
363
+ overlay:
364
+ content: |
365
+ ## Project-Specific Rules
366
+ - Use functional components only
367
+ - All API calls must have error handling
368
+ - Use CSS modules for styling
369
+ ```
370
+
371
+ ---
372
+
373
+ ### preset
374
+
375
+ Quick configuration presets.
376
+
377
+ | Preset | Language | Framework | Build | Test |
378
+ |--------|----------|-----------|-------|------|
379
+ | `default` | Any | Any | `npm run build` | `npm test` |
380
+ | `typescript` | TypeScript | Any | `npm run build` | `npm test` |
381
+ | `python` | Python | Any | `python -m build` | `pytest` |
382
+ | `go` | Go | Any | `go build ./...` | `go test ./...` |
383
+
384
+ **Example:**
385
+
386
+ ```yaml
387
+ # Using preset (recommended for quick setup)
388
+ preset: "typescript"
389
+
390
+ project:
391
+ name: "my-api"
392
+
393
+ # Preset provides defaults for build, rules, etc.
394
+ # Override as needed:
395
+
396
+ build:
397
+ test: "npm run test:coverage"
398
+ ```
399
+
400
+ ---
401
+
402
+ ## Minimal Configuration
403
+
404
+ The minimum required configuration:
405
+
406
+ ```yaml
407
+ project:
408
+ name: "my-project"
409
+ language: "typescript"
410
+ ```
411
+
412
+ All other fields use preset or built-in defaults.
413
+
414
+ ---
415
+
416
+ ## Configuration Merge Order
417
+
418
+ Configuration is merged in this order (later overrides earlier):
419
+
420
+ 1. Foundation defaults
421
+ 2. Preset defaults
422
+ 3. User configuration (`amazingteam.config.yaml`)
423
+ 4. Local overlay
424
+
425
+ ---
426
+
427
+ ## Validation
428
+
429
+ Validate your configuration:
430
+
431
+ ```bash
432
+ npx amazingteam validate
433
+ ```
434
+
435
+ This checks:
436
+ - Required fields present
437
+ - Valid values for enums
438
+ - Correct types for all fields
439
+ - Valid workflow sequences
440
+
441
+ ---
442
+
443
+ ## Environment Variables
444
+
445
+ Override configuration with environment variables:
446
+
447
+ | Variable | Description |
448
+ |----------|-------------|
449
+ | `AI_TEAM_CONFIG` | Path to config file |
450
+ | `AI_TEAM_VERSION` | Override foundation version |
451
+ | `AI_TEAM_REGISTRY` | Override NPM registry |
452
+ | `AI_TEAM_DEBUG` | Enable debug logging |
453
+
454
+ **Example:**
455
+
456
+ ```bash
457
+ AI_TEAM_CONFIG=./custom-config.yaml npx amazingteam validate
458
+ ```
@@ -0,0 +1,178 @@
1
+ # AI Team Template 使用指南
2
+
3
+ ## 模板仓库 vs 项目仓库
4
+
5
+ 本仓库是 **模板仓库** (Template Repository),提供可复用的 AI Team 定义。使用时有两种场景:
6
+
7
+ ### 场景 1: 模板仓库自身(演示/测试)
8
+
9
+ 模板仓库可以运行 AI 来:
10
+ - 演示完整工作流
11
+ - 测试新功能
12
+ - 迭代改进模板
13
+
14
+ **这是可选的**,模板仓库不需要配置 GitHub Secrets 也能作为模板使用。
15
+
16
+ ### 场景 2: 项目仓库(生产使用)
17
+
18
+ 用户复制模板后,在**自己的项目仓库**中运行 AI Team。
19
+
20
+ **重要**: 项目仓库应该有自己的配置,不依赖模板仓库。
21
+
22
+ ---
23
+
24
+ ## 初始化新项目
25
+
26
+ ### 步骤 1: 使用模板创建仓库
27
+
28
+ ```bash
29
+ # 方式 A: GitHub "Use this template" 按钮
30
+ # 方式 B: 克隆后删除模板配置
31
+ git clone https://github.com/your-org/ai-team-template.git my-project
32
+ cd my-project
33
+ rm -rf .git && git init
34
+ ```
35
+
36
+ ### 步骤 2: 运行初始化
37
+
38
+ ```bash
39
+ node cli/ai-team.cjs init --force
40
+ ```
41
+
42
+ 这会:
43
+ - 创建 `ai-team.config.yaml` (项目配置)
44
+ - 更新 `AGENTS.md` (项目规则)
45
+ - 创建目录结构
46
+
47
+ ### 步骤 3: 配置 GitHub Secrets
48
+
49
+ 在你的项目仓库 Settings → Secrets 添加:
50
+
51
+ | Secret | 说明 |
52
+ |--------|------|
53
+ | `ALIBABA_CODING_PLAN_API_KEY` | OpenCode API Key |
54
+ | `GITHUB_TOKEN` | 自动提供,无需配置 |
55
+
56
+ ### 步骤 4: 开始使用
57
+
58
+ 创建 Issue,评论:
59
+ ```
60
+ /opencode use architect to analyze this issue
61
+ ```
62
+
63
+ ---
64
+
65
+ ## 配置文件说明
66
+
67
+ ### 模板仓库配置 (只读)
68
+
69
+ | 文件 | 用途 | 用户是否修改 |
70
+ |------|------|-------------|
71
+ | `.ai-team/agents/*.md` | Agent 定义 | ❌ 不建议 |
72
+ | `.ai-team/skills/*/skill.md` | Skill 定义 | ❌ 不建议 |
73
+ | `.ai-team/commands/*.md` | Command 定义 | ❌ 不建议 |
74
+ | `.ai-team/memory/*/` | Memory 模板 | ❌ 不建议 |
75
+ | `.ai-team/opencode.template.jsonc` | 配置模板 | ❌ 不建议 |
76
+
77
+ ### 项目仓库配置 (可自定义)
78
+
79
+ | 文件 | 用途 | 用户是否修改 |
80
+ |------|------|-------------|
81
+ | `opencode.jsonc` | 运行时配置 | ✅ 应该 |
82
+ | `ai-team.config.yaml` | 项目配置 | ✅ 应该 |
83
+ | `AGENTS.md` | 全局规则 | ✅ 应该 |
84
+ | `docs/` | 项目文档 | ✅ 应该 |
85
+ | `tasks/` | 任务记忆 | ✅ 自动创建 |
86
+
87
+ ---
88
+
89
+ ## opencode.jsonc vs opencode.template.jsonc
90
+
91
+ ### opencode.template.jsonc (模板)
92
+
93
+ - 定义了完整的 Agent/Skill/Command 配置
94
+ - 包含模板变量 `{{PROJECT_NAME}}` 等
95
+ - **不应该直接使用**
96
+
97
+ ### opencode.jsonc (运行时)
98
+
99
+ - 从模板生成或手动创建
100
+ - 替换了模板变量
101
+ - **实际运行使用的配置**
102
+
103
+ ### 初始化时的处理
104
+
105
+ ```bash
106
+ # 初始化时会:
107
+ # 1. 读取 opencode.template.jsonc
108
+ # 2. 替换模板变量
109
+ # 3. 生成 opencode.jsonc (如果不存在)
110
+ ```
111
+
112
+ ---
113
+
114
+ ## 升级模板
115
+
116
+ 当模板仓库有更新时:
117
+
118
+ ```bash
119
+ # 在你的项目仓库中
120
+ ai-team upgrade
121
+
122
+ # 或强制升级
123
+ ai-team upgrade --force
124
+ ```
125
+
126
+ **升级只覆盖**:
127
+ - `.ai-team/agents/`
128
+ - `.ai-team/skills/`
129
+ - `.ai-team/commands/`
130
+ - `.github/workflows/` (可选)
131
+
132
+ **升级不会覆盖**:
133
+ - `opencode.jsonc`
134
+ - `ai-team.config.yaml`
135
+ - `AGENTS.md`
136
+ - `docs/`
137
+ - `tasks/`
138
+
139
+ ---
140
+
141
+ ## 常见问题
142
+
143
+ ### Q: 模板仓库的自举能力会影响我的项目吗?
144
+
145
+ A: 不会。模板仓库和你的项目仓库是独立的。你需要在**自己的仓库**中配置 Secrets 才能运行 AI。
146
+
147
+ ### Q: 我可以修改 Agent/Skill 定义吗?
148
+
149
+ A: 可以,但建议通过自定义 Agent 而不是修改模板文件:
150
+
151
+ ```yaml
152
+ # ai-team.config.yaml
153
+ ai_team:
154
+ custom_agents:
155
+ - name: my-custom-agent
156
+ enabled: true
157
+ ```
158
+
159
+ ### Q: 模板仓库更新后,我的项目会自动更新吗?
160
+
161
+ A: 不会。需要手动运行 `ai-team upgrade` 来同步更新。
162
+
163
+ ### Q: 我不想用某些 Agent,可以禁用吗?
164
+
165
+ A: 可以:
166
+
167
+ ```yaml
168
+ # ai-team.config.yaml
169
+ ai_team:
170
+ agents:
171
+ planner: true
172
+ architect: true
173
+ developer: true
174
+ qa: true
175
+ reviewer: true
176
+ triage: false # 禁用
177
+ ci_analyst: false # 禁用
178
+ ```