{
  "markdown": "# Lope\n\n```\n ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n ████████████████████████████████████████████████\n                                                 \n    ██      ██████    ██████   ███████           \n    ██     ██◉  ◉██   ██   ██  ██                \n    ██     ██ ▽▽ ██   ██████   █████             \n    ██     ██ ◡◡ ██   ██       ██                \n    ██████  ██████    ██       ███████           \n                                                 \n ████████████████████████████████████████████████\n ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n     any cli implements  ·  any cli validates\n```\n\n**Multi-CLI validator ensemble for AI work.**\n\nOne AI CLI drafts. Others validate. No single-model blindspot. Works for multi-phase sprints (negotiate → implement/execute → audit), autonomous graph workflows (`flow`), single-shot multi-model tasks (`ask`, `review`, `vote`, `compare`, `pipe`), evidence gates (`gate`, `check`), and roster management (`team`). Add or remove teammates from any chat window, no JSON editing. Keep Lope current with `lope update`.\n\n> **Judgment superpowers.** Lope is now a **multi-agent judgment engine**. `lope review --consensus` merges, deduplicates, and consensus-ranks findings across N validators with SARIF export for CI. `--synth` rolls those findings into one executive summary. `lope memory` remembers recurring issues across sessions. `lope deliberate` runs Agent-Order-style councils on ADR / PRD / RFC / build-vs-buy / migration / incident decisions. `--brain-context` and `--brain-log` plug into Makakoo OS Brain. `--divide files` walks directories; `--divide hunks` reviews diffs; `--roles` runs the same artifact through security / performance / tests lenses. See **[Judgment superpowers](#judgment-superpowers)** below.\n\n> **Not just for code.** Lope works for **engineering, business (marketing, finance, ops, consulting), and research (systematic reviews, protocols, academic work)**. The same validator loop that catches bugs in code also catches gaps in budgets, timeline assumptions, methodology rigor, and audience targeting. See [Use cases](#use-cases) for 9 worked examples across all three domains.\n\n> Zero external dependencies. Pure Python stdlib. MIT license.\n\n\n## Install or update in one minute\n\n**Fresh install, easiest path:** paste this into any AI agent you already use:\n\n```text\nRead https://raw.githubusercontent.com/traylinx/lope/main/INSTALL.md and follow the instructions to install lope on this machine natively.\n```\n\n**Terminal install:**\n\n```bash\nif [ -d \"$HOME/.lope/.git\" ]; then\n  git -C \"$HOME/.lope\" fetch --tags origin\n  git -C \"$HOME/.lope\" pull --ff-only origin main\nelif [ -e \"$HOME/.lope\" ]; then\n  echo \"$HOME/.lope exists but is not a Lope git checkout. Move it aside manually, then rerun install.\" >&2\n  exit 1\nelse\n  git clone https://github.com/traylinx/lope.git \"$HOME/.lope\"\nfi\n\"$HOME/.lope/install\"\ngrep -qxF \"alias lope='PYTHONPATH=$HOME/.lope python3 -m lope'\" \"$HOME/.zshrc\" 2>/dev/null || echo \"alias lope='PYTHONPATH=$HOME/.lope python3 -m lope'\" >> \"$HOME/.zshrc\"\n```\n\nIf your installed Lope is older than v0.12.0 and says `invalid choice: 'update'`, run the block above once. After that, `lope update` exists.\n\n**Update later:**\n\n```bash\nlope update             # fetch, pull, refresh installed host skills\nlope update --dry-run   # preview the exact commands\nlope upgrade            # legacy alias\n```\n\nThe standard install is a git checkout in `~/.lope`. That is the path to use today. PyPI publishing is not live yet, so do not rely on `pip install lope-agent` until the release workflow's Trusted Publisher setup is fixed.\n\n---\n### Judgment superpowers\n\n```bash\n# Consensus review — merge, dedupe, rank, export\nlope review auth.py --consensus --synth --remember\nlope review src/ --divide files --consensus --format sarif > review.sarif\nlope review patch.diff --divide hunks --consensus --format markdown-pr\nlope review auth.py --roles security,performance,tests --consensus\n\n# Cross-session memory\nlope memory stats\nlope memory hotspots --days 30\nlope memory search \"rate limit\"\nlope memory file auth.py\n\n# Makakoo Brain bridge (optional; activates only when MAKAKOO_BIN/MAKAKOO_HOME set)\nlope review auth.py --consensus --brain-context \"auth decisions\" --brain-log\nlope ask \"What should we do next?\" --brain-context \"lope roadmap\" --synth\n\n# Council deliberation\nlope deliberate adr scenario.md --depth quick\nlope deliberate prd scenario.md --depth standard\nlope deliberate build-vs-buy scenario.md --synth\n```\n\nEvery advanced review feature is **opt-in**. Default `lope review file.py` and friends keep the simple one-file, one-pass behavior.\n\n---\n\n### What it looks like\n\n```\nYou (in Claude Code):    /lope-negotiate \"Add JWT auth with refresh tokens\"\n\n  Round 1  drafter proposes sprint doc (4 phases)\n  Round 1  opencode + vibe + gemini review... NEEDS_FIX (0.78)\n           - Missing rate limiting on refresh endpoint\n           - No test for token expiry edge case\n  Round 2  drafter revises... applies both fixes\n  Round 2  opencode + vibe + gemini review... PASS (0.93)\n\n  Saved: SPRINT-JWT-AUTH.md\n\nYou:    /lope-implement SPRINT-JWT-AUTH.md --agents pi --escalate-to claude,opencode\n\n  Phase 1  scaffold ................ PASS  0.95  12s\n  Phase 2  core-middleware ......... NEEDS_FIX  0.71\n           - Token expiry check missing in middleware/auth.go:142\n           → applying fix...\n  Phase 2  re-validate ............. PASS  0.89  41s\n  Phase 3  refresh-rotation ........ PASS  0.88  28s\n  Phase 4  integration-tests ....... PASS  0.94  19s\n\n  4/4 PASS  |  avg confidence 0.91  |  134s\n```\n\n---\n\n## You don't have to type slash commands\n\nOnce lope is installed, your AI agent knows lope exists. You can just **talk to it** and it will invoke lope on your behalf when the request fits. No command memorization, no flag lookup.\n\n```\nYou:    Let's plan the auth refactor with JWT refresh rotation. I want\n        gemini and opencode to both sign off before I touch any code.\n\nAgent:  [recognizes multi-phase work → invokes /lope-negotiate]\n        Running: lope negotiate \"JWT auth refactor with refresh rotation\" \\\n                   --domain engineering --max-rounds 3\n\n        Drafter: claude-code  ·  Reviewers: gemini-cli, opencode\n        Round 1  drafter proposes sprint doc (3 phases)\n        Round 1  gemini-cli + opencode review... NEEDS_FIX (0.74)\n                 - Refresh endpoint missing rate limiting\n                 - Phase 2 criteria are vague about refresh-token reuse\n        Round 2  drafter revises\n        Round 2  gemini-cli + opencode review... PASS (0.91)\n\n        Saved: SPRINT-JWT-AUTH-REFRESH-ROTATION.md\n```\n\n**Natural language → lope invocation** examples:\n\n| You say | Agent runs |\n|---|---|\n| \"Draft 3 blog posts about lope for the launch\" | `lope negotiate \"Draft 3 launch blog posts\" --domain business` |\n| \"Plan the Q4 marketing campaign carefully\" | `lope negotiate \"Q4 marketing campaign\" --domain business` |\n| \"Scope the data ingestion rewrite\" | `lope negotiate \"Data ingestion pipeline rewrite\" --domain engineering` |\n| \"Systematic review of post-training RL papers\" | `lope negotiate \"Systematic review of post-training RL\" --domain research` |\n| \"What do gemini and claude say about this approach?\" | `lope ask \"<the question>\"` |\n| \"Get a second opinion across models on X\" | `lope ask \"<question about X>\"` |\n| \"Review auth.py across models for security\" | `lope review auth.py --focus security` |\n| \"Multi-model review of my PR diff\" | `lope review <diff path>` |\n| \"Yes/no from all the CLIs — is this safe?\" | `lope vote \"Is this safe?\" --options yes,no` |\n| \"Pick 3.12 or 3.13 for the new project\" | `lope vote \"Python version\" --options 3.12,3.13` |\n| \"Which file is better — old or new?\" | `lope compare old.py new.py --criteria \"correctness and readability\"` |\n| \"Before/after bake-off for security\" | `lope compare before.py after.py --criteria security` |\n| \"Pipe this diff into every model\" | `gh pr diff \\| lope pipe` |\n| *(pastes a curl)* \"add this to lope as openai\" | `lope team add openai --from-curl \"<paste>\"` |\n| \"Add openclaw to lope using my Tytus pod\" | `lope team add openclaw --url <URL> --model openclaw --key-env OPENAI_API_KEY` |\n| \"Add my local ollama (qwen3:8b) as a teammate\" | `lope team add my-ollama --cmd \"ollama run qwen3:8b {prompt}\"` |\n| \"Turn on Codex and OpenCode validators\" | `lope team enable codex opencode` |\n| \"Disable claude for now\" | `lope team disable claude` |\n| \"Remove custom mistral from the team\" | `lope team remove mistral` |\n| \"Who's on lope?\" / \"list validators\" | `lope team list` |\n| \"Test if my new mistral teammate works\" | `lope team test mistral` |\n\nThe trigger words your agent watches for: **plan / negotiate / scope / draft / roll out** → `negotiate`; **ask / what do the CLIs think / second opinion** → `ask`; **review / critique / audit this file** → `review`; **yes-no / A-B-C / pick one** → `vote`; **which is better / compare / bake-off** → `compare`; **pipe / send output / `cmd | lope`** → `pipe`; **add / remove / list / test a validator** → `team`; **agent graph / autonomous loop / consensus workflow** → `flow`; **save/check gates / objective evidence / CI gate** → `gate` or `check`; **recurring finding / hotspots** → `memory`; **ADR / PRD / RFC / build-vs-buy / migration council** → `deliberate`; **update / upgrade / refresh skills** → `update`. The agent maps the shape of your request to the right verb without you having to remember slash syntax.\n\nExplicit slash commands still work — `/lope-negotiate`, `/lope-execute`, `/lope-implement`, `/lope-audit`, `/lope-ask`, `/lope-review`, `/lope-vote`, `/lope-compare`, `/lope-pipe`, `/lope-team`, `/lope-flow`, `/lope-memory`, `/lope-deliberate`, `/lope-headroom`, and `/lope-help` (Gemini uses `/lope:negotiate`, etc.). Natural language is the lazy path when you just want to do something multi-model.\n\n### What happens under the hood\n\nWhen you talk to your agent, the `using-lope` auto-trigger skill fires. It's a meta-skill installed alongside the explicit slash commands. Its job is to recognize the shape of your request and invoke the right lope mode for you. If the request is a single edit, a trivial fix, or pure conversation, `using-lope` **stays out of the way** — it's specifically scoped to multi-phase consequential work. You will not get a sprint negotiation for \"rename this variable\".\n\nSee [`skills/using-lope/SKILL.md`](skills/using-lope/SKILL.md) for the full trigger logic and anti-patterns.\n\n---\n\n\n### Objective evidence gates\n\nLope can now run project-defined evidence gates without becoming a code analyzer. Put deterministic checks in `./.lope/rules.json`:\n\n```json\n{\n  \"gates\": [\n    {\"name\": \"tests\", \"cmd\": \"python -m pytest tests -q\", \"type\": \"exit\"},\n    {\"name\": \"coverage\", \"cmd\": \"python -m coverage json -o -\", \"type\": \"json_number\", \"path\": \"totals.percent_covered\", \"min_delta\": 0}\n  ]\n}\n```\n\nThen use them as a harness signal:\n\n```bash\nlope gate save\n# ... agent changes code ...\nlope gate check --json\nlope execute SPRINT.md --gates\n```\n\nGates are opt-in, stdlib-only, and command-based: tests, lint, typecheck, build, coverage, or custom scripts provide the evidence; Lope coordinates baselines, comparisons, retries, and memory.\n\n> **Trust:** gate commands come from the repository's `.lope/rules.json` and run with your privileges. The first time a repo's gates would run, Lope shows the commands and asks for confirmation (remembered per repo + command-set). In a non-interactive session it refuses unless you pass `--trust` or set `LOPE_TRUST_GATES=1`. **Only run gates from repositories you trust.**\n\n## Install — paste one line into any AI agent\n\nOpen your AI agent (Claude Code, Codex, Cursor, Gemini CLI, OpenCode, GitHub Copilot CLI — whichever you already use) and paste this prompt:\n\n```\nRead https://raw.githubusercontent.com/traylinx/lope/main/INSTALL.md and follow the instructions to install lope on this machine natively.\n```\n\nThat's it. Your agent fetches a single markdown file, follows six short steps, and reports back when lope is live. The install recipe is CLI-agnostic — it writes Lope commands or skills into each host's **native** location using the format that host expects. Restart your CLI once to pick up new slash commands where that host supports them.\n\n**Update later:**\n\n```bash\nlope update             # git checkout: fetch, pull, refresh host skills\nlope update --dry-run   # preview the exact commands\nlope update --host codex # update code, then refresh only Codex skills\nlope upgrade            # legacy alias for update\n```\n\nFor the standard `~/.lope` git install, `lope update` fetches tags, pulls the explicit tracked remote branch with `--ff-only`, and reruns `./install` so host skills stay in sync. Pass `--skip-install` if you only want the engine code. PyPI publishing is not live yet, so use the git checkout install path on servers for now.\n\n**Requirements:** `git`, `python3 ≥ 3.9`, `bash ≥ 3.2`. That's all.\n\n**What gets installed:**\n\n| Host | Path | Format |\n|---|---|---|\n| Claude Code | `~/.claude/skills/lope*/` | skill dirs |\n| Codex | `~/.codex/skills/lope*/` | skill dirs |\n| Gemini CLI | `~/.gemini/commands/lope/*.toml` | TOML commands |\n| OpenCode | `~/.config/opencode/commands/lope*.md` | flat markdown |\n| Cursor | `~/.cursor/agents/lope*.md` | flat markdown |\n| Mistral Vibe | `~/.vibe/skills/lope*/` | skill dirs |\n| Qwen Code | `~/.qwen/skills/lope*/` | skill dirs |\n| pi (Traylinx) | `~/.agents/skills/lope*/` | skill dirs (shared `@agents` tree) |\n\nHosts you don't have installed are skipped silently. Eight hosts are supported today.\n\n### Manual install (for the 1% who prefer to read bash)\n\n```bash\nif [ -d \"$HOME/.lope/.git\" ]; then\n  git -C \"$HOME/.lope\" fetch --tags origin\n  git -C \"$HOME/.lope\" pull --ff-only origin main\nelse\n  git clone https://github.com/traylinx/lope.git \"$HOME/.lope\"\nfi\n\"$HOME/.lope/install\"\n```\n\nTarget a single host:\n\n```bash\n~/.lope/install --host codex\n~/.lope/install --host gemini\n```\n\nThen add a shell alias so you can just type `lope`:\n\n```bash\necho \"alias lope='PYTHONPATH=~/.lope python3 -m lope'\" >> ~/.zshrc\n```\n\n**Check what validators lope found on your machine:**\n\n```bash\nlope status\n```\n\n**Pick which ones to use:**\n\n```bash\nlope configure\n```\n\n---\n\n## How it works\n\nLope has three shapes: **structured sprint mode** (negotiate → implement/execute → audit, with phase retry), **zero-human implement mode** (select the agent roster once, then run the whole sprint), and **single-shot verbs** (ask, review, vote, compare, pipe — one prompt, N responses, done).\n\n### Sprint mode — planned work with phase retries\n\n```\n  NEGOTIATE              VALIDATE              EXECUTE              AUDIT\n  ─────────              ────────              ───────              ─────\n  LLM drafts    ───>   Other CLIs    ───>   Phase by       ───>   Scorecard\n  sprint doc           review & vote         phase with            + journal\n                       (majority vote)       retry on\n                                             NEEDS_FIX\n\n                  <─── NEEDS_FIX ────┘\n```\n\n**Negotiate:** An LLM drafts a structured sprint doc (phases, goals, criteria). Validators push back on scope creep, missing edge cases, unverified assumptions. The LLM revises until PASS or max rounds.\n\n**Execute:** Phase-by-phase implementation with validation after each phase. PASS advances. NEEDS_FIX retries with specific fix instructions (up to 3 attempts). FAIL escalates to you.\n\n**Implement:** High-level zero-human sprint execution. First select implementation agents and escalation agents, then Lope runs the sprint without asking the human again. v1 uses a single writing lead to avoid same-checkout patch races while the selected team acts as validator/escalation context.\n\n**Audit:** Scorecard with per-phase verdicts, confidence scores, duration, and overall status.\n\n### Single-shot verbs — one prompt, N responses\n\n```\n  ASK / REVIEW / VOTE / COMPARE / PIPE\n  ────────────────────────────────────\n        ┌──────────────────────┐\n  You ──>│ fan-out to every     │─────> N raw responses\n         │ configured validator │        (one section per CLI)\n        │ in parallel threads   │        or tally + winner (vote/compare)\n        └──────────────────────┘\n```\n\nEach verb shares the same parallel fan-out primitive (`EnsemblePool.validate`). Consensus and synthesis build on that primitive rather than adding another parallelism layer. No sprint doc, no phase retries, no majority-vote on verdicts. You get each model's actual response; synthesis is your call (or optional with `--json`).\n\n**Core command surface:** sprint commands (`negotiate`, `execute`, `implement`, `audit`), single-shot commands (`ask`, `review`, `vote`, `compare`, `pipe`), autonomous graph workflows (`flow`), evidence gates (`gate`, `check`), roster management (`team`), memory/judgment commands (`memory`, `deliberate`), and maintenance (`update` / `upgrade`).\n\n---\n\n## Supported validators\n\n**Auto-detected built-in CLIs** — run `lope status` and lope finds whatever is on your PATH:\n\n| CLI | Binary | Command |\n|-----|--------|---------|\n| Claude Code | `claude` | `claude --print` |\n| OpenCode | `opencode` | `opencode run --format json` |\n| Gemini CLI | `gemini` | `gemini --prompt` |\n| Codex (OpenAI) | `codex` | `codex exec` |\n| Mistral Vibe | `vibe` | `vibe run \"{prompt}\"` |\n| Aider | `aider` | `aider --message --no-git --yes` |\n| Ollama | `ollama` | local, zero auth |\n| Goose (Block) | `goose` | `goose run --text` |\n| Open Interpreter | `interpreter` | `interpreter --fast -y` |\n| llama.cpp | `llama-cli` | fastest local inference |\n| GitHub Copilot CLI | `gh copilot` | `gh copilot suggest` |\n| Amazon Q | `q` | `q chat` |\n| pi (Traylinx) | `pi` | `pi -p \"{prompt}\"` |\n| Qwen Code | `qwen` | `qwen -p \"{prompt}\"` |\n| Agy | `agy` | `agy -p \"{prompt}\"` |\n\nYou need at least one validator to run, and at least two different validators for the ensemble to have real signal. Install whatever you already use.\n\n### Add any AI in 30 seconds — paste a curl\n\nIf the AI provider publishes a quickstart curl (every major one does), **paste it into lope**. Lope parses the URL, headers, and body; auto-injects `{prompt}` into the user-content field; and infers where the response lives. Zero flag memorization.\n\n```bash\n# Paste a curl straight from OpenAI's docs — done.\nlope team add openai --from-curl \"curl https://api.openai.com/v1/chat/completions \\\n  -H 'Authorization: Bearer \\${OPENAI_API_KEY}' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\\\"model\\\":\\\"gpt-4o-mini\\\",\\\"messages\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"hi\\\"}]}'\"\n\n# Curl had the literal key? Let lope swap it for an env var reference.\nlope team add groq --from-curl \"curl https://api.groq.com/openai/v1/chat/completions \\\n  -H 'Authorization: Bearer gsk_RAW12345' \\\n  -d '{\\\"model\\\":\\\"llama-3.3-70b-versatile\\\",\\\"messages\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"hi\\\"}]}'\" \\\n  --key-env GROQ_API_KEY\n\n# Anthropic, Cohere, Together, Deepinfra, Tytus pods, vLLM servers, self-hosted gateways —\n# same single-command paste-and-go. Response path is auto-inferred.\n\n# Confirm it works\nlope team test openai\n```\n\n**Safety guarantees**, enforced on every paste:\n\n- Literal API keys in the pasted curl are **refused** unless you pass `--key-env` (lope then swaps them for `${VAR}` references). Keys never touch the config file in plaintext.\n- `{prompt}` substitution is a real placeholder — never shell-interpolated. No injection vector.\n- Unsupported shapes (`-u` basic auth, `-F` multipart, `@file` body, `-X GET`) are rejected with a clear fix.\n\n### Add any CLI or HTTP API — flag form\n\nPrefer describing the provider in flags (no curl handy)?\n\n```bash\n# Local CLI binary\nlope team add my-ollama --cmd \"ollama run qwen3:8b {prompt}\"\n\n# HTTP endpoint (OpenAI-compatible shape)\nlope team add openclaw --url http://10.42.42.1:18080/v1/chat/completions \\\n    --model openclaw --key-env OPENAI_API_KEY\n\n# Drop a teammate\nlope team remove codex\n\n# See who's on the team (active + disabled + source tag)\nlope team list\n```\n\nYour agent recognizes natural language — **\"add openclaw to lope\", \"here's a curl, add it\", \"remove codex from the team\", \"test if the new mistral works\"** — and runs the right `lope team` invocation. Built-in names (`claude`, `opencode`, `gemini`, `codex`, `aider`) can't be shadowed. Full decision tree + all supported body shapes + unsupported-curl error recipes in [`skills/lope-team/SKILL.md`](skills/lope-team/SKILL.md).\n\n### Add any CLI or HTTP API — via config (advanced)\n\nPrefer editing JSON? `~/.lope/config.json`:\n\n```json\n{\n    \"version\": 1,\n    \"validators\": [\"claude\", \"ollama-qwen\"],\n    \"providers\": [\n        {\n            \"name\": \"ollama-qwen\",\n            \"type\": \"subprocess\",\n            \"command\": [\"ollama\", \"run\", \"qwen3:8b\", \"{prompt}\"]\n        }\n    ]\n}\n```\n\nTwo provider types cover everything:\n\n| Type | Use for |\n|------|---------|\n| `subprocess` | CLI tools — Ollama, Goose, llama.cpp, any binary |\n| `http` | API endpoints — OpenAI, Anthropic, Groq, self-hosted |\n\nHTTP example (Anthropic):\n\n```json\n{\n    \"name\": \"anthropic-api\",\n    \"type\": \"http\",\n    \"url\": \"https://api.anthropic.com/v1/messages\",\n    \"headers\": {\n        \"x-api-key\": \"${ANTHROPIC_API_KEY}\",\n        \"anthropic-version\": \"2023-06-01\",\n        \"Content-Type\": \"application/json\"\n    },\n    \"body\": {\n        \"model\": \"claude-sonnet-4-5\",\n        \"max_tokens\": 4096,\n        \"messages\": [{\"role\": \"user\", \"content\": \"{prompt}\"}]\n    },\n    \"response_path\": \"content.0.text\"   // dot-path into the JSON response\n}\n```\n\n**The only contract:** the response must contain a `---VERDICT---...---END---` block. Add a `prompt_wrapper` if the model needs explicit instructions:\n\n```json\n{\n    \"name\": \"my-llm\",\n    \"prompt_wrapper\": \"Respond with a VERDICT block at the end:\\n{prompt}\",\n    \"type\": \"http\",\n    ...\n}\n```\n\n**Security:** `subprocess` runs with `shell=False`. `${VAR}` is forbidden in command args and URLs (prevents key leakage into `ps` or server logs). HTTP body encoding prevents injection.\n\n### Python API\n\n```python\nfrom lope import Negotiator, PhaseExecutor, Auditor, ValidatorPool\nfrom lope.validators import ClaudeCodeValidator, OpencodeValidator\n\npool = ValidatorPool(\n    validators=[ClaudeCodeValidator(), OpencodeValidator()],\n    primary=\"claude\",\n)\n```\n\n---\n\n## Slash commands\n\nAfter install, these work in any supported CLI host (Gemini uses the `/lope:<verb>` namespaced form):\n\n| Command | What it does |\n|---------|-------------|\n| `/lope-negotiate` | Draft a sprint doc with multi-round validator review |\n| `/lope-execute` | Run sprint phases with validator-in-the-loop retry |\n| `/lope-implement` | Select implementation/escalation agents, then run a sprint without human intervention |\n| `/lope-audit` | Generate scorecard from sprint results |\n| `/lope-ask` | Fan out one question to every validator; collect N raw answers |\n| `/lope-review` | Fan out a file review to every validator; collect N critiques |\n| `/lope-vote` | Each validator picks from `--options`; tally + winner |\n| `/lope-compare` | Each validator picks between two files given `--criteria`; tally + winner |\n| `/lope-pipe` | Read stdin as the prompt; fan out; per-validator sections |\n| `/lope-team` | Add / remove / list / test teammates — no JSON editing |\n| `/lope-flow` | Run an autonomous DOT graph workflow (fan-out, consensus, fix-loops) |\n| `/lope-memory` | Query remembered review findings and hotspots |\n| `/lope-deliberate` | Run a 7-stage council on ADR / PRD / RFC / build-vs-buy / migration / incident decisions |\n| `/lope-headroom` | Configure or troubleshoot optional Headroom compression for Lope runs |\n| `/lope-help` | Print the full reference into the current session |\n\n---\n\n## Autonomous graph workflows (`lope flow`)\n\n`lope flow` (v0.11) runs a workflow defined as a **Graphviz DOT graph**: nodes are agent turns, ensemble reviews, shell verify-steps, or judge/routers; edges carry conditions and loops. Each node dispatches into lope's existing multi-CLI executors — so any CLI implements and the ensemble votes — and the run is **fully autonomous** (human gates optional) and **bounded** (per-node and graph-wide visit caps guarantee a non-converging loop halts with an escalation, never an infinite loop).\n\n```bash\nlope flow init consensus                                   # writes .lope/flow/consensus.dot\nlope flow validate .lope/flow/consensus.dot                # runnable + bounded?\nlope flow render   .lope/flow/consensus.dot -o flow.svg    # see the graph (needs graphviz)\nlope flow run      .lope/flow/consensus.dot --task \"Add a /health endpoint with a test\"\n```\n\nNode types: `agent` (`generate`), `review` (ensemble vote), `judge` (router), `script` (`gates.run_gate`), plus `start`/`exit` and an optional human `gate`. A `cli_stylesheet` routes a node's class → which CLI plays the role (`.frontier { primary: claude; }`). Three bundled templates: `consensus`, `judge-loop`, `review-gate`. Full details in [docs/reference.md → Flow](docs/reference.md#flow--declarative-graph-workflows).\n\n---\n\n## CLI reference\n\n### `lope status`\nShow detected CLIs and current config.\n\n### `lope configure`\nInteractive validator picker. Auto-detects installed CLIs.\n\n### `lope negotiate <goal>`\n```bash\nlope negotiate \"Add rate limiting to the API gateway\" \\\n    --out SPRINT-RATE-LIMIT.md \\\n    --max-rounds 3 \\\n    --context \"Express.js, Redis\"\n\n# For large repo briefs, keep context out of argv:\nlope negotiate \"Add rate limiting to the API gateway\" \\\n    --context-file ./capacity-brief.md\n```\n\nLarge specs work best as a compact `LOPE_BRIEF.md`. `--context-file` is read and inlined into the model prompt, not attached as a separate file. For multi-page specs, prefer:\n\n```bash\nlope negotiate \"Add rate limiting to the API gateway\" \\\n    --context-file ./LOPE_BRIEF.md \\\n    --timeout 300\n```\n\nIf `pi` or `opencode` time out during negotiate, check the preflight size line first. A 10KB+ generated drafter prompt with a short timeout is usually a prompt-size and timeout mismatch, not a broken provider. Lope invokes `pi` as the raw binary, not your shell alias. OpenCode defaults to `opencode run --pure --model myprovider/ail-compound --format json` unless `LOPE_OPENCODE_ARGS` overrides it.\n\nPass `--domain business` or `--domain research` to switch the validator role and review criteria.\n\n### `lope execute <sprint_doc>`\n```bash\nlope execute SPRINT-RATE-LIMIT.md\n```\n\n### `lope implement <sprint_doc>`\n```bash\n# Interactive TTY: asks which implementation and escalation agents to use first\nlope implement SPRINT-RATE-LIMIT.md\n\n# Agent/CI/non-TTY: pass the roster explicitly\nlope implement SPRINT-RATE-LIMIT.md \\\n  --agents pi,antigravity \\\n  --escalate-to claude,opencode \\\n  --gates\n\n# Check the resolved roster without running anything\nlope implement SPRINT-RATE-LIMIT.md \\\n  --agents pi \\\n  --escalate-to claude,opencode \\\n  --dry-run\n```\n\n`lope implement` is the zero-human wrapper around `execute`: roster selection is the only human step. After that, blockers are resolved inside the selected Lope team. Use `--interactive` to force roster prompts when TTY detection would otherwise require explicit flags. v1 intentionally uses a single writing lead to avoid patch collisions in one checkout; worktree-backed parallel writers are future scope.\n\n### `lope audit <sprint_doc>`\nGenerate scorecard. `--no-journal` skips writing to the journal file.\n\n### `lope ask \"<question>\"`\nFan out one question to every configured validator; collect raw answers. No VERDICT parsing, no phase retry.\n\n```bash\nlope ask \"What's the cleanest way to retry idempotently across models?\"\nlope ask \"<q>\" --validators claude,gemini   # restrict the pool\nlope ask \"<q>\" --context \"We use asyncio.\"  # shared context prepended\nlope ask \"<q>\" --json                       # machine-readable\n```\n\n### `lope review <file>`\nSend a file to every validator with a review prompt; collect N critiques.\n\n```bash\nlope review auth.py                                     # default review focus\nlope review auth.py --focus security\nlope review auth.py --focus \"test coverage, edge cases\"\nlope review auth.py --validators claude,opencode\n```\n\nFocus text is injected explicitly into the prompt — \"better\" is never model-invented.\n\n### `lope vote \"<prompt>\" --options A,B,C`\nEach validator picks exactly one option label. Tally + winner.\n\n```bash\nlope vote \"Should we ship today?\" --options \"ship,hold,escalate\"\nlope vote \"Python 3.12 or 3.13?\" --options 3.12,3.13\nlope vote \"<q>\" --options \"A,B,C\" --json                # structured tally\n```\n\nOption parsing is whole-token strict: `A` won't match inside `ALGORITHM`. Longest-first resolution handles overlaps (`3.13` beats `3.1`).\n\n### `lope compare <file_a> <file_b>`\nEach validator picks which file wins against explicit `--criteria`.\n\n```bash\nlope compare old_auth.py new_auth.py\nlope compare before.md after.md --criteria security\nlope compare a.py b.py --criteria \"correctness, performance, ergonomics\"\n```\n\nDefault criteria: `\"correctness and clarity\"`. Criteria are named explicitly in every validator's prompt so the comparison dimensions are never model-invented.\n\n### `lope pipe`\nRead stdin as the prompt; fan out; per-validator sections.\n\n```bash\ncat plan.md | lope pipe\ngh pr diff | lope pipe --validators claude,gemini\njq '.' events.json | lope pipe --timeout 60\necho \"<prompt>\" | lope pipe --require-all       # exit 1 if any validator errors\n```\n\nDefault is per-validator isolation — one timeout doesn't kill the others. `--require-all` opts in to strict failure for CI.\n\n### `lope team`\nManage the validator roster from a chat window — no JSON editing required.\n\n```bash\n# List current team (active + disabled + source tags: built-in / custom / auto)\nlope team\nlope team list\n\n# Add by pasting a curl (easiest — works with any provider's quickstart)\nlope team add openai --from-curl \"curl https://api.openai.com/v1/chat/completions \\\n  -H 'Authorization: Bearer \\${OPENAI_API_KEY}' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\\\"model\\\":\\\"gpt-4o-mini\\\",\\\"messages\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"hi\\\"}]}'\"\n\n# Paste a curl that has a literal API key — --key-env swaps it for ${VAR}\nlope team add groq --from-curl \"curl ... -H 'Authorization: Bearer gsk_RAW123' ...\" \\\n  --key-env GROQ_API_KEY\n\n# Add a local CLI binary (subprocess)\nlope team add my-ollama --cmd \"ollama run qwen3:8b {prompt}\"\nlope team add hermes --cmd \"hermes chat --json --prompt {prompt}\" --timeout 180\n\n# Add an HTTP endpoint via flags (no curl handy — OpenAI-compatible shape)\nlope team add openclaw --url http://10.42.42.1:18080/v1/chat/completions \\\n    --model openclaw --key-env OPENAI_API_KEY\n\n# Custom HTTP body shape (non-OpenAI)\nlope team add cohere --url https://api.cohere.ai/v1/chat --key-env COHERE_API_KEY \\\n    --body-json '{\"message\":\"{prompt}\",\"model\":\"command-r-plus\"}' --response-path \"text\"\n\n# Make a teammate the primary / save-but-disabled / overwrite\nlope team add openclaw --url ... --primary\nlope team add openclaw --url ... --disabled\nlope team add openclaw --url ... --force\n\n# Remove\nlope team remove codex\n\n# Smoke-test\nlope team test openclaw\nlope team test openclaw \"What's 2+2?\" --timeout 120\n```\n\n**Safety:** `{prompt}` is a real placeholder — never shell-interpolated. API keys live as `${ENV_VAR}` references, expanded only at call time (they never land in argv, URLs, or config files). Literal credentials inside `--from-curl` are refused unless you pass `--key-env` (lope swaps them). Built-in validator names (`claude`, `opencode`, `gemini`, `codex`, `aider`) can't be shadowed.\n\n**Natural language works too** — if your AI CLI is loaded with the `lope-team` skill, say *\"here's a curl from OpenAI's docs, add it to lope\"* or *\"add openclaw to lope with my Tytus pod\"* and the agent runs the right invocation.\n\n### `lope update` / `lope upgrade`\n\nSelf-update Lope and refresh installed host skills.\n\n```bash\nlope update\nlope update --dry-run\nlope update --host codex\nlope update --skip-install\nlope upgrade\n```\n\nGit checkouts fetch tags, pull the explicit tracked remote branch with `--ff-only`, reject tracked dirty files unless `--allow-dirty`, and rerun `./install` so host skills stay current. Untracked runtime state such as `~/.lope/config.json`, journals, and memory databases does not block updates.\n\n`--host` scopes the post-pull installer run; it still fetches and pulls first. If you only want to refresh one host's files without updating code, run `~/.lope/install --host <host>` directly.\n\nUse the git checkout install path today. PyPI publishing is not live yet, so `pip install --upgrade lope-agent` is not the recommended server update path.\n\n---\n\n## Configuration\n\n### Environment variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `LOPE_HOME` | `~/.lope` | Config and journal directory |\n| `LOPE_WORKDIR` | Current directory | Working directory for validators |\n| `LOPE_TIMEOUT` | `480` | Validator timeout (seconds) |\n| `LOPE_CAVEMAN` | `full` | Token compression: `full`, `lite`, or `off` |\n| `LOPE_LLM_URL` | _(unset)_ | **Optional fallback** — hosted OpenAI-compatible endpoint, used only if the primary validator does not support drafting. Normally you do not need this. |\n| `LOPE_LLM_MODEL` | `gpt-4o-mini` | Model name when `LOPE_LLM_URL` fallback is used. |\n| `LOPE_LLM_API_KEY` | _(unset)_ | Bearer token for the fallback endpoint. Falls back to `OPENAI_API_KEY`. |\n| `LOPE_RUN_LOCK` | _(on)_ | Set to `off` to disable the run lock (CI, deliberate parallelism). |\n| `LOPE_RUN_LOCK_WAIT` | _(unset)_ | Seconds to block when another lope run holds the lock. `0` = wait forever. Default: fail fast. |\n| `LOPE_RUN_LOCK_PATH` | `$LOPE_HOME/run.lock` | Override the lockfile path (used by tests). |\n\n> **No separate LLM required.** Lope's premise is *any CLI implements, any CLI validates*. Drafting is just the primary CLI implementing. `lope negotiate` calls the primary validator (`claude`, `opencode`, `gemini-cli`, `codex`, or `aider`) as a subprocess to draft the sprint doc, then routes the draft to the other validators for review. You only need to set `LOPE_LLM_URL` if your primary validator cannot draft (e.g. a custom HTTP provider that only reviews).\n\n### Ensemble vs. fallback\n\n**Ensemble** (`parallel: true`, default): all validators run concurrently. Majority vote. Any FAIL vetoes. Ties resolve to NEEDS_FIX.\n\n**Fallback** (`parallel: false`): primary first, next on infra error. First PASS/NEEDS_FIX/FAIL halts chain.\n\n### Run lock (concurrent invocation safety)\n\nLope holds a file lock (`$LOPE_HOME/run.lock`) for the lifetime of every `negotiate` and `execute` command. Without it, two parallel runs each spawn 3–4 validator CLIs, fight over the same auth tokens, and stall out with fake `INFRA_ERROR` timeouts.\n\nDefault behavior: a second caller fails fast with exit 75 (`EX_TEMPFAIL`) and a clear message showing the holder's pid and command.\n\n```bash\n# Queue the second caller instead of failing — block up to 5 minutes\nLOPE_RUN_LOCK_WAIT=300 lope negotiate \"second goal\"\n\n# Disable the lock entirely (CI, tests, deliberate parallelism)\nLOPE_RUN_LOCK=off lope execute SPRINT.md\n```\n\nRead-only commands (`status`, `configure`, `audit`, `docs`, `version`, `install`) do not touch the lock.\n\n### Token compression (caveman mode)\n\nBy default, lope tells validators to respond in terse fragments — drop articles, filler, hedging. Code, paths, line numbers, and error messages stay exact. This cuts validator response tokens by 50-65%, which matters when you're running N validators × M phases × up to 3 retries per sprint.\n\n```bash\nLOPE_CAVEMAN=off lope negotiate \"...\"   # verbose responses\nLOPE_CAVEMAN=lite lope negotiate \"...\"  # drops filler only, keeps full sentences\n```\n\nAdapted from [JuliusBrussee/caveman](https://github.com/JuliusBrussee/caveman) (MIT).\n\n---\n\n## VERDICT format\n\nEvery validator response must contain:\n\n```\n---VERDICT---\nstatus: PASS | NEEDS_FIX | FAIL\nconfidence: 0.0-1.0\nrationale: 1-3 sentences\nrequired_fixes:\n  - fix 1\n  - fix 2\n---END---\n```\n\n`confidence < 0.7` on a PASS is automatically demoted to NEEDS_FIX. Missing or malformed block → `INFRA_ERROR` (never raises, falls through to next validator).\n\n---\n\n## Use cases\n\nLope is **not just for code**. The `--domain` flag switches the validator role, artifact labels, and review task for the context you're working in:\n\n- `engineering` (default) — code, software, infra, devops\n- `business` — marketing, finance, ops, consulting, management\n- `research` — studies, systematic reviews, academic work\n\nNine worked examples below. Each is a real sprint goal you can paste into `lope negotiate`.\n\n### 💻 Software engineering\n\n```bash\nlope negotiate \"Add JWT auth with refresh token rotation\" --domain engineering\nlope negotiate \"Migrate from REST to gRPC for internal services\" --domain engineering\nlope negotiate \"Rate-limit the public API gateway — per-user + per-IP\" --domain engineering\n```\n\nValidators check: file paths, test coverage, edge cases, error handling, backward compatibility, rollback plan.\n\n### 📢 Marketing & campaigns\n\n```bash\nlope negotiate \"Q4 product launch campaign for SaaS enterprise tier\" --domain business\nlope negotiate \"LinkedIn thought leadership sequence — 8 posts over 4 weeks\" --domain business\nlope negotiate \"Rebranding sprint: logo, site, positioning, migration\" --domain business\n```\n\nValidators check: target audience, message-market fit, channel mix, success metrics, timeline realism, budget allocation.\n\n### 💰 Finance & accounting\n\n```bash\nlope negotiate \"Q2 budget rebuild across 4 cost centers with runway analysis\" --domain business\nlope negotiate \"Month-end close process redesign — target 3-day close\" --domain business\nlope negotiate \"R&D tax credit claim for FY2026 — scoping + documentation\" --domain business\n```\n\nValidators check: reconciliation gaps, audit trail, control points, compliance, variance analysis, stakeholder sign-offs.\n\n### 🎯 Management & operations\n\n```bash\nlope negotiate \"Reorg engineering into 3 squads with clear ownership boundaries\" --domain business\nlope negotiate \"Onboarding overhaul — first 90 days for new hires\" --domain business\nlope negotiate \"Q1 OKR planning across 5 teams with cross-team dependencies\" --domain business\n```\n\nValidators check: dependencies, stakeholder coverage, rollout risk, rollback plan, success metrics, communication plan.\n\n### 🔬 Research & academic\n\n```bash\nlope negotiate \"Systematic review of post-training RL techniques for small LMs\" --domain research\nlope negotiate \"Ethnographic study of remote team collaboration — 12 week protocol\" --domain research\nlope negotiate \"Replication study: attention-head pruning claims in recent paper\" --domain research\n```\n\nValidators check: methodology rigor, sampling bias, reproducibility, ethical considerations, pre-registration, data management plan.\n\n### 🏢 Consulting engagements\n\n```bash\nlope negotiate \"Digital transformation scoping for retail client — 6 week discovery\" --domain business\nlope negotiate \"Technology due diligence for $50M acquisition — 10 day turnaround\" --domain business\nlope negotiate \"Strategic roadmap for CTO — 18 month technical strategy\" --domain business\n```\n\nValidators check: client success criteria, stakeholder mapping, deliverable quality, timeline realism, scope boundaries.\n\n### ⚖️ Legal & compliance\n\n```bash\nlope negotiate \"GDPR compliance audit for data pipeline — retention, SAR, deletion\" --domain business\nlope negotiate \"SOC 2 Type II readiness sprint — 12 week preparation\" --domain business\nlope negotiate \"Employee handbook redesign — remote-first policies\" --domain business\n```\n\nValidators check: regulatory coverage, risk assessment, control mapping, documentation completeness, evidence of enforcement.\n\n### 🎓 Teaching & mentorship\n\n```bash\nlope negotiate \"Bootcamp curriculum redesign — full-stack 16 weeks\" --domain business\nlope negotiate \"Internal engineering onboarding — first 30 days\" --domain business\nlope negotiate \"Workshop: shipping your first LLM-powered feature — 3 hours\" --domain business\n```\n\nValidators check: learning objectives, progression, assessment, practical exercises, prerequisites, time budgets.\n\n### 🚀 DevOps & CI/CD\n\n```bash\nlope negotiate \"Migrate from Jenkins to GitHub Actions across 12 repos\" --domain engineering\nlope negotiate \"Zero-downtime database migration from Postgres 13 to 16\" --domain engineering\nlope negotiate \"Kubernetes cluster hardening — secrets, RBAC, network policies\" --domain engineering\n```\n\nValidators check: blast radius, rollback plan, monitoring coverage, alerting, runbook completeness.\n\n### Why the same loop works for code and non-code\n\nThe validator ensemble doesn't care whether it's reviewing a Python diff or a Q4 marketing brief. What it cares about is: is the plan specific, does it have measurable criteria, is it complete, can the reviewer poke a hole in it? That's domain-agnostic. Lope's `--domain` switch tunes the validator's role prompt (\"you are a senior marketing lead\" vs \"you are a senior systems engineer\") and swaps the artifact labels (`**Deliverables:** / **Success Metrics:**` for business, `**Files:** / **Tests:**` for engineering, `**Artifacts:** / **Validation Criteria:**` for research). The verdict schema, the retry loop, the evidence gate, the caveman mode — all identical across domains.\n\nSee [`docs/samples.md`](docs/samples.md) for 8 end-to-end conversation walkthroughs that show the natural-language use pattern across all three domains.\n\n---\n\n## FAQ\n\n**Does Lope need API keys?**\nNo. Lope calls AI CLIs as subprocesses — each manages its own auth.\n\n**What if I only have one AI CLI installed?**\nWorks fine. You lose cross-model diversity but keep the structured sprint discipline.\n\n**What if validators disagree?**\nEnsemble: majority wins. PASS vs NEEDS_FIX tie → NEEDS_FIX (conservative). Any FAIL vetoes.\n\n**Do I have to type `/lope-negotiate` every time?**\nNo. Just describe what you want in natural language — \"plan the auth refactor\", \"negotiate a Q4 campaign\", \"scope the data migration\". Your AI agent recognizes the shape and runs `lope negotiate` for you. The `using-lope` auto-trigger skill installed alongside the slash commands handles the mapping. See [`docs/samples.md`](docs/samples.md) for 8 end-to-end walkthroughs.\n\n**Can I get lope to do this automatically for some tasks and not others?**\nYes — that's the whole design. The `using-lope` skill's \"When NOT to trigger\" list is deliberately load-bearing: single-edit tasks, trivial ops, and pure conversation are skipped. Only consequential multi-phase work triggers lope. If you ever find lope firing when you didn't want it, the skill's trigger rules need tuning, not the agent.\n\n**Should I write a wrapper script around lope?**\n**No.** Lope is already a CLI. Just invoke `lope <mode> <args>` directly. No Python wrappers, no bash harnesses, no \"lope_runner.sh\". The whole point of the multi-CLI ensemble is that lope IS the harness — anything that wraps it is reinventing the thing you already have.\n\n**Can I use it in CI?**\n```bash\nPYTHONPATH=~/.lope python3 -m lope implement SPRINT-FEATURE-X.md --agents pi --escalate-to claude,opencode || exit 1\n```\nNon-interactive environments auto-select defaults and never block on stdin.\n\n---\n\n## Contributing\n\n```bash\ngit clone https://github.com/traylinx/lope.git\ncd lope\n./install\nPYTHONPATH=. python3 -m lope version\nPYTHONPATH=. python3 -m lope status\n```\n\nMain areas: new validators, better prompts, sprint doc format, CI/CD integrations.\n\n**Cutting a release?** Follow [docs/RELEASING.md](docs/RELEASING.md). It has the full checklist, the SemVer rules lope uses, and the version-bumper script that keeps all 6 version strings in sync.\n\n---\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n\nBuilt by [Sebastian Schkudlara](https://github.com/traylinx). Caveman mode adapted from [JuliusBrussee/caveman](https://github.com/JuliusBrussee/caveman).\n# Timeouts, large requests, and abandoned jobs\n\nFor multi-round commands, set a whole-command ceiling with `--run-timeout`; `--timeout` only limits one provider call. Lope prints a request plan and uses bounded chunking or rejects unsafe argv/input sizes instead of silently expanding work. Inspect and safely reconcile owned jobs with `lope jobs list` and `lope jobs reap --dry-run`. Never use `pkill -f` or process-name matching.\n",
  "bytes": 44432,
  "sha": "328afa7f2c67cc10cdc64713cfb92b288e42900cc042db616c20745723b5545c",
  "repo_slug": "traylinx/lope",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_traylinx_lope_0a12c080/readme"
}