becwright

Guides

AI agents

Install and drive becwright from Claude Code or any MCP-capable agent like Cursor, Windsurf, or opencode.

becwright is built so an AI agent can set it up and run it for you. CLAUDE.md and .cursorrules ask an agent to behave; becwright is the deterministic net that checks the result on every commit. There are two ways to wire it into an agent — a dedicated Claude Code plugin, and a generic path that works with any agent that speaks MCP or can run a shell command.

Claude Code (plugin)

Claude Code has a first-class plugin. Install it from the becwright marketplace:

/plugin marketplace add DataDave-Dev/becwright
/plugin install becwright@becwright

The first command registers the repo as a plugin marketplace; the second installs the plugin from it. It does not bundle becwright — it installs the published becwright package (npm / PyPI) into your project.

What you get:

  • becwright skill — teaches the agent what becwright is, how to install it (npm/pnpm, no Python needed, or pipx), how to scaffold rules, and how to read and fix check output. The agent invokes it automatically when you ask for a guardrail, a pre-commit check, or a rule that “can’t be ignored”.
  • /becwright command — a direct entry point:
CommandWhat it does
/becwright initInstall becwright and scaffold .bec/rules.yaml + hook
/becwright checkRun the rules and summarize PASS / WARN / BLOCK
/becwright add <regex-or-url>Add a forbid rule or import a BEC
/becwright statusReport install + hook + rule count

Any MCP-capable agent

Cursor, Windsurf, opencode, and any other MCP client can consume becwright through its MCP server — no dedicated plugin required. Point the agent’s MCP config at the command:

{
  "mcpServers": {
    "becwright": {
      "command": "becwright",
      "args": ["mcp"]
    }
  }
}

This exposes check and list_checks as structured tools. The MCP server ships with the Python package (pipx install "becwright[mcp]"). See MCP & JSON output for the tool schemas and JSON shape.

Any agent with a shell

You don’t need an integration at all. becwright is a plain CLI, so any agent that can run shell commands — including opencode — can drive it directly:

npm install --save-dev becwright   # no Python needed
npx becwright init                 # scaffold rules + pre-commit hook
npx becwright check --all          # run every rule over the repo
npx becwright check --json         # machine-readable results to parse

Because the pre-commit hook is native, the checks run on every commit no matter which agent made the change — that is the whole point: the guarantee does not depend on the agent cooperating.