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,316 @@
1
+ /**
2
+ * Migrate Command
3
+ * Migrate v2.x project to v3
4
+ */
5
+
6
+ const fs = require('fs');
7
+ const path = require('path');
8
+
9
+ const VERSION = require('../../package.json').version;
10
+
11
+ function detectV2Project(projectPath) {
12
+ const indicators = [
13
+ '.ai-team/agents',
14
+ '.ai-team/skills',
15
+ '.ai-team/commands',
16
+ '.opencode/skills',
17
+ 'tasks/_template/task.yaml'
18
+ ];
19
+
20
+ let score = 0;
21
+ const found = [];
22
+
23
+ for (const indicator of indicators) {
24
+ if (fs.existsSync(path.join(projectPath, indicator))) {
25
+ score++;
26
+ found.push(indicator);
27
+ }
28
+ }
29
+
30
+ return {
31
+ isV2: score >= 3,
32
+ score,
33
+ found
34
+ };
35
+ }
36
+
37
+ function extractUserCustomizations(projectPath) {
38
+ const customizations = {
39
+ config: null,
40
+ agentsMd: null,
41
+ localOverrides: null
42
+ };
43
+
44
+ // Read existing config
45
+ const configPath = path.join(projectPath, 'amazingteam.config.yaml');
46
+ if (fs.existsSync(configPath)) {
47
+ customizations.config = fs.readFileSync(configPath, 'utf-8');
48
+ }
49
+
50
+ // Read AGENTS.md
51
+ const agentsPath = path.join(projectPath, 'AGENTS.md');
52
+ if (fs.existsSync(agentsPath)) {
53
+ customizations.agentsMd = fs.readFileSync(agentsPath, 'utf-8');
54
+ }
55
+
56
+ // Read local overrides
57
+ const overridesPath = path.join(projectPath, '.foundation', 'local-overrides.md');
58
+ if (fs.existsSync(overridesPath)) {
59
+ customizations.localOverrides = fs.readFileSync(overridesPath, 'utf-8');
60
+ }
61
+
62
+ return customizations;
63
+ }
64
+
65
+ function createV3Config(customizations) {
66
+ const lines = [
67
+ '# AmazingTeam Project Configuration (v3)',
68
+ '# Migrated from v2.x',
69
+ '',
70
+ 'version: "1.0"',
71
+ ''
72
+ ];
73
+
74
+ // Extract project info from old config
75
+ if (customizations.config) {
76
+ const configLines = customizations.config.split('\n');
77
+ let inProject = false;
78
+
79
+ for (const line of configLines) {
80
+ if (line.startsWith('project:')) {
81
+ inProject = true;
82
+ lines.push('project:');
83
+ continue;
84
+ }
85
+
86
+ if (inProject) {
87
+ if (line.startsWith(' ')) {
88
+ lines.push(line);
89
+ } else {
90
+ inProject = false;
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ // Add v3 specific fields
97
+ lines.push('');
98
+ lines.push('ai_team:');
99
+ lines.push(` version: "${VERSION}"`);
100
+ lines.push('');
101
+ lines.push('# Migration note: Foundation files are now loaded remotely');
102
+ lines.push('# Run "amazingteam local" to download for local development');
103
+ lines.push('');
104
+
105
+ return lines.join('\n');
106
+ }
107
+
108
+ async function run(options, positional) {
109
+ const projectPath = process.cwd();
110
+
111
+ console.log('\nšŸ”„ AmazingTeam Migration Tool (v2 → v3)\n');
112
+
113
+ // Detect v2 project
114
+ const detection = detectV2Project(projectPath);
115
+
116
+ if (!detection.isV2) {
117
+ console.log('This does not appear to be a v2.x project.');
118
+ console.log('Detected indicators:', detection.score);
119
+ console.log('\nIf you want to initialize a new project, run:');
120
+ console.log(' amazingteam init\n');
121
+ return;
122
+ }
123
+
124
+ console.log('Detected v2.x project:');
125
+ detection.found.forEach(f => console.log(` - ${f}`));
126
+ console.log('');
127
+
128
+ if (options.dryRun) {
129
+ console.log('šŸ“ Dry run - showing what would happen:\n');
130
+ }
131
+
132
+ // Extract customizations
133
+ console.log('Extracting user customizations...');
134
+ const customizations = extractUserCustomizations(projectPath);
135
+
136
+ // Create backup
137
+ if (!options.dryRun) {
138
+ const backupDir = `.ai-team-v2-backup-${Date.now()}`;
139
+ console.log(`Creating backup: ${backupDir}`);
140
+
141
+ const dirsToBackup = ['.ai-team', '.opencode', '.foundation', 'tasks'];
142
+ for (const dir of dirsToBackup) {
143
+ const src = path.join(projectPath, dir);
144
+ if (fs.existsSync(src)) {
145
+ fs.cpSync(src, path.join(backupDir, dir), { recursive: true });
146
+ }
147
+ }
148
+ }
149
+
150
+ // Create v3 config
151
+ console.log('Creating v3 configuration...');
152
+ const v3Config = createV3Config(customizations);
153
+
154
+ if (options.dryRun) {
155
+ console.log('\n--- amazingteam.config.yaml (new) ---');
156
+ console.log(v3Config);
157
+ console.log('--- end ---\n');
158
+ } else {
159
+ fs.writeFileSync(path.join(projectPath, 'amazingteam.config.yaml'), v3Config);
160
+ }
161
+
162
+ // Create v3 workflow
163
+ console.log('Creating v3 workflow...');
164
+ const workflowContent = `# AmazingTeam GitHub Action Workflow (v3)
165
+ name: AmazingTeam
166
+
167
+ on:
168
+ issue_comment:
169
+ types: [created]
170
+ pull_request_review_comment:
171
+ types: [created]
172
+
173
+ jobs:
174
+ ai-team:
175
+ if: |
176
+ startsWith(github.event.comment.body, '/ai') ||
177
+ startsWith(github.event.comment.body, '/opencode')
178
+ runs-on: ubuntu-latest
179
+ permissions:
180
+ id-token: write
181
+ contents: write
182
+ pull-requests: write
183
+ issues: write
184
+ steps:
185
+ - uses: actions/checkout@v4
186
+ with:
187
+ fetch-depth: 0
188
+ - name: Configure git
189
+ run: |
190
+ git config --global user.name "opencode-bot"
191
+ git config --global user.email "opencode-bot@users.noreply.github.com"
192
+ - name: Setup AmazingTeam
193
+ uses: your-org/amazingteam-action@v${VERSION}
194
+ with:
195
+ version: '${VERSION}'
196
+ - name: Run OpenCode
197
+ uses: anomalyco/opencode/github@latest
198
+ env:
199
+ ALIBABA_CODING_PLAN_API_KEY: \${{ secrets.ALIBABA_CODING_PLAN_API_KEY }}
200
+ GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
201
+ `;
202
+
203
+ if (!options.dryRun) {
204
+ const workflowDir = path.join(projectPath, '.github', 'workflows');
205
+ if (!fs.existsSync(workflowDir)) {
206
+ fs.mkdirSync(workflowDir, { recursive: true });
207
+ }
208
+ fs.writeFileSync(path.join(workflowDir, 'amazingteam.yml'), workflowContent);
209
+ }
210
+
211
+ // Create minimal directories
212
+ console.log('Creating minimal runtime directories...');
213
+ const dirs = [
214
+ '.ai-team/memory/planner',
215
+ '.ai-team/memory/architect',
216
+ '.ai-team/memory/developer',
217
+ '.ai-team/memory/qa',
218
+ '.ai-team/memory/reviewer',
219
+ '.ai-team/memory/triage',
220
+ '.ai-team/memory/ci-analyst',
221
+ '.ai-team/memory/failures',
222
+ 'tasks/_template'
223
+ ];
224
+
225
+ if (!options.dryRun) {
226
+ for (const dir of dirs) {
227
+ const fullPath = path.join(projectPath, dir);
228
+ if (!fs.existsSync(fullPath)) {
229
+ fs.mkdirSync(fullPath, { recursive: true });
230
+ }
231
+ }
232
+ }
233
+
234
+ // Update .gitignore
235
+ console.log('Updating .gitignore...');
236
+ const gitignorePath = path.join(projectPath, '.gitignore');
237
+ const additions = '\n# AmazingTeam v3\n.ai-team-local/\n.ai-team-cache/\n';
238
+
239
+ if (!options.dryRun) {
240
+ if (fs.existsSync(gitignorePath)) {
241
+ let content = fs.readFileSync(gitignorePath, 'utf-8');
242
+ if (!content.includes('.ai-team-local/')) {
243
+ content += additions;
244
+ fs.writeFileSync(gitignorePath, content);
245
+ }
246
+ } else {
247
+ fs.writeFileSync(gitignorePath, additions.trim() + '\n');
248
+ }
249
+ }
250
+
251
+ // Remove v2 directories (optional, with backup)
252
+ if (!options.dryRun && !options.keepV2) {
253
+ console.log('\nRemoving v2 foundation files...');
254
+ console.log(' (Backup created, safe to remove)');
255
+
256
+ const v2Dirs = ['.ai-team/agents', '.ai-team/skills', '.ai-team/commands', '.opencode'];
257
+ for (const dir of v2Dirs) {
258
+ const fullPath = path.join(projectPath, dir);
259
+ if (fs.existsSync(fullPath)) {
260
+ fs.rmSync(fullPath, { recursive: true });
261
+ }
262
+ }
263
+ }
264
+
265
+ // Summary
266
+ console.log('\n' + '='.repeat(40));
267
+
268
+ if (options.dryRun) {
269
+ console.log('Dry run complete. Run without --dry-run to apply changes.\n');
270
+ } else {
271
+ console.log('āœ… Migration complete!\n');
272
+ console.log('Changes:');
273
+ console.log(' - Created amazingteam.config.yaml (v3 format)');
274
+ console.log(' - Created .github/workflows/amazingteam.yml (v3)');
275
+ console.log(' - Created runtime directories');
276
+ console.log(' - Updated .gitignore');
277
+ if (!options.keepV2) {
278
+ console.log(' - Removed v2 foundation files');
279
+ }
280
+ console.log('\nNext steps:');
281
+ console.log(' 1. Review amazingteam.config.yaml');
282
+ console.log(' 2. Run "amazingteam local" for local development');
283
+ console.log(' 3. Run "amazingteam validate" to verify setup');
284
+ console.log(' 4. Test your project');
285
+ console.log(' 5. Commit the changes\n');
286
+ }
287
+ }
288
+
289
+ function help() {
290
+ return `
291
+ amazingteam migrate - Migrate v2.x project to v3
292
+
293
+ Usage:
294
+ amazingteam migrate [options]
295
+
296
+ Options:
297
+ --dry-run Preview changes without applying
298
+ --keep-v2 Keep v2 foundation files (don't remove)
299
+
300
+ What migration does:
301
+ 1. Detects v2.x project structure
302
+ 2. Extracts user customizations
303
+ 3. Creates backup of v2 files
304
+ 4. Creates v3 configuration files
305
+ 5. Updates workflow to use remote loading
306
+ 6. Removes v2 foundation files (unless --keep-v2)
307
+
308
+ After migration:
309
+ - Run "amazingteam local" to download foundation for local dev
310
+ - Run "amazingteam validate" to verify the setup
311
+
312
+ Note: A backup is created before any changes.
313
+ `;
314
+ }
315
+
316
+ module.exports = { run, help };
@@ -0,0 +1,241 @@
1
+ /**
2
+ * Status Command
3
+ * Show AmazingTeam status
4
+ */
5
+
6
+ const fs = require('fs');
7
+ const path = require('path');
8
+
9
+ const VERSION = require('../../package.json').version;
10
+
11
+ function parseConfig(configPath) {
12
+ if (!fs.existsSync(configPath)) {
13
+ return null;
14
+ }
15
+
16
+ const content = fs.readFileSync(configPath, 'utf-8');
17
+ const config = {};
18
+ let currentSection = null;
19
+ let currentSubSection = null;
20
+
21
+ content.split('\n').forEach(line => {
22
+ if (line.trim().startsWith('#') || !line.trim()) return;
23
+
24
+ const indent = line.search(/\S/);
25
+
26
+ // Section (0 indent)
27
+ if (indent === 0) {
28
+ const match = line.match(/^(\w+):$/);
29
+ if (match) {
30
+ currentSection = match[1];
31
+ config[currentSection] = {};
32
+ currentSubSection = null;
33
+ }
34
+ }
35
+ // Sub-section (2 spaces)
36
+ else if (indent === 2 && currentSection) {
37
+ const match = line.match(/^ (\w+):\s*(.*)$/);
38
+ if (match) {
39
+ const key = match[1];
40
+ let value = match[2].trim();
41
+
42
+ if (value === '') {
43
+ currentSubSection = key;
44
+ config[currentSection][key] = {};
45
+ } else {
46
+ value = value.replace(/^["']|["']$/g, '');
47
+ if (value === 'true') value = true;
48
+ else if (value === 'false') value = false;
49
+ else if (!isNaN(Number(value))) value = Number(value);
50
+
51
+ config[currentSection][key] = value;
52
+ }
53
+ }
54
+ }
55
+ // Sub-sub-section (4 spaces)
56
+ else if (indent === 4 && currentSection && currentSubSection) {
57
+ const match = line.match(/^ (\w+):\s*(.*)$/);
58
+ if (match) {
59
+ let value = match[2].trim().replace(/^["']|["']$/g, '');
60
+ if (value === 'true') value = true;
61
+ else if (value === 'false') value = false;
62
+
63
+ config[currentSection][currentSubSection][match[1]] = value;
64
+ }
65
+ }
66
+ });
67
+
68
+ return config;
69
+ }
70
+
71
+ function countTasks(tasksPath) {
72
+ if (!fs.existsSync(tasksPath)) return { total: 0, byStatus: {} };
73
+
74
+ const tasks = fs.readdirSync(tasksPath).filter(f =>
75
+ f.startsWith('issue-') && fs.statSync(path.join(tasksPath, f)).isDirectory()
76
+ );
77
+
78
+ const byStatus = {};
79
+
80
+ tasks.forEach(task => {
81
+ const taskFile = path.join(tasksPath, task, 'task.yaml');
82
+ if (fs.existsSync(taskFile)) {
83
+ const content = fs.readFileSync(taskFile, 'utf-8');
84
+ const statusMatch = content.match(/status:\s*(\w+)/);
85
+ if (statusMatch) {
86
+ const status = statusMatch[1];
87
+ byStatus[status] = (byStatus[status] || 0) + 1;
88
+ }
89
+ }
90
+ });
91
+
92
+ return { total: tasks.length, byStatus };
93
+ }
94
+
95
+ function checkMemoryFiles(memoryPath) {
96
+ if (!fs.existsSync(memoryPath)) return {};
97
+
98
+ const roles = fs.readdirSync(memoryPath).filter(f =>
99
+ fs.statSync(path.join(memoryPath, f)).isDirectory()
100
+ );
101
+
102
+ const result = {};
103
+
104
+ roles.forEach(role => {
105
+ const rolePath = path.join(memoryPath, role);
106
+ const files = fs.readdirSync(rolePath).filter(f => f.endsWith('.md'));
107
+ result[role] = files.length;
108
+ });
109
+
110
+ return result;
111
+ }
112
+
113
+ async function run(options, positional) {
114
+ const projectPath = process.cwd();
115
+ const configPath = path.join(projectPath, 'amazingteam.config.yaml');
116
+ const workflowPath = path.join(projectPath, '.github', 'workflows', 'amazingteam.yml');
117
+ const localPath = path.join(projectPath, '.ai-team-local');
118
+
119
+ console.log('\nšŸ“Š AmazingTeam Status\n');
120
+
121
+ const config = parseConfig(configPath);
122
+
123
+ if (!config) {
124
+ console.log('āŒ AmazingTeam not initialized');
125
+ console.log(' Run "amazingteam init" to get started\n');
126
+ return;
127
+ }
128
+
129
+ // Project info
130
+ console.log('Project:');
131
+ console.log(` Name: ${config.project?.name || 'Unknown'}`);
132
+ console.log(` Language: ${config.project?.language || 'Unknown'}`);
133
+ console.log(` Framework: ${config.project?.framework || 'Unknown'}`);
134
+ if (config.project?.description) {
135
+ console.log(` Description: ${config.project.description}`);
136
+ }
137
+
138
+ // Version info
139
+ console.log('\nVersion:');
140
+ console.log(` CLI: ${VERSION}`);
141
+ console.log(` Config: ${config.ai_team?.version || 'Unknown'}`);
142
+
143
+ // Check workflow version
144
+ if (fs.existsSync(workflowPath)) {
145
+ const workflowContent = fs.readFileSync(workflowPath, 'utf-8');
146
+ const actionMatch = workflowContent.match(/amazingteam-action@v?(\d+\.\d+\.\d+)/);
147
+ if (actionMatch) {
148
+ console.log(` Workflow: ${actionMatch[1]}`);
149
+ }
150
+ }
151
+
152
+ // Local foundation status
153
+ console.log('\nLocal Foundation:');
154
+ if (fs.existsSync(localPath)) {
155
+ const localVersionPath = path.join(localPath, 'VERSION');
156
+ if (fs.existsSync(localVersionPath)) {
157
+ console.log(` Status: Downloaded (v${fs.readFileSync(localVersionPath, 'utf-8').trim()})`);
158
+ } else {
159
+ console.log(' Status: Downloaded');
160
+ }
161
+ console.log(` Path: ${LOCAL_DIR}/`);
162
+ } else {
163
+ console.log(' Status: Not downloaded');
164
+ console.log(' Run: amazingteam local');
165
+ }
166
+
167
+ // Memory status
168
+ console.log('\nMemory:');
169
+ const memoryPath = path.join(projectPath, '.ai-team', 'memory');
170
+ const memoryFiles = checkMemoryFiles(memoryPath);
171
+
172
+ if (Object.keys(memoryFiles).length > 0) {
173
+ Object.entries(memoryFiles).forEach(([role, count]) => {
174
+ console.log(` ${role}: ${count} file(s)`);
175
+ });
176
+ } else {
177
+ console.log(' No memory files');
178
+ }
179
+
180
+ // Tasks status
181
+ console.log('\nTasks:');
182
+ const tasksPath = path.join(projectPath, 'tasks');
183
+ const taskStats = countTasks(tasksPath);
184
+
185
+ console.log(` Total: ${taskStats.total}`);
186
+ if (Object.keys(taskStats.byStatus).length > 0) {
187
+ Object.entries(taskStats.byStatus).forEach(([status, count]) => {
188
+ console.log(` ${status}: ${count}`);
189
+ });
190
+ }
191
+
192
+ // Validation quick check
193
+ console.log('\nQuick Check:');
194
+ const issues = [];
195
+
196
+ if (!fs.existsSync(path.join(projectPath, 'opencode.jsonc'))) {
197
+ issues.push('opencode.jsonc not found');
198
+ }
199
+
200
+ if (!fs.existsSync(workflowPath)) {
201
+ issues.push('Workflow file not found');
202
+ }
203
+
204
+ if (!fs.existsSync(path.join(projectPath, '.gitignore'))) {
205
+ issues.push('.gitignore not found');
206
+ }
207
+
208
+ const gitignore = fs.readFileSync(path.join(projectPath, '.gitignore'), 'utf-8');
209
+ if (!gitignore.includes('.ai-team-local/')) {
210
+ issues.push('.ai-team-local/ not in .gitignore');
211
+ }
212
+
213
+ if (issues.length === 0) {
214
+ console.log(' āœ… All checks passed');
215
+ } else {
216
+ issues.forEach(issue => console.log(` āš ļø ${issue}`));
217
+ }
218
+
219
+ console.log('\n');
220
+ }
221
+
222
+ function help() {
223
+ return `
224
+ amazingteam status - Show AmazingTeam status
225
+
226
+ Usage:
227
+ amazingteam status
228
+
229
+ Displays:
230
+ - Project configuration
231
+ - Version information (CLI, config, workflow)
232
+ - Local foundation status
233
+ - Memory files by role
234
+ - Task statistics
235
+ - Quick validation check
236
+
237
+ Run "amazingteam validate" for detailed validation.
238
+ `;
239
+ }
240
+
241
+ module.exports = { run, help };