faf_score
Calculate AI-readiness score (0-100%) to assess organizational preparedness for artificial intelligence implementation, with optional detailed breakdown and improvement suggestions.
Instructions
Calculate AI-readiness score (0-100%)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| details | No | Include detailed breakdown and improvement suggestions |
Implementation Reference
- src/handlers/tools.ts:342-430 (handler)The implementation of the 'faf_score' tool, which calculates an AI-readiness score based on the presence of project files like FAF files, CLAUDE.md, README.md, and configuration files.
private async handleFafScore(args: any): Promise<CallToolResult> { try { const fs = await import('fs').then(m => m.promises); const path = await import('path'); // Get current working directory from engine adapter (smart detection) const cwd = this.engineAdapter.getWorkingDirectory(); // Score calculation components let score = 0; const details: string[] = []; // 1. Check for FAF file (40 points) - v1.2.0: project.faf, *.faf, or .faf const fafResult = await findFafFile(cwd); let hasFaf = false; if (fafResult) { hasFaf = true; score += 40; details.push(`✅ ${fafResult.filename} present (+40)`); } else { details.push('❌ FAF file missing (0/40)'); } // 2. Check for CLAUDE.md (30 points) const claudePath = path.join(cwd, 'CLAUDE.md'); let hasClaude = false; try { await fs.access(claudePath); hasClaude = true; score += 30; details.push('✅ CLAUDE.md present (+30)'); } catch { details.push('❌ CLAUDE.md missing (0/30)'); } // 3. Check for README.md (15 points) const readmePath = path.join(cwd, 'README.md'); let hasReadme = false; try { await fs.access(readmePath); hasReadme = true; score += 15; details.push('✅ README.md present (+15)'); } catch { details.push('⚠️ README.md missing (0/15)'); } // 4. Check for package.json or other project files (14 points) const projectFiles = ['package.json', 'pyproject.toml', 'Cargo.toml', 'go.mod', 'pom.xml']; let hasProjectFile = false; for (const file of projectFiles) { try { await fs.access(path.join(cwd, file)); hasProjectFile = true; score += 14; details.push(`✅ ${file} detected (+14)`); break; } catch { // Continue checking } } if (!hasProjectFile) { details.push('⚠️ No project file found (0/14)'); } // Format the output let output = ''; if (score >= 100) { // Perfect score - Trophy output = `🏎️ FAF SCORE: 100%\n🏆 Trophy\n🏁 Championship Complete!\n\n`; if (args?.details) { output += `${details.join('\n')}\n\n`; output += `🏆 PERFECT SCORE!\n`; output += `Both .faf and CLAUDE.md are championship-quality!\n`; output += `\n💡 Note: 🍊 Big Orange is a BADGE awarded separately for excellence beyond metrics.`; } } else { // Regular score - FAF standard tiers const percentage = Math.min(score, 100); let rating = ''; let emoji = ''; if (percentage >= 99) { rating = 'Gold'; emoji = '🥇'; } else if (percentage >= 95) { rating = 'Silver'; emoji = '🥈'; - src/handlers/tools.ts:43-45 (registration)The registration of the 'faf_score' tool in the tool handler class.
name: 'faf_score', description: 'Calculate AI-readiness score (0-100%)', inputSchema: {