# agentic-playbooks > A local runner for agentic playbooks: YAML playbook definitions, a svelte-flow web visualizer, semver versioning, and an MCP server so coding agents can drive playbooks. Rust workspace, edition 2024. The binary is called `apb`. The MCP server (started with `apb mcp`) identifies itself as `agentic-playbooks` to MCP clients. The binary name and all CLI commands use `apb`. ## Agent setup An agent installing apb for a person follows [docs/AGENT-SETUP.md](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/AGENT-SETUP.md) (also served by the MCP tool `setup_howto`): install, `apb doctor --json`, `apb setup plan --json` (read only, prints a digest), at most five questions to the person, `apb setup apply --plan `, verify, report; `apb setup remove` undoes it. Setup installs the default playbooks (`apb-*` ids, adapt them by forking under your own ids) and the process skills `apb-usage`, `apb-brainstorm`, `apb-delivery`, `apb-diagnosis`, `apb-review`, `apb-test-audit`, `apb-security-audit` and `apb-model-selection`, writes role profiles for the detected agents and registers the MCP server in the detected hosts and the end-of-turn save check `apb hook stop` as a Claude Code Stop hook (`APB_SAVE_NUDGE=off` silences it). A copy of a default an agent saves is approved as locally authored, never with the shipped trust or upgrades; verify defaults with `apb adopt --scope global`. A changed default is replaced only on request (`apb setup plan --replace-modified `), and `apb setup remove` gives the person's copy back. Inside a run step setup only reads (`apb setup plan`); apply and remove are refused there. Setup installs no third-party tool: a review helper already installed on the machine becomes a required review step, the others are only suggested, and it only reports the work trackers it sees. ## Install Prebuilt binaries: macOS (Apple silicon, Intel) and Linux x86_64 (glibc 2.35+ or a static musl build). No Windows or Linux ARM binaries. apb drives coding agent CLIs you install separately (Claude Code, Codex, OpenCode, Cursor Agent, Grok, Hermes, Qoder, Antigravity, Pi, ZCode). The one-liner installer works everywhere a prebuilt binary exists: ```sh curl --proto '=https' --tlsv1.2 -LsSf https://github.com/itechmeat/agentic-playbooks/releases/latest/download/apb-installer.sh | sh ``` This installs the `apb` binary to `CARGO_HOME` (`~/.cargo/bin` by default), no build tools required. Update with `apb self-update`. Homebrew (macOS, Linux x86_64) is equivalent; update with `brew upgrade apb`: ```sh brew install itechmeat/agentic-playbooks/apb ``` Install with cargo: `cargo install --locked agentic-playbooks` (the binary is `apb`; it needs Rust and a C compiler). The crate named `apb` on crates.io is an unrelated project: `cargo install apb` does not install this tool. Fall back to a source build only if the installer is not usable in your environment (for example, no network access to GitHub Releases). This requires Rust (stable), a C compiler and linker, and Bun; the web frontend must be built before the Rust binary because it is embedded at compile time via rust-embed (the build writes `crates/apb-server/dashboard/`). ```sh git clone https://github.com/itechmeat/agentic-playbooks && cd agentic-playbooks (cd web && bun install && bun run build) cargo install --path crates/apb-cli ``` `cargo install --git` is not supported: a git checkout has no built dashboard (`crates/apb-server/dashboard/`), so the build stops. Install from a local clone (`--path`) or the published crate. Verify the installation: ```sh apb --version apb doctor ``` ## Connect to a coding agent (MCP) `apb mcp` starts a stdio MCP server on the current project's `.apb/` directory. Use the name `agentic-playbooks` when registering it. Claude Code (project scope): ```sh claude mcp add agentic-playbooks -- apb mcp ``` Claude Code (global scope): ```sh claude mcp add --scope user agentic-playbooks -- apb mcp ``` Project `.mcp.json` (shareable, commit to repo): ```json { "mcpServers": { "agentic-playbooks": { "command": "apb", "args": ["mcp"] } } } ``` Codex (`~/.codex/config.toml`): ```toml [mcp_servers.agentic-playbooks] command = "apb" args = ["mcp"] ``` OpenCode (`~/.config/opencode/opencode.json`, mcp section): ```json "agentic-playbooks": { "type": "local", "command": ["apb", "mcp"], "enabled": true } ``` Run `apb init` in each project where you want to use playbooks. The MCP server discovers `.apb/` relative to the current working directory. ## CLI commands ```text apb init create the .apb structure (--standing-block yes|no, --subscriptions SPEC: answers without a terminal; --feedback-loop yes only by the person at a terminal, refused with 3 otherwise; --feedback-loop no anywhere; --json) apb setup plan [--json] [--project DIR] [--replace-modified [NAME,...]] (read only, with a digest; also manual host steps, trackers and review helpers, required when installed); apply --plan DIGEST with the same options (exit 0 done, 1 failure, 2 plan changed, 3 refused, also inside a run step or for a bare --replace-modified without a terminal); remove apb hook stop Claude Code's Stop hook (registered by apb setup apply, action register_hook): reads the hook JSON on stdin, prints {"decision":"block",...} once per session when the turn looked like a repeatable process and no playbook tool was used, else nothing; always exits 0; APB_SAVE_NUDGE=off silences it, APB_SAVE_NUDGE_MIN_STEPS and APB_SAVE_NUDGE_MIN_KINDS set its bounds (8, 3) apb list playbooks and versions apb validate validate playbooks, the profiles and scripts they reference, profile models, requires and connectors apb run run a playbook (--confirm-irreversible: consent without a terminal; --confirm-launch: a person's confirmation of a playbook that asks before an agent launches it; --remember: keep its params and instruction for this project; --notify / --no-notify: tell a person about its reviews, questions, pauses and end; --scope project|global: start a global playbook in this project) apb runs list runs, marking those that need a look (apb runs [--json]: one run with its execution mode and outcome; --items [--node N] [--state S]: one line per list item; --html : the report as one self-contained page; apb runs prune [--yes] [--json] [--playbook ]: remove old runs the retention settings no longer keep, a dry run without --yes) apb results a run's result snapshots by node, execution and item ([--node N] [--json]); show r:/ [--out FILE] prints one entry's stored text, re-verified; clean [--dry-run] removes what no stamp names; also lists the claims each evidence session checked apb evidence read read through an attempt's evidence session (--session ID, default APB_EVIDENCE_SESSION): outline | children --view V | read --ref R [--span A,B] | page --view V | search --phrase P; JSON, the same object as MCP run_evidence_read apb notify the machine's notify target, a run's notifications or a person's change of them (--on[=LIST], --off, --via, --to; refused inside a run step); apb notify test sends a test message apb wait block until a run finishes, needs input or stops apb pause pause a run (--drain default, --now, --reason, --until, --keep-lock) apb resume resume a paused or interrupted run (--all: runs a lost driver or a passed pause left waiting; --confirm-launch for a run never authorized) apb stop stop a run apb intent list a run's send intents, or resolve one whose outcome is not known (--sent | --not-sent) apb review decide a pending human_review or publish node (--nonce: the plan's nonce, publish only) apb publish a run's publish gate: show the exact plan, approve it by its nonce, or skip the push (show | approve --nonce N | skip) apb answer answer an interactive node's pending question apb tasks list or submit host tasks (host execution mode; --notes: findings and warnings) apb note post a supervisor note to a run apb export export a playbook version (YAML, layout, scripts) to a bundle file apb import preview and import a playbook bundle into this project (--preview; --accept without a terminal, else exit 3) apb trash list deleted playbooks, restore one with its versions apb trust list approvals (trust.json), revoke by digest or id, approve a version (--digest for imported scripts) apb profile manage agent profiles apb connector list or manage connectors (apb connector oauth [--account A] [--scope S]: a person's loopback consent that prints a refresh token once) apb detect detect installed coding agents (--json) apb models the cloud model catalogs (NEAR AI Cloud): rows, privacy classes, prices (--refresh, --json) apb templates list / show / install the example playbooks apb ships, as drafts (--scope project|global, --as ) apb adopt will it fit here: adoption readiness report for a playbook (--scope project|global) apb memory show or clear the remembered run input of a playbook in this project apb make-global make a project playbook available in every project (--variant trash|retire|keep, --dry-run) apb launch floor print a playbook's launch floor (--global); --lower-to lowers it, a person at an interactive terminal only apb subscriptions view or declare agent subscriptions (--json) apb suggestions inspect and undo recorded suggestion decisions apb migrate migrate schema 1 playbooks to schema 2 apb doctor diagnose environment, the defaults and the reviewer's agent, or one run with --run (--json) apb cache inspect and manage the node result cache apb decide ask the configured decision providers a bounded question (host tasks, scripts) apb decisions decision-model report, stored thresholds, replay apb stats cross-run metrics per playbook version and node (read-only) apb health routine health of watched playbooks (apb health [] [--json]; check []: evaluate now, exit 3 on hold; a person's clear , mute --until , unmute ) apb trigger start rules a person writes and approves (apb trigger set --file ; list, show , approve , enable , disable , remove , log , test [--event ]; a person changes a rule at an interactive terminal or in a signed-in dashboard) apb diagram the flowchart text derived from a playbook version (apb diagram [--version V] [--scope project|global] [--out PATH]; --rebuild |--all writes playbook.mmd again) apb grade grade an ended run by rules (built-in quality criteria) or by the decision model (--model: the playbook's own criteria); --show, --json, --reopen; --backfill [--version] [--last N] [--model] apb candidate a playbook's candidate compared with current by quality, with the summary a person reads first (--promote --expect @ [--ack ], --keep-current [--reason]) apb judge eval a judge node evaluated outside any run (--inputs, --answers, --emulate); also examples [--check] [--live], save-example --expect q=v, values apb version list|use|history the versions and the current one; use moves current (--expect , --reason , --scope project|global) apb problems a playbook's known problems (--json); confirm|dismiss|reopen [--reason]; close --quote; recheck [] [--holds|--model]; scan [--last N] apb discover step sequences past agent sessions repeat, as drafts (--project , --all-projects, --root , --sessions --agent claude-code|codex, --since 30d, --json); list; show [--paths]; save [--scope]; dismiss [--hard] [--global] apb eval run a playbook's eval cases in scratch repositories, store and compare pass counts (--yes approves the suite only; --confirm-launch confirms the launch); --level quick|smoke plays its scenarios, --scenarios lists them apb scenario capture --name a finished run as a scenario preview (--node narrows the asserted nodes; --save writes it, a terminal question or --yes confirms); MCP previews only apb corrections a playbook's corrections ledger (--json); show ; fixed --version X.Y.Z [--reason]; dismiss|reopen [--reason] apb demo install the keyless demo project under the config dir (--run starts it to its review, --remove deletes it) apb projects list or manage the workspace registry apb dashboard web UI on port 7321 apb ingest only the inbound webhook listener (headless) apb server manage server-mode API keys apb dev dev mode: Vite HMR frontend + API server (source tree) apb mcp stdio MCP server for coding agents apb self-update update apb to the latest release apb passkey enroll|list|remove the passkeys that gate person-only decisions and approvals (person only, refused inside a run step; removing the last one needs a one-time code typed at the terminal) ``` ## Architecture Six crates under `crates/` with dependency direction core <- engine <- mcp, cli and server on top, and `apb-decide` (no workspace dependency) <- engine, mcp: - `apb-core`: domain layer (no async). Playbook schema, validator, profiles, registry, versioning, trust store, atomic state IO. - `apb-decide`: blocking, provider-agnostic decision-model client (typed questions, provider chain, cache). - `apb-engine`: execution. Drive loop, node execution, immutable run manifest, agent adapters, append-only event log, background supervisor. - `apb-mcp`: rmcp stdio MCP server, policy gate, profile and supervisor tools. - `apb-cli`: package name `apb` (bin `apb`); thin dispatch. - `apb-server`: axum web API with the svelte frontend embedded via rust-embed. ## Docs - [Install guide](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/INSTALL.md): detailed installation methods and environment checks - [MCP tools reference](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/MCP.md): full tool surface, annotations, safety model, the run outcome (done, verified, not verified, findings, warnings, baseline, unknown sends) - [Run stats](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/STATS.md): `apb stats`, cross-run metrics from the run journals, per executor digest, quality per criterion over signed grades and its deltas in `--compare`, and the run estimate (`apb run --estimate`) - [Run quality](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/QUALITY.md): the `quality:` block, built-in criteria graded by rules as a run ends, a host's bounded grading session with cited evidence, the opt-in decision-model grader (`criteria_grader`), promotion of a candidate by quality (`apb grade`, `apb candidate`) - [Repeats in session history](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/DISCOVER.md): `apb discover` and MCP `playbook_discover`, the Claude Code and Codex history of named projects read within bounds, argument-free step tokens, repeated sequences offered as playbook drafts with scrubbed examples and sources, saved through capture or declined (`playbook_discover_save`, `playbook_discover_dismiss`) - [Known problems](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/KNOWN-PROBLEMS.md): the `known_problems:` block, tool-problem findings and repeated connector failures collected per playbook, shown to later runs as facts to check, rechecked when their source changes and closed only on a quote of the new source (`apb problems`, MCP `playbook_known_problems`, `known_problem_decide`, `known_problem_recheck`) - [Corrections](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/CORRECTIONS.md): the corrections people made along the way collected per playbook, recurring ones proposed with a draft prompt line a person applies and marks the fix version for (`apb corrections`, MCP `playbook_corrections`, `correction_decide`) - [Eval suites](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/EVALS.md): `apb eval`, cases next to a playbook's versions, repeated runs in scratch repositories, results per configuration - [Host integration](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/HOST-INTEGRATION.md): tier-0 instructions delivery, client compatibility - [Compatibility](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/COMPATIBILITY.md): what 1.x keeps stable (schema, journal, MCP tools, codes, files, playbook store), deprecation, platforms, what the freeze does not cover, and how a new name joins the freeze - [Profile authoring](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/PROFILES.md): how profiles bind agent + model + fallbacks + skills; `process_env: allowlist` limits which operator environment variables an agent process inherits - [Cloud models](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/CLOUD-MODELS.md): the NEAR AI Cloud catalog (`apb models`, `--refresh`), privacy classes, `nearai/` models on dsh with only `NEARAI_API_KEY`, catalog pricing, the `catalog: near-ai-cloud` decisions provider - [External data runs](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/EXTERNAL-DATA.md): `external_data: true` (`apb run --external-data`) for a run whose input comes from outside the operator; nothing it produces reaches a learning store or a history reader - [Playbook authoring guide](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/HOWTO-authoring.md): node types, edges, conditions, params, templating, list processing (`list:` runs a step once per item, in batches, with an engine check per item and per-item state kept across retries, pauses and loops), a run `budget:` (a token or dollar limit; the run pauses before a node whose median spend in comparable runs no longer fits, `on_no_estimate: ask|pause|continue`), goal criteria, baseline checks (before and after snapshots the engine reads itself), findings and warnings, the retry briefing, `Apb-Run` trailer reporting - [Guardrails](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/GUARDRAILS.md): which controls advise and which enforce, by layer; project hooks under the minimal environment - [Running apb in CI](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/CI.md): `apb run --detach` plus `apb wait` exit codes, config and secrets, trust in CI, starting once per event (`--start-key`), `apb health check` before a start, `apb runs prune`, a run `--deadline` - [Notifications](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/NOTIFY.md): "Notify me": a run tells a person about a waiting review or question, a pause they did not make and its end, through a connector they configured; trust checked at set time and at every send - [Connectors](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/CONNECTORS.md): calling external services (HTTP, mail, chat, Gmail, Google Calendar, Google Drive, web search) from playbooks, accounts, secrets, trust, OAuth refresh accounts (`apb connector oauth`), bounded paging, sending once (the send ledger, `--intent`, `on_unknown`) - [Deployment](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/DEPLOYMENT.md): running the dashboard on a server behind a TLS proxy with API keys - [Decision models](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/DECISIONS.md): optional small models for completion checks, judge nodes, retry advice and catalog ranking - [Reference scenarios](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/scenarios/README.md): realistic code and routine situations features are checked against, each naming today's gaps - [Interactive agents](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/INTERACTIVE-AGENTS.md): `interactive: true` nodes that ask the user a question mid-run - [Playbook interview](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/HOWTO-interview.md): how an agent interviews a user to capture a process as a playbook - [Feedback loop](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/FEEDBACK-LOOP.md): how agents report apb defects found during supervised runs ## Optional - [Design spec](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/superpowers/specs/2026-07-08-workflows-cli-design.md): full system design and rationale - [Agent profiles spec](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/superpowers/specs/2026-07-12-agent-profiles-design.md): profiles, trust, skills, scope resolution - [List processing spec](https://github.com/itechmeat/agentic-playbooks/blob/main/docs/superpowers/specs/2026-10-27-list-processing-design.md): list nodes, the item state machine, item checks, send-once per item, the review panel examples