faf-mcp 2.3.1 → 3.0.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/CHANGELOG.md +49 -4
- package/CLAUDE.md +10 -6
- package/README.md +95 -86
- package/dist/src/faf-core/commands/agents.d.ts +2 -2
- package/dist/src/faf-core/commands/agents.js +2 -2
- package/dist/src/faf-core/commands/claude.d.ts +31 -0
- package/dist/src/faf-core/commands/{bi-sync.js → claude.js} +39 -77
- package/dist/src/faf-core/commands/claude.js.map +1 -0
- package/dist/src/faf-core/commands/conductor.d.ts +1 -1
- package/dist/src/faf-core/commands/conductor.js +1 -1
- package/dist/src/faf-core/commands/cursor.d.ts +2 -2
- package/dist/src/faf-core/commands/cursor.js +2 -2
- package/dist/src/faf-core/commands/gemini.d.ts +2 -2
- package/dist/src/faf-core/commands/gemini.js +2 -2
- package/dist/src/faf-core/commands/git-context.d.ts +1 -1
- package/dist/src/faf-core/commands/git-context.js +2 -2
- package/dist/src/faf-core/commands/git-context.js.map +1 -1
- package/dist/src/faf-core/commands/sync.js.map +1 -1
- package/dist/src/faf-core/engines/dependency-tsa.js.map +1 -1
- package/dist/src/faf-core/fix-once/colors.js +1 -1
- package/dist/src/faf-core/fix-once/colors.js.map +1 -1
- package/dist/src/faf-core/parsers/agents-parser.d.ts +17 -1
- package/dist/src/faf-core/parsers/agents-parser.js +31 -124
- package/dist/src/faf-core/parsers/agents-parser.js.map +1 -1
- package/dist/src/faf-core/parsers/conductor-parser.d.ts +1 -1
- package/dist/src/faf-core/parsers/conductor-parser.js +2 -2
- package/dist/src/faf-core/parsers/conductor-parser.js.map +1 -1
- package/dist/src/faf-core/parsers/cursorrules-parser.d.ts +17 -1
- package/dist/src/faf-core/parsers/cursorrules-parser.js +56 -112
- package/dist/src/faf-core/parsers/cursorrules-parser.js.map +1 -1
- package/dist/src/faf-core/parsers/faf-git-generator.d.ts +1 -1
- package/dist/src/faf-core/parsers/faf-git-generator.js +6 -6
- package/dist/src/faf-core/parsers/faf-git-generator.js.map +1 -1
- package/dist/src/faf-core/parsers/gemini-parser.d.ts +12 -1
- package/dist/src/faf-core/parsers/gemini-parser.js +21 -78
- package/dist/src/faf-core/parsers/gemini-parser.js.map +1 -1
- package/dist/src/faf-core/parsers/github-extractor.d.ts +1 -1
- package/dist/src/faf-core/parsers/github-extractor.js +1 -1
- package/dist/src/faf-core/parsers/slot-counter.d.ts +1 -1
- package/dist/src/faf-core/parsers/slot-counter.js +1 -1
- package/dist/src/handlers/engine-adapter.d.ts +13 -12
- package/dist/src/handlers/engine-adapter.js +105 -683
- package/dist/src/handlers/engine-adapter.js.map +1 -1
- package/dist/src/handlers/resources.d.ts +19 -1
- package/dist/src/handlers/resources.js +108 -23
- package/dist/src/handlers/resources.js.map +1 -1
- package/dist/src/handlers/skills.d.ts +70 -0
- package/dist/src/handlers/skills.js +174 -0
- package/dist/src/handlers/skills.js.map +1 -0
- package/dist/src/handlers/tools.d.ts +43 -7
- package/dist/src/handlers/tools.js +300 -375
- package/dist/src/handlers/tools.js.map +1 -1
- package/dist/src/server.d.ts +4 -0
- package/dist/src/server.js +51 -6
- package/dist/src/server.js.map +1 -1
- package/dist/src/utils/faf-cli-bridge.d.ts +14 -8
- package/dist/src/utils/faf-cli-bridge.js +28 -8
- package/dist/src/utils/faf-cli-bridge.js.map +1 -1
- package/package.json +18 -15
- package/project.faf +14 -9
- package/scripts/check-engines.mjs +53 -0
- package/scripts/sync-version.js +33 -19
- package/skills/faf-ide/SKILL.md +40 -0
- package/dist/src/config/visibility.d.ts +0 -41
- package/dist/src/config/visibility.js +0 -158
- package/dist/src/config/visibility.js.map +0 -1
- package/dist/src/faf-core/commands/audit.d.ts +0 -21
- package/dist/src/faf-core/commands/audit.js +0 -83
- package/dist/src/faf-core/commands/audit.js.map +0 -1
- package/dist/src/faf-core/commands/auto.d.ts +0 -25
- package/dist/src/faf-core/commands/auto.js +0 -74
- package/dist/src/faf-core/commands/auto.js.map +0 -1
- package/dist/src/faf-core/commands/bi-sync.d.ts +0 -31
- package/dist/src/faf-core/commands/bi-sync.js.map +0 -1
- package/dist/src/faf-core/commands/doctor.d.ts +0 -17
- package/dist/src/faf-core/commands/doctor.js +0 -198
- package/dist/src/faf-core/commands/doctor.js.map +0 -1
- package/dist/src/faf-core/commands/enhance.d.ts +0 -46
- package/dist/src/faf-core/commands/enhance.js +0 -360
- package/dist/src/faf-core/commands/enhance.js.map +0 -1
- package/dist/src/faf-core/commands/formats.d.ts +0 -22
- package/dist/src/faf-core/commands/formats.js +0 -117
- package/dist/src/faf-core/commands/formats.js.map +0 -1
- package/dist/src/faf-core/commands/human.d.ts +0 -27
- package/dist/src/faf-core/commands/human.js +0 -183
- package/dist/src/faf-core/commands/human.js.map +0 -1
- package/dist/src/faf-core/commands/init.d.ts +0 -26
- package/dist/src/faf-core/commands/init.js +0 -114
- package/dist/src/faf-core/commands/init.js.map +0 -1
- package/dist/src/faf-core/commands/innit.d.ts +0 -7
- package/dist/src/faf-core/commands/innit.js +0 -13
- package/dist/src/faf-core/commands/innit.js.map +0 -1
- package/dist/src/faf-core/commands/migrate.d.ts +0 -15
- package/dist/src/faf-core/commands/migrate.js +0 -86
- package/dist/src/faf-core/commands/migrate.js.map +0 -1
- package/dist/src/faf-core/commands/quick.d.ts +0 -16
- package/dist/src/faf-core/commands/quick.js +0 -184
- package/dist/src/faf-core/commands/quick.js.map +0 -1
- package/dist/src/faf-core/commands/readme.d.ts +0 -47
- package/dist/src/faf-core/commands/readme.js +0 -361
- package/dist/src/faf-core/commands/readme.js.map +0 -1
- package/dist/src/faf-core/commands/score.d.ts +0 -47
- package/dist/src/faf-core/commands/score.js +0 -49
- package/dist/src/faf-core/commands/score.js.map +0 -1
- package/dist/src/faf-core/commands/update.d.ts +0 -12
- package/dist/src/faf-core/commands/update.js +0 -46
- package/dist/src/faf-core/commands/update.js.map +0 -1
- package/dist/src/faf-core/commands/validate.d.ts +0 -21
- package/dist/src/faf-core/commands/validate.js +0 -81
- package/dist/src/faf-core/commands/validate.js.map +0 -1
- package/dist/src/faf-core/compiler/faf-compiler.d.ts +0 -138
- package/dist/src/faf-core/compiler/faf-compiler.js +0 -1362
- package/dist/src/faf-core/compiler/faf-compiler.js.map +0 -1
- package/dist/src/faf-core/engines/fab-formats-processor.d.ts +0 -166
- package/dist/src/faf-core/engines/fab-formats-processor.js +0 -1274
- package/dist/src/faf-core/engines/fab-formats-processor.js.map +0 -1
- package/dist/src/faf-core/engines/faf-dna.d.ts +0 -159
- package/dist/src/faf-core/engines/faf-dna.js +0 -555
- package/dist/src/faf-core/engines/faf-dna.js.map +0 -1
- package/dist/src/faf-core/engines/relentless-context-extractor.d.ts +0 -100
- package/dist/src/faf-core/engines/relentless-context-extractor.js +0 -625
- package/dist/src/faf-core/engines/relentless-context-extractor.js.map +0 -1
- package/dist/src/faf-core/fix-once/types.d.ts +0 -257
- package/dist/src/faf-core/fix-once/types.js +0 -26
- package/dist/src/faf-core/fix-once/types.js.map +0 -1
- package/dist/src/faf-core/generators/faf-generator-championship.d.ts +0 -16
- package/dist/src/faf-core/generators/faf-generator-championship.js +0 -463
- package/dist/src/faf-core/generators/faf-generator-championship.js.map +0 -1
- package/dist/src/faf-core/inject.d.ts +0 -19
- package/dist/src/faf-core/inject.js +0 -57
- package/dist/src/faf-core/inject.js.map +0 -1
- package/dist/src/faf-core/parsers/index.d.ts +0 -12
- package/dist/src/faf-core/parsers/index.js +0 -29
- package/dist/src/faf-core/parsers/index.js.map +0 -1
- package/dist/src/faf-core/utils/balance-visualizer.d.ts +0 -37
- package/dist/src/faf-core/utils/balance-visualizer.js +0 -197
- package/dist/src/faf-core/utils/balance-visualizer.js.map +0 -1
- package/dist/src/faf-core/utils/championship-style.d.ts +0 -109
- package/dist/src/faf-core/utils/championship-style.js +0 -219
- package/dist/src/faf-core/utils/championship-style.js.map +0 -1
- package/dist/src/faf-core/utils/chrome-extension-detector.d.ts +0 -73
- package/dist/src/faf-core/utils/chrome-extension-detector.js +0 -268
- package/dist/src/faf-core/utils/chrome-extension-detector.js.map +0 -1
- package/dist/src/faf-core/utils/platform-detector.d.ts +0 -30
- package/dist/src/faf-core/utils/platform-detector.js +0 -218
- package/dist/src/faf-core/utils/platform-detector.js.map +0 -1
- package/dist/src/faf-core/utils/technical-credit.d.ts +0 -35
- package/dist/src/faf-core/utils/technical-credit.js +0 -286
- package/dist/src/faf-core/utils/technical-credit.js.map +0 -1
- package/dist/src/faf-core/utils/yaml-generator.d.ts +0 -41
- package/dist/src/faf-core/utils/yaml-generator.js +0 -360
- package/dist/src/faf-core/utils/yaml-generator.js.map +0 -1
- package/dist/src/handlers/behavioral-instruction.d.ts +0 -16
- package/dist/src/handlers/behavioral-instruction.js +0 -43
- package/dist/src/handlers/behavioral-instruction.js.map +0 -1
- package/dist/src/handlers/championship-tools.d.ts +0 -116
- package/dist/src/handlers/championship-tools.js +0 -2320
- package/dist/src/handlers/championship-tools.js.map +0 -1
- package/dist/src/handlers/cloud-handler.d.ts +0 -59
- package/dist/src/handlers/cloud-handler.js +0 -348
- package/dist/src/handlers/cloud-handler.js.map +0 -1
- package/dist/src/handlers/tool-registry.d.ts +0 -23
- package/dist/src/handlers/tool-registry.js +0 -68
- package/dist/src/handlers/tool-registry.js.map +0 -1
- package/dist/src/handlers/tool-types.d.ts +0 -167
- package/dist/src/handlers/tool-types.js +0 -7
- package/dist/src/handlers/tool-types.js.map +0 -1
- package/dist/src/test-all-functions.d.ts +0 -15
- package/dist/src/test-all-functions.js +0 -163
- package/dist/src/test-all-functions.js.map +0 -1
- package/dist/src/types/mcp-tools.d.ts +0 -53
- package/dist/src/types/mcp-tools.js +0 -77
- package/dist/src/types/mcp-tools.js.map +0 -1
- package/dist/src/types/tool-visibility.d.ts +0 -36
- package/dist/src/types/tool-visibility.js +0 -551
- package/dist/src/types/tool-visibility.js.map +0 -1
- package/dist/src/utils/auto-path-detection.d.ts +0 -26
- package/dist/src/utils/auto-path-detection.js +0 -198
- package/dist/src/utils/auto-path-detection.js.map +0 -1
- package/dist/src/utils/championship-format.d.ts +0 -30
- package/dist/src/utils/championship-format.js +0 -81
- package/dist/src/utils/championship-format.js.map +0 -1
- package/dist/src/utils/cli-detector.d.ts +0 -17
- package/dist/src/utils/cli-detector.js +0 -247
- package/dist/src/utils/cli-detector.js.map +0 -1
- package/dist/src/utils/display-protocol.d.ts +0 -57
- package/dist/src/utils/display-protocol.js +0 -131
- package/dist/src/utils/display-protocol.js.map +0 -1
- package/dist/src/utils/username-detector.d.ts +0 -27
- package/dist/src/utils/username-detector.js +0 -90
- package/dist/src/utils/username-detector.js.map +0 -1
- package/dist/src/utils/visual-style.d.ts +0 -62
- package/dist/src/utils/visual-style.js +0 -166
- package/dist/src/utils/visual-style.js.map +0 -1
- package/scripts/postinstall.js +0 -50
- package/skill/SKILL.md +0 -385
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!-- faf: faf-mcp | TypeScript | mcp
|
|
2
|
-
<!-- faf: doc=changelog | latest=
|
|
1
|
+
<!-- faf: faf-mcp | TypeScript | mcp | The Interop MCP for Context — the Cursor / IDE Edition. Persistent context for Cursor, VS Code, and every MCP-compatible IDE. IANA-registered application/vnd.faf+yaml. Start with "Use FAF". -->
|
|
2
|
+
<!-- faf: doc=changelog | latest=v3.0.1 | canonical=project.faf | family=FAF -->
|
|
3
3
|
|
|
4
4
|
# Changelog
|
|
5
5
|
|
|
@@ -8,7 +8,52 @@ All notable changes to faf-mcp will be documented in this file.
|
|
|
8
8
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
9
9
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
10
10
|
|
|
11
|
-
## [
|
|
11
|
+
## [3.0.1] - 2026-09-10 — The Compose Edition
|
|
12
|
+
|
|
13
|
+
**Names that match the code: `faf_bi_sync` is now `faf_claude`, `faf_init` writes what `faf init` writes, and the listings lead with .FAF Context.**
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- **`faf_bi_sync` is now `faf_claude`.** The tool only ever wrote CLAUDE.md from `project.faf`, one direction; nothing read CLAUDE.md back. The old name, its "Bi-sync now active!" message and its header claimed a two-way sync it never did. `faf_claude` sits beside `faf_agents`, `faf_cursor` and `faf_gemini`, keeps the `agents` / `cursor` / `gemini` / `all` flags, and stays in the Core tier. Tool count unchanged: 29, 15 by default.
|
|
17
|
+
- `faf_bi_sync` still answers as an unlisted alias, so existing prompts and configs keep working. Its removal will be announced here first.
|
|
18
|
+
- `faf_agents`, `faf_cursor` and `faf_gemini` no longer call their `sync` action "bidirectional": it re-writes the file from `project.faf` (export with force). `import` reads the file; `merge: true` writes it into `project.faf`.
|
|
19
|
+
- README "Eternal Sync" tells the direction truthfully: CLAUDE.md is written from `project.faf`; the other three formats can also import.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- **`faf_init` writes what `faf init` writes.** It runs faf-cli's own init steps on the folder, so the file is valid and scored from what the folder holds, and it reports that starting score. Before, it wrote a legacy template that scored 0% on any folder, failed `faf_trust` and crashed `faf_go`. The new project also becomes the current one, so the next steps it suggests act on it. Path handling is unchanged.
|
|
23
|
+
- **The docs page no longer strikes through its own keyword.** The hero line rendered "Context" in red strikethrough, a style left over from an older slogan.
|
|
24
|
+
- README: the all-formats example is the MCP call that works (`faf bi-sync --all` is rejected by faf-cli 7.12); 25 test suites, not 9; the Trophy badge and tier table use ✪.
|
|
25
|
+
- The server status banner reports 29 tools, 15 by default, and reads the version from the package instead of a hardcoded "33+".
|
|
26
|
+
- Tool output: headers say FAF, not "Claude FAF"; the readiness target is 100%, not 99%; tier lines use ✪ ★ ◆ ◇ ●; tools say they author and rewrite files.
|
|
27
|
+
- `faf_git` writes `faf_version: "3.0"` and the package version into the files it authors (it wrote 2.5.0 and 4.5.0), with the spec URL at faf.one.
|
|
28
|
+
- Listings lead with the product name: the npm, MCP Registry, Glama and Smithery descriptions say **.FAF Context**, and `project.faf` marks PulseMCP and Glama live.
|
|
29
|
+
- The registry receipt in `server.json` is refreshed, and the `.faf-dna` birth certificate is re-grounded at 100% with its 2025 birth record kept.
|
|
30
|
+
- Docs: the two essays keep their dated figures with broken links, paths and the missing image fixed; the style source mirrors the live page.
|
|
31
|
+
- Source comments that labelled faf-cli 7.12 code as v4.5.0, faf-cli 7.11.0 or Node 18 now say what the code does; ported parsers keep their provenance line.
|
|
32
|
+
|
|
33
|
+
## [3.0.0] - 2026-09-09 — The Compose Edition
|
|
34
|
+
|
|
35
|
+
**Compose, don't port: faf-mcp 3.0 runs on faf-cli 7.12 in-process — one scorer, one set of renderers, one injector — and every number, file and claim this package makes is true. Local stdio, 29 tools, Node 22+.**
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
- **One score function.** `faf_auto`, `faf_dna`, `faf_doctor`, `faf_go` and `faf_bi_sync` all report faf-cli's `scoreFafYaml` on the bytes on disk. The local `calculateSimpleScore` heuristic (29 points off `faf_score` on the same file), `faf_go`'s 8-field ratio, `faf_bi_sync`'s "FAF Score: 0%" and `faf_dna`'s frozen birth score are gone.
|
|
39
|
+
- **No more shelling out.** `faf_trust`, `faf_clear` and both resources no longer fall through to whatever `faf` is on PATH. The startup `which faf` detector, the exec fallback and the "install faf-cli FIRST" banner are removed; nothing under `src/` imports `child_process`. A machine with an unrelated `faf` binary on PATH is no longer a problem.
|
|
40
|
+
- **Managed-block injector** matches markers as whole lines at column 0 (fenced examples skipped, an unbalanced fence inside the block cannot hide the end marker, CRLF and BOM preserved). A file written by faf-cli 7.11.0 no longer stacks on re-export; a block that lost its end marker is prefixed, never overwritten.
|
|
41
|
+
- **Tool contracts match their handlers.** `faf_sync` says what it does (reconcile `project.faf` with package.json/git, dry-run, `apply:true` writes); `faf_bi_sync` drops the never-read `auto`/`watch`/`force` flags and states its direction; `faf_clear` offers only the store that exists; `faf_debug` reports the bundled faf-cli version; `faf_auto` drops an unread `force`; seven references to the retired `faf_enhance` are gone. Failed bundled commands now carry their reason instead of "❌ undefined".
|
|
42
|
+
- **Docs tell the truth.** The "Hosted MCP endpoint" claim, the "Deploy to Vercel" door, the MCPaaS landing copy, the `faf_cloud_*` tool table, "Streamable HTTP" and "Cloudflare edge" in `project.faf`/`CLAUDE.md` are removed. faf-mcp runs locally over stdio; that is what every surface now says.
|
|
43
|
+
- `tests/wjttc-v200` no longer writes AGENTS.md / .cursorrules / GEMINI.md into the repo root on every run.
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
- **Composes faf-cli 7.12.0 (The Open Renderers Edition).** AGENTS.md, GEMINI.md, .cursorrules and CLAUDE.md are written by faf-cli's own renderers, repo enrichment and injector — the same bytes `faf export` and `faf sync` write. `faf_auto` runs faf-cli's `updateExistingFaf` on an existing file and `writeFaf` for the bytes (no runtime `_meta` block; docker-compose facts flow instead of arriving as `slotignored`). The hand-ported renderers, the pre-v3 CLAUDE.md template and faf-mcp's own injector are deleted.
|
|
47
|
+
- Resource URIs are `faf://context` and `faf://status`; `claude-faf://` stays readable as an alias for this release.
|
|
48
|
+
- `faf-cli` dependency `^6.10.1` → `^7.12.0`; `@modelcontextprotocol/sdk` `^1.27.1` → `^1.30.0` (its own range now admits `@hono/node-server` 2.x, so the forced-major override for it is gone); hono override floor `>=4.13.5`.
|
|
49
|
+
- **Node 22 or newer.** The floor was 18, which reached end of life in April 2025 (20 followed in April 2026), and six production dependencies already required 20+. `engines.node` is now `>=22.0.0`, the CI smoke matrix runs 22 and 24, and `scripts/check-engines.mjs` refuses a floor that CI does not exercise.
|
|
50
|
+
|
|
51
|
+
### Removed
|
|
52
|
+
- 44 unreachable source modules (~15,900 lines): the Mk3 bundled engine (13 vendored commands, `championship-tools.ts`, `cloud-handler.ts`, the shadow tool-visibility registry, the bundled compiler, `faf-dna.ts` and helpers). Tarball 256 → 126 files. `prebuild` now clears `dist/` — tsc never did, so deleted modules had kept shipping.
|
|
53
|
+
- `scripts/postinstall.js` (told users to global-install a dependency this package bundles), `start-http.js` (retired transport), the stale `skill/SKILL.md`.
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
- Regression suites: score parity with a hand-authored seed that kills the pre-merge mutant, tool-schema truth (every declared property is read by its handler; every `faf_*` name in output exists), score truth, engine-adapter (no `child_process`, unknown command is an error), line-anchored injector, compose-faf-cli (byte-identical to faf-cli's writers), no-false-hosted-claim over every shipped surface.
|
|
12
57
|
|
|
13
58
|
## [2.3.1] - 2026-06-30
|
|
14
59
|
|
|
@@ -58,7 +103,7 @@ faf-mcp now **enhances** your context files instead of replacing them — a stru
|
|
|
58
103
|
|
|
59
104
|
### Changed
|
|
60
105
|
|
|
61
|
-
- **Non-destructive interop.** `faf_cursor`, `faf_agents`, `faf_gemini`, and `faf_sync` now inject a structured `.faf` block at the top of .cursorrules, AGENTS.md, GEMINI.md, and CLAUDE.md and preserve everything you've written below. Re-runs update the block in place (idempotent); existing faf-
|
|
106
|
+
- **Non-destructive interop.** `faf_cursor`, `faf_agents`, `faf_gemini`, and `faf_sync` now inject a structured `.faf` block at the top of .cursorrules, AGENTS.md, GEMINI.md, and CLAUDE.md and preserve everything you've written below. Re-runs update the block in place (idempotent); existing faf-authored files upgrade cleanly in one pass.
|
|
62
107
|
- **Composes faf-cli's single-source engines.** Turbo-Cat (~200-format detection) and the 6Ws interview now come from faf-cli — faf-mcp's own forks are deleted. One source of truth, no drift between the CLI and the server.
|
|
63
108
|
- **Migrated to the `one.faf` namespace.** MCP Registry identity `io.github.Wolfe-Jam/faf-mcp` → `one.faf/faf-mcp` (DNS-verified), carrying the single-source `one.faf/context` `_meta` block emitted by faf-cli. The npm package `faf-mcp`, its tools, and its downloads are **unchanged** — only the registry identity moves.
|
|
64
109
|
|
package/CLAUDE.md
CHANGED
|
@@ -12,9 +12,9 @@ The Interop MCP for Context — the Cursor / IDE Edition. Persistent context for
|
|
|
12
12
|
|
|
13
13
|
- **Language:** TypeScript
|
|
14
14
|
- **Backend:** MCP SDK (TS)
|
|
15
|
-
- **API:** MCP (stdio
|
|
16
|
-
- **Runtime:** Node.js >=
|
|
17
|
-
- **Hosting:** npm
|
|
15
|
+
- **API:** MCP (stdio)
|
|
16
|
+
- **Runtime:** Node.js >=22
|
|
17
|
+
- **Hosting:** npm
|
|
18
18
|
- **Build:** TypeScript (tsc)
|
|
19
19
|
- **CI/CD:** GitHub Actions
|
|
20
20
|
- **Package Manager:** npm
|
|
@@ -24,11 +24,15 @@ The Interop MCP for Context — the Cursor / IDE Edition. Persistent context for
|
|
|
24
24
|
- **Who:** Developers using Claude, Cursor, Windsurf, VS Code, Cline, and any MCP-compatible IDE
|
|
25
25
|
- **What:** The Cursor / IDE Edition — persistent context for Cursor, VS Code, and every MCP-compatible IDE — 29 MCP tools (15 essential shown by default), interop with AGENTS.md, .cursorrules, GEMINI.md
|
|
26
26
|
- **Why:** Eliminate the 20-minute AI context tax — give AI instant project understanding in 30 seconds
|
|
27
|
-
- **Where:** npm · MCP Registry ·
|
|
28
|
-
- **When:** Production/Stable —
|
|
27
|
+
- **Where:** npm · MCP Registry · any MCP-compatible IDE — people get it how they wish
|
|
28
|
+
- **When:** Production/Stable — v3.0.1 The Compose Edition, WJTTC certified
|
|
29
29
|
- **How:** npx faf-mcp or npm install -g faf-mcp, then add to your MCP config
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
33
|
-
*STATUS: BI-SYNC ACTIVE — 2026-
|
|
33
|
+
*STATUS: BI-SYNC ACTIVE — 2026-09-10T19:01:58.786Z*
|
|
34
34
|
<!-- faf:end -->
|
|
35
|
+
|
|
36
|
+
## Working here
|
|
37
|
+
|
|
38
|
+
Build, test, layout and the load-bearing conventions live in AGENTS.md under "Working in this repo". Refresh the managed block above with `faf sync` (CLI) or the `faf_claude` tool (MCP); both keep this section.
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- faf: faf-mcp | TypeScript | mcp
|
|
1
|
+
<!-- faf: faf-mcp | TypeScript | mcp | The Interop MCP for Context — the Cursor / IDE Edition. Persistent context for Cursor, VS Code, and every MCP-compatible IDE. IANA-registered application/vnd.faf+yaml. Start with "Use FAF". -->
|
|
2
2
|
<!-- faf: doc=readme | canonical=project.faf | score=100 | family=FAF -->
|
|
3
3
|
|
|
4
4
|
<div style="display: flex; align-items: center; gap: 12px;">
|
|
@@ -10,13 +10,16 @@
|
|
|
10
10
|
</div>
|
|
11
11
|
|
|
12
12
|
[](https://www.npmjs.com/package/faf-mcp)[](https://www.npmjs.com/package/faf-mcp)
|
|
13
|
-
[](https://faf.one)
|
|
14
14
|
[](https://www.iana.org/assignments/media-types/application/vnd.faf+yaml)
|
|
15
15
|
[](https://doi.org/10.5281/zenodo.18251362)
|
|
16
|
+
[](https://doi.org/10.5281/zenodo.21951641)
|
|
16
17
|
|
|
17
|
-
**Home:** [wolfe-jam.github.io/faf-mcp](https://wolfe-jam.github.io/faf-mcp/)
|
|
18
|
+
**Home:** [wolfe-jam.github.io/faf-mcp](https://wolfe-jam.github.io/faf-mcp/)
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
**.FAF Context** is the MCP server for the IDE side of FAF. One `project.faf` in your repo, and every AI tool's context file is authored from it — AGENTS.md, .cursorrules, GEMINI.md, CLAUDE.md — and scored, so you know exactly where to focus. It runs locally over stdio on the same faf-cli the terminal uses. The FAF ecosystem it belongs to has comfortably passed 100k downloads across npm and PyPI ([live count](https://faf.one/downloads)).
|
|
21
|
+
|
|
22
|
+
⭐ Bookmarks it for you, helps other devs find it too.
|
|
20
23
|
|
|
21
24
|
[](https://github.com/Wolfe-Jam/faf-mcp/actions/workflows/ci.yml)
|
|
22
25
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -24,9 +27,26 @@ The MCP you didn't realise you needed, or wanted but didn't know who to ask, is
|
|
|
24
27
|
|
|
25
28
|
---
|
|
26
29
|
|
|
27
|
-
## What's New in
|
|
30
|
+
## What's New in 3.0.1 — The Compose Edition
|
|
31
|
+
|
|
32
|
+
**Names that match the code: `faf_bi_sync` is now `faf_claude`, `faf_init` writes what `faf init` writes, and the listings lead with .FAF Context.**
|
|
33
|
+
|
|
34
|
+
- **`faf_bi_sync` is now `faf_claude`.** It writes CLAUDE.md from `project.faf`, one direction, which is all it ever did. The old name still answers, so existing configs keep working.
|
|
35
|
+
- **`faf_init` writes what `faf init` writes.** It runs faf-cli's own init on the folder: a valid file, scored from what is there, and the new project becomes the current one.
|
|
36
|
+
- **The interop tools say what `sync` does.** `faf_agents`, `faf_cursor` and `faf_gemini` re-write their file from `project.faf`; `import` with `merge: true` brings a file back in.
|
|
37
|
+
- **Surfaces corrected.** The docs page hero, the npm, MCP Registry, Glama and Smithery descriptions, the registry receipt, the birth certificate and dozens of tool strings now match 3.0.
|
|
38
|
+
|
|
39
|
+
## The Compose Edition (3.0)
|
|
40
|
+
|
|
41
|
+
**Compose, don't port: faf-mcp 3.0 runs on faf-cli 7.12 in-process — one scorer, one set of renderers, one injector — and every number, file and claim this package makes is true. Local stdio, 29 tools, Node 22+.**
|
|
28
42
|
|
|
29
|
-
**
|
|
43
|
+
- **Composes faf-cli 7.12.** AGENTS.md, GEMINI.md, .cursorrules and CLAUDE.md are written by faf-cli's own renderers, repo enrichment and block injector — the same bytes `faf export` and `faf sync` write. `faf_auto` runs faf-cli's own update chain. The hand-ported renderers, the pre-v3 CLAUDE.md template and the local injector are gone.
|
|
44
|
+
- **One score function.** `faf_auto`, `faf_go`, `faf_dna`, `faf_doctor` and `faf_claude` all report faf-cli's scorer on the bytes on disk — no local heuristics, no frozen birth score, no "0%".
|
|
45
|
+
- **Nothing shells out.** The `which faf` detector, the exec fallback and the "install faf-cli first" banner are gone; nothing under `src/` imports `child_process`. A machine with an unrelated `faf` on PATH is no longer a problem.
|
|
46
|
+
- **Every tool contract matches its handler.** Descriptions say what the tools do, schemas declare only flags that are read, failures carry their reason.
|
|
47
|
+
- **The Mk3 engine is deleted.** 44 unreachable modules, ~15,900 lines; the tarball halves. `prebuild` clears `dist/` so nothing deleted ever ships again.
|
|
48
|
+
- **Resource URIs** are `faf://context` and `faf://status`; `claude-faf://` remains readable as an alias for this release.
|
|
49
|
+
- **Node 22 or newer.** 18 and 20 are end of life; the CI matrix runs 22 and 24 and a guard keeps the floor honest.
|
|
30
50
|
|
|
31
51
|
---
|
|
32
52
|
|
|
@@ -36,6 +56,8 @@ You maintain `.cursorrules`. Your teammate uses `AGENTS.md`. Someone on the team
|
|
|
36
56
|
|
|
37
57
|
**faf-mcp is the dedicated MCP server for Cursor, Windsurf, Cline, VS Code, and every non-Claude platform.** One `.faf` file in your repo, synced to every format your team needs.
|
|
38
58
|
|
|
59
|
+
**Context for Cursor & IDE agents:** faf-cli (v7.12) authors the files this server syncs — `bunx faf export --agents`, zero-install and git-native. See [FAF-CLI for Cursor & IDE agents 👀](https://github.com/Wolfe-Jam/faf-cli/blob/main/docs/faf-cli-for-agents.md).
|
|
60
|
+
|
|
39
61
|
```
|
|
40
62
|
project.faf
|
|
41
63
|
│
|
|
@@ -47,6 +69,10 @@ You maintain `.cursorrules`. Your teammate uses `AGENTS.md`. Someone on the team
|
|
|
47
69
|
|
|
48
70
|
### Quick Start
|
|
49
71
|
|
|
72
|
+
**Cursor — one click:** [](cursor://anysphere.cursor-deeplink/mcp/install?name=faf-mcp&config=eyJjb21tYW5kIjoiYnVueCIsImFyZ3MiOlsiZmFmLW1jcCJdfQ==)
|
|
73
|
+
|
|
74
|
+
**Everywhere else:**
|
|
75
|
+
|
|
50
76
|
```bash
|
|
51
77
|
bunx faf-mcp
|
|
52
78
|
```
|
|
@@ -67,30 +93,14 @@ Add to your MCP config:
|
|
|
67
93
|
|
|
68
94
|
---
|
|
69
95
|
|
|
70
|
-
##
|
|
71
|
-
|
|
72
|
-
| Door | Method | Best For |
|
|
73
|
-
|------|--------|----------|
|
|
74
|
-
| **Hosted** | [mcpaas.live](https://mcpaas.live) | Zero-install, point any MCP client to the URL |
|
|
75
|
-
| **Self-Deploy** | [Deploy to Vercel](https://vercel.com/new?repository-url=https://github.com/Wolfe-Jam/faf-mcp) | Your own instance, full control |
|
|
76
|
-
| **Local** | `bunx faf-mcp` | IDE integration via stdio transport |
|
|
77
|
-
|
|
78
|
-
### Hosted (mcpaas.live)
|
|
96
|
+
## Run It
|
|
79
97
|
|
|
80
|
-
|
|
98
|
+
faf-mcp runs locally over stdio. Point your IDE at one of these commands.
|
|
81
99
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
- `/info` — Server metadata + tool list
|
|
87
|
-
- `/mcp/v1` — MCP Streamable HTTP transport
|
|
88
|
-
|
|
89
|
-
### Local (npm)
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
npx faf-mcp
|
|
93
|
-
```
|
|
100
|
+
| Method | Command |
|
|
101
|
+
|--------|---------|
|
|
102
|
+
| **npm** | `npx faf-mcp` |
|
|
103
|
+
| **Bun** | `bunx faf-mcp` |
|
|
94
104
|
|
|
95
105
|
---
|
|
96
106
|
|
|
@@ -102,62 +112,36 @@ npx faf-mcp
|
|
|
102
112
|
| `faf_cursor` | Cursor IDE | Import/export/sync .cursorrules |
|
|
103
113
|
| `faf_gemini` | Google Gemini | Import/export/sync GEMINI.md |
|
|
104
114
|
| `faf_conductor` | Conductor | Import/export directory structure |
|
|
105
|
-
| `faf_git` | GitHub |
|
|
115
|
+
| `faf_git` | GitHub | Author .faf from any repo URL |
|
|
106
116
|
|
|
107
|
-
```
|
|
108
|
-
#
|
|
109
|
-
|
|
117
|
+
```text
|
|
118
|
+
# MCP tool calls — ask your IDE's AI
|
|
119
|
+
# Write all four formats from project.faf
|
|
120
|
+
faf_claude { all: true }
|
|
110
121
|
|
|
111
|
-
#
|
|
122
|
+
# Author .faf from any GitHub repo
|
|
112
123
|
faf_git { url: "https://github.com/facebook/react" }
|
|
113
124
|
```
|
|
114
125
|
|
|
115
|
-
**Core tier:** 15 essential tools shown by default; set `FAF_TOOLS=all` for the full **29** (every tool stays callable by name either way) ·
|
|
126
|
+
**Core tier:** 15 essential tools shown by default; set `FAF_TOOLS=all` for the full **29** (every tool stays callable by name either way) · **25 test suites** · **7 bundled parsers**
|
|
116
127
|
|
|
117
128
|
---
|
|
118
129
|
|
|
119
|
-
##
|
|
120
|
-
|
|
121
|
-
Share your FAF context globally via [mcpaas.live](https://mcpaas.live):
|
|
130
|
+
## Eternal Sync
|
|
122
131
|
|
|
123
|
-
|
|
124
|
-
|------|---------|
|
|
125
|
-
| `faf_cloud_publish` | Upload to cloud, get shareable URL |
|
|
126
|
-
| `faf_cloud_fetch` | Pull context from cloud |
|
|
127
|
-
| `faf_cloud_list` | List available souls |
|
|
128
|
-
| `faf_cloud_search` | Search across souls |
|
|
129
|
-
| `faf_cloud_share` | Generate share links |
|
|
130
|
-
|
|
131
|
-
**Example Workflow:**
|
|
132
|
-
```bash
|
|
133
|
-
# Upload your project.faf
|
|
134
|
-
faf_cloud_publish { soul_name: "my-project" }
|
|
135
|
-
→ https://mcpaas.live/souls/my-project
|
|
136
|
-
|
|
137
|
-
# Anyone can fetch it
|
|
138
|
-
faf_cloud_fetch { soul_name: "my-project" }
|
|
139
|
-
→ Context merged into local project.faf
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
**Zero-install sharing** - Recipients need no MCP setup. Served from 300+ Cloudflare edges with <1ms cold starts via 2.7KB Zig-WASM engine.
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## Eternal Bi-Sync
|
|
147
|
-
|
|
148
|
-
Your `.faf` file and your platform context files stay synchronized in milliseconds.
|
|
132
|
+
`project.faf` is the source. faf-mcp writes every tool's context file from it in milliseconds.
|
|
149
133
|
|
|
150
134
|
```
|
|
151
|
-
project.faf
|
|
135
|
+
project.faf ──── 8ms ───→ CLAUDE.md / AGENTS.md / .cursorrules / GEMINI.md
|
|
152
136
|
Single source of truth
|
|
153
137
|
```
|
|
154
138
|
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
139
|
+
- `faf_claude { all: true }` writes all four formats at once
|
|
140
|
+
- `faf_agents`, `faf_cursor` and `faf_gemini` can also import an existing file: `merge: true` merges it into `project.faf`
|
|
141
|
+
- Content outside the faf-managed block is preserved, byte for byte
|
|
158
142
|
- Works across teams, branches, sessions
|
|
159
143
|
|
|
160
|
-
AI assistants forget. They drift. Every new session, AI starts guessing again.
|
|
144
|
+
AI assistants forget. They drift. Every new session, AI starts guessing again. One source means **context never goes stale**.
|
|
161
145
|
|
|
162
146
|
---
|
|
163
147
|
|
|
@@ -165,7 +149,7 @@ AI assistants forget. They drift. Every new session, AI starts guessing again. B
|
|
|
165
149
|
|
|
166
150
|
| Tier | Score | Status |
|
|
167
151
|
|------|-------|--------|
|
|
168
|
-
|
|
|
152
|
+
| ✪ **TROPHY** | 100% | AI never has to guess |
|
|
169
153
|
| ★ **GOLD** | 99%+ | 1 slot from Trophy |
|
|
170
154
|
| ◆ **SILVER** | 95%+ | Close — keep going |
|
|
171
155
|
| ◇ **BRONZE** | 85%+ | Interim — keep going |
|
|
@@ -199,8 +183,8 @@ Works on all platforms — stops web search, forces tool usage.
|
|
|
199
183
|
|------|---------|
|
|
200
184
|
| `faf_init` | Initialize project.faf |
|
|
201
185
|
| `faf_score` | Check AI-readiness (0-100%) |
|
|
202
|
-
| `faf_sync` |
|
|
203
|
-
| `
|
|
186
|
+
| `faf_sync` | Reconcile project.faf with package.json / git (dry-run; `apply:true` writes) |
|
|
187
|
+
| `faf_claude` | Write CLAUDE.md (+ AGENTS.md, .cursorrules, GEMINI.md) from project.faf |
|
|
204
188
|
| `faf_read` | Parse and validate FAF files |
|
|
205
189
|
| `faf_write` | Create/update FAF with validation |
|
|
206
190
|
| **Interop Tools** | |
|
|
@@ -208,39 +192,64 @@ Works on all platforms — stops web search, forces tool usage.
|
|
|
208
192
|
| `faf_cursor` | Import/export/sync .cursorrules |
|
|
209
193
|
| `faf_gemini` | Import/export/sync GEMINI.md |
|
|
210
194
|
| `faf_conductor` | Import/export directory structure |
|
|
211
|
-
| `faf_git` |
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
| `faf_cloud_fetch` | Pull from cloud |
|
|
215
|
-
| `faf_cloud_list` | List souls |
|
|
216
|
-
| `faf_cloud_search` | Search souls |
|
|
217
|
-
| `faf_cloud_share` | Generate share links |
|
|
218
|
-
|
|
219
|
-
**Plus CLI fallback** (via faf-cli):
|
|
220
|
-
- `faf readme` - Extract 6 Ws from README (+25-35% boost)
|
|
221
|
-
- `faf human-add` - Non-interactive YAML merge (6Ws Builder)
|
|
222
|
-
- `faf git` - GitHub repo analysis without cloning
|
|
223
|
-
- And 40+ more commands...
|
|
195
|
+
| `faf_git` | Author .faf from GitHub repo URL |
|
|
196
|
+
|
|
197
|
+
**Built on faf-cli.** Every tool composes the bundled [faf-cli](https://www.npmjs.com/package/faf-cli) in-process — the same scorer, the same renderers, the same block injector the CLI uses. Nothing shells out to a `faf` on your PATH.
|
|
224
198
|
|
|
225
199
|
---
|
|
226
200
|
|
|
227
201
|
## Ecosystem
|
|
228
202
|
|
|
229
|
-
- **[claude-faf-mcp](https://npmjs.com/package/claude-faf-mcp)** — Claude Desktop
|
|
203
|
+
- **[claude-faf-mcp](https://npmjs.com/package/claude-faf-mcp)** — Claude Desktop
|
|
230
204
|
- **[faf-cli](https://npmjs.com/package/faf-cli)** — Terminal CLI
|
|
231
205
|
- **[faf-wasm](https://www.npmjs.com/package/faf-wasm)** — WASM SDK (<5ms scoring)
|
|
206
|
+
- **[faf-wasm-gen](https://www.npmjs.com/package/faf-wasm-gen)** — Rust→WASM `project.faf` authoring engine, browser/edge (faf-wasm's authoring sibling)
|
|
207
|
+
- **[faf-trinity](https://github.com/Wolfe-Jam/faf-trinity)** — reference MCP server exposing all three IANA FAF formats (context/memory/agent) together
|
|
232
208
|
- **[faf.one](https://faf.one)** — Official website
|
|
209
|
+
- **[docs/SKILLS-OVER-MCP.md](./docs/SKILLS-OVER-MCP.md)** — J1 Agent Skill `faf-ide` (stdio · skills/list · digests)
|
|
233
210
|
|
|
234
211
|
---
|
|
235
212
|
|
|
236
213
|
If `faf-mcp` has been useful, consider starring the repo — it helps others find it.
|
|
237
214
|
|
|
215
|
+
## Citation
|
|
216
|
+
|
|
217
|
+
If you use `faf-mcp` or the `.faf` / `.fafa` formats in research or production, please cite the format papers:
|
|
218
|
+
|
|
219
|
+
> Wolfe, J. (2025). *Format-Driven AI Context Architecture: The .faf Standard for Persistent Project Understanding*. Zenodo. https://doi.org/10.5281/zenodo.18251362
|
|
220
|
+
|
|
221
|
+
> Wolfe, J. (2026). *Why Agents Need a Passport: .fafa — Portable Identity for the Agentic Era*. Zenodo. https://doi.org/10.5281/zenodo.21951641
|
|
222
|
+
|
|
223
|
+
### BibTeX
|
|
224
|
+
|
|
225
|
+
```bibtex
|
|
226
|
+
@article{wolfe2025faf,
|
|
227
|
+
title = {Format-Driven AI Context Architecture: The .faf Standard for Persistent Project Understanding},
|
|
228
|
+
author = {Wolfe, James},
|
|
229
|
+
year = {2025},
|
|
230
|
+
month = {nov},
|
|
231
|
+
publisher = {Zenodo},
|
|
232
|
+
doi = {10.5281/zenodo.18251362},
|
|
233
|
+
url = {https://doi.org/10.5281/zenodo.18251362}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
@article{wolfe2026fafa,
|
|
237
|
+
title = {Why Agents Need a Passport: .fafa — Portable Identity for the Agentic Era},
|
|
238
|
+
author = {Wolfe, James},
|
|
239
|
+
year = {2026},
|
|
240
|
+
month = {aug},
|
|
241
|
+
publisher = {Zenodo},
|
|
242
|
+
doi = {10.5281/zenodo.21951641},
|
|
243
|
+
url = {https://doi.org/10.5281/zenodo.21951641}
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
238
247
|
## License
|
|
239
248
|
|
|
240
249
|
MIT License — Free and open source
|
|
241
250
|
|
|
242
251
|
---
|
|
243
252
|
|
|
244
|
-
**Zero drift. Eternal sync. AI optimized.**
|
|
253
|
+
**Zero drift. Eternal sync. AI optimized.** ✪
|
|
245
254
|
|
|
246
255
|
*"It's so logical if it didn't exist, AI would have built it itself" — Claude*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Agents Command -
|
|
2
|
+
* Agents Command — Interop (faf-mcp 2.0.0; ported from faf-cli 4.5.0 via claude-faf-mcp 4.5.0)
|
|
3
3
|
*
|
|
4
4
|
* Import/Export/Sync between AGENTS.md and project.faf
|
|
5
|
-
* Bundled command — no
|
|
5
|
+
* Bundled command — no shell-out; export composes faf-cli in-process.
|
|
6
6
|
*/
|
|
7
7
|
export interface AgentsCommandResult {
|
|
8
8
|
success: boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Agents Command -
|
|
3
|
+
* Agents Command — Interop (faf-mcp 2.0.0; ported from faf-cli 4.5.0 via claude-faf-mcp 4.5.0)
|
|
4
4
|
*
|
|
5
5
|
* Import/Export/Sync between AGENTS.md and project.faf
|
|
6
|
-
* Bundled command — no
|
|
6
|
+
* Bundled command — no shell-out; export composes faf-cli in-process.
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Command — writes CLAUDE.md from project.faf, one direction.
|
|
3
|
+
*
|
|
4
|
+
* CLAUDE.md is faf-cli's render of project.faf (the same bytes `faf sync`
|
|
5
|
+
* pushes), injected with faf-cli's injector, so content outside the managed
|
|
6
|
+
* block survives. With agents / cursor / gemini / all it also writes
|
|
7
|
+
* AGENTS.md, .cursorrules and GEMINI.md. Nothing here reads CLAUDE.md back
|
|
8
|
+
* into project.faf. Backs the `faf_claude` tool, named `faf_bi_sync` before
|
|
9
|
+
* 3.0.1; the old name claimed a two-way sync this code never did.
|
|
10
|
+
*/
|
|
11
|
+
export interface ClaudeExportOptions {
|
|
12
|
+
json?: boolean;
|
|
13
|
+
agents?: boolean;
|
|
14
|
+
cursor?: boolean;
|
|
15
|
+
gemini?: boolean;
|
|
16
|
+
all?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ClaudeExportResult {
|
|
19
|
+
success: boolean;
|
|
20
|
+
direction: 'faf-to-claude' | 'none';
|
|
21
|
+
filesChanged: string[];
|
|
22
|
+
conflicts: string[];
|
|
23
|
+
duration: number;
|
|
24
|
+
message: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Write CLAUDE.md (and any requested IDE formats) from project.faf.
|
|
30
|
+
*/
|
|
31
|
+
export declare function claudeExportCommand(projectPath?: string, _options?: ClaudeExportOptions): Promise<ClaudeExportResult>;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Claude Command — writes CLAUDE.md from project.faf, one direction.
|
|
4
|
+
*
|
|
5
|
+
* CLAUDE.md is faf-cli's render of project.faf (the same bytes `faf sync`
|
|
6
|
+
* pushes), injected with faf-cli's injector, so content outside the managed
|
|
7
|
+
* block survives. With agents / cursor / gemini / all it also writes
|
|
8
|
+
* AGENTS.md, .cursorrules and GEMINI.md. Nothing here reads CLAUDE.md back
|
|
9
|
+
* into project.faf. Backs the `faf_claude` tool, named `faf_bi_sync` before
|
|
10
|
+
* 3.0.1; the old name claimed a two-way sync this code never did.
|
|
6
11
|
*/
|
|
7
12
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
13
|
if (k2 === undefined) k2 = k;
|
|
@@ -38,75 +43,21 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
38
43
|
};
|
|
39
44
|
})();
|
|
40
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.
|
|
42
|
-
exports.syncBiDirectional = syncBiDirectional;
|
|
46
|
+
exports.claudeExportCommand = claudeExportCommand;
|
|
43
47
|
const yaml_1 = require("../fix-once/yaml");
|
|
44
48
|
const path = __importStar(require("path"));
|
|
45
49
|
const fs_1 = require("fs");
|
|
46
50
|
const file_utils_1 = require("../utils/file-utils");
|
|
47
51
|
const agents_js_1 = require("./agents.js");
|
|
48
|
-
const inject_1 = require("../inject");
|
|
49
52
|
const cursor_js_1 = require("./cursor.js");
|
|
50
53
|
const gemini_js_1 = require("./gemini.js");
|
|
54
|
+
const faf_cli_bridge_js_1 = require("../../utils/faf-cli-bridge.js");
|
|
51
55
|
/**
|
|
52
|
-
|
|
53
|
-
*/
|
|
54
|
-
function fafToClaudeMd(fafContent) {
|
|
55
|
-
try {
|
|
56
|
-
const fafData = (0, yaml_1.parse)(fafContent);
|
|
57
|
-
let claudeMd = `# 🏎️ CLAUDE.md - ${fafData.project?.name || 'Project'} Persistent Context & Intelligence\n\n`;
|
|
58
|
-
// Project State
|
|
59
|
-
if (fafData.project) {
|
|
60
|
-
claudeMd += `## PROJECT STATE: ${fafData.context_quality?.overall_assessment || 'ACTIVE'} 🚀\n`;
|
|
61
|
-
if (fafData.project.goal) {
|
|
62
|
-
claudeMd += `**Current Position:** ${fafData.project.goal}\n`;
|
|
63
|
-
}
|
|
64
|
-
claudeMd += `**Tyre Compound:** ULTRASOFT C5 (Maximum Performance)\n\n`;
|
|
65
|
-
claudeMd += `---\n\n`;
|
|
66
|
-
}
|
|
67
|
-
// Core Context
|
|
68
|
-
claudeMd += `## 🎨 CORE CONTEXT\n\n`;
|
|
69
|
-
if (fafData.project) {
|
|
70
|
-
claudeMd += `### Project Identity\n`;
|
|
71
|
-
claudeMd += `- **Name:** ${fafData.project.name || 'Unknown'}\n`;
|
|
72
|
-
if (fafData.instant_context?.tech_stack) {
|
|
73
|
-
claudeMd += `- **Stack:** ${fafData.instant_context.tech_stack}\n`;
|
|
74
|
-
}
|
|
75
|
-
claudeMd += `- **Quality:** F1-INSPIRED (Championship Performance)\n\n`;
|
|
76
|
-
}
|
|
77
|
-
// Technical Context
|
|
78
|
-
if (fafData.instant_context) {
|
|
79
|
-
claudeMd += `### Technical Architecture\n`;
|
|
80
|
-
if (fafData.instant_context.what_building) {
|
|
81
|
-
claudeMd += `- **What Building:** ${fafData.instant_context.what_building}\n`;
|
|
82
|
-
}
|
|
83
|
-
if (fafData.instant_context.main_language) {
|
|
84
|
-
claudeMd += `- **Main Language:** ${fafData.instant_context.main_language}\n`;
|
|
85
|
-
}
|
|
86
|
-
claudeMd += `\n`;
|
|
87
|
-
}
|
|
88
|
-
// Context Quality
|
|
89
|
-
if (fafData.context_quality) {
|
|
90
|
-
claudeMd += `### 📊 Context Quality Status\n`;
|
|
91
|
-
claudeMd += `- **Overall Assessment:** ${fafData.context_quality.overall_assessment || 'Good'}\n`;
|
|
92
|
-
claudeMd += `- **Last Updated:** ${new Date().toISOString().split('T')[0]}\n\n`;
|
|
93
|
-
}
|
|
94
|
-
// Championship Footer
|
|
95
|
-
claudeMd += `---\n\n`;
|
|
96
|
-
claudeMd += `**STATUS: BI-SYNC ACTIVE 🔗 - Synchronized with .faf context!**\n\n`;
|
|
97
|
-
claudeMd += `*Last Sync: ${new Date().toISOString()}*\n`;
|
|
98
|
-
claudeMd += `*Sync Engine: F1-Inspired Software Engineering*\n`;
|
|
99
|
-
claudeMd += `*🏎️⚡️_championship_sync*\n`;
|
|
100
|
-
return claudeMd;
|
|
101
|
-
}
|
|
102
|
-
catch (error) {
|
|
103
|
-
throw new Error(`Failed to convert .faf to CLAUDE.md: ${error instanceof Error ? error.message : String(error)}`);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
56
|
+
|
|
106
57
|
/**
|
|
107
|
-
*
|
|
58
|
+
* Write CLAUDE.md (and any requested IDE formats) from project.faf.
|
|
108
59
|
*/
|
|
109
|
-
async function
|
|
60
|
+
async function claudeExportCommand(projectPath, _options = {}) {
|
|
110
61
|
const startTime = Date.now();
|
|
111
62
|
const result = {
|
|
112
63
|
success: false,
|
|
@@ -130,27 +81,38 @@ async function syncBiDirectional(projectPath, _options = {}) {
|
|
|
130
81
|
const claudeMdExists = await (0, file_utils_1.fileExists)(claudeMdPath);
|
|
131
82
|
// Read .faf content
|
|
132
83
|
const fafContent = await fs_1.promises.readFile(fafPath, 'utf-8');
|
|
133
|
-
|
|
134
|
-
|
|
84
|
+
(0, yaml_1.parse)(fafContent); // still validates the YAML before anything is written
|
|
85
|
+
// The score in the message is the real one — faf-cli's scorer on the
|
|
86
|
+
// bytes read — not a `faf_score` key nothing ever writes.
|
|
87
|
+
const { scoreFafYaml, readFaf, renderClaudeMd, writeClaudeMd } = await faf_cli_bridge_js_1.fafCli;
|
|
88
|
+
let currentScore = 'unknown';
|
|
89
|
+
try {
|
|
90
|
+
currentScore = `${scoreFafYaml(fafContent).score}%`;
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
/* scorer unavailable — say so rather than invent a number */
|
|
94
|
+
}
|
|
135
95
|
if (!claudeMdExists) {
|
|
136
|
-
//
|
|
137
|
-
|
|
138
|
-
|
|
96
|
+
// CLAUDE.md is faf-cli's render of project.faf — the same bytes
|
|
97
|
+
// `faf sync` writes — injected with faf-cli's injector. The pre-v3
|
|
98
|
+
// template that lived here dropped Stack and every human_context slot.
|
|
99
|
+
writeClaudeMd(projectDir, renderClaudeMd(readFaf(fafPath)));
|
|
139
100
|
result.success = true;
|
|
140
101
|
result.direction = 'faf-to-claude';
|
|
141
102
|
result.filesChanged.push('CLAUDE.md');
|
|
142
|
-
result.message = `CLAUDE.md
|
|
103
|
+
result.message = `CLAUDE.md written from project.faf. FAF Score: ${currentScore}`;
|
|
143
104
|
}
|
|
144
105
|
else {
|
|
145
|
-
//
|
|
146
|
-
|
|
147
|
-
|
|
106
|
+
// CLAUDE.md is faf-cli's render of project.faf — the same bytes
|
|
107
|
+
// `faf sync` writes — injected with faf-cli's injector. The pre-v3
|
|
108
|
+
// template that lived here dropped Stack and every human_context slot.
|
|
109
|
+
writeClaudeMd(projectDir, renderClaudeMd(readFaf(fafPath)));
|
|
148
110
|
result.success = true;
|
|
149
111
|
result.direction = 'faf-to-claude';
|
|
150
112
|
result.filesChanged.push('CLAUDE.md');
|
|
151
|
-
result.message = `
|
|
113
|
+
result.message = `CLAUDE.md refreshed from project.faf. FAF Score: ${currentScore}`;
|
|
152
114
|
}
|
|
153
|
-
//
|
|
115
|
+
// Chain additional format exports if requested
|
|
154
116
|
const doAgents = _options.agents || _options.all;
|
|
155
117
|
const doCursor = _options.cursor || _options.all;
|
|
156
118
|
const doGemini = _options.gemini || _options.all;
|
|
@@ -162,7 +124,7 @@ async function syncBiDirectional(projectPath, _options = {}) {
|
|
|
162
124
|
}
|
|
163
125
|
}
|
|
164
126
|
catch {
|
|
165
|
-
// Non-fatal — CLAUDE.md
|
|
127
|
+
// Non-fatal — the CLAUDE.md write already succeeded
|
|
166
128
|
}
|
|
167
129
|
}
|
|
168
130
|
if (doCursor) {
|
|
@@ -188,15 +150,15 @@ async function syncBiDirectional(projectPath, _options = {}) {
|
|
|
188
150
|
}
|
|
189
151
|
}
|
|
190
152
|
if (result.filesChanged.length > 1) {
|
|
191
|
-
result.message += ` | Also
|
|
153
|
+
result.message += ` | Also wrote: ${result.filesChanged.filter(f => f !== 'CLAUDE.md').join(', ')}`;
|
|
192
154
|
}
|
|
193
155
|
result.duration = Date.now() - startTime;
|
|
194
156
|
return result;
|
|
195
157
|
}
|
|
196
158
|
catch (error) {
|
|
197
159
|
result.duration = Date.now() - startTime;
|
|
198
|
-
result.message = error instanceof Error ? error.message : '
|
|
160
|
+
result.message = error instanceof Error ? error.message : 'CLAUDE.md write failed';
|
|
199
161
|
return result;
|
|
200
162
|
}
|
|
201
163
|
}
|
|
202
|
-
//# sourceMappingURL=
|
|
164
|
+
//# sourceMappingURL=claude.js.map
|