claude-faf-mcp 3.2.0 → 3.2.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.
- package/CLAUDE.md +64 -0
- package/README.md +82 -8
- package/assets/Project-faf-pckg-json-README.png +0 -0
- package/assets/icons/faf-icon-256.png +0 -0
- package/assets/icons/faf-icon-512.png +0 -0
- package/assets/icons/orange-smiley.svg +6 -0
- package/dist/src/compiler/index.d.ts +7 -0
- package/dist/src/compiler/index.js +24 -0
- package/dist/src/compiler/index.js.map +1 -0
- package/dist/src/compiler/scorer.d.ts +53 -0
- package/dist/src/compiler/scorer.js +189 -0
- package/dist/src/compiler/scorer.js.map +1 -0
- package/dist/src/compiler/slot-validator.d.ts +32 -0
- package/dist/src/compiler/slot-validator.js +293 -0
- package/dist/src/compiler/slot-validator.js.map +1 -0
- package/dist/src/compiler/type-detector.d.ts +62 -0
- package/dist/src/compiler/type-detector.js +388 -0
- package/dist/src/compiler/type-detector.js.map +1 -0
- package/dist/src/handlers/championship-tools.d.ts +1 -0
- package/dist/src/handlers/championship-tools.js +169 -10
- package/dist/src/handlers/championship-tools.js.map +1 -1
- package/dist/src/handlers/engine-adapter.d.ts +8 -0
- package/dist/src/handlers/engine-adapter.js +54 -18
- package/dist/src/handlers/engine-adapter.js.map +1 -1
- package/dist/src/handlers/tool-types.d.ts +2 -1
- package/dist/src/handlers/tools.d.ts +2 -0
- package/dist/src/handlers/tools.js +316 -41
- package/dist/src/handlers/tools.js.map +1 -1
- package/dist/src/index.js +0 -0
- package/dist/src/server.js +2 -2
- package/dist/src/server.js.map +1 -1
- package/dist/src/types/project-types.d.ts +22 -0
- package/dist/src/types/project-types.js +85 -0
- package/dist/src/types/project-types.js.map +1 -0
- package/dist/src/types/slots.d.ts +39 -0
- package/dist/src/types/slots.js +162 -0
- package/dist/src/types/slots.js.map +1 -0
- package/dist/src/utils/auto-path-detection.d.ts +26 -0
- package/dist/src/utils/auto-path-detection.js +198 -0
- package/dist/src/utils/auto-path-detection.js.map +1 -0
- package/dist/src/utils/cli-detector.d.ts +20 -0
- package/dist/src/utils/cli-detector.js +230 -0
- package/dist/src/utils/cli-detector.js.map +1 -0
- package/dist/src/utils/path-resolver.d.ts +51 -0
- package/dist/src/utils/path-resolver.js +214 -0
- package/dist/src/utils/path-resolver.js.map +1 -0
- package/dist/src/utils/username-detector.d.ts +27 -0
- package/dist/src/utils/username-detector.js +90 -0
- package/dist/src/utils/username-detector.js.map +1 -0
- package/package.json +8 -3
- package/scripts/discord-sync-curated.js +233 -0
- package/scripts/discord-sync-final.js +218 -0
- package/scripts/discord-sync-simple.js +175 -0
- package/scripts/discord-sync-working.js +187 -0
- package/scripts/discord-sync.js +181 -0
- package/scripts/postinstall.js +46 -0
- package/skill/SKILL.md +385 -0
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# 🏎️ CLAUDE.md - claude-faf-mcp Persistent Context & Intelligence
|
|
2
|
+
**.faf format | project.faf**
|
|
3
|
+
|
|
4
|
+
## PROJECT STATE: ACTIVE 🚀
|
|
5
|
+
**Current Position:** Provide FAF context tools directly in Claude Desktop via MCP
|
|
6
|
+
**Tyre Compound:** ULTRASOFT C5 (Maximum Performance)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 🎨 CORE CONTEXT
|
|
11
|
+
|
|
12
|
+
### Project Identity
|
|
13
|
+
- **Name:** claude-faf-mcp
|
|
14
|
+
- **Stack:** Node.js/TypeScript
|
|
15
|
+
- **Quality:** F1-INSPIRED (Championship Performance)
|
|
16
|
+
|
|
17
|
+
### Our Mission - 100% Standalone MCP Server
|
|
18
|
+
|
|
19
|
+
**v3.0.4 Historic Milestone: ZERO CLI DEPENDENCIES**
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
claude-faf-mcp: 100% STANDALONE
|
|
23
|
+
├── 50/50 MCP tools operational
|
|
24
|
+
├── 14/14 bundled commands
|
|
25
|
+
├── 16.2x faster than CLI versions
|
|
26
|
+
├── 19ms average execution
|
|
27
|
+
└── Zero external dependencies
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**CRITICAL: claude-faf-mcp IS NOT A WRAPPER**
|
|
31
|
+
- ✅ Independent standalone MCP server
|
|
32
|
+
- ✅ 100% operational without any CLI
|
|
33
|
+
- ✅ Own bundled FAF engine
|
|
34
|
+
- ✅ Championship-grade performance
|
|
35
|
+
- ❌ NOT a wrapper, NOT dependent on CLI
|
|
36
|
+
|
|
37
|
+
**The .faf Position in MCP:**
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
Model Context Protocol
|
|
41
|
+
───── ─────── ────────
|
|
42
|
+
Claude → .faf → MCP
|
|
43
|
+
Gemini → .faf → MCP
|
|
44
|
+
Codex → .faf → MCP
|
|
45
|
+
Any LLM → IANA Format → Open Protocol
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
.FAF provides the standardized Context that makes the Model Context Protocol work for everyone.
|
|
49
|
+
|
|
50
|
+
### Technical Architecture
|
|
51
|
+
- **What Building:** Universal FAF MCP Server for Claude Desktop - AI Context Intelligence
|
|
52
|
+
- **Main Language:** TypeScript
|
|
53
|
+
|
|
54
|
+
### 📊 Context Quality Status
|
|
55
|
+
- **Overall Assessment:** Good
|
|
56
|
+
- **Last Updated:** 2025-11-06
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
**STATUS: BI-SYNC ACTIVE 🔗 - Synchronized with .faf context!**
|
|
61
|
+
|
|
62
|
+
*Last Sync: 2025-11-06T13:20:32.280Z*
|
|
63
|
+
*Sync Engine: F1-Inspired Software Engineering*
|
|
64
|
+
*🏎️⚡️_championship_sync*
|
package/README.md
CHANGED
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
|
|
23
23
|
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.
|
|
24
24
|
|
|
25
|
+
<div align="center">
|
|
26
|
+
<img src="./assets/Project-faf-pckg-json-README.png" alt="project.faf file positioning" width="600" />
|
|
27
|
+
<p><em>project.faf lives at the project root, between package.json and README.md</em></p>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
25
30
|
```
|
|
26
31
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
27
32
|
🏎️ FAF AI-READINESS SCORE: 100/100 — PODIUM EDITION
|
|
@@ -47,14 +52,24 @@ At 55% you are building your project with half a blueprint and basically flippin
|
|
|
47
52
|
|
|
48
53
|
## ⚡ Quick Start
|
|
49
54
|
|
|
55
|
+
**⚠️ INSTALLATION ORDER REQUIRED:**
|
|
56
|
+
|
|
57
|
+
**Step 1: Install CLI First (Required)**
|
|
58
|
+
```bash
|
|
59
|
+
npm install -g faf-cli
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Step 2: Then Install MCP Server**
|
|
50
63
|
```bash
|
|
51
|
-
#
|
|
64
|
+
# Via npx (recommended - always latest)
|
|
52
65
|
npx @modelcontextprotocol/inspector npx -y claude-faf-mcp
|
|
53
66
|
|
|
54
67
|
# Or install globally
|
|
55
68
|
npm install -g claude-faf-mcp
|
|
56
69
|
```
|
|
57
70
|
|
|
71
|
+
**Why this order?** MCP auto-detects CLI at startup. Installing MCP first will show warnings. Always install faf-cli before claude-faf-mcp.
|
|
72
|
+
|
|
58
73
|
**Claude Desktop Configuration:**
|
|
59
74
|
```json
|
|
60
75
|
{
|
|
@@ -69,17 +84,76 @@ npm install -g claude-faf-mcp
|
|
|
69
84
|
|
|
70
85
|
---
|
|
71
86
|
|
|
87
|
+
## 📁 Projects Convention
|
|
88
|
+
|
|
89
|
+
**Default Path Structure:** `~/Projects/[project-name]/project.faf`
|
|
90
|
+
|
|
91
|
+
The MCP server uses an intelligent path resolution system:
|
|
92
|
+
|
|
93
|
+
1. **AI Inference** - Automatically detects project name from README titles, package.json, or uploaded files
|
|
94
|
+
2. **User Statement** - Explicit project name provided by user
|
|
95
|
+
3. **Custom Path** - User-provided path always wins
|
|
96
|
+
|
|
97
|
+
**Example Workflows:**
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# Upload README titled "Heritage Club Dubai"
|
|
101
|
+
# → Automatically creates: ~/Projects/heritage-club-dubai/project.faf
|
|
102
|
+
|
|
103
|
+
# Provide project name
|
|
104
|
+
faf_init projectName:"my-app"
|
|
105
|
+
# → Creates: ~/Projects/my-app/project.faf
|
|
106
|
+
|
|
107
|
+
# Explicit path (always respected)
|
|
108
|
+
faf_init path:"/Users/you/custom/location"
|
|
109
|
+
# → Creates: /Users/you/custom/location/project.faf
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Cross-Platform Support:**
|
|
113
|
+
- macOS: `~/Projects/`
|
|
114
|
+
- Linux: `~/Projects/`
|
|
115
|
+
- Windows: `%USERPROFILE%\Projects\`
|
|
116
|
+
|
|
117
|
+
**Guide Tool:**
|
|
118
|
+
Run `faf_guide` in Claude Desktop for complete path resolution rules and UX patterns.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## 🔧 Troubleshooting
|
|
123
|
+
|
|
124
|
+
**CLI Not Detected?**
|
|
125
|
+
|
|
126
|
+
The MCP auto-detects faf-cli in common locations. If detection fails, set the path manually:
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"mcpServers": {
|
|
131
|
+
"faf": {
|
|
132
|
+
"command": "npx",
|
|
133
|
+
"args": ["-y", "claude-faf-mcp"],
|
|
134
|
+
"env": {
|
|
135
|
+
"FAF_CLI_PATH": "/custom/path/to/faf"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Find your CLI path: `which faf`
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
72
146
|
## 🎯 What is FAF?
|
|
73
147
|
|
|
74
148
|
**The .FAF Position in the MCP Ecosystem:**
|
|
75
149
|
|
|
76
150
|
```
|
|
77
|
-
Model Context Protocol
|
|
78
|
-
───── ─────── ────────
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
151
|
+
Model Context Protocol
|
|
152
|
+
───── ─────── ────────
|
|
153
|
+
LLM → IANA Format → Open Protocol
|
|
154
|
+
Claude → .faf → MCP
|
|
155
|
+
Gemini → .faf → MCP
|
|
156
|
+
Codex → .faf → MCP
|
|
83
157
|
```
|
|
84
158
|
|
|
85
159
|
**.FAF is the foundational, universal base layer** for any Model using the MCP Protocol. It provides the standardized Context that makes the Model Context Protocol work for everyone.
|
|
@@ -88,7 +162,7 @@ Any LLM → IANA Format → Open Protocol
|
|
|
88
162
|
|
|
89
163
|
## 🛠️ Core Features
|
|
90
164
|
|
|
91
|
-
###
|
|
165
|
+
### 51 MCP Tools (100% Standalone)
|
|
92
166
|
- **faf_quick** - Lightning-fast project.faf creation (3ms avg)
|
|
93
167
|
- **faf_enhance** - Intelligent enhancement with auto-detection
|
|
94
168
|
- **faf_read** - Parse and validate FAF files
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle cx="50" cy="50" r="40" fill="#FF6B35" />
|
|
3
|
+
<circle cx="35" cy="40" r="5" fill="black" />
|
|
4
|
+
<circle cx="65" cy="40" r="5" fill="black" />
|
|
5
|
+
<path d="M 30 60 Q 50 70 70 60" stroke="black" stroke-width="3" fill="none" />
|
|
6
|
+
</svg>
|
|
@@ -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
|
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,EAAE,CAAC;YAC9B,WAAW,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;YAC3E,WAAW,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;QAC9D,CAAC;QAED,IAAI,KAAK,IAAI,EAAE,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;YAC/B,WAAW,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;YAClE,WAAW,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;QAC7D,CAAC;QAED,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;YAClB,WAAW,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;YAC3E,WAAW,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;CACF;AAxND,oDAwNC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slot Validator - FAF Compiler Engine MK3
|
|
3
|
+
* Championship-grade slot validation with .faf content analysis
|
|
4
|
+
*/
|
|
5
|
+
import { ValidationResult } from '../types/slots';
|
|
6
|
+
import { ProjectType } from '../types/project-types';
|
|
7
|
+
export declare class SlotValidator {
|
|
8
|
+
/**
|
|
9
|
+
* Validate all slots against project type
|
|
10
|
+
*/
|
|
11
|
+
validate(fafContent: any, projectType: ProjectType): ValidationResult;
|
|
12
|
+
/**
|
|
13
|
+
* Check if a specific slot is filled in .faf content
|
|
14
|
+
*/
|
|
15
|
+
private isSlotFilled;
|
|
16
|
+
/**
|
|
17
|
+
* Get the value of a slot from .faf content
|
|
18
|
+
*/
|
|
19
|
+
private getSlotValue;
|
|
20
|
+
/**
|
|
21
|
+
* Helper: Check if fafContent has a specific framework
|
|
22
|
+
*/
|
|
23
|
+
private hasFramework;
|
|
24
|
+
/**
|
|
25
|
+
* Determine medal from score
|
|
26
|
+
*/
|
|
27
|
+
private getMedal;
|
|
28
|
+
/**
|
|
29
|
+
* Load and parse .faf file from directory
|
|
30
|
+
*/
|
|
31
|
+
static loadFafFile(projectPath: string): Promise<any | null>;
|
|
32
|
+
}
|