faf-mcp 1.2.2 → 1.2.3

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.
package/README.md CHANGED
@@ -1,247 +1,189 @@
1
1
  <div style="display: flex; align-items: center; gap: 12px;">
2
2
  <img src="https://raw.githubusercontent.com/Wolfe-Jam/faf/main/assets/logos/orange-smiley.svg" alt="FAF" width="40" />
3
3
  <div>
4
- <h1 style="margin: 0; color: #FF8C00;">faf-mcp | use>faf</h1>
4
+ <h1 style="margin: 0; color: #FF8C00;">faf-mcp</h1>
5
5
  <p style="margin: 4px 0 0 0;"><strong>IANA-Registered Format for AI Context</strong> · <code>application/vnd.faf+yaml</code></p>
6
6
  </div>
7
7
  </div>
8
8
 
9
- > Universal MCP server for .FAF (Foundational AI-context Format) with 17 native tools + CLI fallback - Persistent project context for Cursor, Windsurf, Cline, VS Code, and all MCP-compatible platforms (including [Claude Desktop](https://github.com/Wolfe-Jam/claude-faf-mcp))
9
+ > **.FAF optimizes AI for your codebase.** At 100% (Gold Code), AI stops guessing and starts knowing. Universal MCP server for Cursor, Windsurf, Cline, VS Code, and all MCP-compatible platforms.
10
10
 
11
- **Universal version of [claude-faf-mcp](https://github.com/Wolfe-Jam/claude-faf-mcp)** — Anthropic-approved MCP server, now compatible with all platforms. Built on the IANA-registered .FAF format (`application/vnd.faf+yaml`).
11
+ **Universal version of [claude-faf-mcp](https://github.com/Wolfe-Jam/claude-faf-mcp)** — Anthropic-approved MCP server, now compatible with all platforms.
12
12
 
13
13
  [![NPM Downloads](https://img.shields.io/npm/dt/faf-mcp?label=total%20downloads&color=00CCFF)](https://www.npmjs.com/package/faf-mcp)
14
- [![Discord](https://img.shields.io/badge/Discord-Join%20Community-5865F2?logo=discord&logoColor=white)](https://discord.com/invite/56fPBUJKfk)
15
- [![Chrome Web Store](https://img.shields.io/badge/Chrome-Extension-4285F4?logo=googlechrome&logoColor=white)](https://chromewebstore.google.com/detail/lnecebepmpjpilldfmndnaofbfjkjlkm)
16
14
  [![Website](https://img.shields.io/badge/Website-faf.one-orange)](https://faf.one)
17
15
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
18
16
 
19
17
  ---
20
18
 
21
- ## Quick Start
22
-
23
- **1. Install:**
24
-
25
- ```bash
26
- npm install -g faf-mcp
27
- ```
28
-
29
- **2. Copy and paste this to your AI:**
30
-
31
- ```
32
- Install the FAF MCP server: npm install -g faf-mcp, then add this to my MCP config: {"mcpServers": {"faf": {"command": "npx", "args": ["-y", "faf-mcp"]}}} and restart.
33
- ```
34
-
35
- ### Platform-Specific Setup
19
+ ## The Problem: Context-Drift
36
20
 
37
- **Cursor IDE:** Add to `~/.cursor/mcp.json` ([setup guide](https://docs.cursor.com/context/model-context-protocol))
21
+ AI assistants forget. They misunderstand. They drift.
38
22
 
39
- **Windsurf Editor:** Add to `~/.codeium/windsurf/mcp_config.json` ([Cascade docs](https://docs.windsurf.com/windsurf/cascade/mcp))
23
+ Every new session, every new file, every new developer — AI starts guessing again. Your codebase context leaks away. Yesterday's perfect assistant becomes today's confused intern.
40
24
 
41
- **Cline:** Add to Cline's MCP settings
42
-
43
- **VS Code:** Install MCP extension, then add server config
44
-
45
- **Claude Desktop:** Use the [dedicated claude-faf-mcp package](https://github.com/Wolfe-Jam/claude-faf-mcp) for optimized Claude integration
25
+ **.FAF fixes this permanently.**
46
26
 
47
27
  ---
48
28
 
49
- ## 🏁 AI-Readiness Scorecard
50
-
51
- > **"README for the AI era"** — Google Gemini
52
-
53
- <div align="center">
54
- <img src="https://raw.githubusercontent.com/Wolfe-Jam/faf-mcp/main/assets/Project-faf-pckg-json-README.png" alt="project.faf file positioning" width="600" />
55
- <p><em><strong>project.faf is to AI context what package.json is to dependencies</strong></em></p>
56
- <p><em>Lives at the project root, between package.json and README.md</em></p>
57
- </div>
58
-
59
- **The closer you get to 100% the better AI can assist you.**
60
-
61
- At 55% you are building your project with half a blueprint and basically flipping a coin with AI. .FAF defines, and AI becomes optimized for Context with the project.faf file.
29
+ ## The Solution: Gold Code
62
30
 
63
31
  ```
64
32
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
65
- 🏎️ FAF AI-READINESS SCORE: 100/100 — PODIUM EDITION
33
+ 🏆 FAF AI-READINESS SCORE: 100/100 — GOLD CODE
66
34
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
67
35
 
68
- 📊 CORE INTELLIGENCE 🎯 CONTEXT DELIVERY
69
- ├─ Project DNA [██████] 100% ├─ MCP Protocol [██████] 100%
70
- ├─ Architecture Map [██████] 100% ├─ 17 Native Tools [██████] 100%
71
- ├─ Domain Model [██████] 100% ├─ IANA Format [██████] 100%
72
- └─ Version Tracking [██████] 100% └─ Universal Context [██████] 100%
36
+ At 100%, AI is optimized. No more guessing.
37
+ Peak AI performance activated.
73
38
 
74
- 🚀 PERFORMANCE ⚡ STANDALONE OPERATION
75
- ├─ 16.2x CLI Speedup [██████] 100% ├─ Zero Dependencies [██████] 100%
76
- ├─ 19ms Avg Execution [██████] 100% ├─ Bundled Engine [██████] 100%
77
- ├─ 17/17 Tools Active [██████] 100% ├─ Direct Function [██████] 100%
78
- └─ Zero Memory Leaks [██████] 100% └─ 14 Bundled Cmds [██████] 100%
39
+ ├─ Project DNA locked in ├─ Zero context-drift
40
+ ├─ Architecture understood ├─ Eternal bi-sync active
41
+ ├─ Domain model captured ├─ Team alignment permanent
42
+ └─ Every session starts smart └─ AI works WITH you, not around you
79
43
 
80
- 🏆 project.faf score: podium
81
44
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
82
45
  ```
83
46
 
84
47
  ---
85
48
 
86
- ## 🎯 Want a Platform-Specific Package?
49
+ ## 💎 Lifecycle Value
50
+
51
+ Setup savings get you started. Lifecycle optimization keeps you ahead.
87
52
 
88
- We're launching `faf-mcp` as the universal package. If you'd prefer a dedicated package for your platform (like `cursor-faf-mcp` or `windsurf-faf-mcp` with tailored setup instructions), **[request it here](https://github.com/Wolfe-Jam/faf-mcp/issues)**.
53
+ | When | Without FAF | With FAF |
54
+ |------|-------------|----------|
55
+ | **Day 1** | 20 min setup per dev | 0 min — instant context |
56
+ | **Month 1** | AI forgets between sessions | AI remembers everything |
57
+ | **Year 1** | New devs re-explain everything | New devs inherit full context |
58
+ | **Year 3+** | Institutional knowledge lost | Project DNA preserved forever |
89
59
 
90
- We'll publish platform-specific packages based on demand.
60
+ **Setup savings: 20 minutes. Lifecycle savings: Infinite.**
91
61
 
92
62
  ---
93
63
 
94
- ## 💬 use>faf | Prompt Pattern
64
+ ## Quick Start
95
65
 
96
- **Start every prompt with "Use FAF"** to invoke MCP tools directly:
66
+ **1. Install:**
97
67
 
98
- ### All Platforms
99
- ```
100
- Use FAF to initialize my project
101
- Use FAF to sync my project.faf to all platforms
102
- Use FAF to score my AI-readiness
103
- Use FAF to enhance my project context
104
- Use FAF to create platform sync files
68
+ ```bash
69
+ npm install -g faf-mcp
105
70
  ```
106
71
 
107
- ### Why "Use FAF" Works Everywhere
108
-
109
- **Claude Desktop:**
110
- - ✅ Calls MCP tool instead of searching web
111
- - ✅ No void container issues
112
- - ✅ Direct tool invocation
113
-
114
- **Claude.ai (Web):**
115
- - ✅ Stops web search addiction immediately
116
- - ✅ Forces MCP tool usage
117
- - ✅ No more guessing
118
-
119
- **Cursor / Windsurf / Cline:**
120
- - ✅ MCP standard compliance
121
- - ✅ Tool invocation (not manual file creation)
122
- - ✅ Consistent behavior
72
+ **2. Add to your MCP config:**
123
73
 
124
- ### The Pattern
74
+ ```json
75
+ {"mcpServers": {"faf": {"command": "npx", "args": ["-y", "faf-mcp"]}}}
76
+ ```
125
77
 
126
- **Without "Use FAF":**
127
- - ❌ AI searches the web
128
- - ❌ AI creates files manually
129
- - ❌ Void containers
130
- - ❌ Inconsistent results
78
+ ### Platform-Specific Setup
131
79
 
132
- **With "Use FAF":**
133
- - ✅ MCP tool called correctly
134
- - Championship output
135
- - Every time
80
+ | Platform | Config File |
81
+ |----------|-------------|
82
+ | **Cursor** | `~/.cursor/mcp.json` |
83
+ | **Windsurf** | `~/.codeium/windsurf/mcp_config.json` |
84
+ | **Cline** | Cline MCP settings |
85
+ | **VS Code** | MCP extension config |
86
+ | **Claude Desktop** | Use [claude-faf-mcp](https://github.com/Wolfe-Jam/claude-faf-mcp) |
136
87
 
137
88
  ---
138
89
 
139
- ## 🎯 What is FAF?
90
+ ## 🔄 Eternal Bi-Sync
140
91
 
141
- **The .FAF Position in the MCP Ecosystem:**
92
+ The magic: `.faf` ↔ `CLAUDE.md` stay synchronized in milliseconds.
142
93
 
143
94
  ```
144
- Platform Context Protocol
145
- ──────── ─────── ────────
146
- Any IDE → IANA Format → Open Protocol
147
- Cursor → .faf → MCP
148
- Windsurf → .faf → MCP
149
- Cline → .faf → MCP
150
- VS Code → .faf → MCP
151
- Claude → .faf → MCP
152
- Gemini → .faf → MCP
95
+ project.faf ←──── 8ms ────→ CLAUDE.md
96
+ │ │
97
+ └── Single source of truth ──┘
153
98
  ```
154
99
 
155
- **.FAF is the foundational, universal base layer** for any platform using the Model Context Protocol. It provides the standardized Context that makes MCP work for everyone.
100
+ - Update either file both stay aligned
101
+ - Zero manual maintenance
102
+ - Works across teams, branches, sessions
103
+ - **Context never goes stale**
156
104
 
157
105
  ---
158
106
 
159
- ## 🛠️ Core Features
160
-
161
- ### 17 Native MCP Tools
162
- - **faf_init** - Initialize project.faf with auto-detection
163
- - **faf_score** - AI-readiness scoring engine
164
- - **faf_enhance** - Intelligent enhancement with auto-detection
165
- - **faf_read** - Parse and validate FAF files
166
- - **faf_write** - Create/update FAF with validation
167
- - **faf_sync** - Synchronize context across platforms
168
- - **faf_bi_sync** - Bi-directional CLAUDE.md sync
169
-
170
- ### CLI Fallback (40+ commands)
171
- - **faf readme** - Smart 6 Ws extraction from README.md
172
- - **faf human-add** - Non-interactive human context entry
173
- - **faf git** - GitHub repo extraction (Git CLI, no rate limits)
174
- - Plus all other faf-cli commands
175
-
176
- ### IANA-Registered Standard
177
- - Official MIME type: `application/vnd.faf+yaml`
178
- - W3C-compliant structured format
179
- - Universal AI context protocol
180
- - Cross-platform compatibility
181
-
182
- ### Championship Performance
183
- - **16.2x faster** than CLI versions (direct function calls vs process spawning)
184
- - **19ms average** execution across all bundled commands
185
- - **Fastest: 1ms** (formats command)
186
- - **Zero memory leaks** with F1-grade engineering
187
-
188
- ---
107
+ ## Tier System: From Blind to Optimized
189
108
 
190
- ## 📚 Documentation
109
+ | Tier | Score | Status |
110
+ |------|-------|--------|
111
+ | 🏆 **Trophy** | 100% | **AI Optimized** — Gold Code |
112
+ | 🥇 **Gold** | 99%+ | Near-perfect context |
113
+ | 🥈 **Silver** | 95%+ | Excellent |
114
+ | 🥉 **Bronze** | 85%+ | Production ready |
115
+ | 🟢 **Green** | 70%+ | Solid foundation |
116
+ | 🟡 **Yellow** | 55%+ | AI flipping coins |
117
+ | 🔴 **Red** | <55% | AI working blind |
118
+ | 🤍 **White** | 0% | No context at all |
191
119
 
192
- - **[Full Documentation](https://wolfe-jam.github.io/claude-faf-mcp/)** - Complete guide
193
- - **[Getting Started](https://github.com/Wolfe-Jam/claude-faf-mcp/blob/main/docs/getting-started.md)** - Installation & setup
194
- - **[MCP Tools Reference](https://github.com/Wolfe-Jam/claude-faf-mcp/blob/main/docs/mcp-tools.md)** - All 17 native tools
195
- - **[FAQ](https://github.com/Wolfe-Jam/claude-faf-mcp/blob/main/docs/FAQ.md)** - Common questions
196
- - **[CHANGELOG](./CHANGELOG.md)** - Version history
120
+ **At 55%, AI is guessing half the time.** At 100%, AI is optimized.
197
121
 
198
122
  ---
199
123
 
200
- ## 🏆 Why FAF?
124
+ ## 💬 use>faf | Prompt Pattern
125
+
126
+ **Start every prompt with "Use FAF"** to invoke MCP tools:
201
127
 
202
- ### Championship Credentials
128
+ ```
129
+ Use FAF to initialize my project
130
+ Use FAF to score my AI-readiness
131
+ Use FAF to sync my context
132
+ Use FAF to enhance my project
133
+ ```
203
134
 
204
- **🏅 Creators of the Format** - We designed .FAF (IANA-registered `application/vnd.faf+yaml`)
205
- **🏅 First & Only** - Persistent Project Context MCP Server approved by Anthropic
206
- **🏅 Creators of Context-Mirroring** - faf_bi_sync creates native files for all platforms
207
- **🏅 Google Chrome-Approved** - Published Chrome Extension
208
- **🏅 15K+ npm Downloads** - Proven adoption across the FAF ecosystem
135
+ Works on all platforms stops web search, forces tool usage.
209
136
 
210
- > "README for the AI era" — Google Gemini
137
+ ---
211
138
 
212
- ### The FAF Advantage
139
+ ## 🛠️ 17 Native MCP Tools
213
140
 
214
- **Persistent Context** - Your project's DNA lives in `project.faf`, readable by any AI or human
141
+ | Tool | Purpose |
142
+ |------|---------|
143
+ | `faf_init` | Initialize project.faf |
144
+ | `faf_score` | Check AI-readiness (0-100%) |
145
+ | `faf_sync` | Sync context across platforms |
146
+ | `faf_bi_sync` | Bi-directional .faf ↔ CLAUDE.md |
147
+ | `faf_enhance` | Intelligent enhancement |
148
+ | `faf_read` | Parse and validate FAF files |
149
+ | `faf_write` | Create/update FAF with validation |
215
150
 
216
- **Universal Format** - IANA-registered standard works across Claude, Gemini, Cursor, Windsurf, any MCP platform
151
+ Plus CLI fallback with 40+ commands.
217
152
 
218
- **Zero Setup Tax** - One file (`project.faf`) eliminates AI context setup across your entire team
153
+ ---
219
154
 
220
- **FREE FOREVER** - MIT License, open source, no subscription
155
+ ## 🎯 The .FAF Position
221
156
 
222
- **All Boats Rise Together** - Improving projects, AI performance, code quality, speed to market for everyone
157
+ ```
158
+ Platform Context Protocol
159
+ ──────── ─────── ────────
160
+ Cursor → .faf → MCP
161
+ Windsurf → .faf → MCP
162
+ Cline → .faf → MCP
163
+ VS Code → .faf → MCP
164
+ Claude → .faf → MCP
165
+ Any IDE → .faf → MCP
166
+ ```
223
167
 
224
- **Championship Engineering** - F1-inspired performance with strict TypeScript, zero runtime errors
168
+ **.FAF is the foundational layer.** Universal context format. IANA-registered. Works everywhere.
225
169
 
226
170
  ---
227
171
 
228
172
  ## 📦 Ecosystem
229
173
 
230
- - **[FAF Format Spec](https://github.com/Wolfe-Jam/faf)** - Official IANA specification
231
- - **[FAF CLI](https://github.com/Wolfe-Jam/faf-cli)** - Command-line tooling
232
- - **[claude-faf-mcp](https://github.com/Wolfe-Jam/claude-faf-mcp)** - Claude Desktop-specific package
233
- - **[Chrome Extension](https://chromewebstore.google.com/detail/lnecebepmpjpilldfmndnaofbfjkjlkm)** - Browser integration
234
- - **[faf.one](https://faf.one)** - Official website and documentation
235
- - **[Discord Community](https://discord.com/invite/56fPBUJKfk)** - Join the discussion
174
+ - **[claude-faf-mcp](https://npmjs.com/package/claude-faf-mcp)** Claude Desktop (52 tools)
175
+ - **[faf-cli](https://npmjs.com/package/faf-cli)** Terminal CLI (18k+ downloads)
176
+ - **[faf-wasm](https://www.npmjs.com/package/faf-wasm)** WASM SDK (<5ms scoring)
177
+ - **[faf.one](https://faf.one)** Official website
236
178
 
237
179
  ---
238
180
 
239
181
  ## 📄 License
240
182
 
241
- MIT License - Free and open source
183
+ MIT License Free and open source
242
184
 
243
185
  ---
244
186
 
245
- **Built with F1-inspired engineering principles** 🏎️⚡
187
+ **Zero drift. Eternal sync. AI optimized.** 🏆
246
188
 
247
189
  *"It's so logical if it didn't exist, AI would have built it itself" — Claude*
@@ -0,0 +1 @@
1
+ {"note":"Placeholder for Vercel build"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * FAF Compiler Engine MK3
3
+ * Championship-grade project type detection and scoring
4
+ */
5
+ export * from './type-detector';
6
+ export * from './slot-validator';
7
+ export * from './scorer';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /**
3
+ * FAF Compiler Engine MK3
4
+ * Championship-grade project type detection and scoring
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ __exportStar(require("./type-detector"), exports);
22
+ __exportStar(require("./slot-validator"), exports);
23
+ __exportStar(require("./scorer"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/compiler/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;AAEH,kDAAgC;AAChC,mDAAiC;AACjC,2CAAyB"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Compiler Engine Scorer - FAF Compiler Engine MK3
3
+ * Championship-grade scoring with context-aware metrics
4
+ */
5
+ export interface ScoringResult {
6
+ score: number;
7
+ medal: 'trophy' | 'gold' | 'silver' | 'bronze' | 'red' | 'white';
8
+ emoji: string;
9
+ message: string;
10
+ breakdown: {
11
+ totalSlots: 21;
12
+ relevantSlots: number;
13
+ filledSlots: number;
14
+ ignoredSlots: number;
15
+ };
16
+ nextMilestone: {
17
+ targetScore: number;
18
+ medal: string;
19
+ emoji: string;
20
+ slotsNeeded: number;
21
+ message: string;
22
+ } | null;
23
+ }
24
+ export declare class CompilerEngineScorer {
25
+ /**
26
+ * Calculate score with slotignore support
27
+ */
28
+ calculateScore(filledSlots: number, relevantSlots: number, slotignore: string[]): ScoringResult;
29
+ /**
30
+ * Determine medal from score
31
+ */
32
+ private getMedal;
33
+ /**
34
+ * Get medal emoji
35
+ */
36
+ private getMedalEmoji;
37
+ /**
38
+ * Generate contextual message
39
+ */
40
+ private getMessage;
41
+ /**
42
+ * Calculate next milestone
43
+ */
44
+ private getNextMilestone;
45
+ /**
46
+ * Format scoring result as human-readable text
47
+ */
48
+ formatResult(result: ScoringResult, projectType?: string): string;
49
+ /**
50
+ * Generate actionable suggestions based on score
51
+ */
52
+ generateSuggestions(score: number, _medal: string, _missingSlots: string[]): string[];
53
+ }
@@ -0,0 +1,189 @@
1
+ "use strict";
2
+ /**
3
+ * Compiler Engine Scorer - FAF Compiler Engine MK3
4
+ * Championship-grade scoring with context-aware metrics
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.CompilerEngineScorer = void 0;
8
+ class CompilerEngineScorer {
9
+ /**
10
+ * Calculate score with slotignore support
11
+ */
12
+ calculateScore(filledSlots, relevantSlots, slotignore) {
13
+ // Calculate score: (filled / relevant) * 100
14
+ const score = Math.round((filledSlots / relevantSlots) * 100);
15
+ // Determine medal
16
+ const medal = this.getMedal(score);
17
+ const emoji = this.getMedalEmoji(medal);
18
+ // Generate message
19
+ const message = this.getMessage(score, filledSlots, relevantSlots, medal);
20
+ // Calculate next milestone
21
+ const nextMilestone = this.getNextMilestone(score, filledSlots, relevantSlots);
22
+ return {
23
+ score,
24
+ medal,
25
+ emoji,
26
+ message,
27
+ breakdown: {
28
+ totalSlots: 21,
29
+ relevantSlots,
30
+ filledSlots,
31
+ ignoredSlots: slotignore.length,
32
+ },
33
+ nextMilestone,
34
+ };
35
+ }
36
+ /**
37
+ * Determine medal from score
38
+ */
39
+ getMedal(score) {
40
+ if (score >= 85)
41
+ return 'trophy'; // Championship grade
42
+ if (score >= 70)
43
+ return 'gold'; // Podium grade
44
+ if (score >= 55)
45
+ return 'silver'; // Strong
46
+ if (score >= 40)
47
+ return 'bronze'; // Decent
48
+ if (score >= 20)
49
+ return 'red'; // Needs work
50
+ return 'white'; // Just started
51
+ }
52
+ /**
53
+ * Get medal emoji
54
+ */
55
+ getMedalEmoji(medal) {
56
+ switch (medal) {
57
+ case 'trophy': return '🏆';
58
+ case 'gold': return '🥇';
59
+ case 'silver': return '🥈';
60
+ case 'bronze': return '🥉';
61
+ case 'red': return '🔴';
62
+ case 'white': return '🤍';
63
+ default: return '⚪';
64
+ }
65
+ }
66
+ /**
67
+ * Generate contextual message
68
+ */
69
+ getMessage(score, filled, relevant, medal) {
70
+ if (score === 100) {
71
+ return `Perfect ${medal === 'trophy' ? 'Championship' : 'Project'} DNA! All ${filled}/${relevant} relevant slots filled.`;
72
+ }
73
+ if (score >= 85) {
74
+ return `Championship grade! ${filled}/${relevant} slots filled. Podium performance!`;
75
+ }
76
+ if (score >= 70) {
77
+ return `Podium grade! ${filled}/${relevant} slots filled. Strong AI context.`;
78
+ }
79
+ if (score >= 55) {
80
+ return `Solid foundation. ${filled}/${relevant} slots filled. Keep going!`;
81
+ }
82
+ if (score >= 40) {
83
+ return `Decent start. ${filled}/${relevant} slots filled. Room for improvement.`;
84
+ }
85
+ if (score >= 20) {
86
+ return `Getting started. ${filled}/${relevant} slots filled. Focus on core context.`;
87
+ }
88
+ return `Just beginning. ${filled}/${relevant} slots filled. Add project basics first.`;
89
+ }
90
+ /**
91
+ * Calculate next milestone
92
+ */
93
+ getNextMilestone(score, filled, relevant) {
94
+ // Already at 100%
95
+ if (score === 100) {
96
+ return null;
97
+ }
98
+ // Define milestones
99
+ const milestones = [
100
+ { threshold: 85, name: 'trophy', emoji: '🏆', label: 'Championship Grade' },
101
+ { threshold: 70, name: 'gold', emoji: '🥇', label: 'Podium Grade' },
102
+ { threshold: 55, name: 'silver', emoji: '🥈', label: 'Solid Foundation' },
103
+ { threshold: 40, name: 'bronze', emoji: '🥉', label: 'Decent Start' },
104
+ { threshold: 20, name: 'red', emoji: '🔴', label: 'Getting Started' },
105
+ ];
106
+ // Find next milestone
107
+ const nextMilestone = milestones.find(m => score < m.threshold);
108
+ if (!nextMilestone) {
109
+ // Already above all milestones, aim for 100%
110
+ const slotsNeeded = relevant - filled;
111
+ return {
112
+ targetScore: 100,
113
+ medal: 'trophy',
114
+ emoji: '🏆',
115
+ slotsNeeded,
116
+ message: `Fill ${slotsNeeded} more slot${slotsNeeded === 1 ? '' : 's'} to reach 100% (Perfect!)`,
117
+ };
118
+ }
119
+ // Calculate slots needed
120
+ const targetFilled = Math.ceil((nextMilestone.threshold / 100) * relevant);
121
+ const slotsNeeded = Math.max(1, targetFilled - filled);
122
+ return {
123
+ targetScore: nextMilestone.threshold,
124
+ medal: nextMilestone.name,
125
+ emoji: nextMilestone.emoji,
126
+ slotsNeeded,
127
+ message: `Fill ${slotsNeeded} more slot${slotsNeeded === 1 ? '' : 's'} to reach ${nextMilestone.threshold}% (${nextMilestone.label})`,
128
+ };
129
+ }
130
+ /**
131
+ * Format scoring result as human-readable text
132
+ */
133
+ formatResult(result, projectType) {
134
+ const lines = [];
135
+ // Header
136
+ lines.push(`${result.emoji} Score: ${result.score}%`);
137
+ lines.push('');
138
+ // Message
139
+ lines.push(result.message);
140
+ lines.push('');
141
+ // Breakdown
142
+ lines.push('Breakdown:');
143
+ lines.push(` Total Slots: ${result.breakdown.totalSlots}`);
144
+ if (projectType) {
145
+ lines.push(` Project Type: ${projectType}`);
146
+ }
147
+ lines.push(` Relevant Slots: ${result.breakdown.relevantSlots}`);
148
+ lines.push(` Filled Slots: ${result.breakdown.filledSlots}`);
149
+ if (result.breakdown.ignoredSlots > 0) {
150
+ lines.push(` Ignored Slots: ${result.breakdown.ignoredSlots} (not applicable to this project type)`);
151
+ }
152
+ // Next milestone
153
+ if (result.nextMilestone) {
154
+ lines.push('');
155
+ lines.push('Next Milestone:');
156
+ lines.push(` ${result.nextMilestone.emoji} ${result.nextMilestone.message}`);
157
+ }
158
+ return lines.join('\n');
159
+ }
160
+ /**
161
+ * Generate actionable suggestions based on score
162
+ */
163
+ generateSuggestions(score, _medal, _missingSlots) {
164
+ const suggestions = [];
165
+ if (score < 40) {
166
+ suggestions.push('Start with core slots: project_identity, language, human_context');
167
+ suggestions.push('Add basic documentation: README.md, CLAUDE.md');
168
+ }
169
+ if (score >= 40 && score < 70) {
170
+ suggestions.push('Fill in your tech stack details (frontend, backend, database)');
171
+ suggestions.push('Add build and deployment information');
172
+ }
173
+ if (score >= 70 && score < 85) {
174
+ suggestions.push('Complete architecture details (auth, storage, caching)');
175
+ suggestions.push('Add team workflow and CI/CD information');
176
+ }
177
+ if (score >= 85 && score < 100) {
178
+ suggestions.push('Polish remaining slots for championship grade');
179
+ suggestions.push('Ensure all documentation is up to date');
180
+ }
181
+ if (score === 100) {
182
+ suggestions.push('Perfect! Consider sharing your .faf with the community');
183
+ suggestions.push('Keep it updated as your project evolves');
184
+ }
185
+ return suggestions;
186
+ }
187
+ }
188
+ exports.CompilerEngineScorer = CompilerEngineScorer;
189
+ //# sourceMappingURL=scorer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scorer.js","sourceRoot":"","sources":["../../../src/compiler/scorer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAsBH,MAAa,oBAAoB;IAC/B;;OAEG;IACH,cAAc,CACZ,WAAmB,EACnB,aAAqB,EACrB,UAAoB;QAEpB,6CAA6C;QAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,GAAG,aAAa,CAAC,GAAG,GAAG,CAAC,CAAC;QAE9D,kBAAkB;QAClB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAExC,mBAAmB;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;QAE1E,2BAA2B;QAC3B,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,aAAa,CA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