agileflow 3.4.0 → 3.4.2

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 (115) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +4 -4
  3. package/package.json +1 -1
  4. package/scripts/agileflow-welcome.js +79 -0
  5. package/scripts/claude-tmux.sh +12 -36
  6. package/scripts/lib/ac-test-matcher.js +452 -0
  7. package/scripts/lib/audit-registry.js +94 -2
  8. package/scripts/lib/configure-features.js +35 -0
  9. package/scripts/lib/model-profiles.js +25 -5
  10. package/scripts/lib/quality-gates.js +163 -0
  11. package/scripts/lib/signal-detectors.js +43 -0
  12. package/scripts/lib/status-writer.js +255 -0
  13. package/scripts/lib/story-claiming.js +128 -45
  14. package/scripts/lib/task-sync.js +32 -38
  15. package/scripts/lib/tmux-audit-monitor.js +611 -0
  16. package/scripts/lib/tmux-group-colors.js +2 -2
  17. package/scripts/lib/tool-registry.yaml +241 -0
  18. package/scripts/lib/tool-shed.js +441 -0
  19. package/scripts/native-team-observer.js +219 -0
  20. package/scripts/obtain-context.js +14 -0
  21. package/scripts/ralph-loop.js +30 -5
  22. package/scripts/smart-detect.js +21 -0
  23. package/scripts/spawn-audit-sessions.js +373 -45
  24. package/scripts/team-manager.js +19 -0
  25. package/src/core/agents/a11y-analyzer-aria.md +155 -0
  26. package/src/core/agents/a11y-analyzer-forms.md +162 -0
  27. package/src/core/agents/a11y-analyzer-keyboard.md +175 -0
  28. package/src/core/agents/a11y-analyzer-semantic.md +153 -0
  29. package/src/core/agents/a11y-analyzer-visual.md +158 -0
  30. package/src/core/agents/a11y-consensus.md +248 -0
  31. package/src/core/agents/ads-consensus.md +74 -0
  32. package/src/core/agents/ads-generate.md +145 -0
  33. package/src/core/agents/ads-performance-tracker.md +197 -0
  34. package/src/core/agents/api-quality-analyzer-conventions.md +148 -0
  35. package/src/core/agents/api-quality-analyzer-docs.md +176 -0
  36. package/src/core/agents/api-quality-analyzer-errors.md +183 -0
  37. package/src/core/agents/api-quality-analyzer-pagination.md +171 -0
  38. package/src/core/agents/api-quality-analyzer-versioning.md +143 -0
  39. package/src/core/agents/api-quality-consensus.md +214 -0
  40. package/src/core/agents/arch-analyzer-circular.md +148 -0
  41. package/src/core/agents/arch-analyzer-complexity.md +171 -0
  42. package/src/core/agents/arch-analyzer-coupling.md +146 -0
  43. package/src/core/agents/arch-analyzer-layering.md +151 -0
  44. package/src/core/agents/arch-analyzer-patterns.md +162 -0
  45. package/src/core/agents/arch-consensus.md +227 -0
  46. package/src/core/commands/adr.md +1 -0
  47. package/src/core/commands/ads/audit.md +67 -5
  48. package/src/core/commands/ads/generate.md +238 -0
  49. package/src/core/commands/ads/health.md +327 -0
  50. package/src/core/commands/ads/test-plan.md +317 -0
  51. package/src/core/commands/ads/track.md +288 -0
  52. package/src/core/commands/ads.md +28 -16
  53. package/src/core/commands/assign.md +1 -0
  54. package/src/core/commands/audit.md +43 -6
  55. package/src/core/commands/babysit.md +90 -6
  56. package/src/core/commands/baseline.md +1 -0
  57. package/src/core/commands/blockers.md +1 -0
  58. package/src/core/commands/board.md +1 -0
  59. package/src/core/commands/changelog.md +1 -0
  60. package/src/core/commands/choose.md +1 -0
  61. package/src/core/commands/ci.md +1 -0
  62. package/src/core/commands/code/accessibility.md +347 -0
  63. package/src/core/commands/code/api.md +297 -0
  64. package/src/core/commands/code/architecture.md +297 -0
  65. package/src/core/commands/code/completeness.md +43 -6
  66. package/src/core/commands/code/legal.md +43 -6
  67. package/src/core/commands/code/logic.md +43 -6
  68. package/src/core/commands/code/performance.md +43 -6
  69. package/src/core/commands/code/security.md +43 -6
  70. package/src/core/commands/code/test.md +43 -6
  71. package/src/core/commands/configure.md +1 -0
  72. package/src/core/commands/council.md +1 -0
  73. package/src/core/commands/deploy.md +1 -0
  74. package/src/core/commands/diagnose.md +1 -0
  75. package/src/core/commands/docs.md +1 -0
  76. package/src/core/commands/epic/edit.md +213 -0
  77. package/src/core/commands/epic.md +1 -0
  78. package/src/core/commands/export.md +238 -0
  79. package/src/core/commands/help.md +16 -1
  80. package/src/core/commands/ideate/discover.md +7 -3
  81. package/src/core/commands/ideate/features.md +65 -4
  82. package/src/core/commands/ideate/new.md +158 -124
  83. package/src/core/commands/impact.md +1 -0
  84. package/src/core/commands/learn/explain.md +118 -0
  85. package/src/core/commands/learn/glossary.md +135 -0
  86. package/src/core/commands/learn/patterns.md +138 -0
  87. package/src/core/commands/learn/tour.md +126 -0
  88. package/src/core/commands/migrate/codemods.md +151 -0
  89. package/src/core/commands/migrate/plan.md +131 -0
  90. package/src/core/commands/migrate/scan.md +114 -0
  91. package/src/core/commands/migrate/validate.md +119 -0
  92. package/src/core/commands/multi-expert.md +1 -0
  93. package/src/core/commands/pr.md +1 -0
  94. package/src/core/commands/review.md +1 -0
  95. package/src/core/commands/seo/audit.md +61 -6
  96. package/src/core/commands/sprint.md +1 -0
  97. package/src/core/commands/status/undo.md +191 -0
  98. package/src/core/commands/status.md +1 -0
  99. package/src/core/commands/story/edit.md +204 -0
  100. package/src/core/commands/story/view.md +29 -7
  101. package/src/core/commands/story-validate.md +1 -0
  102. package/src/core/commands/story.md +1 -0
  103. package/src/core/commands/tdd.md +1 -0
  104. package/src/core/commands/team/start.md +10 -6
  105. package/src/core/commands/tests.md +1 -0
  106. package/src/core/commands/verify.md +27 -1
  107. package/src/core/commands/workflow.md +2 -0
  108. package/src/core/teams/backend.json +41 -0
  109. package/src/core/teams/frontend.json +41 -0
  110. package/src/core/teams/qa.json +41 -0
  111. package/src/core/teams/solo.json +35 -0
  112. package/src/core/templates/agileflow-metadata.json +5 -0
  113. package/tools/cli/commands/setup.js +85 -3
  114. package/tools/cli/commands/update.js +42 -0
  115. package/tools/cli/installers/ide/claude-code.js +68 -0
@@ -89,7 +89,14 @@ module.exports = {
89
89
  config = await promptInstall();
90
90
  }
91
91
 
92
- displaySection('Setting Up AgileFlow', `Target: ${config.directory}`);
92
+ const totalSteps = 5;
93
+ let currentStep = 0;
94
+ const step = label => {
95
+ currentStep++;
96
+ return `[${currentStep}/${totalSteps}] ${label}`;
97
+ };
98
+
99
+ displaySection(step('Installing Core Content'), `Target: ${config.directory}`);
93
100
 
94
101
  // Run core installation
95
102
  const coreResult = await installer.install(config);
@@ -104,17 +111,81 @@ module.exports = {
104
111
  success(`Installed ${coreResult.counts.skills} skills`);
105
112
 
106
113
  // Setup IDE configurations
107
- displaySection('Configuring IDEs');
114
+ displaySection(step('Configuring IDEs'));
108
115
 
109
116
  ideManager.setAgileflowFolder(config.agileflowFolder);
110
117
  ideManager.setDocsFolder(config.docsFolder);
111
118
 
119
+ // Check for existing IDE configs before overwriting
120
+ if (!options.yes) {
121
+ const existingConfigs = [];
122
+ const ideConfigDirs = {
123
+ 'claude-code': '.claude',
124
+ cursor: '.cursor',
125
+ windsurf: '.windsurf',
126
+ };
127
+
128
+ for (const ide of config.ides) {
129
+ const configDir = ideConfigDirs[ide];
130
+ if (configDir) {
131
+ const fullPath = path.join(config.directory, configDir);
132
+ if (fs.existsSync(fullPath)) {
133
+ existingConfigs.push({ ide, dir: configDir });
134
+ }
135
+ }
136
+ }
137
+
138
+ if (existingConfigs.length > 0) {
139
+ const { confirmOverwrite } = require('inquirer');
140
+ const configList = existingConfigs.map(c => ` ${c.dir}/`).join('\n');
141
+ console.log(chalk.yellow(`\n Existing IDE configs detected:\n${configList}\n`));
142
+ console.log(
143
+ chalk.dim(
144
+ ' AgileFlow will add commands and hooks to these directories.\n' +
145
+ ' Existing settings will be merged (not replaced).\n'
146
+ )
147
+ );
148
+
149
+ let proceed = true;
150
+ try {
151
+ const inquirer = require('inquirer');
152
+ const answer = await inquirer.prompt([
153
+ {
154
+ type: 'confirm',
155
+ name: 'proceed',
156
+ message: 'Continue with IDE configuration?',
157
+ default: true,
158
+ },
159
+ ]);
160
+ proceed = answer.proceed;
161
+ } catch {
162
+ // If inquirer not available or stdin not interactive, proceed
163
+ proceed = true;
164
+ }
165
+
166
+ if (!proceed) {
167
+ info('Skipping IDE configuration. Core installation is complete.');
168
+ console.log(chalk.dim(' Run setup again to configure IDEs later.\n'));
169
+ // Skip to docs structure
170
+ displaySection('Creating Documentation Structure', `Folder: ${config.docsFolder}/`);
171
+ const docsResult = await createDocsStructure(config.directory, config.docsFolder, {
172
+ updateGitignore: config.updateGitignore,
173
+ });
174
+ if (!docsResult.success) {
175
+ error('Failed to create docs structure');
176
+ }
177
+ console.log(chalk.green('\n✨ Setup complete (without IDE configs)!\n'));
178
+ return;
179
+ }
180
+ }
181
+ }
182
+
112
183
  for (const ide of config.ides) {
113
184
  await ideManager.setup(ide, config.directory, coreResult.path);
114
185
  }
115
186
 
116
187
  // Create docs structure
117
- displaySection('Creating Documentation Structure', `Folder: ${config.docsFolder}/`);
188
+ displaySection(step('Creating Documentation Structure'), `Folder: ${config.docsFolder}/`);
118
189
  const docsResult = await createDocsStructure(config.directory, config.docsFolder, {
119
190
  updateGitignore: config.updateGitignore,
120
191
  });
@@ -127,6 +198,7 @@ module.exports = {
127
198
  }
128
199
 
129
200
  // Update metadata with config tracking
201
+ displaySection(step('Updating Configuration'));
130
202
  try {
131
203
  const metadataPath = path.join(
132
204
  config.directory,
@@ -149,6 +221,16 @@ module.exports = {
149
221
  }
150
222
 
151
223
  // Final summary
224
+ displaySection(step('Verifying Installation'));
225
+ const { counts } = coreResult;
226
+ const totalItems = (counts.commands || 0) + (counts.agents || 0) + (counts.skills || 0);
227
+ console.log(
228
+ chalk.green(
229
+ ` Setup complete: ${counts.commands} commands, ${counts.agents} agents, ${counts.skills} skills installed`
230
+ )
231
+ );
232
+ console.log(chalk.dim(` IDEs configured: ${config.ides.join(', ')}`));
233
+
152
234
  console.log(chalk.green('\n✨ Setup complete!\n'));
153
235
 
154
236
  console.log(chalk.bold('Get started:'));
@@ -230,6 +230,48 @@ module.exports = {
230
230
 
231
231
  console.log(chalk.green(`\n✨ Update complete! (${status.version} → ${latestVersion})\n`));
232
232
 
233
+ // Show changelog diff between old and new version
234
+ try {
235
+ const fs = require('node:fs');
236
+ const changelogPath = path.join(status.path, 'CHANGELOG.md');
237
+ if (fs.existsSync(changelogPath)) {
238
+ const changelog = fs.readFileSync(changelogPath, 'utf8');
239
+ const oldVer = status.version.replace(/^v/, '');
240
+ const newVer = latestVersion.replace(/^v/, '');
241
+
242
+ // Extract sections between old and new version headers
243
+ const versionPattern = /^##\s+\[?\d+\.\d+\.\d+\]?/m;
244
+ const lines = changelog.split('\n');
245
+ const relevantLines = [];
246
+ let capturing = false;
247
+
248
+ for (const line of lines) {
249
+ if (versionPattern.test(line)) {
250
+ if (line.includes(oldVer)) {
251
+ break; // Stop at old version
252
+ }
253
+ capturing = true;
254
+ }
255
+ if (capturing) {
256
+ relevantLines.push(line);
257
+ }
258
+ }
259
+
260
+ if (relevantLines.length > 0) {
261
+ const maxLines = 20;
262
+ const display = relevantLines.slice(0, maxLines);
263
+ console.log(chalk.hex('#e8683a').bold(` What's New in v${newVer}:\n`));
264
+ display.forEach(l => console.log(chalk.dim(` ${l}`)));
265
+ if (relevantLines.length > maxLines) {
266
+ console.log(chalk.dim(` ... and ${relevantLines.length - maxLines} more lines`));
267
+ }
268
+ console.log(chalk.dim(`\n Run /agileflow:whats-new for full changelog\n`));
269
+ }
270
+ }
271
+ } catch {
272
+ // Changelog display is non-critical
273
+ }
274
+
233
275
  // If running from outdated global installation, remind user to update it
234
276
  if (
235
277
  npmLatestVersion &&
@@ -64,6 +64,9 @@ class ClaudeCodeSetup extends BaseIdeSetup {
64
64
  // Claude Code specific: Setup SessionStart hooks (welcome, archive, context-loader)
65
65
  await this.setupSessionStartHooks(projectDir, agileflowDir, ideDir, options);
66
66
 
67
+ // Claude Code specific: Setup PostToolUse hooks (native team observer)
68
+ await this.setupPostToolUseHooks(projectDir, agileflowDir, ideDir, options);
69
+
67
70
  return result;
68
71
  }
69
72
 
@@ -297,6 +300,71 @@ class ClaudeCodeSetup extends BaseIdeSetup {
297
300
  );
298
301
  }
299
302
 
303
+ /**
304
+ * Setup PostToolUse hooks for native Agent Teams observability.
305
+ * Registers native-team-observer.js for TeamCreate, SendMessage, ListTeams.
306
+ * @param {string} projectDir - Project directory
307
+ * @param {string} agileflowDir - AgileFlow installation directory
308
+ * @param {string} claudeDir - .claude directory path
309
+ * @param {Object} options - Setup options
310
+ */
311
+ async setupPostToolUseHooks(projectDir, agileflowDir, claudeDir, options = {}) {
312
+ const settingsPath = path.join(claudeDir, 'settings.json');
313
+ let settings = {};
314
+
315
+ if (fs.existsSync(settingsPath)) {
316
+ try {
317
+ settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
318
+ } catch (e) {
319
+ settings = {};
320
+ }
321
+ }
322
+
323
+ if (!settings.hooks) settings.hooks = {};
324
+ if (!settings.hooks.PostToolUse) settings.hooks.PostToolUse = [];
325
+
326
+ const observerCommand = 'node $CLAUDE_PROJECT_DIR/.agileflow/scripts/native-team-observer.js';
327
+
328
+ const postToolUseHooks = [
329
+ {
330
+ matcher: 'TeamCreate',
331
+ hooks: [{ type: 'command', command: observerCommand, timeout: 5000 }],
332
+ },
333
+ {
334
+ matcher: 'SendMessage',
335
+ hooks: [{ type: 'command', command: observerCommand, timeout: 5000 }],
336
+ },
337
+ {
338
+ matcher: 'ListTeams',
339
+ hooks: [{ type: 'command', command: observerCommand, timeout: 5000 }],
340
+ },
341
+ ];
342
+
343
+ // Merge with existing hooks (don't duplicate)
344
+ for (const newHook of postToolUseHooks) {
345
+ const existingIdx = settings.hooks.PostToolUse.findIndex(h => h.matcher === newHook.matcher);
346
+ if (existingIdx === -1) {
347
+ settings.hooks.PostToolUse.push(newHook);
348
+ } else {
349
+ const existing = settings.hooks.PostToolUse[existingIdx];
350
+ if (!existing.hooks) existing.hooks = [];
351
+ const hasObserver = existing.hooks.some(
352
+ h => h.type === 'command' && h.command && h.command.includes('native-team-observer')
353
+ );
354
+ if (!hasObserver) {
355
+ existing.hooks.push(newHook.hooks[0]);
356
+ }
357
+ }
358
+ }
359
+
360
+ await fs.writeFile(settingsPath, JSON.stringify(settings, null, 2));
361
+ console.log(
362
+ chalk.dim(
363
+ ` - PostToolUse hooks: native team observer (TeamCreate, SendMessage, ListTeams)`
364
+ )
365
+ );
366
+ }
367
+
300
368
  /**
301
369
  * Remove AgileFlow command duplicates from user-level ~/.claude/commands/
302
370
  * When the same command exists in both ~/.claude/commands/ and