Faro is a VS Code extension for turning agent reasoning about a codebase into persistent, navigable code landmarks.
This repository currently contains a working local MVP of the extension:
- a canonical Faro document model
- validation and path navigation logic
- an in-memory store
- pure app-layer projections for the Faro main view
- real VS Code host bindings for the main view, commands, setup integration, and editor reveal
- an agent-facing Faro service plus MCP tools/resources
- local stdio MCP server registration through the VS Code MCP provider API
- a verified protocol-level authoring loop from the registered Faro MCP server into the sidebar state
node:testcoverage and a real TypeScript check
- Node.js 23.x or newer
- npm
- VS Code 1.109 or newer
This project currently relies on Node's native TypeScript type stripping for local execution and tests.
npm installThe right way to understand Faro is to follow the agentic loop inside VS Code.
Use this first-run path:
- Install and validate the repository:
npm install
npm run check
npm test- Install the extension locally:
make install-local- Install the local Faro agent artifacts for this workspace:
make upsert-agent-local SCOPE=local- Open the repository in VS Code:
code .-
Reload the window once if needed so VS Code picks up the local extension and the generated custom agent artifacts.
-
Open the Chat view and select the
Faro Path Authorcustom agent. -
Ensure the local
FaroMCP server is enabled for the workspace. -
Ask the agent to create or revise a path for a concrete code-reading goal.
Example:
Create a Faro path that explains how the main VS Code view is built and wired.
-
Open the
Faroactivity bar container and inspect the result in the main view:Homegives you the product entrypointPathshows the active path and current beaconSetupshows local/global integration targets
-
Use
Prev,Next, andRevealto verify that the generated path is actually navigable in code.
That is the intended product loop: author in chat, inspect in Faro, reveal in code.
Run the TypeScript check:
npm run checkRun the test suite:
npm testOr run both with make targets:
make check
make testWatch mode for tests:
npm run test:watchOpen the repository root in VS Code:
code .Package the extension as a local VSIX:
make package-vsixInstall that VSIX into your normal VS Code profile:
make install-localThis writes dist/faro.vsix and installs it with code --install-extension --force.
Use explicit local or global commands so the write scope is unambiguous.
Local workspace-scoped artifacts:
make upsert-agent-local SCOPE=localThat upserts:
CLAUDE.md.github/copilot-instructions.md.github/agents/faro-path-author.agent.md.codex/skills/faro-author-paths/SKILL.md
Global user-level artifacts:
make upsert-agent-global SCOPE=globalThat upserts:
${CLAUDE_HOME:-$HOME/.claude}/CLAUDE.md${COPILOT_HOME:-$HOME/.copilot}/instructions/faro.instructions.md${COPILOT_HOME:-$HOME/.copilot}/agents/faro-path-author.agent.md${CODEX_HOME:-$HOME/.codex}/skills/faro-author-paths/SKILL.md
If the Faro-specific global Copilot files already exist and differ, the command refuses to overwrite them unless you opt in:
make upsert-agent-global SCOPE=global FORCE=1If you intentionally want both scopes in one run:
make upsert-agent-all SCOPE=allAdd FORCE=1 there too if you want the global Copilot Faro files replaced.
If you only want the VS Code Copilot custom agent file:
make upsert-copilot-agent-local SCOPE=localThat writes .github/agents/faro-path-author.agent.md.
For Codex, the local install writes to .codex/skills/... inside this repository. To make Codex consume that local skill home instead of your global one, start Codex with CODEX_HOME="$(pwd)/.codex".
After running make upsert-copilot-agent or make upsert-agent-instructions:
- Open the repository in VS Code.
- Open the Chat view.
- Choose the
Faro Path Authorcustom agent from the agent picker. - Ensure the local
FaroMCP server is enabled for the workspace.
If the agent picker does not show the new custom agent immediately, run Developer: Reload Window once.
The custom agent definition is generated from the same AGENTS.md and skills/faro-author-paths/SKILL.md sources that drive the other instruction artifacts, so the Copilot agent stays aligned with the Faro authoring rules.
The extension can be tried locally in an Extension Development Host on macOS or Linux.
make dev-hostThat target will:
- open faro-dev.code-workspace in a new Extension Development Host window
- load the extension from this repository with
--extensionDevelopmentPath - enable
faro.autoFocusOnStartupthrough the dev workspace settings - let the extension focus the
Faroactivity bar container on startup
Current expectation:
- the
Faroactivity bar container is visible - the main Faro view opens with
Home,Path, andSetuproutes Pathshows the seeded sample path and current beaconPrev/Nextupdates the current beacon in the viewRevealopens seeded sample beacons in the local repositorySetupshows local/global integration targets for Claude, Copilot, and Codex
If you want to launch the host manually instead of using the workspace shortcut:
code --new-window --extensionDevelopmentPath="$(pwd)" "$(pwd)"Then either:
- run
Faro: Focus Sidebarmanually from the Command Palette - or open faro-dev.code-workspace, which enables startup autofocusing
If you want the extension host run to stay aligned with repo quality gates, run these before launching:
make check
make testIf the setup is working, the first useful experience should look like this:
- You ask the Faro agent in VS Code Chat for a path.
- The agent uses the local Faro MCP surface made available by the extension.
- Faro state updates inside the extension runtime.
- The
Pathroute in the Faro view reflects the new or revised path. Prev,Next, andReveallet you walk that path against real code.
The key mental model is:
- chat is the authoring surface
- Faro is the reading and navigation surface
- the editor is where the code is revealed
For now, Faro's MCP surface is effectively local to VS Code.
That means:
- the extension registers one local
faro.localMCP server definition for the workspace - VS Code Chat can use that MCP surface when the workspace enables it
- Faro is not yet exposed as a standalone external MCP service meant to be consumed directly by tools outside VS Code
There is protocol-level coverage for the MCP authoring loop in tests, but the developer-facing story is still centered on VS Code Chat rather than an external Codex-to-Faro connection.
When Faro is running in VS Code:
- the extension activates one runtime over one canonical store
- the extension registers the local Faro MCP surface for the workspace
- VS Code Chat can call Faro MCP operations against that runtime-backed store
- the main Faro view renders derived state from the same store
- command actions such as
Prev,Next, andRevealgo through the same runtime loop
That is the main invariant in this repository:
- one canonical Faro document
- one runtime/store loop
- one VS Code-hosted local MCP surface
src/
core/ canonical document model, validation, path movement, store logic
app/ pure view-model/projection logic
infra/ VS Code-facing adapters and extension runtime
test/
core/ domain and store tests
app/ projection tests
infra/ adapter tests
docs/
faro-plan.md
Implemented:
- strict TypeScript setup
- ESM modules
npm run checknode:testsuite- typed core/app/infra boundaries
- real extension composition root
- one main webview with
Home,Path, andSetuproutes - editor reveal/highlight wiring
- local command surface for navigating and focusing Faro
- setup integration flow for local/global agent artifacts
- agent-facing Faro contract (
listPaths,getPath,upsertPath,setActivePath,setCurrentBeacon,deletePath) - MCP tools/resources bootstrap over the canonical store
- VS Code MCP server definition registration for a local stdio Faro server
- protocol-level Faro authoring verified end to end against the registered stdio MCP bridge and sidebar state
Not implemented yet:
- manual VS Code chat-session validation over the Faro MCP server
- richer authoring operations such as append/branch editing
- import/export and stale-range handling polish
The repository now includes both the runtime contract and the agent instructions for path selection:
- AGENTS.md constrains the beacon-selection agent role
- skills/faro-author-paths/SKILL.md defines the pragmatic authoring workflow
When a Faro-aware agent runtime exposes the local faro.* tools, the expected workflow is:
faro.listPathsfaro.getPathwhen revisingfaro.upsertPathas the main writefaro.setActivePathonly if the new path should become primaryfaro.setCurrentBeacononly if the starting step should move
The immediate implementation path is:
- Manually validate the chat-to-sidebar workflow inside VS Code over the registered Faro MCP server.
- Add pragmatic authoring operations only where the workflow actually needs them.
- Improve sample and empty-state UX around the first generated path.
- Add import/export and stale-range handling polish.