faf-mcp 1.0.0

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 (207) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/CLAUDE.md +73 -0
  3. package/LICENSE +22 -0
  4. package/README.md +165 -0
  5. package/assets/Project-faf-pckg-json-README.png +0 -0
  6. package/assets/icons/faf-icon-128.png +0 -0
  7. package/assets/icons/faf-icon-256.png +0 -0
  8. package/assets/icons/faf-icon-48.png +0 -0
  9. package/assets/icons/faf-icon-512.png +0 -0
  10. package/assets/icons/orange-smiley.svg +6 -0
  11. package/dist/src/compiler/index.d.ts +7 -0
  12. package/dist/src/compiler/index.js +24 -0
  13. package/dist/src/compiler/index.js.map +1 -0
  14. package/dist/src/compiler/scorer.d.ts +53 -0
  15. package/dist/src/compiler/scorer.js +189 -0
  16. package/dist/src/compiler/scorer.js.map +1 -0
  17. package/dist/src/compiler/slot-validator.d.ts +32 -0
  18. package/dist/src/compiler/slot-validator.js +293 -0
  19. package/dist/src/compiler/slot-validator.js.map +1 -0
  20. package/dist/src/compiler/type-detector.d.ts +62 -0
  21. package/dist/src/compiler/type-detector.js +388 -0
  22. package/dist/src/compiler/type-detector.js.map +1 -0
  23. package/dist/src/config/visibility.d.ts +41 -0
  24. package/dist/src/config/visibility.js +158 -0
  25. package/dist/src/config/visibility.js.map +1 -0
  26. package/dist/src/faf-core/commands/audit.d.ts +21 -0
  27. package/dist/src/faf-core/commands/audit.js +83 -0
  28. package/dist/src/faf-core/commands/audit.js.map +1 -0
  29. package/dist/src/faf-core/commands/auto.d.ts +25 -0
  30. package/dist/src/faf-core/commands/auto.js +74 -0
  31. package/dist/src/faf-core/commands/auto.js.map +1 -0
  32. package/dist/src/faf-core/commands/bi-sync.d.ts +26 -0
  33. package/dist/src/faf-core/commands/bi-sync.js +157 -0
  34. package/dist/src/faf-core/commands/bi-sync.js.map +1 -0
  35. package/dist/src/faf-core/commands/doctor.d.ts +17 -0
  36. package/dist/src/faf-core/commands/doctor.js +198 -0
  37. package/dist/src/faf-core/commands/doctor.js.map +1 -0
  38. package/dist/src/faf-core/commands/enhance.d.ts +46 -0
  39. package/dist/src/faf-core/commands/enhance.js +360 -0
  40. package/dist/src/faf-core/commands/enhance.js.map +1 -0
  41. package/dist/src/faf-core/commands/formats.d.ts +22 -0
  42. package/dist/src/faf-core/commands/formats.js +117 -0
  43. package/dist/src/faf-core/commands/formats.js.map +1 -0
  44. package/dist/src/faf-core/commands/init.d.ts +26 -0
  45. package/dist/src/faf-core/commands/init.js +114 -0
  46. package/dist/src/faf-core/commands/init.js.map +1 -0
  47. package/dist/src/faf-core/commands/innit.d.ts +7 -0
  48. package/dist/src/faf-core/commands/innit.js +13 -0
  49. package/dist/src/faf-core/commands/innit.js.map +1 -0
  50. package/dist/src/faf-core/commands/migrate.d.ts +15 -0
  51. package/dist/src/faf-core/commands/migrate.js +86 -0
  52. package/dist/src/faf-core/commands/migrate.js.map +1 -0
  53. package/dist/src/faf-core/commands/quick.d.ts +16 -0
  54. package/dist/src/faf-core/commands/quick.js +184 -0
  55. package/dist/src/faf-core/commands/quick.js.map +1 -0
  56. package/dist/src/faf-core/commands/score.d.ts +47 -0
  57. package/dist/src/faf-core/commands/score.js +49 -0
  58. package/dist/src/faf-core/commands/score.js.map +1 -0
  59. package/dist/src/faf-core/commands/sync.d.ts +16 -0
  60. package/dist/src/faf-core/commands/sync.js +210 -0
  61. package/dist/src/faf-core/commands/sync.js.map +1 -0
  62. package/dist/src/faf-core/commands/update.d.ts +12 -0
  63. package/dist/src/faf-core/commands/update.js +46 -0
  64. package/dist/src/faf-core/commands/update.js.map +1 -0
  65. package/dist/src/faf-core/commands/validate.d.ts +21 -0
  66. package/dist/src/faf-core/commands/validate.js +81 -0
  67. package/dist/src/faf-core/commands/validate.js.map +1 -0
  68. package/dist/src/faf-core/compiler/faf-compiler.d.ts +138 -0
  69. package/dist/src/faf-core/compiler/faf-compiler.js +794 -0
  70. package/dist/src/faf-core/compiler/faf-compiler.js.map +1 -0
  71. package/dist/src/faf-core/engines/dependency-tsa.d.ts +88 -0
  72. package/dist/src/faf-core/engines/dependency-tsa.js +361 -0
  73. package/dist/src/faf-core/engines/dependency-tsa.js.map +1 -0
  74. package/dist/src/faf-core/engines/fab-formats-processor.d.ts +166 -0
  75. package/dist/src/faf-core/engines/fab-formats-processor.js +1274 -0
  76. package/dist/src/faf-core/engines/fab-formats-processor.js.map +1 -0
  77. package/dist/src/faf-core/engines/faf-dna.d.ts +159 -0
  78. package/dist/src/faf-core/engines/faf-dna.js +554 -0
  79. package/dist/src/faf-core/engines/faf-dna.js.map +1 -0
  80. package/dist/src/faf-core/engines/relentless-context-extractor.d.ts +100 -0
  81. package/dist/src/faf-core/engines/relentless-context-extractor.js +625 -0
  82. package/dist/src/faf-core/engines/relentless-context-extractor.js.map +1 -0
  83. package/dist/src/faf-core/fix-once/colors.d.ts +104 -0
  84. package/dist/src/faf-core/fix-once/colors.js +236 -0
  85. package/dist/src/faf-core/fix-once/colors.js.map +1 -0
  86. package/dist/src/faf-core/fix-once/types.d.ts +257 -0
  87. package/dist/src/faf-core/fix-once/types.js +26 -0
  88. package/dist/src/faf-core/fix-once/types.js.map +1 -0
  89. package/dist/src/faf-core/fix-once/yaml.d.ts +57 -0
  90. package/dist/src/faf-core/fix-once/yaml.js +172 -0
  91. package/dist/src/faf-core/fix-once/yaml.js.map +1 -0
  92. package/dist/src/faf-core/generators/faf-generator-championship.d.ts +16 -0
  93. package/dist/src/faf-core/generators/faf-generator-championship.js +462 -0
  94. package/dist/src/faf-core/generators/faf-generator-championship.js.map +1 -0
  95. package/dist/src/faf-core/utils/balance-visualizer.d.ts +37 -0
  96. package/dist/src/faf-core/utils/balance-visualizer.js +197 -0
  97. package/dist/src/faf-core/utils/balance-visualizer.js.map +1 -0
  98. package/dist/src/faf-core/utils/championship-style.d.ts +109 -0
  99. package/dist/src/faf-core/utils/championship-style.js +219 -0
  100. package/dist/src/faf-core/utils/championship-style.js.map +1 -0
  101. package/dist/src/faf-core/utils/chrome-extension-detector.d.ts +73 -0
  102. package/dist/src/faf-core/utils/chrome-extension-detector.js +268 -0
  103. package/dist/src/faf-core/utils/chrome-extension-detector.js.map +1 -0
  104. package/dist/src/faf-core/utils/fafignore-parser.d.ts +20 -0
  105. package/dist/src/faf-core/utils/fafignore-parser.js +178 -0
  106. package/dist/src/faf-core/utils/fafignore-parser.js.map +1 -0
  107. package/dist/src/faf-core/utils/file-utils.d.ts +112 -0
  108. package/dist/src/faf-core/utils/file-utils.js +846 -0
  109. package/dist/src/faf-core/utils/file-utils.js.map +1 -0
  110. package/dist/src/faf-core/utils/native-file-finder.d.ts +115 -0
  111. package/dist/src/faf-core/utils/native-file-finder.js +211 -0
  112. package/dist/src/faf-core/utils/native-file-finder.js.map +1 -0
  113. package/dist/src/faf-core/utils/platform-detector.d.ts +30 -0
  114. package/dist/src/faf-core/utils/platform-detector.js +218 -0
  115. package/dist/src/faf-core/utils/platform-detector.js.map +1 -0
  116. package/dist/src/faf-core/utils/technical-credit.d.ts +35 -0
  117. package/dist/src/faf-core/utils/technical-credit.js +286 -0
  118. package/dist/src/faf-core/utils/technical-credit.js.map +1 -0
  119. package/dist/src/faf-core/utils/yaml-generator.d.ts +41 -0
  120. package/dist/src/faf-core/utils/yaml-generator.js +360 -0
  121. package/dist/src/faf-core/utils/yaml-generator.js.map +1 -0
  122. package/dist/src/handlers/behavioral-instruction.d.ts +16 -0
  123. package/dist/src/handlers/behavioral-instruction.js +43 -0
  124. package/dist/src/handlers/behavioral-instruction.js.map +1 -0
  125. package/dist/src/handlers/championship-tools.d.ts +113 -0
  126. package/dist/src/handlers/championship-tools.js +2602 -0
  127. package/dist/src/handlers/championship-tools.js.map +1 -0
  128. package/dist/src/handlers/engine-adapter.d.ts +28 -0
  129. package/dist/src/handlers/engine-adapter.js +603 -0
  130. package/dist/src/handlers/engine-adapter.js.map +1 -0
  131. package/dist/src/handlers/fileHandler.d.ts +36 -0
  132. package/dist/src/handlers/fileHandler.js +246 -0
  133. package/dist/src/handlers/fileHandler.js.map +1 -0
  134. package/dist/src/handlers/resources.d.ts +18 -0
  135. package/dist/src/handlers/resources.js +78 -0
  136. package/dist/src/handlers/resources.js.map +1 -0
  137. package/dist/src/handlers/tool-registry.d.ts +23 -0
  138. package/dist/src/handlers/tool-registry.js +68 -0
  139. package/dist/src/handlers/tool-registry.js.map +1 -0
  140. package/dist/src/handlers/tool-types.d.ts +167 -0
  141. package/dist/src/handlers/tool-types.js +7 -0
  142. package/dist/src/handlers/tool-types.js.map +1 -0
  143. package/dist/src/handlers/tools.d.ts +25 -0
  144. package/dist/src/handlers/tools.js +1168 -0
  145. package/dist/src/handlers/tools.js.map +1 -0
  146. package/dist/src/index.d.ts +2 -0
  147. package/dist/src/index.js +17 -0
  148. package/dist/src/index.js.map +1 -0
  149. package/dist/src/server.d.ts +28 -0
  150. package/dist/src/server.js +179 -0
  151. package/dist/src/server.js.map +1 -0
  152. package/dist/src/test-all-functions.d.ts +15 -0
  153. package/dist/src/test-all-functions.js +163 -0
  154. package/dist/src/test-all-functions.js.map +1 -0
  155. package/dist/src/types/mcp-tools.d.ts +53 -0
  156. package/dist/src/types/mcp-tools.js +77 -0
  157. package/dist/src/types/mcp-tools.js.map +1 -0
  158. package/dist/src/types/project-types.d.ts +22 -0
  159. package/dist/src/types/project-types.js +85 -0
  160. package/dist/src/types/project-types.js.map +1 -0
  161. package/dist/src/types/slots.d.ts +39 -0
  162. package/dist/src/types/slots.js +162 -0
  163. package/dist/src/types/slots.js.map +1 -0
  164. package/dist/src/types/tool-visibility.d.ts +36 -0
  165. package/dist/src/types/tool-visibility.js +510 -0
  166. package/dist/src/types/tool-visibility.js.map +1 -0
  167. package/dist/src/utils/auto-path-detection.d.ts +26 -0
  168. package/dist/src/utils/auto-path-detection.js +198 -0
  169. package/dist/src/utils/auto-path-detection.js.map +1 -0
  170. package/dist/src/utils/championship-format.d.ts +30 -0
  171. package/dist/src/utils/championship-format.js +79 -0
  172. package/dist/src/utils/championship-format.js.map +1 -0
  173. package/dist/src/utils/cli-detector.d.ts +20 -0
  174. package/dist/src/utils/cli-detector.js +230 -0
  175. package/dist/src/utils/cli-detector.js.map +1 -0
  176. package/dist/src/utils/display-protocol.d.ts +57 -0
  177. package/dist/src/utils/display-protocol.js +131 -0
  178. package/dist/src/utils/display-protocol.js.map +1 -0
  179. package/dist/src/utils/faf-file-finder.d.ts +59 -0
  180. package/dist/src/utils/faf-file-finder.js +139 -0
  181. package/dist/src/utils/faf-file-finder.js.map +1 -0
  182. package/dist/src/utils/fuzzy-detector.d.ts +56 -0
  183. package/dist/src/utils/fuzzy-detector.js +221 -0
  184. package/dist/src/utils/fuzzy-detector.js.map +1 -0
  185. package/dist/src/utils/path-resolver.d.ts +51 -0
  186. package/dist/src/utils/path-resolver.js +214 -0
  187. package/dist/src/utils/path-resolver.js.map +1 -0
  188. package/dist/src/utils/type-guards.d.ts +9 -0
  189. package/dist/src/utils/type-guards.js +27 -0
  190. package/dist/src/utils/type-guards.js.map +1 -0
  191. package/dist/src/utils/username-detector.d.ts +27 -0
  192. package/dist/src/utils/username-detector.js +90 -0
  193. package/dist/src/utils/username-detector.js.map +1 -0
  194. package/dist/src/utils/visual-style.d.ts +62 -0
  195. package/dist/src/utils/visual-style.js +164 -0
  196. package/dist/src/utils/visual-style.js.map +1 -0
  197. package/dist/src/version.d.ts +9 -0
  198. package/dist/src/version.js +37 -0
  199. package/dist/src/version.js.map +1 -0
  200. package/package.json +114 -0
  201. package/scripts/discord-sync-curated.js +233 -0
  202. package/scripts/discord-sync-final.js +218 -0
  203. package/scripts/discord-sync-simple.js +175 -0
  204. package/scripts/discord-sync-working.js +187 -0
  205. package/scripts/discord-sync.js +181 -0
  206. package/scripts/postinstall.js +46 -0
  207. package/skill/SKILL.md +385 -0
package/package.json ADDED
@@ -0,0 +1,114 @@
1
+ {
2
+ "name": "faf-mcp",
3
+ "version": "1.0.0",
4
+ "mcpName": "io.github.Wolfe-Jam/faf-mcp",
5
+ "description": "IANA-registered format (application/vnd.faf+yaml) โ€ข Persistent project context โ€ข MCP server for all platforms โ€ข MIT License",
6
+ "icon": "./assets/icons/faf-icon-256.png",
7
+ "logo": "./assets/icons/faf-icon-256.png",
8
+ "displayName": ".faf ๐Ÿงกโšก๏ธ",
9
+ "main": "dist/src/index.js",
10
+ "bin": {
11
+ "faf-mcp": "dist/src/index.js"
12
+ },
13
+ "scripts": {
14
+ "build": "tsc",
15
+ "dev": "ts-node src/server.ts",
16
+ "dev:stdio": "ts-node src/cli.ts --transport stdio",
17
+ "dev:http": "ts-node src/cli.ts --transport http-sse --port 3001",
18
+ "test": "jest",
19
+ "test:mcp": "mcp-inspector stdio ts-node src/cli.ts",
20
+ "lint": "eslint src/**/*.ts",
21
+ "lint:fix": "eslint src/**/*.ts --fix",
22
+ "type-check": "tsc --noEmit",
23
+ "format:check": "prettier --check \"src/**/*.ts\"",
24
+ "format": "prettier --write \"src/**/*.ts\"",
25
+ "postinstall": "node scripts/postinstall.js",
26
+ "debug": "node --inspect-brk=0.0.0.0:9229 -r ts-node/register src/cli.ts"
27
+ },
28
+ "keywords": [
29
+ "mcp",
30
+ "mcp-server",
31
+ "model-context-protocol",
32
+ "faf",
33
+ ".faf",
34
+ "dot-faf",
35
+ "claude",
36
+ "claude-desktop",
37
+ "cursor",
38
+ "cursor-ide",
39
+ "windsurf",
40
+ "windsurf-editor",
41
+ "gemini",
42
+ "vscode",
43
+ "anthropic",
44
+ "ai-context",
45
+ "project-dna",
46
+ "ai-readiness",
47
+ "context-management",
48
+ "persistent-project-context",
49
+ "universal-context",
50
+ "iana-format",
51
+ "project-intelligence",
52
+ "codebase-understanding",
53
+ "ai-assistant",
54
+ "ai-tools",
55
+ "llm-tools",
56
+ "developer-tools",
57
+ "devtools",
58
+ "typescript",
59
+ "open-source",
60
+ "mit-license",
61
+ "free-forever"
62
+ ],
63
+ "author": {
64
+ "name": "wolfejam",
65
+ "email": "team@faf.one",
66
+ "url": "https://wolfejam.dev"
67
+ },
68
+ "license": "MIT",
69
+ "repository": {
70
+ "type": "git",
71
+ "url": "https://github.com/Wolfe-Jam/faf-mcp.git"
72
+ },
73
+ "bugs": {
74
+ "url": "https://github.com/Wolfe-Jam/faf-mcp/issues"
75
+ },
76
+ "homepage": "https://faf.one",
77
+ "engines": {
78
+ "node": ">=18.0.0"
79
+ },
80
+ "files": [
81
+ "dist/**/*",
82
+ "assets/**/*",
83
+ "scripts/**/*",
84
+ "skill/SKILL.md",
85
+ "README.md",
86
+ "CLAUDE.md",
87
+ ".faf",
88
+ "LICENSE",
89
+ "CHANGELOG.md"
90
+ ],
91
+ "publishConfig": {
92
+ "access": "public"
93
+ },
94
+ "dependencies": {
95
+ "faf-cli": ">=3.1.1",
96
+ "@modelcontextprotocol/sdk": "^1.20.1",
97
+ "yaml": "^2.4.1"
98
+ },
99
+ "devDependencies": {
100
+ "@jest/globals": "^30.1.2",
101
+ "@types/cors": "^2.8.19",
102
+ "@types/express": "^5.0.3",
103
+ "@types/jest": "^30.0.0",
104
+ "@types/jsonwebtoken": "^9.0.5",
105
+ "@types/node": "^20.11.0",
106
+ "@typescript-eslint/eslint-plugin": "^7.0.0",
107
+ "@typescript-eslint/parser": "^7.0.0",
108
+ "eslint": "^8.56.0",
109
+ "jest": "^29.7.0",
110
+ "ts-jest": "^29.1.0",
111
+ "ts-node": "^10.9.2",
112
+ "typescript": "^5.3.0"
113
+ }
114
+ }
@@ -0,0 +1,233 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Discord Documentation Sync Tool (Curated Content)
5
+ * Posts hand-crafted summaries of FAF documentation to Discord
6
+ *
7
+ * Usage: node scripts/discord-sync-curated.js <webhook-url>
8
+ */
9
+
10
+ const https = require('https');
11
+
12
+ // Curated messages for Discord
13
+ const MESSAGES = [
14
+ {
15
+ title: '๐Ÿ“š FAF MCP Server Documentation',
16
+ content: `Welcome to **claude-faf-mcp** - the Model Context Protocol server that brings FAF (Foundational AI-context Format) to Claude Desktop!
17
+
18
+ **What is FAF?**
19
+ ๐Ÿงก IANA-registered AI context format (\`application/vnd.faf+yaml\`)
20
+ ๐Ÿ“ฆ Universal project DNA that works with any AI tool
21
+ ๐Ÿ† F1-inspired scoring system for project quality
22
+
23
+ **Two Tools Available:**
24
+ โ€ข **MCP Server** (1,231/week downloads) - For Claude Desktop integration
25
+ โ€ข **CLI Tool** (235/week downloads) - Command-line standalone tool
26
+
27
+ Choose MCP for Claude Desktop, CLI for terminal workflows, or both!
28
+
29
+ Full documentation below...`,
30
+ order: 1
31
+ },
32
+ {
33
+ title: '๐Ÿš€ Quick Start - Claude Desktop Setup',
34
+ content: `**Install the MCP server:**
35
+ \`\`\`bash
36
+ npm install -g claude-faf-mcp
37
+ \`\`\`
38
+
39
+ **Add to Claude Desktop config:**
40
+ \`\`\`json
41
+ {
42
+ "mcpServers": {
43
+ "faf": {
44
+ "command": "npx",
45
+ "args": ["claude-faf-mcp"]
46
+ }
47
+ }
48
+ }
49
+ \`\`\`
50
+
51
+ **Config location:**
52
+ โ€ข macOS: \`~/Library/Application Support/Claude/claude_desktop_config.json\`
53
+ โ€ข Windows: \`%APPDATA%\\Claude\\claude_desktop_config.json\`
54
+
55
+ **Restart Claude Desktop**, then test with: \`faf_score()\`
56
+
57
+ [Full Quick Start Guide](https://github.com/Wolfe-Jam/claude-faf-mcp/blob/main/docs/QUICK_START.md)`,
58
+ order: 2
59
+ },
60
+ {
61
+ title: '๐Ÿ† The PODIUM Scoring System',
62
+ content: `**Gamifying Software Excellence**
63
+
64
+ \`\`\`
65
+ ๐Ÿฅ‰ 85/100 = BRONZE PODIUM (3rd Place)
66
+ ๐Ÿฅˆ 95/100 = SILVER PODIUM (2nd Place)
67
+ ๐Ÿฅ‡ 99/100 = GOLD PODIUM (1st Place)
68
+ ๐Ÿ† 105/100 = TROPHY (Beyond Podium)
69
+ \`\`\`
70
+
71
+ **The Psychology:**
72
+ When you see your project is BRONZE (85%), you can't help it...
73
+ **YOU'RE GONNA WANNA WIN.**
74
+
75
+ **How scores work:**
76
+ โ€ข .faf file: 40 points
77
+ โ€ข CLAUDE.md: 30 points
78
+ โ€ข README.md: 15 points
79
+ โ€ข Project file (package.json, etc): 14 points
80
+
81
+ Nobody wants to ship BRONZE when GOLD is 14 points away.
82
+
83
+ [Read PODIUM System](https://github.com/Wolfe-Jam/claude-faf-mcp/blob/main/docs/PODIUM-SYSTEM.md)`,
84
+ order: 3
85
+ },
86
+ {
87
+ title: 'โ“ Common Questions',
88
+ content: `**Do I need the FAF CLI installed?**
89
+ No. The MCP server works standalone. Some advanced features currently require CLI but are being migrated.
90
+
91
+ **What's the difference between MCP and CLI?**
92
+ โ€ข **MCP Server**: Claude Desktop integration, native tools
93
+ โ€ข **CLI Tool**: Terminal-based, standalone commands
94
+
95
+ **How is the score calculated?**
96
+ 40 (.faf) + 30 (CLAUDE.md) + 15 (README.md) + 14 (project file) = 99% max
97
+ The final 1% represents perfect human-AI collaboration.
98
+
99
+ **Is my code safe?**
100
+ Yes. Everything runs locally. No data sent externally. No network capabilities.
101
+
102
+ **Which commands work without CLI?**
103
+ \`faf_score\`, \`faf_detect\`, \`faf_list\`, \`faf_read\`, \`faf_write\`, \`faf_debug\`
104
+
105
+ [Full FAQ](https://github.com/Wolfe-Jam/claude-faf-mcp/blob/main/docs/FAQ.md)`,
106
+ order: 4
107
+ },
108
+ {
109
+ title: '๐Ÿ“š User Guide Overview',
110
+ content: `**Core Features:**
111
+
112
+ **Project Scoring** - \`faf_score()\`
113
+ Evaluates your project's AI-readiness (0-99%, with Claude able to grant 100%)
114
+
115
+ **Project Detection** - \`faf_detect()\`
116
+ Automatically identifies your stack and frameworks
117
+
118
+ **Directory Exploration** - \`faf_list()\`
119
+ View project structure with smart file type detection
120
+
121
+ **File Operations** - \`faf_read()\` / \`faf_write()\`
122
+ Native file system operations
123
+
124
+ **Best Practices:**
125
+ 1. Start with detection - let FAF understand your project
126
+ 2. Check your score - see where you stand
127
+ 3. Follow suggestions - each command guides next steps
128
+ 4. Build gradually - improve incrementally
129
+
130
+ [Complete User Guide](https://github.com/Wolfe-Jam/claude-faf-mcp/blob/main/docs/USER_GUIDE.md)`,
131
+ order: 5
132
+ },
133
+ {
134
+ title: '๐Ÿ”— Links & Resources',
135
+ content: `**Main Sites:**
136
+ โ€ข [faf.one](https://faf.one) - FAF Format homepage
137
+ โ€ข [GitHub - MCP Server](https://github.com/Wolfe-Jam/claude-faf-mcp)
138
+ โ€ข [GitHub - CLI Tool](https://github.com/Wolfe-Jam/faf-cli)
139
+
140
+ **npm Packages:**
141
+ โ€ข [claude-faf-mcp](https://www.npmjs.com/package/claude-faf-mcp) - 6.1k downloads
142
+ โ€ข [faf-cli](https://www.npmjs.com/package/faf-cli) - 6.2k downloads
143
+
144
+ **Getting Help:**
145
+ โ€ข Discord: This server! Ask in #help
146
+ โ€ข GitHub Issues: Report bugs & request features
147
+ โ€ข Documentation: All docs linked above
148
+
149
+ **IANA Registration:** \`application/vnd.faf+yaml\`
150
+ ๐Ÿงก Official AI context format standard`,
151
+ order: 6
152
+ }
153
+ ];
154
+
155
+ function postToDiscord(webhookUrl, content) {
156
+ return new Promise((resolve, reject) => {
157
+ const url = new URL(webhookUrl);
158
+ const payload = JSON.stringify({
159
+ content: content.substring(0, 2000)
160
+ });
161
+
162
+ const options = {
163
+ hostname: url.hostname,
164
+ path: url.pathname + url.search,
165
+ method: 'POST',
166
+ headers: {
167
+ 'Content-Type': 'application/json',
168
+ 'Content-Length': Buffer.byteLength(payload)
169
+ }
170
+ };
171
+
172
+ const req = https.request(options, (res) => {
173
+ let body = '';
174
+ res.on('data', chunk => body += chunk);
175
+ res.on('end', () => {
176
+ if (res.statusCode === 204 || res.statusCode === 200) {
177
+ resolve();
178
+ } else {
179
+ reject(new Error(`Discord returned status ${res.statusCode}: ${body}`));
180
+ }
181
+ });
182
+ });
183
+
184
+ req.on('error', reject);
185
+ req.write(payload);
186
+ req.end();
187
+ });
188
+ }
189
+
190
+ async function syncDocs(webhookUrl) {
191
+ console.log('๐Ÿ”„ Starting Discord documentation sync (curated)...\n');
192
+
193
+ const sortedMessages = MESSAGES.sort((a, b) => a.order - b.order);
194
+
195
+ for (const msg of sortedMessages) {
196
+ const message = `**${msg.title}**
197
+
198
+ ${msg.content}`;
199
+
200
+ try {
201
+ await postToDiscord(webhookUrl, message);
202
+ console.log(`โœ… Posted ${msg.title}`);
203
+
204
+ // Rate limit: Discord allows 5 requests per 2 seconds
205
+ await new Promise(resolve => setTimeout(resolve, 1000));
206
+ } catch (error) {
207
+ console.error(`โŒ Failed to post ${msg.title}:`, error.message);
208
+ }
209
+ }
210
+
211
+ console.log('\nโœจ Sync complete!');
212
+ }
213
+
214
+ // Main execution
215
+ if (require.main === module) {
216
+ const webhookUrl = process.argv[2];
217
+
218
+ if (!webhookUrl) {
219
+ console.error('Usage: node scripts/discord-sync-curated.js <webhook-url>');
220
+ console.error('\nGet your webhook URL from Discord:');
221
+ console.error('1. Server Settings > Integrations > Webhooks');
222
+ console.error('2. Create New Webhook or use existing');
223
+ console.error('3. Copy Webhook URL');
224
+ process.exit(1);
225
+ }
226
+
227
+ syncDocs(webhookUrl).catch((error) => {
228
+ console.error('Fatal error:', error);
229
+ process.exit(1);
230
+ });
231
+ }
232
+
233
+ module.exports = { syncDocs };
@@ -0,0 +1,218 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Discord Documentation Sync Tool (Final Version)
5
+ * Posts clean summaries with links to GitHub (single source of truth)
6
+ *
7
+ * Usage: node scripts/discord-sync-final.js <webhook-url>
8
+ */
9
+
10
+ const https = require('https');
11
+
12
+ // Clean messages that link to GitHub as source of truth
13
+ const MESSAGES = [
14
+ {
15
+ title: '๐Ÿ“š Welcome to FAF',
16
+ content: `**FAF (Foundational AI-context Format)** - IANA-registered AI context standard
17
+
18
+ ๐Ÿงก **IANA Format:** \`application/vnd.faf+yaml\`
19
+ ๐Ÿ“ฆ **MCP Server:** 6.1k downloads (1,231/week)
20
+ โšก **CLI Tool:** 6.2k downloads (235/week)
21
+
22
+ **Two packages, one ecosystem:**
23
+ โ€ข \`claude-faf-mcp\` - For Claude Desktop (MCP integration)
24
+ โ€ข \`faf-cli\` - For terminal workflows
25
+
26
+ **โญ๏ธ Help us grow:** <https://github.com/Wolfe-Jam/claude-faf-mcp>
27
+ Every star helps more devs discover FAF!
28
+
29
+ โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”`,
30
+ order: 1
31
+ },
32
+ {
33
+ title: '๐Ÿš€ Quick Start',
34
+ content: `**Get started in 2 minutes:**
35
+
36
+ \`\`\`bash
37
+ npm install -g claude-faf-mcp
38
+ \`\`\`
39
+
40
+ **Add to Claude Desktop config:**
41
+ \`\`\`json
42
+ {
43
+ "mcpServers": {
44
+ "faf": {
45
+ "command": "npx",
46
+ "args": ["claude-faf-mcp"]
47
+ }
48
+ }
49
+ }
50
+ \`\`\`
51
+
52
+ **Restart Claude Desktop** โ†’ Test with \`faf_score()\`
53
+
54
+ ๐Ÿ“– **Full guide:** <https://github.com/Wolfe-Jam/claude-faf-mcp/blob/main/docs/QUICK_START.md>`,
55
+ order: 2
56
+ },
57
+ {
58
+ title: '๐Ÿ† PODIUM Scoring',
59
+ content: `**Gamifying Software Excellence**
60
+
61
+ \`\`\`
62
+ ๐Ÿฅ‰ 85% = BRONZE PODIUM
63
+ ๐Ÿฅˆ 95% = SILVER PODIUM
64
+ ๐Ÿฅ‡ 99% = GOLD PODIUM
65
+ ๐Ÿ† 105% = TROPHY
66
+ \`\`\`
67
+
68
+ When you see BRONZE (85%), you can't help it...
69
+ **YOU'RE GONNA WANNA WIN.**
70
+
71
+ **Score breakdown:**
72
+ โ€ข 40 points: .faf file (project context)
73
+ โ€ข 30 points: CLAUDE.md (AI instructions)
74
+ โ€ข 15 points: README.md (documentation)
75
+ โ€ข 14 points: Project file (package.json, etc)
76
+
77
+ ๐Ÿ“– **Full system:** <https://github.com/Wolfe-Jam/claude-faf-mcp/blob/main/docs/PODIUM-SYSTEM.md>`,
78
+ order: 3
79
+ },
80
+ {
81
+ title: 'โ“ FAQ',
82
+ content: `**Common Questions:**
83
+
84
+ **Do I need the CLI installed?**
85
+ No. v3.0.5 is 100% standalone (50/50 tools operational).
86
+
87
+ **What's MCP vs CLI?**
88
+ MCP = Claude Desktop integration
89
+ CLI = Terminal standalone tool
90
+
91
+ **How are scores calculated?**
92
+ .faf (40) + CLAUDE.md (30) + README (15) + project file (14) = 99%
93
+ Final 1% = perfect collaboration (only Claude can grant)
94
+
95
+ **Is my code safe?**
96
+ Yes. Everything runs locally. No external data transmission.
97
+
98
+ ๐Ÿ“– **Full FAQ:** <https://github.com/Wolfe-Jam/claude-faf-mcp/blob/main/docs/FAQ.md>`,
99
+ order: 4
100
+ },
101
+ {
102
+ title: '๐Ÿ“– Documentation',
103
+ content: `**All docs available on GitHub:**
104
+
105
+ โ€ข **Quick Start:** <https://github.com/Wolfe-Jam/claude-faf-mcp/blob/main/docs/QUICK_START.md>
106
+ โ€ข **User Guide:** <https://github.com/Wolfe-Jam/claude-faf-mcp/blob/main/docs/USER_GUIDE.md>
107
+ โ€ข **FAQ:** <https://github.com/Wolfe-Jam/claude-faf-mcp/blob/main/docs/FAQ.md>
108
+ โ€ข **PODIUM System:** <https://github.com/Wolfe-Jam/claude-faf-mcp/blob/main/docs/PODIUM-SYSTEM.md>
109
+ โ€ข **Main README:** <https://github.com/Wolfe-Jam/claude-faf-mcp>
110
+
111
+ **npm packages:**
112
+ โ€ข MCP: <https://www.npmjs.com/package/claude-faf-mcp>
113
+ โ€ข CLI: <https://www.npmjs.com/package/faf-cli>
114
+
115
+ **Website:** <https://faf.one>`,
116
+ order: 5
117
+ },
118
+ {
119
+ title: 'โญ๏ธ Support FAF',
120
+ content: `**Help FAF grow:**
121
+
122
+ โญ๏ธ **Star on GitHub:** <https://github.com/Wolfe-Jam/claude-faf-mcp>
123
+ Every star helps developers discover this tool!
124
+
125
+ ๐Ÿ’ฌ **Join the community:**
126
+ Already here? Introduce yourself in #introductions!
127
+
128
+ ๐Ÿ“ฃ **Share FAF:**
129
+ Know someone building with Claude? Share the npm link:
130
+ <https://www.npmjs.com/package/claude-faf-mcp>
131
+
132
+ ๐Ÿ› **Report issues:** <https://github.com/Wolfe-Jam/claude-faf-mcp/issues>
133
+
134
+ โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
135
+ Thanks for being part of the FAF community! ๐Ÿงก`,
136
+ order: 6
137
+ }
138
+ ];
139
+
140
+ function postToDiscord(webhookUrl, content) {
141
+ return new Promise((resolve, reject) => {
142
+ const url = new URL(webhookUrl);
143
+ const payload = JSON.stringify({
144
+ content: content.substring(0, 2000)
145
+ });
146
+
147
+ const options = {
148
+ hostname: url.hostname,
149
+ path: url.pathname + url.search,
150
+ method: 'POST',
151
+ headers: {
152
+ 'Content-Type': 'application/json',
153
+ 'Content-Length': Buffer.byteLength(payload)
154
+ }
155
+ };
156
+
157
+ const req = https.request(options, (res) => {
158
+ let body = '';
159
+ res.on('data', chunk => body += chunk);
160
+ res.on('end', () => {
161
+ if (res.statusCode === 204 || res.statusCode === 200) {
162
+ resolve();
163
+ } else {
164
+ reject(new Error(`Discord returned status ${res.statusCode}: ${body}`));
165
+ }
166
+ });
167
+ });
168
+
169
+ req.on('error', reject);
170
+ req.write(payload);
171
+ req.end();
172
+ });
173
+ }
174
+
175
+ async function syncDocs(webhookUrl) {
176
+ console.log('๐Ÿ”„ Starting Discord documentation sync (final)...\n');
177
+
178
+ const sortedMessages = MESSAGES.sort((a, b) => a.order - b.order);
179
+
180
+ for (const msg of sortedMessages) {
181
+ const message = `**${msg.title}**
182
+
183
+ ${msg.content}`;
184
+
185
+ try {
186
+ await postToDiscord(webhookUrl, message);
187
+ console.log(`โœ… Posted ${msg.title}`);
188
+
189
+ // Rate limit: Discord allows 5 requests per 2 seconds
190
+ await new Promise(resolve => setTimeout(resolve, 1000));
191
+ } catch (error) {
192
+ console.error(`โŒ Failed to post ${msg.title}:`, error.message);
193
+ }
194
+ }
195
+
196
+ console.log('\nโœจ Sync complete!');
197
+ }
198
+
199
+ // Main execution
200
+ if (require.main === module) {
201
+ const webhookUrl = process.argv[2];
202
+
203
+ if (!webhookUrl) {
204
+ console.error('Usage: node scripts/discord-sync-final.js <webhook-url>');
205
+ console.error('\nGet your webhook URL from Discord:');
206
+ console.error('1. Server Settings > Integrations > Webhooks');
207
+ console.error('2. Create New Webhook or use existing');
208
+ console.error('3. Copy Webhook URL');
209
+ process.exit(1);
210
+ }
211
+
212
+ syncDocs(webhookUrl).catch((error) => {
213
+ console.error('Fatal error:', error);
214
+ process.exit(1);
215
+ });
216
+ }
217
+
218
+ module.exports = { syncDocs };