AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
Doctrine is an opinionated but hackable set of tools and conventions for
software engineering with LLM agents.
Heresy burns; Doctrine remains.
1. Correctness
2. Laziness
3. Hackability
4. EfficiencyREADME 전문 보기 ↗Doctrine is an evolving, ambitious, pragmatic approach to agentic engineering, expressed as a Rust CLI tool. You might think of it as a harness for your harness.
It promotes engineering rigour, fosters clear understanding, and bounds agent autonomy. Agents adhere to your intent, and you focus your attention on design, not supervision or repair.
Why?
You can build an effective process for small-scale projects in 80 lines of markdown - but agents follow prose instructions unreliably. As project scope and complexity grow, the effectiveness of this approach declines, and new failure modes emerge. Prose is flexible, but unstructured. A prompt, no matter how well considered, can only improve the odds so much.
Doctrine supplements coding agents with the determinism of classical software systems. Workflows are pushed down into finite state machines. Structured data alongside markdown documents allows their traversal as nodes in a graph. Decisions, assumptions, hypotheses, and evidence records make a shared semantic view of your codebase legible. Memories decay over time, and are surfaced when the files they concern are encountered.
Doctrine is designed to work with any model or harness, though specific integrations may vary slightly. Its vendor-agnostic handling of project context, and strict guardrails, make less capable and cheaper models more reliable and reduce the barriers to substitution.
freedom through constraint
Priorities, in order — when two conflict, the higher one wins:
| Area | What it does |
|---|---|
| Change lifecycle | Every intentional change is a slice: scope → design → plan → phases → audit → reconcile → close. The lifecycle is a state machine; design runs are managed, so an interview resumes cleanly in a fresh context. |
| Specifications & governance | Product and technical specs, requirements, ADRs, policies, standards, RFCs, and revisions. A boot snapshot puts the binding rules — and who may override them — in front of every agent session. |
| Epistemic records | Assumptions, decisions, open questions, constraints, evidence, hypotheses, and concepts: the things a project acts on without having proven, tracked from held to settled instead of lost in prose. Useful before anything is concrete enough to build. |
| Memory | Typed, scoped memories anchored to the code they describe. Surfaced when an agent touches matching files; verified, aged, and flagged when stale. Usable on its own (--only-memory). |
| Adversarial review | Reviews as a first-class ledger: findings are raised, disposed, verified, or contested turn by turn — across models if you like. Audit uses the same ledger to reconcile what was built against what was designed. |
| Backlog & priority | Cheap capture of issues, improvements, chores, risks, and ideas. Priority and actionability are derived from the dependency graph and lifecycle state; doctrine next explains its answer. Value can be elicited by pairwise comparison. |
| Parallel dispatch | Phases run as workers in isolated git worktrees (kernel-confined on Linux). One orchestrator is the sole writer of shared state; progress is crash-resumable; nothing lands on trunk before audit. Orchestration verbs are primitives you can compose. |
| Exploration | Ranked search over the whole corpus, relation graphs in the terminal, and a local web explorer (doctrine map serve). |
| Harness independence | Skills install for Claude Code, Codex, pi, and other agents. Per-model prompt supplements resolve on demand, so one project works across harnesses. |
| Self-measurement | An observation ledger captures process friction as it happens, so the workflow itself can be tuned on evidence. |
The separation is deliberate throughout: structured, queryable data in TOML; prose in Markdown; disposable runtime state in a gitignored directory, apart from the artifacts worth keeping.
TL'DR:
curl -sL https://install.doctrinal.systems | sh
Prebuilt binary (macOS + Linux, no Rust toolchain) — recommended:
# latest release (rolling):
curl -fsSL https://raw.githubusercontent.com/davidlee/doctrine/main/install.sh | sh
# or pin to a release tag for reproducibility:
curl -fsSL https://raw.githubusercontent.com/davidlee/doctrine/v0.8.1/install.sh | sh
Installs to ~/.local/bin (override with DOCTRINE_BIN_DIR); choose a version
with DOCTRINE_VERSION. The script checksum-verifies what it downloads — read it
before piping to a shell. macOS arm64 + x86_64; Linux x86_64 + aarch64 (static
musl — runs on any distro regardless of glibc version).
Or with cargo binstall (prebuilt, no compile):
cargo binstall doctrine
Or cargo install (compiles from source; needs a Rust toolchain — may hit the
-liconv link error on some macOS toolchains, which the prebuilt paths above
sidestep):
cargo install doctrine
Then bootstrap a project:
cd my_project || mkdir my_project
doctrine install # prompts to confirm; or use --dry-run | --yes
claude
> Let's design a feature: ...
or install from source (customise templates / skills):
gh repo clone davidlee/doctrine && cd doctrine
# optional:
# customise install/templates and/or plugins/skills
# they'll get bundled into the binary for installation
cargo install --path .
or use it as a nix flake:
inputs.doctrine.url = "github:davidlee/doctrine";
# ...
doctrine = inputs.doctrine.packages.${system}.doctrine;
to install skills for other agents:
doctrine install --agent codex # or pi / universal: all read .agents/skills from the embed
doctrine install registers the doctrine MCP server with each detected harness.
The Codex registration is user-level: install runs
codex mcp add doctrine -- <absolute path of the doctrine on your PATH> serve --mcp,
writing ~/.codex/config.toml (or $CODEX_HOME/config.toml), so it applies to
every project on the machine. Interactive codex starts MCP servers from a
long-lived daemon whose PATH is frozen, so a PATH-dependent command fails
there; an absolute path works, and a machine path does not belong in a file that
client projects commit.
Two things follow:
-y grants it; declining changes
nothing in either codex config;codex mcp add replaces the whole entry, so the prompt lists any keys the
write would drop.An old doctrine-written project-level [mcp_servers.doctrine] entry is removed
under the same consent, because codex prefers the project layer. A project entry
whose command contains a path separator — or a url transport — is a deliberate
override: left untouched and reported. A PATH-dependent foreign project entry is
warned about and leaves install incomplete. Codex has a per-folder trust prompt
before it loads project config; the user-level entry does not depend on it.
The codex CLI is a declared dependency of the codex harness: with no codex on
PATH, install prints the codex mcp add line to run yourself. A codex session
already running keeps its old MCP config until restarted.
mkdir my-project && cd my-project
git init
mkdir .claude
# also run this after a new doctrine version:
doctrine install -y
# commit with the git add / git commit command install prints
Use Doctrine's memory system with your preferred tooling for the rest:
cd my-project
doctrine install --agent claude --only-memory -y
# doctrine memory help
# doctrine memory record --type pattern "red/green/refactor TDD" --glob "src/lib/**/*" --summary "..."
# doctrine memory list
# start up your harness of choice
claude
# it'll route through doctrine when it needs to
> I've got a markdown file @here.md with a task description. Take a look and let's shape it up.
Many / most of the CLI surface is really for agents. Once you have some content, you might find some of these useful:
doctrine --help
doctrine slice list
doctrine status
doctrine next
doctrine backlog list
doctrine <kind> paths <ID>
doctrine search ...
doctrine memory find ...
Doctrine ships with self-documenting agent memories.
You can view them yourself with doctrine onboard.
The agent should be able to steer while you get used to the default workflow.
templates:
nvim .doctrine/templates
skills:
rm .claude/skills/code-review # remove symlink
cp -r .doctrine/skills/code-review/ .claude/skills/
nvim .claude/skills/code-review/SKILL.md
git add -f .claude/skills/code-review/SKILL.md
doctrine install # skips existing non-symlinks
or:
gh repo fork davidlee/doctrine --clone
cd doctrine
nvim doctrine/plugins/review
git commit -m "feat: review like a pirate" && git push
cargo install --path . # build with your edits
# in your projects
doctrine install --agent claude --yes # from binary, or
doctrine install --agent universal --yes # for pi / codex / other .agents/skills harnesses
This repository is multi-licensed:
plugins/ are licensed under MIT.install/ are licensed under MIT, including templates and config.toml.Where a file contains an SPDX license identifier or a directory contains its own LICENSE file, that more specific notice controls.
The /worktree skill's directory-selection and safety-verification patterns are
adapted from superpowers:using-git-worktrees
by Jesse Vincent (MIT).
Product and technical specifications — the durable, agent-readable intent behind
Doctrine's capabilities. Regenerate this list with just readme-index.
activeactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveopenopenresolvedresolvedopenresolvedopenresolvedopenresolvedacceptedacceptedacceptedacceptedacceptedacceptedacceptedacceptedacceptedacceptedactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveactiveopenopenacceptedaccepted