OpenCastle

Docs

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

1

Install

npx opencastle init

Needs Node.js 22.5 or newer.

2

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.

3

Open your assistant

Open VS Code and reload the window (Cmd+Shift+P → “Developer: Reload Window”). This loads the OpenCastle agents, skills, and instructions.

4

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.

Skip this step for brand-new projects — there’s nothing to detect yet. How each assistant runs a prompt: Prompt Templates.

5

Start building

Choose how you want to work:

A

In your assistant’s chat recommended

Start with a prompt: implement-feature for a change, bug-fix for a bug. The Team Lead makes a change in one area itself, and splits work across areas into tasks for specialist agents, in the same session; it tests, has the change reviewed, and opens a pull request. Work you want run unattended as parallel tasks is a convoy (option B).

In Copilot Chat type /oc:implement-feature and what you want built; it selects the Team Lead (OpenCastle) agent.

For common jobs a prompt gives it a fixed procedure — brainstorm, bug-fix, implement-feature and more; all of them work in your session, except convoy, which hands the work to the convoy planner. How each assistant runs them.

B

Convoy autonomous experimental

For larger work, the convoy engine plans the work, then runs its tasks in parallel, each in its own git worktree, on the agent CLI init set up. It is experimental and may change.

1

Plan: npx opencastle convoy "Add tags to notes, and reject a note without a title". Planning changes no code: it sizes the request, writes a PRD first only when the work is not small, writes a spec to .opencastle/convoys/, shows the plan as a table, and asks “Run it? [Y/n]”. Answer n to edit the spec first and run it later with the command it prints: npx opencastle convoy run .opencastle/convoys/<spec>.yml.

2

Watch: the run prints each task as it finishes, with its time and cost; on a terminal it also prints the address of a live dashboard. npx opencastle convoy says where the last run stands; after Ctrl+C or a failure, npx opencastle convoy resume carries on.

3

Merge: the work is on a branch of its own, and the run ends with the git diff and git merge commands for it. Your checkout is not touched.

Worked runs, with their time and cost: Use cases. Every command and option: CLI reference.

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 here

How 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

guide

Guide 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 commands

Complete 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

guide

Share 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 prompts

Ready-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

standard

AGENTS.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 integrations

Set up each integration: the skill it adds, how its MCP server signs in, and the config init writes for it.

Use Cases

2 recipes

When 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

fixes

What 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.