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,278 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ const COLORS = {
7
+ reset: '\x1b[0m',
8
+ green: '\x1b[32m',
9
+ yellow: '\x1b[33m',
10
+ red: '\x1b[31m',
11
+ cyan: '\x1b[36m',
12
+ check: '\x1b[32m✓\x1b[0m',
13
+ cross: '\x1b[31m✗\x1b[0m',
14
+ };
15
+
16
+ function log(message, color = 'reset') {
17
+ console.log(`${COLORS[color]}${message}${COLORS.reset}`);
18
+ }
19
+
20
+ function fileExists(filePath) {
21
+ return fs.existsSync(filePath);
22
+ }
23
+
24
+ function dirExists(dirPath) {
25
+ return fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory();
26
+ }
27
+
28
+ const results = {
29
+ passed: 0,
30
+ failed: 0,
31
+ warnings: 0,
32
+ };
33
+
34
+ function check(name, condition, isWarning = false) {
35
+ if (condition) {
36
+ log(` ${COLORS.check} ${name}`, 'green');
37
+ results.passed++;
38
+ } else if (isWarning) {
39
+ log(` ⚠ ${name}`, 'yellow');
40
+ results.warnings++;
41
+ } else {
42
+ log(` ${COLORS.cross} ${name}`, 'red');
43
+ results.failed++;
44
+ }
45
+ }
46
+
47
+ function checkFile(filePath, description, required = true) {
48
+ check(`${description}: ${filePath}`, fileExists(filePath), !required);
49
+ }
50
+
51
+ function checkDir(dirPath, description, required = true) {
52
+ check(`${description}: ${dirPath}`, dirExists(dirPath), !required);
53
+ }
54
+
55
+ function validateStructure() {
56
+ log('\n📁 目录结构验证', 'cyan');
57
+
58
+ checkDir('.ai-team', '核心目录');
59
+ checkDir('.ai-team/agents', 'Agents 目录');
60
+ checkDir('.ai-team/skills', 'Skills 目录');
61
+ checkDir('.ai-team/commands', 'Commands 目录');
62
+ checkDir('.ai-team/memory', 'Memory 目录');
63
+ checkDir('.github/workflows', 'GitHub Workflows 目录');
64
+ checkDir('.github/ISSUE_TEMPLATE', 'Issue 模板目录');
65
+ checkDir('docs', '文档目录');
66
+ checkDir('tasks', '任务目录');
67
+ checkDir('tasks/_template', '任务模板目录');
68
+ }
69
+
70
+ function validateAgents() {
71
+ log('\n🤖 AI 角色验证 (v2)', 'cyan');
72
+
73
+ const agents = [
74
+ { name: 'Planner', file: '.ai-team/agents/planner.md', v2: true },
75
+ { name: 'Architect', file: '.ai-team/agents/architect.md', v2: false },
76
+ { name: 'Developer', file: '.ai-team/agents/developer.md', v2: false },
77
+ { name: 'QA', file: '.ai-team/agents/qa.md', v2: false },
78
+ { name: 'Reviewer', file: '.ai-team/agents/reviewer.md', v2: false },
79
+ { name: 'Triage', file: '.ai-team/agents/triage.md', v2: true },
80
+ { name: 'CI Analyst', file: '.ai-team/agents/ci-analyst.md', v2: true },
81
+ ];
82
+
83
+ agents.forEach(agent => {
84
+ const label = agent.v2 ? `${agent.name} (v2)` : agent.name;
85
+ checkFile(agent.file, label);
86
+ });
87
+ }
88
+
89
+ function validateSkills() {
90
+ log('\n📚 技能验证', 'cyan');
91
+
92
+ const skills = [
93
+ { name: 'Repo Architecture Reader', dir: 'repo-architecture-reader' },
94
+ { name: 'Bugfix Playbook', dir: 'bugfix-playbook' },
95
+ { name: 'Test-First Feature Dev', dir: 'test-first-feature-dev' },
96
+ { name: 'Safe Refactor Checklist', dir: 'safe-refactor-checklist' },
97
+ { name: 'Task Breakdown (v2)', dir: 'task-breakdown-and-dispatch', v2: true },
98
+ { name: 'Issue Triage (v2)', dir: 'issue-triage', v2: true },
99
+ { name: 'CI Failure Analysis (v2)', dir: 'ci-failure-analysis', v2: true },
100
+ { name: 'Regression Checklist (v2)', dir: 'regression-checklist', v2: true },
101
+ { name: 'Release Readiness (v2)', dir: 'release-readiness-check', v2: true },
102
+ ];
103
+
104
+ skills.forEach(skill => {
105
+ const label = skill.v2 ? `${skill.name} (v2)` : skill.name;
106
+ checkFile(`.ai-team/skills/${skill.dir}/skill.md`, label);
107
+ });
108
+ }
109
+
110
+ function validateCommands() {
111
+ log('\n⚡ 命令验证', 'cyan');
112
+
113
+ const commands = [
114
+ { name: 'Triage', file: '.ai-team/commands/triage.md' },
115
+ { name: 'Design', file: '.ai-team/commands/design.md' },
116
+ { name: 'Implement', file: '.ai-team/commands/implement.md' },
117
+ { name: 'Test', file: '.ai-team/commands/test.md' },
118
+ { name: 'Review', file: '.ai-team/commands/review.md' },
119
+ { name: 'CI Analyze (v2)', file: '.ai-team/commands/ci-analyze.md', v2: true },
120
+ { name: 'Release Check (v2)', file: '.ai-team/commands/release-check.md', v2: true },
121
+ ];
122
+
123
+ commands.forEach(cmd => {
124
+ const label = cmd.v2 ? `${cmd.name} (v2)` : cmd.name;
125
+ checkFile(cmd.file, label);
126
+ });
127
+ }
128
+
129
+ function validateMemory() {
130
+ log('\n🧠 记忆系统验证 (v2)', 'cyan');
131
+
132
+ const memoryAreas = [
133
+ { role: 'Planner', dir: 'planner', files: ['decomposition_notes.md', 'flow_rules.md'], v2: true },
134
+ { role: 'Architect', dir: 'architect', files: ['architecture_notes.md', 'module_map.md', 'design_rationale.md'] },
135
+ { role: 'Developer', dir: 'developer', files: ['implementation_notes.md', 'bug_investigation.md', 'build_issues.md'] },
136
+ { role: 'QA', dir: 'qa', files: ['test_strategy.md', 'regression_cases.md', 'validation_notes.md'] },
137
+ { role: 'Reviewer', dir: 'reviewer', files: ['review_notes.md', 'quality_rules.md', 'recurring_risks.md'] },
138
+ { role: 'Triage', dir: 'triage', files: ['classification_heuristics.md', 'debug_notes.md'], v2: true },
139
+ { role: 'CI Analyst', dir: 'ci-analyst', files: ['failure_patterns.md', 'runbook_references.md'], v2: true },
140
+ { role: 'Failures Library', dir: 'failures', files: ['failure_library.md'], v2: true },
141
+ ];
142
+
143
+ memoryAreas.forEach(area => {
144
+ const label = area.v2 ? `${area.role} (v2)` : area.role;
145
+ checkDir(`.ai-team/memory/${area.dir}`, label);
146
+ area.files.forEach(file => {
147
+ checkFile(`.ai-team/memory/${area.dir}/${file}`, ` └ ${file}`);
148
+ });
149
+ });
150
+ }
151
+
152
+ function validateDocumentation() {
153
+ log('\n📖 文档验证 (v2)', 'cyan');
154
+
155
+ checkDir('docs/architecture', '架构文档');
156
+ checkDir('docs/decisions', '决策记录');
157
+ checkDir('docs/patterns', '模式库 (v2)', false);
158
+ checkDir('docs/releases', '发布文档 (v2)', false);
159
+ checkDir('docs/runbooks', '运维手册');
160
+ checkDir('docs/runbooks/ci', 'CI 运维手册 (v2)', false);
161
+
162
+ checkFile('AGENTS.md', '全局规则');
163
+ checkFile('README.md', '项目说明');
164
+ }
165
+
166
+ function validateTaskTemplate() {
167
+ log('\n📋 任务模板验证 (v2)', 'cyan');
168
+
169
+ checkFile('tasks/_template/task.yaml', '任务清单模板');
170
+ checkFile('tasks/_template/analysis.md', '分析模板');
171
+ checkFile('tasks/_template/design.md', '设计模板');
172
+ checkFile('tasks/_template/implementation.md', '实现模板');
173
+ checkFile('tasks/_template/validation.md', '验证模板');
174
+ checkFile('tasks/_template/review.md', '审查模板');
175
+ checkFile('tasks/_template/release.md', '发布模板');
176
+ }
177
+
178
+ function validateGitHubWorkflows() {
179
+ log('\n⚙️ GitHub Workflows 验证', 'cyan');
180
+
181
+ checkFile('.github/workflows/opencode.yml', 'OpenCode 触发');
182
+ checkFile('.github/workflows/ci.yml', 'CI 流水线');
183
+ checkFile('.github/workflows/pr-check.yml', 'PR 检查');
184
+
185
+ const issueTemplates = ['feature_request.md', 'bug_report.md', 'tech_task.md'];
186
+ issueTemplates.forEach(template => {
187
+ checkFile(`.github/ISSUE_TEMPLATE/${template}`, `Issue 模板: ${template}`);
188
+ });
189
+
190
+ checkFile('.github/pull_request_template.md', 'PR 模板');
191
+ }
192
+
193
+ function validateConfig() {
194
+ log('\n🔧 配置验证', 'cyan');
195
+
196
+ checkFile('.ai-team/opencode.template.jsonc', 'OpenCode 模板配置');
197
+ checkFile('ai-team.config.yaml', '项目配置', false);
198
+ checkFile('package.json', 'Package 配置');
199
+ checkFile('tsconfig.json', 'TypeScript 配置');
200
+
201
+ const config = fileExists('.ai-team/opencode.template.jsonc');
202
+ if (config) {
203
+ try {
204
+ const content = fs.readFileSync('.ai-team/opencode.template.jsonc', 'utf-8');
205
+ const jsonStr = content.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g, '');
206
+ const config = JSON.parse(jsonStr);
207
+
208
+ const agentCount = Object.keys(config.agents || {}).length;
209
+ const skillCount = Object.keys(config.skills || {}).length;
210
+ const commandCount = Object.keys(config.commands || {}).length;
211
+
212
+ check(` 配置包含 ${agentCount} 个 agents`, agentCount >= 7);
213
+ check(` 配置包含 ${skillCount} 个 skills`, skillCount >= 9);
214
+ check(` 配置包含 ${commandCount} 个 commands`, commandCount >= 7);
215
+ } catch (e) {
216
+ log(` ⚠ 配置文件解析失败: ${e.message}`, 'yellow');
217
+ results.warnings++;
218
+ }
219
+ }
220
+ }
221
+
222
+ function validateAGENTSmd() {
223
+ log('\n📄 AGENTS.md 内容验证', 'cyan');
224
+
225
+ if (fileExists('AGENTS.md')) {
226
+ const content = fs.readFileSync('AGENTS.md', 'utf-8');
227
+
228
+ check(' 包含 Planner 角色规则', content.includes('Planner Agent'));
229
+ check(' 包含 Triage 角色规则', content.includes('Triage Agent'));
230
+ check(' 包含 CI Analyst 角色规则', content.includes('CI Analyst'));
231
+ check(' 包含任务系统说明', content.includes('Task System'));
232
+ check(' 包含治理模型', content.includes('Governance'));
233
+ check(' 包含状态机', content.includes('State') || content.includes('backlog'));
234
+ check(' 包含 v2 命令表', content.includes('/ci-analyze') || content.includes('/release-check'));
235
+ }
236
+ }
237
+
238
+ function printSummary() {
239
+ log('\n' + '═'.repeat(50), 'cyan');
240
+ log('验证结果汇总', 'cyan');
241
+ log('═'.repeat(50), 'cyan');
242
+
243
+ const total = results.passed + results.failed + results.warnings;
244
+
245
+ log(`\n 通过: ${results.passed}/${total}`, 'green');
246
+ log(` 失败: ${results.failed}/${total}`, results.failed > 0 ? 'red' : 'reset');
247
+ log(` 警告: ${results.warnings}/${total}`, results.warnings > 0 ? 'yellow' : 'reset');
248
+
249
+ if (results.failed === 0) {
250
+ log('\n✅ AI Team 底座结构验证通过!', 'green');
251
+ log('\n下一步:', 'cyan');
252
+ log(' 1. 运行 npm test 验证代码');
253
+ log(' 2. 运行 node cli/ai-team.cjs status 检查状态');
254
+ log(' 3. 创建测试 Issue 验证 GitHub Actions');
255
+ } else {
256
+ log('\n❌ 验证失败,请检查上述错误项', 'red');
257
+ process.exit(1);
258
+ }
259
+ }
260
+
261
+ function main() {
262
+ log('\n🔍 AI Team v2 底座验证\n', 'cyan');
263
+
264
+ validateStructure();
265
+ validateAgents();
266
+ validateSkills();
267
+ validateCommands();
268
+ validateMemory();
269
+ validateDocumentation();
270
+ validateTaskTemplate();
271
+ validateGitHubWorkflows();
272
+ validateConfig();
273
+ validateAGENTSmd();
274
+
275
+ printSummary();
276
+ }
277
+
278
+ main();
@@ -0,0 +1,192 @@
1
+ #!/bin/bash
2
+ # validate_foundation.sh
3
+ # Validate the foundation repository integrity
4
+
5
+ set -e
6
+
7
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
+ FOUNDATION_ROOT="$(dirname "$SCRIPT_DIR")"
9
+
10
+ # Colors
11
+ RED='\033[0;31m'
12
+ GREEN='\033[0;32m'
13
+ YELLOW='\033[1;33m'
14
+ CYAN='\033[0;36m'
15
+ NC='\033[0m'
16
+
17
+ PASS=0
18
+ FAIL=0
19
+ WARN=0
20
+
21
+ check_pass() {
22
+ echo -e "${GREEN}✓${NC} $1"
23
+ ((PASS++))
24
+ }
25
+
26
+ check_fail() {
27
+ echo -e "${RED}✗${NC} $1"
28
+ ((FAIL++))
29
+ }
30
+
31
+ check_warn() {
32
+ echo -e "${YELLOW}⚠${NC} $1"
33
+ ((WARN++))
34
+ }
35
+
36
+ check_dir() {
37
+ if [[ -d "$1" ]]; then
38
+ check_pass "$2"
39
+ else
40
+ check_fail "$2"
41
+ fi
42
+ }
43
+
44
+ check_file() {
45
+ if [[ -f "$1" ]]; then
46
+ check_pass "$2"
47
+ else
48
+ check_fail "$2"
49
+ fi
50
+ }
51
+
52
+ check_file_optional() {
53
+ if [[ -f "$1" ]]; then
54
+ check_pass "$2"
55
+ else
56
+ check_warn "$2 (optional)"
57
+ fi
58
+ }
59
+
60
+ echo -e "${CYAN}══════════════════════════════════════════════════${NC}"
61
+ echo -e "${CYAN} AI Team Foundation Validation${NC}"
62
+ echo -e "${CYAN}══════════════════════════════════════════════════${NC}"
63
+ echo ""
64
+
65
+ # Read version
66
+ VERSION=$(cat "$FOUNDATION_ROOT/VERSION" 2>/dev/null || echo "unknown")
67
+ echo -e "${CYAN}Foundation Version:${NC} $VERSION"
68
+ echo ""
69
+
70
+ # 1. Core Structure
71
+ echo -e "${CYAN}[1] Core Structure${NC}"
72
+ check_dir "$FOUNDATION_ROOT/.ai-team" "Core .ai-team directory"
73
+ check_dir "$FOUNDATION_ROOT/.github" "GitHub configuration"
74
+ check_dir "$FOUNDATION_ROOT/docs" "Documentation directory"
75
+ check_dir "$FOUNDATION_ROOT/tasks" "Tasks directory"
76
+ check_dir "$FOUNDATION_ROOT/scripts" "Scripts directory"
77
+ echo ""
78
+
79
+ # 2. Agents
80
+ echo -e "${CYAN}[2] AI Agents${NC}"
81
+ for agent in planner architect developer qa reviewer triage ci-analyst; do
82
+ check_file "$FOUNDATION_ROOT/.ai-team/agents/$agent.md" "Agent: $agent"
83
+ done
84
+ echo ""
85
+
86
+ # 3. Skills
87
+ echo -e "${CYAN}[3] Skills${NC}"
88
+ check_dir "$FOUNDATION_ROOT/.ai-team/skills" "Skills directory"
89
+ for skill in repo-architecture-reader bugfix-playbook test-first-feature-dev safe-refactor-checklist task-breakdown-and-dispatch issue-triage ci-failure-analysis regression-checklist release-readiness-check; do
90
+ check_file "$FOUNDATION_ROOT/.ai-team/skills/$skill/skill.md" "Skill: $skill"
91
+ done
92
+ echo ""
93
+
94
+ # 4. Commands
95
+ echo -e "${CYAN}[4] Commands${NC}"
96
+ for cmd in triage design implement test review ci-analyze release-check; do
97
+ check_file "$FOUNDATION_ROOT/.ai-team/commands/$cmd.md" "Command: $cmd"
98
+ done
99
+ echo ""
100
+
101
+ # 5. Memory Structure
102
+ echo -e "${CYAN}[5] Memory Structure${NC}"
103
+ for role in planner architect developer qa reviewer triage ci-analyst failures; do
104
+ check_dir "$FOUNDATION_ROOT/.ai-team/memory/$role" "Memory: $role"
105
+ done
106
+ echo ""
107
+
108
+ # 6. Documentation Zones
109
+ echo -e "${CYAN}[6] Documentation Zones${NC}"
110
+ check_dir "$FOUNDATION_ROOT/docs/architecture" "Architecture docs"
111
+ check_dir "$FOUNDATION_ROOT/docs/decisions" "Decision records"
112
+ check_dir "$FOUNDATION_ROOT/docs/patterns" "Patterns library"
113
+ check_dir "$FOUNDATION_ROOT/docs/releases" "Release docs"
114
+ check_dir "$FOUNDATION_ROOT/docs/runbooks" "Runbooks"
115
+ check_dir "$FOUNDATION_ROOT/docs/runbooks/ci" "CI runbooks"
116
+ echo ""
117
+
118
+ # 7. GitHub Workflows
119
+ echo -e "${CYAN}[7] GitHub Workflows${NC}"
120
+ check_file "$FOUNDATION_ROOT/.github/workflows/opencode.yml" "OpenCode workflow"
121
+ check_file "$FOUNDATION_ROOT/.github/workflows/ci.yml" "CI workflow"
122
+ check_file "$FOUNDATION_ROOT/.github/workflows/pr-check.yml" "PR check workflow"
123
+ echo ""
124
+
125
+ # 8. Issue Templates
126
+ echo -e "${CYAN}[8] Issue Templates${NC}"
127
+ for template in feature_request.md bug_report.md tech_task.md; do
128
+ check_file "$FOUNDATION_ROOT/.github/ISSUE_TEMPLATE/$template" "Template: $template"
129
+ done
130
+ check_file "$FOUNDATION_ROOT/.github/pull_request_template.md" "PR template"
131
+ echo ""
132
+
133
+ # 9. Task Templates
134
+ echo -e "${CYAN}[9] Task Templates${NC}"
135
+ check_dir "$FOUNDATION_ROOT/tasks/_template" "Task template directory"
136
+ check_file "$FOUNDATION_ROOT/tasks/_template/task.yaml" "Task manifest template"
137
+ for file in analysis.md design.md implementation.md validation.md review.md release.md; do
138
+ check_file "$FOUNDATION_ROOT/tasks/_template/$file" "Template: $file"
139
+ done
140
+ echo ""
141
+
142
+ # 10. Version & Metadata
143
+ echo -e "${CYAN}[10] Version & Metadata${NC}"
144
+ check_file "$FOUNDATION_ROOT/VERSION" "VERSION file"
145
+ check_file "$FOUNDATION_ROOT/CHANGELOG.md" "CHANGELOG"
146
+ check_file "$FOUNDATION_ROOT/AGENTS.md" "AGENTS.md (global rules)"
147
+ check_file "$FOUNDATION_ROOT/.ai-team/opencode.template.jsonc" "OpenCode template config"
148
+ check_file "$FOUNDATION_ROOT/README.md" "README"
149
+ echo ""
150
+
151
+ # 11. Bootstrap Scripts
152
+ echo -e "${CYAN}[11] Bootstrap Scripts${NC}"
153
+ check_file "$FOUNDATION_ROOT/scripts/init_project.sh" "init_project.sh"
154
+ check_file "$FOUNDATION_ROOT/scripts/validate_foundation.sh" "validate_foundation.sh"
155
+ check_file "$FOUNDATION_ROOT/scripts/validate_project_setup.sh" "validate_project_setup.sh"
156
+ check_file "$FOUNDATION_ROOT/scripts/plan_upgrade.sh" "plan_upgrade.sh"
157
+ check_file "$FOUNDATION_ROOT/scripts/upgrade_foundation.sh" "upgrade_foundation.sh"
158
+ check_file "$FOUNDATION_ROOT/scripts/diff_foundation_vs_project.sh" "diff_foundation_vs_project.sh"
159
+ check_file "$FOUNDATION_ROOT/scripts/generate_docs.sh" "generate_docs.sh"
160
+ echo ""
161
+
162
+ # 12. Overlays
163
+ echo -e "${CYAN}[12] Overlays${NC}"
164
+ if [[ -d "$FOUNDATION_ROOT/overlays" ]]; then
165
+ for overlay in "$FOUNDATION_ROOT/overlays"/*; do
166
+ if [[ -d "$overlay" ]]; then
167
+ name=$(basename "$overlay")
168
+ check_dir "$overlay" "Overlay: $name"
169
+ fi
170
+ done
171
+ else
172
+ check_warn "No overlays directory"
173
+ fi
174
+ echo ""
175
+
176
+ # Summary
177
+ echo -e "${CYAN}══════════════════════════════════════════════════${NC}"
178
+ echo -e "${CYAN}Validation Summary${NC}"
179
+ echo -e "${CYAN}══════════════════════════════════════════════════${NC}"
180
+ echo ""
181
+ echo -e " ${GREEN}Passed:${NC} $PASS"
182
+ echo -e " ${RED}Failed:${NC} $FAIL"
183
+ echo -e " ${YELLOW}Warnings:${NC} $WARN"
184
+ echo ""
185
+
186
+ if [[ $FAIL -eq 0 ]]; then
187
+ echo -e "${GREEN}✓ Foundation validation passed!${NC}"
188
+ exit 0
189
+ else
190
+ echo -e "${RED}✗ Foundation validation failed with $FAIL errors${NC}"
191
+ exit 1
192
+ fi
@@ -0,0 +1,171 @@
1
+ #!/bin/bash
2
+ # validate_project_setup.sh
3
+ # Validate a downstream project's AI Team setup
4
+
5
+ set -e
6
+
7
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
+ PROJECT_ROOT="${1:-.}"
9
+
10
+ # Resolve to absolute path
11
+ if [[ "${PROJECT_ROOT:0:1}" != "/" ]]; then
12
+ PROJECT_ROOT="$(pwd)/$PROJECT_ROOT"
13
+ fi
14
+
15
+ # Colors
16
+ RED='\033[0;31m'
17
+ GREEN='\033[0;32m'
18
+ YELLOW='\033[1;33m'
19
+ CYAN='\033[0;36m'
20
+ NC='\033[0m'
21
+
22
+ PASS=0
23
+ FAIL=0
24
+ WARN=0
25
+
26
+ check_pass() {
27
+ echo -e "${GREEN}✓${NC} $1"
28
+ ((PASS++))
29
+ }
30
+
31
+ check_fail() {
32
+ echo -e "${RED}✗${NC} $1"
33
+ ((FAIL++))
34
+ }
35
+
36
+ check_warn() {
37
+ echo -e "${YELLOW}⚠${NC} $1"
38
+ ((WARN++))
39
+ }
40
+
41
+ check_dir() {
42
+ if [[ -d "$PROJECT_ROOT/$1" ]]; then
43
+ check_pass "$2"
44
+ else
45
+ check_fail "$2"
46
+ fi
47
+ }
48
+
49
+ check_file() {
50
+ if [[ -f "$PROJECT_ROOT/$1" ]]; then
51
+ check_pass "$2"
52
+ else
53
+ check_fail "$2"
54
+ fi
55
+ }
56
+
57
+ check_file_optional() {
58
+ if [[ -f "$PROJECT_ROOT/$1" ]]; then
59
+ check_pass "$2"
60
+ else
61
+ check_warn "$2 (optional)"
62
+ fi
63
+ }
64
+
65
+ echo -e "${CYAN}══════════════════════════════════════════════════${NC}"
66
+ echo -e "${CYAN} AI Team Project Setup Validation${NC}"
67
+ echo -e "${CYAN}══════════════════════════════════════════════════${NC}"
68
+ echo ""
69
+ echo -e "${CYAN}Project Path:${NC} $PROJECT_ROOT"
70
+ echo ""
71
+
72
+ # Check if foundation lock exists
73
+ LOCK_FILE="$PROJECT_ROOT/.foundation/foundation.lock"
74
+ if [[ -f "$LOCK_FILE" ]]; then
75
+ echo -e "${CYAN}Foundation Lock:${NC}"
76
+ cat "$LOCK_FILE" | head -5
77
+ echo ""
78
+ fi
79
+
80
+ # 1. Foundation Metadata
81
+ echo -e "${CYAN}[1] Foundation Metadata${NC}"
82
+ check_file ".foundation/foundation.lock" "Foundation lock file"
83
+ check_file ".foundation/upgrade-history.md" "Upgrade history"
84
+ check_file ".foundation/local-overrides.md" "Local overrides doc"
85
+ echo ""
86
+
87
+ # 2. Core Structure
88
+ echo -e "${CYAN}[2] Core Structure${NC}"
89
+ check_dir ".ai-team" ".ai-team directory"
90
+ check_dir ".github" ".github directory"
91
+ check_dir "docs" "docs directory"
92
+ check_dir "tasks" "tasks directory"
93
+ echo ""
94
+
95
+ # 3. Agent Files
96
+ echo -e "${CYAN}[3] Agent Files${NC}"
97
+ for agent in planner architect developer qa reviewer triage ci-analyst; do
98
+ check_file ".ai-team/agents/$agent.md" "Agent: $agent"
99
+ done
100
+ echo ""
101
+
102
+ # 4. Memory Directories
103
+ echo -e "${CYAN}[4] Memory Directories${NC}"
104
+ for role in planner architect developer qa reviewer triage ci-analyst failures; do
105
+ check_dir ".ai-team/memory/$role" "Memory: $role"
106
+ done
107
+ echo ""
108
+
109
+ # 5. GitHub Configuration
110
+ echo -e "${CYAN}[5] GitHub Configuration${NC}"
111
+ check_dir ".github/workflows" "Workflows directory"
112
+ check_file ".github/workflows/opencode.yml" "OpenCode workflow"
113
+ check_file ".github/workflows/ci.yml" "CI workflow"
114
+ check_dir ".github/ISSUE_TEMPLATE" "Issue templates directory"
115
+ echo ""
116
+
117
+ # 6. Documentation
118
+ echo -e "${CYAN}[6] Documentation${NC}"
119
+ check_file "AGENTS.md" "AGENTS.md (global rules)"
120
+ check_file "README.md" "README"
121
+ check_dir "docs/architecture" "Architecture docs"
122
+ check_dir "docs/decisions" "Decision records"
123
+ echo ""
124
+
125
+ # 7. Task Templates
126
+ echo -e "${CYAN}[7] Task Templates${NC}"
127
+ check_dir "tasks/_template" "Task template directory"
128
+ check_file "tasks/_template/task.yaml" "Task manifest template"
129
+ echo ""
130
+
131
+ # 8. Project Configuration
132
+ echo -e "${CYAN}[8] Project Configuration${NC}"
133
+ check_file "ai-team.config.yaml" "Project configuration"
134
+ check_file "opencode.jsonc" "OpenCode runtime config"
135
+ echo ""
136
+
137
+ # 9. Source Structure
138
+ echo -e "${CYAN}[9] Source Structure${NC}"
139
+ check_dir "src" "Source directory"
140
+ check_dir "tests" "Tests directory"
141
+ echo ""
142
+
143
+ # 10. Protected Paths Check
144
+ echo -e "${CYAN}[10] Protected Paths${NC}"
145
+ if [[ -d "$PROJECT_ROOT/docs/architecture" ]]; then
146
+ file_count=$(find "$PROJECT_ROOT/docs/architecture" -type f 2>/dev/null | wc -l)
147
+ echo -e " Architecture docs: $file_count files"
148
+ fi
149
+ if [[ -d "$PROJECT_ROOT/docs/decisions" ]]; then
150
+ file_count=$(find "$PROJECT_ROOT/docs/decisions" -type f 2>/dev/null | wc -l)
151
+ echo -e " Decision records: $file_count files"
152
+ fi
153
+ echo ""
154
+
155
+ # Summary
156
+ echo -e "${CYAN}══════════════════════════════════════════════════${NC}"
157
+ echo -e "${CYAN}Validation Summary${NC}"
158
+ echo -e "${CYAN}══════════════════════════════════════════════════${NC}"
159
+ echo ""
160
+ echo -e " ${GREEN}Passed:${NC} $PASS"
161
+ echo -e " ${RED}Failed:${NC} $FAIL"
162
+ echo -e " ${YELLOW}Warnings:${NC} $WARN"
163
+ echo ""
164
+
165
+ if [[ $FAIL -eq 0 ]]; then
166
+ echo -e "${GREEN}✓ Project setup validation passed!${NC}"
167
+ exit 0
168
+ else
169
+ echo -e "${RED}✗ Project setup validation failed with $FAIL errors${NC}"
170
+ exit 1
171
+ fi