faf-cli 4.2.2 → 4.3.1

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 (81) hide show
  1. package/README.md +266 -90
  2. package/assets/project-faf-screenshot.png +0 -0
  3. package/dist/cli.d.ts.map +1 -1
  4. package/dist/cli.js +40 -22
  5. package/dist/cli.js.map +1 -1
  6. package/dist/commands/git.d.ts.map +1 -1
  7. package/dist/commands/git.js +9 -7
  8. package/dist/commands/git.js.map +1 -1
  9. package/dist/commands/readme.d.ts +11 -6
  10. package/dist/commands/readme.d.ts.map +1 -1
  11. package/dist/commands/readme.js +167 -120
  12. package/dist/commands/readme.js.map +1 -1
  13. package/dist/commands/show.d.ts.map +1 -1
  14. package/dist/commands/show.js +22 -7
  15. package/dist/commands/show.js.map +1 -1
  16. package/dist/commands/sixws.d.ts +6 -0
  17. package/dist/commands/sixws.d.ts.map +1 -0
  18. package/dist/commands/sixws.js +154 -0
  19. package/dist/commands/sixws.js.map +1 -0
  20. package/dist/github/current-score-calculator.d.ts +15 -0
  21. package/dist/github/current-score-calculator.d.ts.map +1 -0
  22. package/dist/github/current-score-calculator.js +125 -0
  23. package/dist/github/current-score-calculator.js.map +1 -0
  24. package/dist/github/faf-git-generator.d.ts +58 -0
  25. package/dist/github/faf-git-generator.d.ts.map +1 -0
  26. package/dist/github/faf-git-generator.js +557 -0
  27. package/dist/github/faf-git-generator.js.map +1 -0
  28. package/dist/github/github-extractor.d.ts +4 -0
  29. package/dist/github/github-extractor.d.ts.map +1 -1
  30. package/dist/github/github-extractor.js +27 -0
  31. package/dist/github/github-extractor.js.map +1 -1
  32. package/dist/github/repo-selector.d.ts +2 -2
  33. package/dist/github/repo-selector.d.ts.map +1 -1
  34. package/dist/github/repo-selector.js +30 -23
  35. package/dist/github/repo-selector.js.map +1 -1
  36. package/dist/utils/file-utils.d.ts.map +1 -1
  37. package/dist/utils/file-utils.js +1 -4
  38. package/dist/utils/file-utils.js.map +1 -1
  39. package/dist/utils/slot-counter.d.ts +56 -0
  40. package/dist/utils/slot-counter.d.ts.map +1 -0
  41. package/dist/utils/slot-counter.js +100 -0
  42. package/dist/utils/slot-counter.js.map +1 -0
  43. package/dist/utils/yaml-generator.d.ts.map +1 -1
  44. package/dist/utils/yaml-generator.js +3 -7
  45. package/dist/utils/yaml-generator.js.map +1 -1
  46. package/package.json +7 -2
  47. package/project.faf +5 -9
  48. package/scripts/ANTHROPIC-DEMO.sh +203 -0
  49. package/scripts/boris-ready.sh +169 -0
  50. package/scripts/bundle-yaml.js +87 -0
  51. package/scripts/check-version.js +88 -0
  52. package/scripts/clean-build.js +34 -0
  53. package/scripts/cleanup-unused.sh +54 -0
  54. package/scripts/debug-django.txt +9 -0
  55. package/scripts/debug-mongo.txt +9 -0
  56. package/scripts/debug-react.txt +9 -0
  57. package/scripts/debug-rust.txt +9 -0
  58. package/scripts/debug-whisper.cpp.txt +9 -0
  59. package/scripts/evaluate-family-member.ts +300 -0
  60. package/scripts/generate-docs.ts +358 -0
  61. package/scripts/generate-drift-reports.sh +111 -0
  62. package/scripts/industry-showcase.json +122 -0
  63. package/scripts/mcp-ecosystem-research.sh +58 -0
  64. package/scripts/migrate-yaml-imports.sh +55 -0
  65. package/scripts/migrate-yaml.ts +132 -0
  66. package/scripts/performance-validation.ts +460 -0
  67. package/scripts/postinstall.js +30 -0
  68. package/scripts/prepare-release.ts +421 -0
  69. package/scripts/run-industry-showcase.ts +237 -0
  70. package/scripts/run-test-showcase.ts +244 -0
  71. package/scripts/setup-github-watch.sh +43 -0
  72. package/scripts/sync-version.js +35 -0
  73. package/scripts/test-integration-detection.ts +93 -0
  74. package/scripts/test-integration-simple.js +93 -0
  75. package/scripts/test-medal-progression.sh +143 -0
  76. package/scripts/test-showcase-results.json +109 -0
  77. package/scripts/test-showcase.json +32 -0
  78. package/scripts/update-version.js +148 -0
  79. package/scripts/verify-build.js +343 -0
  80. package/scripts/version-check.js +78 -0
  81. package/scripts/watch-discussions.sh +86 -0
@@ -0,0 +1,132 @@
1
+ #!/usr/bin/env ts-node
2
+ /**
3
+ * 🔥 ROCK SOLID YAML FIX - Automated Migration
4
+ * FIX ONCE, DONE FOREVER
5
+ *
6
+ * This script migrates ALL yaml imports to use fix-once/yaml
7
+ */
8
+
9
+ import * as fs from 'fs';
10
+ import * as path from 'path';
11
+
12
+ const SRC_DIR = path.join(__dirname, '../src');
13
+
14
+ function getAllTypeScriptFiles(dir: string): string[] {
15
+ const files: string[] = [];
16
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
17
+
18
+ for (const entry of entries) {
19
+ const fullPath = path.join(dir, entry.name);
20
+ if (entry.isDirectory()) {
21
+ files.push(...getAllTypeScriptFiles(fullPath));
22
+ } else if (entry.isFile() && entry.name.endsWith('.ts')) {
23
+ files.push(fullPath);
24
+ }
25
+ }
26
+
27
+ return files;
28
+ }
29
+
30
+ interface MigrationResult {
31
+ file: string;
32
+ changed: boolean;
33
+ errors: string[];
34
+ }
35
+
36
+ function getRelativeImportPath(filePath: string): string {
37
+ // Get relative path from file to src/fix-once/yaml
38
+ const fileDir = path.dirname(filePath);
39
+ const targetPath = path.join(SRC_DIR, 'fix-once', 'yaml');
40
+ const relativePath = path.relative(fileDir, targetPath);
41
+
42
+ // Convert to Unix-style path for imports
43
+ return relativePath.replace(/\\/g, '/').replace(/\.ts$/, '');
44
+ }
45
+
46
+ function migrateFile(filePath: string): MigrationResult {
47
+ const result: MigrationResult = {
48
+ file: filePath,
49
+ changed: false,
50
+ errors: []
51
+ };
52
+
53
+ // Skip the fix-once/yaml.ts file itself
54
+ if (filePath.includes('fix-once/yaml.ts')) {
55
+ return result;
56
+ }
57
+
58
+ let content = fs.readFileSync(filePath, 'utf-8');
59
+ const originalContent = content;
60
+
61
+ // Calculate correct relative path
62
+ const relativePath = getRelativeImportPath(filePath);
63
+
64
+ // Pattern 1: import * as YAML from 'yaml'
65
+ content = content.replace(
66
+ /import \* as YAML from ['"]yaml['"]/g,
67
+ `import { parse as parseYAML, stringify as stringifyYAML } from '${relativePath}'`
68
+ );
69
+
70
+ // Pattern 2: import * as yaml from 'yaml'
71
+ content = content.replace(
72
+ /import \* as yaml from ['"]yaml['"]/g,
73
+ `import { parse as parseYAML, stringify as stringifyYAML } from '${relativePath}'`
74
+ );
75
+
76
+ // Pattern 3: import yaml from 'yaml'
77
+ content = content.replace(
78
+ /import yaml from ['"]yaml['"]/g,
79
+ `import { parse as parseYAML, stringify as stringifyYAML } from '${relativePath}'`
80
+ );
81
+
82
+ // Pattern 4: import { parse, stringify } from 'yaml'
83
+ content = content.replace(
84
+ /import { parse, stringify } from ['"]yaml['"]/g,
85
+ `import { parse as parseYAML, stringify as stringifyYAML } from '${relativePath}'`
86
+ );
87
+
88
+ // Replace usage patterns (basic - may need manual fixes)
89
+ content = content.replace(/YAML\.parse\(/g, 'parseYAML(');
90
+ content = content.replace(/yaml\.parse\(/g, 'parseYAML(');
91
+ content = content.replace(/YAML\.stringify\(/g, 'stringifyYAML(');
92
+ content = content.replace(/yaml\.stringify\(/g, 'stringifyYAML(');
93
+
94
+ if (content !== originalContent) {
95
+ fs.writeFileSync(filePath, content);
96
+ result.changed = true;
97
+ }
98
+
99
+ return result;
100
+ }
101
+
102
+ // Find all TypeScript files
103
+ const files = getAllTypeScriptFiles(SRC_DIR);
104
+
105
+ console.log('🔥 ROCK SOLID YAML MIGRATION');
106
+ console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
107
+ console.log(`Found ${files.length} TypeScript files`);
108
+ console.log('');
109
+
110
+ const results: MigrationResult[] = [];
111
+ let changedCount = 0;
112
+
113
+ for (const file of files) {
114
+ const result = migrateFile(file);
115
+ if (result.changed) {
116
+ console.log(`✅ ${file.replace(SRC_DIR, 'src')}`);
117
+ changedCount++;
118
+ }
119
+ results.push(result);
120
+ }
121
+
122
+ console.log('');
123
+ console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
124
+ console.log(`✅ Migration complete: ${changedCount} files updated`);
125
+ console.log('');
126
+ console.log('⚠️ NEXT STEPS (Manual):');
127
+ console.log(' 1. Search for parseYAML( calls');
128
+ console.log(' 2. Add { filepath: <path> } option where appropriate');
129
+ console.log(' 3. Example: parseYAML(content, { filepath: fafPath })');
130
+ console.log(' 4. Run: npm test to verify');
131
+ console.log('');
132
+ console.log('🏎️ YAML IS NOW ROCK SOLID - FIX ONCE, DONE FOREVER');
@@ -0,0 +1,460 @@
1
+ #!/usr/bin/env ts-node
2
+
3
+ /**
4
+ * ⚡ F1-Inspired Performance Validation Suite
5
+ * Validates championship performance claims in real-world environments
6
+ */
7
+
8
+ import * as fs from 'fs/promises';
9
+ import * as path from 'path';
10
+ import * as os from 'os';
11
+ import { execSync } from 'child_process';
12
+ import { performance } from 'perf_hooks';
13
+ import { FAF_COLORS, FAF_ICONS, PERFORMANCE_STANDARDS } from '../src/utils/championship-style';
14
+
15
+ interface PerformanceTest {
16
+ name: string;
17
+ description: string;
18
+ target: number; // ms
19
+ command: string;
20
+ args: string[];
21
+ iterations: number;
22
+ warmup?: boolean;
23
+ }
24
+
25
+ interface PerformanceResult {
26
+ test: string;
27
+ results: number[]; // Array of execution times in ms
28
+ average: number;
29
+ median: number;
30
+ min: number;
31
+ max: number;
32
+ standardDeviation: number;
33
+ target: number;
34
+ passed: boolean;
35
+ percentile95: number;
36
+ }
37
+
38
+ interface SystemInfo {
39
+ platform: string;
40
+ arch: string;
41
+ nodeVersion: string;
42
+ cpuModel: string;
43
+ cpuCores: number;
44
+ totalMemory: number;
45
+ freeMemory: number;
46
+ loadAverage: number[];
47
+ }
48
+
49
+ /**
50
+ * F1-Inspired Performance Test Suite
51
+ */
52
+ const PERFORMANCE_TESTS: PerformanceTest[] = [
53
+ {
54
+ name: 'status_command',
55
+ description: 'faf status - Git status equivalent speed',
56
+ target: PERFORMANCE_STANDARDS.status_command, // 38ms
57
+ command: 'faf',
58
+ args: ['status'],
59
+ iterations: 50,
60
+ warmup: true
61
+ },
62
+ {
63
+ name: 'trust_dashboard',
64
+ description: 'faf trust - Real-time trust calculation',
65
+ target: PERFORMANCE_STANDARDS.trust_dashboard, // 40ms
66
+ command: 'faf',
67
+ args: ['trust'],
68
+ iterations: 30,
69
+ warmup: true
70
+ },
71
+ {
72
+ name: 'help_command',
73
+ description: 'faf --help - Instant help display',
74
+ target: 50, // ms
75
+ command: 'faf',
76
+ args: ['--help'],
77
+ iterations: 20
78
+ },
79
+ {
80
+ name: 'index_command',
81
+ description: 'faf index - Universal A-Z reference',
82
+ target: 100, // ms
83
+ command: 'faf',
84
+ args: ['index'],
85
+ iterations: 20
86
+ },
87
+ {
88
+ name: 'score_basic',
89
+ description: 'faf score - Quick score check',
90
+ target: 150, // ms
91
+ command: 'faf',
92
+ args: ['score'],
93
+ iterations: 20,
94
+ warmup: true
95
+ },
96
+ {
97
+ name: 'analytics_summary',
98
+ description: 'faf analytics --summary - Performance metrics',
99
+ target: 100, // ms
100
+ command: 'faf',
101
+ args: ['analytics', '--summary'],
102
+ iterations: 15
103
+ }
104
+ ];
105
+
106
+ /**
107
+ * Main performance validation function
108
+ */
109
+ async function runPerformanceValidation(): Promise<void> {
110
+ console.log(`${FAF_COLORS.fafCyan('⚡ F1-Inspired Performance Validation')}`);
111
+ console.log(`${FAF_COLORS.fafCyan('├─')} Championship engineering demands measurable speed`);
112
+ console.log(`${FAF_COLORS.fafCyan('└─')} Validating real-world performance claims`);
113
+ console.log();
114
+
115
+ // Gather system information
116
+ const systemInfo = await getSystemInfo();
117
+ displaySystemInfo(systemInfo);
118
+
119
+ // Setup test environment
120
+ await setupTestEnvironment();
121
+
122
+ // Run performance tests
123
+ const results: PerformanceResult[] = [];
124
+
125
+ for (const test of PERFORMANCE_TESTS) {
126
+ console.log(`${FAF_COLORS.fafCyan('🏎️')} Running: ${test.description}`);
127
+
128
+ try {
129
+ const result = await runPerformanceTest(test);
130
+ results.push(result);
131
+
132
+ const status = result.passed ?
133
+ `${FAF_COLORS.fafGreen('✅ PASS')} (${result.average.toFixed(1)}ms)` :
134
+ `${FAF_COLORS.fafOrange('⚠️ SLOW')} (${result.average.toFixed(1)}ms vs ${result.target}ms target)`;
135
+
136
+ console.log(`${FAF_COLORS.fafCyan(' ')}${status}`);
137
+
138
+ } catch (error) {
139
+ console.log(`${FAF_COLORS.fafOrange(' ❌ ERROR:')} ${error}`);
140
+
141
+ // Create failed result
142
+ results.push({
143
+ test: test.name,
144
+ results: [],
145
+ average: 0,
146
+ median: 0,
147
+ min: 0,
148
+ max: 0,
149
+ standardDeviation: 0,
150
+ target: test.target,
151
+ passed: false,
152
+ percentile95: 0
153
+ });
154
+ }
155
+
156
+ console.log();
157
+ }
158
+
159
+ // Generate comprehensive report
160
+ await generatePerformanceReport(results, systemInfo);
161
+
162
+ // Show championship summary
163
+ showChampionshipSummary(results);
164
+ }
165
+
166
+ /**
167
+ * Get detailed system information
168
+ */
169
+ async function getSystemInfo(): Promise<SystemInfo> {
170
+ const cpus = os.cpus();
171
+
172
+ return {
173
+ platform: `${os.platform()}-${os.arch()}`,
174
+ arch: os.arch(),
175
+ nodeVersion: process.version,
176
+ cpuModel: cpus[0]?.model || 'Unknown',
177
+ cpuCores: cpus.length,
178
+ totalMemory: Math.round(os.totalmem() / 1024 / 1024), // MB
179
+ freeMemory: Math.round(os.freemem() / 1024 / 1024), // MB
180
+ loadAverage: os.loadavg()
181
+ };
182
+ }
183
+
184
+ /**
185
+ * Display system information
186
+ */
187
+ function displaySystemInfo(info: SystemInfo): void {
188
+ console.log(`${FAF_COLORS.fafCyan('🖥️ System Information:')}`);
189
+ console.log(`${FAF_COLORS.fafCyan('├─')} Platform: ${info.platform}`);
190
+ console.log(`${FAF_COLORS.fafCyan('├─')} Node.js: ${info.nodeVersion}`);
191
+ console.log(`${FAF_COLORS.fafCyan('├─')} CPU: ${info.cpuModel} (${info.cpuCores} cores)`);
192
+ console.log(`${FAF_COLORS.fafCyan('├─')} Memory: ${info.freeMemory}MB / ${info.totalMemory}MB available`);
193
+ console.log(`${FAF_COLORS.fafCyan('└─')} Load: ${info.loadAverage.map(l => l.toFixed(2)).join(', ')}`);
194
+ console.log();
195
+ }
196
+
197
+ /**
198
+ * Setup test environment
199
+ */
200
+ async function setupTestEnvironment(): Promise<void> {
201
+ console.log(`${FAF_COLORS.fafCyan('🔧 Setting up test environment...')}`);
202
+
203
+ // Create temporary test directory
204
+ const testDir = path.join(os.tmpdir(), 'faf-performance-test');
205
+ await fs.mkdir(testDir, { recursive: true });
206
+
207
+ // Create minimal .faf file for tests
208
+ const testFafContent = `
209
+ project:
210
+ name: "Performance Test Project"
211
+ description: "Minimal project for performance testing"
212
+
213
+ stack:
214
+ primary_language: "typescript"
215
+ framework: "node"
216
+
217
+ context_quality:
218
+ slots_filled: 5
219
+
220
+ ai_score: 75
221
+ `.trim();
222
+
223
+ await fs.writeFile(path.join(testDir, '.faf'), testFafContent);
224
+
225
+ // Change to test directory
226
+ process.chdir(testDir);
227
+
228
+ console.log(`${FAF_COLORS.fafGreen('✅')} Test environment ready: ${testDir}`);
229
+ console.log();
230
+ }
231
+
232
+ /**
233
+ * Run a single performance test
234
+ */
235
+ async function runPerformanceTest(test: PerformanceTest): Promise<PerformanceResult> {
236
+ const results: number[] = [];
237
+
238
+ // Warmup iterations
239
+ if (test.warmup) {
240
+ for (let i = 0; i < 3; i++) {
241
+ try {
242
+ await executeCommand(test.command, test.args, 5000); // 5s timeout for warmup
243
+ } catch {
244
+ // Ignore warmup failures
245
+ }
246
+ }
247
+ }
248
+
249
+ // Main test iterations
250
+ for (let i = 0; i < test.iterations; i++) {
251
+ try {
252
+ const startTime = performance.now();
253
+ await executeCommand(test.command, test.args, 10000); // 10s timeout
254
+ const endTime = performance.now();
255
+
256
+ const duration = endTime - startTime;
257
+ results.push(duration);
258
+
259
+ } catch (error) {
260
+ // For failed executions, record a very high time
261
+ results.push(10000); // 10 seconds = failure
262
+ }
263
+ }
264
+
265
+ if (results.length === 0) {
266
+ throw new Error('No successful test iterations');
267
+ }
268
+
269
+ // Calculate statistics
270
+ const sorted = results.sort((a, b) => a - b);
271
+ const average = results.reduce((sum, val) => sum + val, 0) / results.length;
272
+ const median = sorted[Math.floor(sorted.length / 2)];
273
+ const min = sorted[0];
274
+ const max = sorted[sorted.length - 1];
275
+ const percentile95 = sorted[Math.floor(sorted.length * 0.95)];
276
+
277
+ // Calculate standard deviation
278
+ const variance = results.reduce((sum, val) => sum + Math.pow(val - average, 2), 0) / results.length;
279
+ const standardDeviation = Math.sqrt(variance);
280
+
281
+ return {
282
+ test: test.name,
283
+ results,
284
+ average,
285
+ median,
286
+ min,
287
+ max,
288
+ standardDeviation,
289
+ target: test.target,
290
+ passed: average <= test.target,
291
+ percentile95
292
+ };
293
+ }
294
+
295
+ /**
296
+ * Execute a command with timeout
297
+ */
298
+ async function executeCommand(command: string, args: string[], timeoutMs: number): Promise<void> {
299
+ return new Promise((resolve, reject) => {
300
+ const child = execSync(`${command} ${args.join(' ')}`, {
301
+ stdio: 'pipe',
302
+ timeout: timeoutMs
303
+ });
304
+ resolve();
305
+ });
306
+ }
307
+
308
+ /**
309
+ * Generate comprehensive performance report
310
+ */
311
+ async function generatePerformanceReport(results: PerformanceResult[], systemInfo: SystemInfo): Promise<void> {
312
+ const reportPath = path.join(process.cwd(), 'performance-report.json');
313
+
314
+ const report = {
315
+ timestamp: new Date().toISOString(),
316
+ systemInfo,
317
+ summary: {
318
+ totalTests: results.length,
319
+ passed: results.filter(r => r.passed).length,
320
+ failed: results.filter(r => !r.passed).length,
321
+ overallScore: (results.filter(r => r.passed).length / results.length) * 100
322
+ },
323
+ results: results.map(result => ({
324
+ ...result,
325
+ results: undefined // Remove raw data from summary
326
+ })),
327
+ rawData: results // Keep detailed data
328
+ };
329
+
330
+ await fs.writeFile(reportPath, JSON.stringify(report, null, 2));
331
+ console.log(`${FAF_COLORS.fafGreen('📊')} Performance report saved: ${reportPath}`);
332
+ }
333
+
334
+ /**
335
+ * Show championship summary
336
+ */
337
+ function showChampionshipSummary(results: PerformanceResult[]): void {
338
+ const passed = results.filter(r => r.passed).length;
339
+ const total = results.length;
340
+ const score = (passed / total) * 100;
341
+
342
+ console.log(`${FAF_COLORS.fafCyan('🏁 Championship Performance Summary:')}`);
343
+ console.log();
344
+
345
+ // Overall score
346
+ const scoreColor = score >= 90 ? FAF_COLORS.fafGreen :
347
+ score >= 70 ? FAF_COLORS.fafOrange : FAF_COLORS.fafOrange;
348
+
349
+ console.log(`${FAF_COLORS.fafCyan('├─')} Overall Score: ${scoreColor(score.toFixed(1))}% (${passed}/${total} tests passed)`);
350
+
351
+ // Individual test summary
352
+ console.log(`${FAF_COLORS.fafCyan('├─')} Test Results:`);
353
+ results.forEach((result, index) => {
354
+ const connector = index === results.length - 1 ? '└─' : '├─';
355
+ const status = result.passed ?
356
+ `${FAF_ICONS.trophy} ${result.average.toFixed(1)}ms` :
357
+ `${FAF_ICONS.shield} ${result.average.toFixed(1)}ms (target: ${result.target}ms)`;
358
+
359
+ console.log(`${FAF_COLORS.fafCyan(`│ ${connector}`)} ${result.test}: ${status}`);
360
+ });
361
+
362
+ console.log();
363
+
364
+ // Championship verdict
365
+ if (score >= 90) {
366
+ console.log(`${FAF_COLORS.fafGreen('🏆 CHAMPIONSHIP PERFORMANCE ACHIEVED!')}`);
367
+ console.log(`${FAF_COLORS.fafGreen('⚡ F1-inspired engineering delivers on promises!')}`);
368
+ } else if (score >= 70) {
369
+ console.log(`${FAF_COLORS.fafOrange('🥈 SOLID PERFORMANCE - Minor optimizations needed')}`);
370
+ console.log(`${FAF_COLORS.fafOrange('🔧 Some commands could use championship tuning')}`);
371
+ } else {
372
+ console.log(`${FAF_COLORS.fafOrange('🔧 PERFORMANCE TUNING REQUIRED')}`);
373
+ console.log(`${FAF_COLORS.fafOrange('⚡ Time to unleash the F1 engineering spirit!')}`);
374
+ }
375
+
376
+ console.log();
377
+ console.log(`${FAF_COLORS.fafCyan('📈 Performance Standards:')}`);
378
+ console.log(`${FAF_COLORS.fafCyan('├─')} Status command: <38ms (faster than git status)`);
379
+ console.log(`${FAF_COLORS.fafCyan('├─')} Trust dashboard: <40ms (real-time calculation)`);
380
+ console.log(`${FAF_COLORS.fafCyan('├─')} Help/Index: <100ms (instant reference)`);
381
+ console.log(`${FAF_COLORS.fafCyan('└─')} Score calculation: <150ms (comprehensive analysis)`);
382
+ }
383
+
384
+ /**
385
+ * CLI for running specific tests
386
+ */
387
+ function parseArgs(): { testNames?: string[], verbose?: boolean } {
388
+ const args = process.argv.slice(2);
389
+ const options: { testNames?: string[], verbose?: boolean } = {};
390
+
391
+ for (let i = 0; i < args.length; i++) {
392
+ const arg = args[i];
393
+
394
+ switch (arg) {
395
+ case '--tests':
396
+ options.testNames = args[++i].split(',');
397
+ break;
398
+ case '--verbose':
399
+ options.verbose = true;
400
+ break;
401
+ case '--help':
402
+ showHelp();
403
+ process.exit(0);
404
+ break;
405
+ }
406
+ }
407
+
408
+ return options;
409
+ }
410
+
411
+ /**
412
+ * Show help
413
+ */
414
+ function showHelp(): void {
415
+ console.log(`
416
+ ⚡ FAF CLI Performance Validation Suite
417
+
418
+ Usage: npm run performance [options]
419
+
420
+ Options:
421
+ --tests <names> Run specific tests (comma-separated)
422
+ --verbose Show detailed execution logs
423
+ --help Show this help
424
+
425
+ Examples:
426
+ npm run performance # Run all tests
427
+ npm run performance -- --tests status,trust # Run specific tests
428
+ npm run performance -- --verbose # Detailed output
429
+
430
+ Available Tests:
431
+ ${PERFORMANCE_TESTS.map(t => ` - ${t.name}: ${t.description} (target: ${t.target}ms)`).join('\n')}
432
+
433
+ 🏎️ F1-inspired engineering - Every millisecond matters!
434
+ `);
435
+ }
436
+
437
+ // Run if called directly
438
+ if (require.main === module) {
439
+ const options = parseArgs();
440
+
441
+ // Filter tests if specific ones requested
442
+ if (options.testNames) {
443
+ const filteredTests = PERFORMANCE_TESTS.filter(t =>
444
+ options.testNames!.includes(t.name)
445
+ );
446
+
447
+ if (filteredTests.length === 0) {
448
+ console.error('No matching tests found');
449
+ process.exit(1);
450
+ }
451
+
452
+ // Replace global test array
453
+ PERFORMANCE_TESTS.length = 0;
454
+ PERFORMANCE_TESTS.push(...filteredTests);
455
+ }
456
+
457
+ runPerformanceValidation().catch(console.error);
458
+ }
459
+
460
+ export { runPerformanceValidation, PERFORMANCE_TESTS };
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Post-install message: Confirm successful installation
5
+ *
6
+ * Shows clear success message with version and getting started commands.
7
+ *
8
+ * Writes directly to /dev/tty to bypass npm output suppression.
9
+ */
10
+
11
+ const packageJson = require('../package.json');
12
+ const fs = require('fs');
13
+
14
+ const message = `
15
+ \x1b[32m✓\x1b[0m faf-cli@${packageJson.version} installed successfully
16
+
17
+ Getting started:
18
+ faf init # Initialize .faf in your project
19
+ faf score # Check AI-readiness (0-100%)
20
+
21
+ Docs: https://faf.one
22
+ `;
23
+
24
+ try {
25
+ // Write directly to terminal, bypassing npm's output suppression
26
+ fs.writeSync(fs.openSync('/dev/tty', 'w'), message);
27
+ } catch (e) {
28
+ // Fallback to stderr if /dev/tty not available (Windows, etc.)
29
+ console.error(message);
30
+ }