How ferroxlabs/ijfw works
1. What this repository is
- IJFW is a local-first orchestration layer for AI coding tools, not a single app.
- The repo is organized around a central Node.js service plus many tool-specific adapters so Claude, Codex, Gemini, Cursor, Windsurf, Copilot, Aider, and others can share the same memory, workflow, and guardrails.
2. Top-level architecture
- The core runtime lives in mcp-server/, which acts as the shared brain and protocol hub.
- Surrounding it are integration surfaces for each host tool: claude/, codex/, gemini/, wayland/, hermes/, cursor/, windsurf/, copilot/, aider/, antigravity/, plus shared rules and skills under shared/.
- The repository also includes the installer (installer/) and a large test/fixture corpus for regression and compatibility checks.
3. Host-tool integration layer
- Each tool gets a different delivery mechanism depending on what it supports: plugin, MCP, hooks, command files, or rules files.
- Examples:
- claude/ and codex/ include command libraries, hook scripts, and skill packs.
- gemini/extensions/ijfw/ packages the same functionality as a Gemini extension with commands, hooks, and policies.
- hermes/plugins/ijfw/ and wayland/plugins/ijfw/ are Python plugin shims for those environments.
- This layer is the boundary between IJFW’s shared logic and the host agent’s native config/runtime.
4. Central server and protocol boundary
- mcp-server/src/server.js is the main server entry point.
- It exposes the capabilities that tools consume through MCP and related local interfaces.
- The server stays localhost-only and is designed to be the shared backend for all supported clients, rather than a cloud service.
5. Memory subsystem
- The memory engine is a major subsystem under mcp-server/src/memory/ and mcp-server/src/brain/.
- It stores and retrieves durable context as local files and indexed data, with support for:
- markdown/obsidian-style notes
- FTS5 search
- vector/semantic search
- temporal and bi-temporal facts
- promotion/deduplication/staleness logic
- The flow is: session observations and user decisions are captured locally, indexed, and later recalled into new sessions across tools.
6. Workflow and discipline engine
- IJFW’s “plan before build” behavior is implemented in mcp-server/src/orchestrator/ and mcp-server/src/swarm/.
- These modules enforce phases such as brief, plan, execute, verify, and ship, with explicit gates rather than silent auto-advance.
- The workflow layer also coordinates wave planning, review, termination, status, and worktree provisioning, which matters because the agent may split work across parallel branches or specialist runs.
7. Cross-audit and multi-model review
- mcp-server/src/cross-*.js and related orchestrator code implement the multi-model review flow.
- The system selects reviewers from different model lineages, chunks work, dispatches audits, and records findings as consensus or contested.
- This is a distinct boundary: the reviewer panel is intentionally separate from the model that made the change.
8. Personalization and “learns you” profile
- mcp-server/src/profile/ captures edits, preferences, exemplars, and telemetry so the system can adapt to a user over time.
- The profile pipeline is consent-aware: capture, disclosure, and injection are separate concerns, and there are explicit kill-switches and forget/reset paths.
- Data flow here is from observed corrections or exemplars into a local profile store, then back into future prompt rendering and tool behavior.
9. Observability, receipts, and dashboard
- mcp-server/src/dashboard-server.js, dashboard-aggregator.js, and the scripts/dashboard/ utilities turn local logs into a live session dashboard.
- The repo’s observability model is event-driven: each tool call or session action becomes a local record, then the dashboard aggregates cost, cache savings, memory hits, and audit outcomes.
- This is deliberately offline and inspectable; the dashboard is a local artifact, not a hosted product.
10. Cost/routing optimization
- mcp-server/src/cost/, src/model-refresh.js, and related routing code manage model selection and pricing-aware accounting.
- The system uses cheaper models for read-heavy or routine tasks and reserves stronger models for architecture/review tasks.
- Cost reporting is tied to actual usage logs and cache behavior, not synthetic estimates.
11. Design contract and specialist skills
- Design support is a first-class subsystem: mcp-server/src/design*, mcp-server/templates/design/, and the mirrored skill packages under shared/skills/ and tool-specific skill directories.
- “Skills” are the bounded specialist modules that get loaded on demand rather than kept resident.
- This repo uses that pattern broadly: workflow skills, design skills, debug/review skills, memory skills, and team-generation skills all sit beside the core system and are dispatched by intent.
12. Installer and machine-level setup
- installer/ is the packaging and mutation layer that wires IJFW into the user’s local tool configs.
- It handles discovery of supported tools, preflight checks, install/uninstall flows, config backups, and platform-specific gates.
- The installer is where the repo crosses from “source code” into “machine state,” which is why it has dedicated checks for integrity, smoke tests, and rollback safety.
13. Platform-specific shims
- The repo includes multiple front doors for different ecosystems:
- Node-based adapters and CLIs
- Python plugin shims for Hermes/Wayland
- PowerShell support for Windows installation
- shell scripts for hooks, smoke tests, and maintenance
- These wrappers are thin; the shared logic lives in mcp-server/ and shared skill/rule assets.
14. Validation, fixtures, and regression safety
- The repository is heavily test-driven, with extensive coverage in mcp-server/test*, installer/test*, hermes/plugins/ijfw/tests, and wayland/plugins/ijfw/tests.
- Fixtures model real project types, memory behavior, cross-audit cases, truncation recovery, and platform-specific edge cases.
- This matters architecturally because the repo’s complexity is in integration behavior across tools, not in a single algorithmic core.
15. Main data flow to draw
- User action enters through a host tool.
- Tool-specific hook/plugin/rules layer captures the prompt or event.
- The shared server resolves memory, profile, workflow, or audit actions.
- Results are injected back into the tool, while receipts, logs, and state are persisted locally.
- The dashboard and benchmark tooling read the same local artifacts for visibility and validation.
16. Key boundaries to preserve in a diagram
- Host tool boundary: each editor/CLI has its own adapter surface.
- Shared local brain boundary: mcp-server centralizes logic and state.
- Local storage boundary: memory, profile, receipts, and config all live on disk.
- Review boundary: cross-audit is separate from the generating model.
- Installer boundary: setup/uninstall is a distinct machine-state mutation path.
- No cloud backend boundary: the architecture is intentionally offline-first and user-controlled.
Main entry points: server.js Server entry · install.js Installer core · claude Claude · codex Codex
Components 24
Host integrations
Tool-specific entry points, adapters, hooks, rules, and skill bundles for different AI environments.
- Claude · Claude plugin surface with commands, hooks, rules, agents, and skills.
claude - Codex · Codex plugin surface with commands, hooks, config, and mirrored skills.
codex - Gemini · Gemini extension packaging commands, hooks, policies, and skills.
gemini/extensions/ijfw - Cursor · Cursor rules and MCP configuration for local IJFW behavior.
cursor - Windsurf · Windsurf rules and MCP configuration for local IJFW behavior.
windsurf - Hermes · Python plugin shim and MCP bridge for Hermes environments.
hermes/plugins/ijfw - Wayland · Python plugin shim and MCP bridge for Wayland environments.
wayland/plugins/ijfw - Antigravity · MCP config front door for Antigravity integration.
antigravity
Core server
Local MCP backend and the shared runtime that holds memory, workflow, review, profile, cost, and dashboard logic.
- Server entry · Main localhost-only server entry point for IJFW capabilities.
mcp-server/src/server.js - Memory brain · Durable local memory, extraction, search, and recall pipeline.
mcp-server/src/memory - Brain runtime · Higher-level brain logic for ingestion, promotion, wiki compilation, and guardrails.
mcp-server/src/brain - Workflow engine · Plan/execute/verify/ship gating, wave state, worktrees, and status protocol.
mcp-server/src/orchestrator - Swarm · Dispatch and planning layer for parallelized work and review flows.
mcp-server/src/swarm - Cross-audit · Chunking, reviewer dispatch, and consensus/contested audit flow.
mcp-server/src/cross-orchestrator.js - Profile · Consent-aware capture, derivation, storage, and injection of user preferences.
mcp-server/src/profile - Dashboard · Local session dashboard and receipt aggregation from logs and events.
mcp-server/src/dashboard-server.js - Cost routing · Model selection, usage accounting, and cost aggregation.
mcp-server/src/cost
Installer
Machine-state setup and teardown path for wiring IJFW into local tools.
- Installer core · Install/uninstall orchestration and machine-state wiring for host integrations.
installer/src/install.js - Preflight gates · Platform and integrity checks before installation or release actions.
installer/src/preflight
Shared assets
Rules, skills, and templates mirrored across tool ecosystems.
- Shared rules · Repo-wide IJFW rules shared across hosts.
shared/rules/IJFW.md - Shared skills · Canonical skill packs mirrored into host-specific bundles.
shared/skills - Design system · Design templates, component snippets, and design reasoning assets.
shared/skills/ijfw-design
Validation
Regression corpus, smoke tests, and fixtures that protect integration behavior.
Connections 27
- Claude → Server entry: uses MCP · Claude tooling talks to the shared local server through MCP and hooks.
- Codex → Server entry: uses MCP · Codex tooling talks to the shared local server through MCP and hooks.
- Gemini → Server entry: uses MCP · Gemini extension routes commands and hooks into the shared server.
- Cursor → Server entry: uses MCP · Cursor reads shared behavior from local MCP configuration.
- Windsurf → Server entry: uses MCP · Windsurf reads shared behavior from local MCP configuration.
- Hermes → Server entry: bridges to server · Hermes plugin shim forwards local agent actions into IJFW core services.
- Wayland → Server entry: bridges to server · Wayland plugin shim forwards local agent actions into IJFW core services.
- Antigravity → Server entry: configures access · Antigravity exposes IJFW through local MCP configuration.
- Shared rules → Claude: shapes behavior · Shared rules are mirrored into host-specific rule files and prompts.
- Shared rules → Codex: shapes behavior · Shared rules are mirrored into host-specific rule files and prompts.
- Shared skills → Claude: packages skills · Canonical skills are copied or adapted into Claude-specific bundles.
- Shared skills → Codex: packages skills · Canonical skills are copied or adapted into Codex-specific bundles.
- Shared skills → Gemini: packages skills · Canonical skills are packaged into the Gemini extension.
- Server entry → Memory brain: serves memory · Server routes memory and recall requests into the memory engine.
- Server entry → Brain runtime: serves brain · Server delegates higher-level context and ingestion work to the brain runtime.
- Server entry → Workflow engine: runs workflow · Server exposes discipline phases, status, and worktree orchestration.
- Server entry → Swarm: coordinates swarm · Server delegates parallel planning and dispatch to swarm logic.
- Server entry → Cross-audit: routes review · Server triggers cross-model review and records audit outcomes.
- Server entry → Profile: injects profile · Server captures preferences and reinjects consented user profile data.
- Server entry → Dashboard: emits receipts · Server writes event and receipt data that the dashboard aggregates.
- Server entry → Cost routing: tracks cost · Server feeds usage data into model pricing and savings accounting.
- Installer core → Preflight gates: guards install · Installation and uninstall flows are gated by preflight checks.
- Installer core → Claude: wires host · Installer mutates host configs and hooks for Claude.
- Installer core → Codex: wires host · Installer mutates host configs and hooks for Codex.
- Installer core → Gemini: wires host · Installer mutates host configs and hooks for Gemini.
- Fixtures → MCP tests: drives regressions · Fixtures feed regression suites covering integration and data-shape behavior.
- MCP tests → Server entry: verifies · Tests validate the server, adapters, workflows, memory, and dashboard flows.