Coordinate multi-agent implementation workflows from markdown plans.
Project description
diamond-dev
Run one plan through competing coding agents, pick the winner, ship a PR.
diamond-dev takes a single markdown plan and hands it to two coding agents at
once (by default Codex and Claude), each working on its own branch. A judge agent
(Gemini) compares the results, you accept one branch with a single checkbox, and
diamond-dev then refines it, runs a CodeRabbit review, applies the accepted
fixes, and opens a GitHub PR.
The name traces the shape of the run: it fans out from one plan to many parallel implementations, then converges back in — through the judge's comparison and your acceptance — to a single PR. Out, then in: a diamond.
Workflow
flowchart TD
plan["📄 markdown plan"] --> impl
subgraph impl["1 · Implement in parallel"]
codex["codex/<slug>"]
claude["claude/<slug>"]
end
impl --> bundle["2 · Build deterministic comparison bundle"]
bundle --> judge["3 · Gemini compares branches → comparison.md (wiki)"]
judge --> accept{"4 · You accept one branch<br/>in the wiki"}
accept --> refine["5 · Refine the accepted branch"]
refine --> review["6 · CodeRabbit review → judge findings → apply accepted fixes"]
review --> finalpr["7 · Final review → open GitHub PR"]
- Implement — each configured implementer (default
codex,claude) implements the plan on its own branch and commits without pushing. - Bundle —
diamond-devbuilds a deterministic comparison bundle (branch metadata, diffs, optional test results) for the judge to read. - Compare — the comparison judge (default
gemini) writescomparison.md, which is pushed to the GitHub wiki with an acceptance checkbox. - Accept — you check exactly one box in the wiki to choose a branch. The workflow polls the wiki and resumes when it sees your choice.
- Refine — the accepted branch is refined per the comparison follow-up.
- Review — CodeRabbit reviews the branch, the review judge classifies each finding, and the review fixer applies accepted fixes.
- PR — a final reviewer runs and
diamond-devopens a GitHub PR.
⚠️ Security:
diamond-devruns coding agents with their sandbox and approval prompts disabled, and executes package-install and test commands from the target repository. Run it only against repositories and plans you trust. See Security.
Table of Contents
Getting started
Reference
Prerequisites
- Python 3.14+
- External CLIs, installed and authenticated where needed. The default
workflow needs:
gitgh(authenticated —diamond-devverifiesgh auth statusat startup)codexclaudegeminicoderabbit
- Optional CLIs, required only when the cloned target repository has matching
root lockfiles:
uv— foruv.lock(uv sync --locked)pnpm— forpnpm-lock.yaml(pnpm install --frozen-lockfile)
Before cloning or launching agents, diamond-dev runs doctor-grade preflight
checks that verify the configured commands are available on PATH, GitHub auth
works, each configured agent adapter is logged in, local workspace and wiki
directories are writable, and the wiki remote accepts a dry-run push. When you
use custom agents, only the CLIs for the adapters you configure are required.
Installation
diamond-dev targets Python 3.14+. The recommended installer is
uv.
Install the CLI directly from the repository:
uv tool install git+https://github.com/hbmartin/diamond-dev.git
Or clone and install from source for development:
git clone https://github.com/hbmartin/diamond-dev.git
cd diamond-dev
uv sync --all-groups
uv run diamond-dev --version
Quickstart
# 1. Generate a starter config in your working directory.
diamond-dev init
# 2. Check CLI auth, wiki push access, and local write permissions.
diamond-dev doctor
# 3. Write a plan describing the change you want.
$EDITOR my-plan.md
# 4. Run the workflow.
diamond-dev my-plan.md
init asks for the target repository URL, an optional wiki repository URL, and
optional notification URLs, then writes .diamond-dev.toml. Everything else uses
the defaults described under Configuration.
When the run reaches step 3 of the workflow, it pauses for your input. Open
the comparison page in the repository's GitHub wiki (<slug>-comparison.md),
read Gemini's comparison of the two branches, and check exactly one box:
- [x] Accept: codex
diamond-dev polls the wiki, sees your choice, and resumes automatically —
refining the accepted branch, running the review, and opening the PR. You do not
need to restart the command; if it has exited, rerunning diamond-dev my-plan.md
auto-resumes from where it left off (see
Repositories & auto-resume).
Usage
diamond-dev path/to/my-plan.md
The command must be run from a directory containing .diamond-dev.toml (or pass
--config). It takes a path to a .md plan file.
The plan file name is copied into generated repositories and wiki artifacts, so
its basename must be a direct, cross-platform file name: no path separators,
leading dash, trailing dot or space, control characters, Windows-reserved
characters, or Windows device names such as CON or NUL.txt.
To compare two existing commits instead of starting from a plan, pass exactly two commit-ish refs:
diamond-dev abc123 def456
This skips the implementation agents and compares the two commits through the same acceptance, review, and PR flow. See Two-commit mode for ref resolution and naming rules.
To create a starter config interactively:
diamond-dev init
The initializer asks for the target repository URL, an optional wiki repository
URL, and optional notification URLs. It writes only .diamond-dev.toml; workflow,
agent, prompt, and comparison settings use the defaults documented under
Configuration unless you edit the generated file.
Useful flags:
--config PATH: Load configuration from a specific TOML file instead of.diamond-dev.tomlin the current directory. Relative paths resolve from the invocation directory. Withinit, this selects the config file to write.--force: Withinit, overwrite an existing config file without asking.--version: Show the installeddiamond-devversion.
To run readiness checks without starting a workflow:
diamond-dev doctor
diamond-dev --config custom.toml doctor
doctor runs the same startup checks used by workflow preflight. Codex, Claude,
and CodeRabbit use their auth status commands. Gemini does not expose a status
command, so doctor sends a tiny headless prompt to validate Gemini auth before
long-running agents start.
Configuration
diamond-dev reads .diamond-dev.toml from the invocation directory (or the
path passed to --config). Only one key is required — the target repository —
so the smallest working config is a single line:
repository_url = "git@github.com:owner/repo.git"
repository_url must be a Git remote URL in a supported form such as
https://github.com/owner/repo, ssh://git@github.com/owner/repo.git, or an
SCP-like form such as git@github.com:owner/repo.git. With only this key,
diamond-dev uses the default implementers, judge, prompts, and comparison
settings.
Everything else is optional and has a default. For the complete set of tables and
keys — [workflow], [agents.*], [comparison], [acceptance],
[notifications], [prompts], and legacy/migration notes — see the
Configuration reference.
Documentation
The docs/ directory holds focused guides for everything beyond
the getting-started path:
- Understand — Architecture: the phases, modules, and data structures behind a run.
- Configure & customize — Configuration reference, Agents & custom adapters, Custom prompts.
- Reference — Two-commit mode, Repositories & auto-resume, Acceptance & review artifacts.
- Operate — Automation & CI integration, Observability, Troubleshooting.
Security
diamond-dev executes code on your machine from two untrusted-by-default
sources — the coding agents and the target repository — so run it only against
repositories and plans you trust:
- Agents run with sandbox and approval prompts disabled. Implementers are
launched non-interactively with full edit permissions:
codex exec --dangerously-bypass-approvals-and-sandbox,claude -p --permission-mode bypassPermissions --dangerously-skip-permissions, andgemini -p … --skip-trust -y. The agents can read and write files and run commands in their clones without prompting. - Package install runs repository lifecycle scripts. When a clone contains
uv.lockorpnpm-lock.yaml,diamond-devruns the matching install command, which can execute dependency lifecycle scripts defined by the target repository. - Comparison test commands are trusted and run via
sh -lc. Any[comparison].test_commandsyou configure run in each implementation clone. - Logs may contain secrets. Loguru exception logs include local variable
values by default. Set
DIAMOND_DEV_LOG_DIAGNOSE=0(orfalse/no/off) to disable this if your logs may capture sensitive values. See Observability.
Troubleshooting & FAQ
Preflight fails with a missing command. The named CLI is not on PATH.
Install it (see Prerequisites) or, if you don't use it, remove
the corresponding agent from [workflow]. Only the CLIs for configured adapters
are checked.
Preflight fails on gh auth status. Authenticate the GitHub CLI with
gh auth login (or set GH_TOKEN) before running.
The run exited while waiting for acceptance. That's fine. Edit the acceptance
checkbox in the wiki, then rerun diamond-dev my-plan.md; it auto-resumes and
picks up your choice. Pressing Ctrl-C during acceptance polling exits with code
130 after writing the current run report.
Where are the artifacts? Comparison bundle, comparison page, review file, and
review-judgment sidecar are written in the invocation directory and pushed to the
GitHub wiki. Per-run logs and run-report.json are under logs/.
For deeper recovery — plan drift, divergent branches, succeeded_with_warnings,
existing PRs on resume, dirty files, and finding the right log — see the
Troubleshooting guide.
License
diamond-dev is (C) 2026 Harold Martin and licensed under the Apache License, Version 2.0. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file diamond_dev-0.3.0.tar.gz.
File metadata
- Download URL: diamond_dev-0.3.0.tar.gz
- Upload date:
- Size: 62.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0dd178064da299f7f9c502e8944f46acaa0288f24c55815afc1ed83a7d563e7d
|
|
| MD5 |
6bdf4ae0dac4706e3fae6e4710c12146
|
|
| BLAKE2b-256 |
bab32269a47c80aa513c53acc2d87bd41be5187ba754fa03bae53e47dd843297
|
File details
Details for the file diamond_dev-0.3.0-py3-none-any.whl.
File metadata
- Download URL: diamond_dev-0.3.0-py3-none-any.whl
- Upload date:
- Size: 77.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cfab6431711148972efd123004b4f51eb366888c443c78c78ad62f69f770280
|
|
| MD5 |
782a5b89224952a3d819647ea896ed44
|
|
| BLAKE2b-256 |
a7d41fcfa42476495a3fda77e2048c2747f45e38d7bab8c72f92902b140cc0dd
|