OpenCastle Documentation
Everything you need to give every teammate's assistant the team's instructions, skills and memory, share them across your repositories, and check them on every pull request.
Get started
Install
npx opencastle init Needs Node.js 22.5 or newer.
Confirm what it found
It reads your repository first — which assistants already have config, which framework, database, and test runner you use — shows the plan, and asks once: Set this up? [Y/n]. --yes accepts without asking. Prefer to choose by hand? npx opencastle init --customize.
Root files you wrote — CLAUDE.md, .cursorrules, AGENTS.md, copilot-instructions.md — keep your content above a managed block. A file of yours inside a directory OpenCastle generates, such as .cursor/rules/ or .claude/agents/, is named by init and removed by the next sync: move it into .opencastle/ and it is compiled for every assistant. A skill another tool wrote there is kept: sync moves it into .opencastle/skills/ for you.
Open your assistant
Open VS Code and reload the window (Cmd+Shift+P → “Developer: Reload Window”). This loads the OpenCastle agents, skills, and instructions.
Open Cursor — the rules load from .cursor/rules/ (the instructions from CLAUDE.md or AGENTS.md when Claude Code, Codex or OpenCode is set up too, since Cursor reads those), and skills from .agents/skills/ when a task matches or you type / and the skill's name.
Run claude in your terminal from the project root. It loads CLAUDE.md; skills come from .claude/skills/ and MCP servers from .mcp.json.
Run opencode in your terminal from the project root. It loads AGENTS.md; skills come from .agents/skills/ and MCP servers from opencode.json.
Open Windsurf (Devin Desktop) — rules load from .windsurf/rules/, skills from .agents/skills/, and the Devin Local agent starts the MCP servers in .devin/mcp_config.json.
Run codex in your terminal from the project root and trust the project when it asks. AGENTS.md is loaded, skills come from .agents/skills/ and MCP servers from .codex/config.toml.
Open Antigravity — it loads GEMINI.md, and AGENTS.md when Codex or OpenCode is set up too; skills come from .agents/skills/ and MCP servers from .agents/mcp_config.json.
Bootstrap an existing codebase
init has written the stack, structure, commands, routes and models into .opencastle/ from the code. Run the bootstrap-customizations prompt once to fill in what files cannot say — architecture, access rules, test conventions — listed at the end of each file. It ends by running npx opencastle sync, so every assistant gets the result.
In Copilot Chat type /oc:bootstrap-customizations — it runs as the Team Lead (OpenCastle) agent.
No slash command here — ask for the prompt by name: “Run the bootstrap-customizations prompt in .cursor/rules/prompts/.”
Type /oc:bootstrap-customizations.
No slash command here — ask for the prompt by name: “Run the bootstrap-customizations prompt in .opencode/prompts/.”
No slash command here — ask for the prompt by name: “Run the bootstrap-customizations prompt in .windsurf/rules/prompts/.”
No slash command here — ask for the prompt by name: “Run the bootstrap-customizations prompt in .codex/prompts/.”
No slash command here — ask for the prompt by name: “Run the bootstrap-customizations prompt in .agents/prompts/.”
Skip this step for brand-new projects — there’s nothing to detect yet. How each assistant runs a prompt: Prompt Templates.
Start building
Choose how you want to work:
Demo: from init to a drift check
A Next.js and Supabase project that already has a CLAUDE.md and a
.cursorrules. npx opencastle reports
that it is not set up. npx opencastle init finds Claude Code and Cursor,
Next.js, Supabase and Vitest, and asks once. npx opencastle add linear slack
adds two integrations, and npx opencastle explain shows what every
assistant is given and what is left to set up. Last, a hand edit to a generated skill:
npx opencastle sync --check catches it, and
npx opencastle sync restores the file.
Staying in sync
Ask what needs doing
Run npx opencastle with no arguments. It reports which targets exist, whether the generated files are still current, which assistants are configured but not being compiled, and the one command to run next.
Recompile
npx opencastle sync regenerates every target from source. Your customizations in .opencastle/ are kept, and so is your content above the managed block of a root file such as CLAUDE.md. A file added by hand inside a generated directory, such as .cursor/rules/, is removed — put it in .opencastle/ and it is compiled for every assistant.
Catch drift in CI
npx opencastle sync --check compiles to a scratch directory and compares. It writes nothing and exits non-zero when a generated file no longer matches its source — someone edited .cursor/rules/foo.mdc by hand, dropped a file into a generated directory, or upgraded without recompiling. Without it, drift is invisible: a stale rule file still loads fine.
Commit the generated config, like a lockfile — that is what gives the check something to compare, and what lets a teammate clone the repo and have working rules without running anything. Only .env and run artefacts are gitignored.
Run npm i -D opencastle && npx opencastle ci once. It writes .github/workflows/opencastle.yml: checkout, install, sync --check with the OpenCastle version the project uses, and review on pull requests. On another CI, run npx opencastle sync --check with opencastle as a devDependency. See opencastle ci.
Adopt a new tool
npx opencastle add supabase updates the stored stack and recompiles, so the integration's skills and MCP config reach every target. npx opencastle add --list shows what is available.
Upgrade
npm i -D opencastle@latest, then npx opencastle sync: it names each file it removes and counts the ones it changes; git diff shows them all. Read the diff and commit it. Something not working? Troubleshooting.
Share it across a team
npx opencastle baseline init starts a standard every repository can extend, and npx opencastle explain shows a new teammate what their assistant is given and what they still need to set up. See OpenCastle for Teams.
Concepts
start hereHow OpenCastle works: one source for every assistant, what an assistant loads and when, agents, integrations, layers, the lock and lessons — with a glossary of the words the docs use.
Agentic Development
guideGuide to agentic development and multi-agent orchestration. Vibecoding best practices, prompt patterns, specialist agents, quality gates, and how to coordinate AI agent teams.
CLI Reference
13 commandsComplete reference for every opencastle command — init, sync, add, doctor, remove, the team commands explain, review, ci, baseline, plugin, promote and fleet, and the experimental convoy namespace.
OpenCastle for Teams
guideShare one standard across every repository: baselines your repositories extend, a policy for the MCP servers agents may start, a lock file that records what every assistant is given, and a review of what each change does.
Prompt Templates
7 promptsReady-to-use prompt templates for the Team Lead agent. Brainstorm ideas, implement features, fix bugs, resolve PR comments, and generate task specs.
Agent Plugins & Open Standards
standardAGENTS.md, Agent Skills, MCP and Agent Plugins 1.0 — what each covers and where OpenCastle writes it. Use any Agent Plugin in every assistant, and publish your team's standard as one.
Integrations
33 integrationsSet up each integration: the skill it adds, how its MCP server signs in, and the config init writes for it.
Use Cases
2 recipesWhen a convoy beats Claude Code /batch or Copilot CLI /fleet, and real convoy runs, end to end: plan and run a feature from one sentence, and write a spec, stop its run and resume it. Each with its time and cost.
Troubleshooting
fixesWhat goes wrong and what clears it: commands not found, sync --check failing in CI, files a sync removed, version refusals, MCP servers that do not start, commands that do not appear.