@the-open-engine/zeroshot 6.2.0 → 6.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +141 -474
  2. package/cli/event-copy.js +12 -0
  3. package/cli/index.js +314 -96
  4. package/cli/message-formatters-normal.js +14 -2
  5. package/cli/message-formatters-watch.js +9 -2
  6. package/cluster-hooks/block-ask-user-question.py +53 -0
  7. package/cluster-hooks/block-dangerous-git.py +145 -0
  8. package/lib/clusters-registry.js +48 -0
  9. package/lib/compose-utils.js +101 -0
  10. package/lib/detached-startup.js +12 -1
  11. package/lib/id-detector.js +8 -9
  12. package/lib/path-check.js +63 -0
  13. package/lib/run-mode.js +34 -0
  14. package/lib/run-plan.js +32 -0
  15. package/lib/start-cluster.js +58 -28
  16. package/package.json +7 -6
  17. package/scripts/check-path.js +19 -0
  18. package/scripts/validate-templates.js +11 -29
  19. package/src/agent/agent-hook-executor.js +1 -1
  20. package/src/agent/agent-lifecycle.js +2 -0
  21. package/src/agent/agent-task-executor.js +4 -3
  22. package/src/agent/pr-verification.js +27 -1
  23. package/src/agents/git-pusher-template.js +121 -4
  24. package/src/attach/socket-discovery.js +2 -3
  25. package/src/claude-credentials.js +75 -0
  26. package/src/claude-task-runner.js +1 -0
  27. package/src/isolation-manager.js +12 -9
  28. package/src/issue-providers/README.md +45 -15
  29. package/src/issue-providers/index.js +2 -0
  30. package/src/issue-providers/jira-provider.js +8 -1
  31. package/src/issue-providers/linear-provider.js +405 -0
  32. package/src/ledger.js +45 -3
  33. package/src/lib/gc.js +2 -3
  34. package/src/message-bus.js +22 -2
  35. package/src/orchestrator.js +271 -144
  36. package/src/preflight.js +12 -16
  37. package/src/providers/base-provider.js +7 -6
  38. package/src/status-footer.js +13 -1
  39. package/src/template-validation/index.js +3 -0
  40. package/src/template-validation/report-formatter.js +55 -0
  41. package/src/worktree-claude-config.js +2 -13
  42. package/task-lib/runner.js +1 -0
  43. package/task-lib/watcher.js +1 -0
package/README.md CHANGED
@@ -1,554 +1,221 @@
1
- # zeroshot CLI
1
+ <div align="center">
2
2
 
3
- > **🎉 New in v5.4:** Now supports **OpenCode** CLI! Use Claude, Codex, Gemini, or OpenCode as your AI provider. Also supports **GitHub, GitLab, Jira, and Azure DevOps** as issue backends. See [Providers](#providers) and [Multi-Platform Issue Support](#multi-platform-issue-support).
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="docs/brand/zeroshot-hero-dark.png">
5
+ <img alt="Zeroshot. Self-driving software engineering. Layer 01 · Verification, The Open Engine." src="docs/brand/zeroshot-hero-light.png" width="100%">
6
+ </picture>
4
7
 
5
- <!-- install-placeholder -->
6
- <p align="center">
7
- <code>npm install -g @the-open-engine/zeroshot</code>
8
- </p>
9
-
10
- <p align="center">
11
- <img src="./docs/assets/zeroshot-demo.gif" alt="Demo" width="700">
12
- <br>
13
- <em>Demo (100x speed, 90-minute run, 5 iterations to approval)</em>
14
- </p>
15
-
16
- [![CI](https://github.com/the-open-engine/zeroshot/actions/workflows/ci.yml/badge.svg)](https://github.com/the-open-engine/zeroshot/actions/workflows/ci.yml)
17
- [![npm version](https://img.shields.io/npm/v/@the-open-engine/zeroshot.svg)](https://www.npmjs.com/package/@the-open-engine/zeroshot)
18
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
19
- [![Node 18+](https://img.shields.io/badge/node-18%2B-brightgreen.svg)](https://nodejs.org/)
20
- ![Platform: Linux | macOS](https://img.shields.io/badge/platform-Linux%20%7C%20macOS-blue.svg)
21
-
22
- <!-- discord-placeholder -->
23
-
24
- [![Discord](https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white)](https://discord.gg/PdZ3UEXB)
25
-
26
- Zeroshot is an open-source AI coding agent orchestration CLI that runs multi-agent workflows to autonomously implement, review, test, and verify code changes.
8
+ &nbsp;
27
9
 
28
- It runs a **planner**, an **implementer**, and independent **validators** in isolated environments, looping until changes are **verified** or **rejected** with actionable, reproducible failures.
10
+ <a href="https://theopenengine.com"><picture><source media="(prefers-color-scheme: dark)" srcset="docs/brand/social/website-dark.png"><img alt="Website" src="docs/brand/social/website-light.png" height="30"></picture></a>
11
+ <a href="https://x.com/OpenEngineCo"><picture><source media="(prefers-color-scheme: dark)" srcset="docs/brand/social/x-dark.png"><img alt="X · @OpenEngineCo" src="docs/brand/social/x-light.png" height="30"></picture></a>
12
+ <a href="https://www.linkedin.com/company/the-open-engine-company"><picture><source media="(prefers-color-scheme: dark)" srcset="docs/brand/social/linkedin-dark.png"><img alt="LinkedIn" src="docs/brand/social/linkedin-light.png" height="30"></picture></a>
13
+ <a href="https://discord.gg/fZyzf2Cut9"><picture><source media="(prefers-color-scheme: dark)" srcset="docs/brand/social/discord-dark.png"><img alt="Discord" src="docs/brand/social/discord-light.png" height="30"></picture></a>
29
14
 
30
- Built for tasks where correctness matters more than speed.
15
+ [![npm](https://img.shields.io/npm/v/@the-open-engine/zeroshot?style=flat&labelColor=171411&color=171411)](https://www.npmjs.com/package/@the-open-engine/zeroshot)
16
+ [![CI](https://img.shields.io/github/actions/workflow/status/the-open-engine/zeroshot/ci.yml?style=flat&labelColor=171411&label=CI)](https://github.com/the-open-engine/zeroshot/actions/workflows/ci.yml)
17
+ [![License: MIT](https://img.shields.io/badge/license-MIT-171411?style=flat)](LICENSE)
18
+ [![node](https://img.shields.io/badge/node-%E2%89%A5%2018-171411?style=flat)](#install)
19
+ [![platforms](https://img.shields.io/badge/platforms-linux%20%C2%B7%20macos-171411?style=flat)](#install)
20
+ [![stars](https://img.shields.io/github/stars/the-open-engine/zeroshot?style=flat&labelColor=171411&color=171411)](https://github.com/the-open-engine/zeroshot)
21
+ [![Layer 01 · The Open Engine](https://img.shields.io/badge/Layer_01-The_Open_Engine-C2240C?style=flat&labelColor=171411)](#the-open-engine)
31
22
 
32
- ## How It Works
23
+ </div>
33
24
 
34
- - Plan: translate a task into concrete acceptance criteria
35
- - Implement: make changes in an isolated workspace (local, worktree, or Docker)
36
- - Validate: run automated checks with independent validators
37
- - Iterate: repeat until verified, or return actionable failures
38
- - Resume: crash-safe state persisted for recovery
25
+ **The agent that wrote the code shouldn't be the one that says it works.**
39
26
 
40
- ## Quick Start
27
+ Zeroshot is an open-source, multi-agent orchestration engine for autonomous software engineering. It drives a coding agent you already run (Claude Code, OpenAI Codex, Gemini CLI, or OpenCode) through an **executor-verifier loop**: an agent writes the change, then an _independent_ verifier that never saw how it was made approves it, or hands back a reproducible failure. The loop runs until the change is verified.
41
28
 
42
- ```bash
43
- zeroshot run 123 # GitHub issue number
44
- zeroshot run feature.md # Markdown file
45
- zeroshot run "Add dark mode" # Inline text
46
- ```
29
+ ## Install
47
30
 
48
- Or describe a complex task inline:
49
-
50
- ```bash
51
- zeroshot run "Add optimistic locking with automatic retry: when updating a user,
52
- retry with exponential backoff up to 3 times, merge non-conflicting field changes,
53
- and surface conflicts with details. Handle the ABA problem where version goes A->B->A."
54
- ```
55
-
56
- ## Why Not Just Use a Single AI Agent?
57
-
58
- | Approach | Writes Code | Runs Tests | Blind Validation | Iterates Until Verified |
59
- | -------------------------- | ----------- | ---------- | ---------------- | ----------------------- |
60
- | Chat-based assistant | ✅ | ⚠️ | ❌ | ❌ |
61
- | Single coding agent | ✅ | ⚠️ | ❌ | ⚠️ |
62
- | **Zeroshot (multi-agent)** | ✅ | ✅ | ✅ | ✅ |
63
-
64
- ## Use Cases
65
-
66
- - Autonomous AI code refactoring
67
- - AI-powered pull request automation
68
- - Automated bug fixing with validation
69
- - Multi-agent code generation for software engineering
70
- - Agentic coding workflows with blind validation
71
-
72
- ## Who Is This For?
73
-
74
- - Senior engineers who care about correctness and reproducibility
75
- - Teams automating PR workflows and code review gates
76
- - Infra/platform teams standardizing agentic workflows
77
- - Open-source maintainers working through issue backlogs
78
- - AI power users who want verification, not vibes
79
-
80
- ## Install and Requirements
81
-
82
- **Platforms**: Linux, macOS. Windows (native/WSL) is deferred while we harden reliability and multi-provider correctness.
31
+ <!-- install-placeholder -->
83
32
 
84
33
  ```bash
85
34
  npm install -g @the-open-engine/zeroshot
86
35
  ```
87
36
 
88
- **Requires**: Node 18+, at least one provider CLI (Claude Code, Codex, Gemini, Opencode).
89
-
90
- ```bash
91
- # Install one or more providers
92
- npm i -g @anthropic-ai/claude-code
93
- npm i -g @openai/codex
94
- npm i -g @google/gemini-cli
95
- # Opencode: see https://opencode.ai
96
-
97
- # Authenticate with the provider CLI
98
- claude login # Claude
99
- codex login # Codex
100
- gemini auth login # Gemini
101
- opencode auth login # Opencode
102
-
103
- # GitHub auth (for issue numbers)
104
- gh auth login
105
- ```
106
-
107
- ## Providers
108
-
109
- Zeroshot shells out to provider CLIs. Pick a default and override per run:
110
-
111
- ```bash
112
- zeroshot providers
113
- zeroshot providers set-default codex
114
- zeroshot run 123 --provider gemini
115
- ```
116
-
117
- See `docs/providers.md` for setup, model levels, and Docker mounts.
118
- See `docs/provider-cli-helper.md` for the strict TypeScript provider helper,
119
- the `zeroshot-agent-provider` JSON executable contract, and the boundary with
120
- Orchestra.
121
-
122
- ## Why Multiple Agents?
123
-
124
- Single-agent sessions degrade. Context gets buried under thousands of tokens. The model optimizes for "done" over "correct."
125
-
126
- Zeroshot fixes this with isolated agents that check each other's work. Validators can't lie about code they didn't write. Fail the check? Fix and retry until it actually works.
127
-
128
- ## What Makes It Different
129
-
130
- - **Blind validation** - Validators never see the worker's context or code history
131
- - **Repeatable workflows** - Task complexity determines agent count and model selection
132
- - **Accept/reject loop** - Rejections include actionable findings, not vague complaints
133
- - **Crash recovery** - All state persisted to SQLite; resume anytime
134
- - **Isolation modes** - None, git worktree, or Docker container
135
- - **Cost control** - Model ceilings prevent runaway API spend
136
-
137
- ## Required Handoff Quality Gates
138
-
139
- Zeroshot owns a tool-neutral handoff contract for `--pr` and `--ship` flows. It does not know which tool produced a gate. Repos configure required gates, validators publish matching `qualityGates` evidence, and the git-pusher trigger refuses to wake until every configured gate has fresh passing evidence after `IMPLEMENTATION_READY`.
140
-
141
- Gate config can come from run options or repo settings:
142
-
143
- ```json
144
- {
145
- "ship": {
146
- "requiredQualityGates": [
147
- {
148
- "id": "repo-quality",
149
- "scope": "repo",
150
- "description": "Repository quality gate",
151
- "command": "repo-quality --changed --json"
152
- }
153
- ]
154
- }
155
- }
156
- ```
157
-
158
- The `id` and optional `scope` are generic. A repo may bind `repo-quality` to any local quality command, a CI status command, or another quality command outside Zeroshot. Validators receive the configured gate list and must publish entries with `status`, `completedAt` or `timestamp`, and `evidence.command`, `evidence.exitCode`, and string `evidence.output`. Failing or unavailable commands mean `approved: false` with gate status `FAIL` or `UNAVAILABLE`.
37
+ Requires **Node 18** and at least one provider CLI (Claude Code, Codex, Gemini, or OpenCode). Linux and macOS today; Windows is deferred.
159
38
 
160
- The pusher fails closed before commit, push, PR creation, or merge when a configured gate is missing, failing, unavailable, stale, older than `IMPLEMENTATION_READY`, or lacks usable evidence. If no `requiredQualityGates` are configured, Zeroshot preserves its existing validator consensus behavior.
161
-
162
- ## Cmdproof Command Reuse
163
-
164
- Clusters can make expensive exact commands reusable across workers and validators with `cmdproof`. Zeroshot does not intercept arbitrary shell commands; it gives agents a cluster-scoped helper for configured command proofs.
39
+ <div align="center">
40
+ <img src="docs/assets/zeroshot-demo.gif" alt="Zeroshot resolving an issue through the executor-verifier loop" width="760">
41
+ <br>
42
+ <em>One run, unattended. 100× speed · 90-minute run · 5 iterations to approval.</em>
43
+ </div>
165
44
 
166
- Issue bodies can opt in per run:
45
+ ## How it works
167
46
 
168
- ````markdown
169
- ```zeroshot-command-proofs
170
- [
171
- {
172
- "id": "repo-ci",
173
- "profile": "ci-equivalent",
174
- "scope": "repo",
175
- "description": "Repository local CI-equivalent gate",
176
- "command": "bash ./scripts/ci/run-local-ci-equivalent.sh"
177
- }
178
- ]
179
- ```
180
- ````
181
-
182
- Repos can also configure the same commands in `.zeroshot/settings.json`:
183
-
184
- ```json
185
- {
186
- "ship": {
187
- "commandProofs": [
188
- {
189
- "id": "repo-ci",
190
- "profile": "ci-equivalent",
191
- "scope": "repo",
192
- "description": "Repository local CI-equivalent gate",
193
- "command": "bash ./scripts/ci/run-local-ci-equivalent.sh"
194
- }
195
- ]
196
- }
197
- }
198
- ```
47
+ Zeroshot separates the agent that **writes** the code from the agent that **judges** it.
199
48
 
200
- Agents receive instructions to use:
49
+ A conductor sizes the workflow to the task. An executor (an AI coding agent) implements the change in an isolated workspace (git worktree or Docker). Then an **independent verifier** inspects the result without ever seeing the executor's context or history, so it cannot approve its own reasoning. The verifier returns `APPROVED`, or `REJECTED` with an actionable, reproducible failure, and the loop repeats until the change is verified or hands back a concrete reason it isn't. Every step is written to a crash-safe SQLite ledger, so a run survives a reboot and resumes where it stopped.
201
50
 
202
- ```bash
203
- zeroshot cmdproof check repo-ci
51
+ ```text
52
+ task --> plan --> implement --> verify --> APPROVED --> done
53
+ ^ |
54
+ +- REJECTED -+ (reproducible failure)
204
55
  ```
205
56
 
206
- The helper uses a cluster-local cache and trusted-agent key under `~/.zeroshot/cmdproof/<cluster-id>/`, runs `cmdproof verify` first, and falls back to `cmdproof prove --fallback run` on misses. In `--ship` flows, configured command proofs are also required handoff quality gates.
207
-
208
- ## When to Use Zeroshot
209
-
210
- Zeroshot performs best when tasks have clear acceptance criteria.
57
+ Bring your own provider and your own backend. Zeroshot orchestrates the agents that write your code; it doesn't store your keys or replace your models.
211
58
 
212
- | Scenario | Use | Why |
213
- | ----------------------------------------------- | --- | ------------------------- |
214
- | Add rate limiting (sliding window, per-IP, 429) | Yes | Clear requirements |
215
- | Refactor auth to JWT | Yes | Defined end state |
216
- | Fix login bug | Yes | Success is measurable |
217
- | Fix 2410 lint violations | Yes | Clear completion criteria |
218
- | Make the app faster | No | Needs exploration first |
219
- | Improve the codebase | No | No acceptance criteria |
220
- | Figure out flaky tests | No | Exploratory |
59
+ ## How is this different from a single coding agent?
221
60
 
222
- Rule of thumb: if you cannot describe what "done" means, validators cannot verify it.
61
+ | | A single coding agent | Zeroshot |
62
+ | --------------------------- | ---------------------------- | ------------------------------------------------------------------------------------------- |
63
+ | Who says it is correct? | the same agent that wrote it | a separate agent that never saw how it was written |
64
+ | Is the code actually run? | usually just claimed | executed against your real tests |
65
+ | When it fails, you get | an assertion it is fine | a reproducible failure |
66
+ | When does it stop? | when it decides it is done | when the change is verified, or provably is not |
67
+ | Which coding agent runs it? | one, fixed | any you already run: Zeroshot is the harness around Claude Code, Codex, Gemini, or OpenCode |
223
68
 
224
- ## Command Overview
69
+ ## Quick start
225
70
 
226
71
  ```bash
227
- # Run
228
- zeroshot run 123 # GitHub issue
229
- zeroshot run feature.md # Markdown file
230
- zeroshot run "Add dark mode" # Inline text
231
-
232
- # Isolation
233
- zeroshot run 123 --worktree # git worktree
234
- zeroshot run 123 --docker # container
235
-
236
- # Automation (--ship implies --pr implies --worktree)
237
- zeroshot run 123 --pr # worktree + create PR
238
- zeroshot run 123 --ship # PR + auto-merge on approval
239
-
240
- # Background mode
241
- zeroshot run 123 -d
242
- zeroshot run 123 --ship -d
243
-
244
- # Control
245
- zeroshot list
246
- zeroshot status <id>
247
- zeroshot logs <id> -f
248
- zeroshot resume <id>
249
- zeroshot stop <id>
250
- zeroshot kill <id>
251
-
252
- # Providers
253
- zeroshot providers
254
- zeroshot providers set-default codex
255
-
256
- # Agent library
257
- zeroshot agents list
258
- zeroshot agents show <name>
259
-
260
- # Maintenance
261
- zeroshot clean
262
- zeroshot purge
72
+ zeroshot run 123 # a GitHub issue number
73
+ zeroshot run feature.md # a markdown spec
74
+ zeroshot run "Add a --json flag" # inline text
263
75
  ```
264
76
 
265
- ## Multi-Platform Issue Support
266
-
267
- Zeroshot works with **GitHub, GitLab, Jira, and Azure DevOps**. Just paste the issue URL or key.
268
- When working in a git repository, zeroshot automatically detects the issue provider from your git remote URL. No configuration needed!
77
+ Describe a non-trivial task inline and let the loop run it to a verified change:
269
78
 
270
79
  ```bash
271
- # GitHub
272
- zeroshot run 123
273
- zeroshot run https://github.com/org/repo/issues/123
274
-
275
- # GitLab (cloud and self-hosted)
276
- zeroshot run https://gitlab.com/org/repo/-/issues/456
277
- zeroshot run https://gitlab.mycompany.com/org/repo/-/issues/789
278
-
279
- # Jira
280
- zeroshot run PROJ-789
281
- zeroshot run https://company.atlassian.net/browse/PROJ-789
282
-
283
- # Azure DevOps
284
- zeroshot run https://dev.azure.com/org/project/_workitems/edit/999
285
- ```
286
-
287
- **Requires**: CLI tools ([`gh`](https://cli.github.com/), [`glab`](https://gitlab.com/gitlab-org/cli), [`jira`](https://github.com/go-jira/jira), or [`az`](https://docs.microsoft.com/cli/azure/)) for the platform you use. See [issue-providers README](src/issue-providers/README.md) for setup and self-hosted instances.
288
-
289
- **Important for `--pr` mode**: Run zeroshot from the target repository directory. PRs are created on the git remote of your current directory. If you run from a different repo, zeroshot will warn you and skip the "Closes #X" reference (the PR is still created, but won't auto-close the issue).
290
-
291
- ## Architecture
292
-
293
- Zeroshot is a message-driven coordination layer with smart defaults.
294
-
295
- - The conductor classifies tasks by complexity and type.
296
- - A workflow template selects agents and validators.
297
- - Agents publish results to a SQLite ledger.
298
- - Validators approve or reject with specific findings.
299
- - Rejections route back to the worker for fixes.
300
-
301
- ```
302
- ┌─────────────────┐
303
- │ TASK │
304
- └────────┬────────┘
305
-
306
-
307
- ┌────────────────────────────────────────────┐
308
- │ CONDUCTOR │
309
- │ Complexity × TaskType → Workflow │
310
- └────────────────────────┬───────────────────┘
311
-
312
- ┌─────────────────────────────┼─────────────────────────────┐
313
- │ │ │
314
- ▼ ▼ ▼
315
- ┌───────────┐ ┌───────────┐ ┌───────────┐
316
- │ TRIVIAL │ │ SIMPLE │ │ STANDARD+ │
317
- │ 1 agent │──────────▶ │ worker │ │ planner │
318
- │ (level1) │ COMPLETE │ + 1 valid.│ │ + worker │
319
- │ no valid. │ └─────┬─────┘ │ + 3-5 val.│
320
- └───────────┘ │ └─────┬─────┘
321
- ▼ │
322
- ┌─────────────┐ ▼
323
- ┌──▶│ WORKER │ ┌─────────────┐
324
- │ └──────┬──────┘ │ PLANNER │
325
- │ │ └──────┬──────┘
326
- │ ▼ │
327
- │ ┌─────────────────────┐ ▼
328
- │ │ ✓ validator │ ┌─────────────┐
329
- │ │ (generic check) │ ┌──▶│ WORKER │
330
- │ └──────────┬──────────┘ │ └──────┬──────┘
331
- │ REJECT │ ALL OK │ │
332
- └──────────────┘ │ │ ▼
333
- │ │ ┌──────────────────────┐
334
- │ │ │ ✓ requirements │
335
- │ │ │ ✓ code (STANDARD+) │
336
- │ │ │ ✓ security (CRIT) │
337
- │ │ │ ✓ tester (CRIT) │
338
- │ │ │ ✓ adversarial │
339
- │ │ │ (real execution) │
340
- │ │ └──────────┬───────────┘
341
- │ │ REJECT │ ALL OK
342
- │ └──────────────┘ │
343
- ▼ ▼
344
- ┌─────────────────────────────────────────────────────────────────────────────┐
345
- │ COMPLETE │
346
- └─────────────────────────────────────────────────────────────────────────────┘
80
+ zeroshot run "Add optimistic locking with automatic retry: when updating a user,
81
+ retry with exponential backoff up to 3 times, merge non-conflicting field changes,
82
+ and surface conflicts with details. Handle the ABA problem where version goes A->B->A."
347
83
  ```
348
84
 
349
- ### Complexity Model
350
-
351
- | Task | Complexity | Agents | Validators |
352
- | ---------------------- | ---------- | ------ | ------------------------------------------------- |
353
- | Fix typo in README | TRIVIAL | 1 | None |
354
- | Add dark mode toggle | SIMPLE | 2 | Generic validator |
355
- | Refactor auth system | STANDARD | 4 | Requirements, code |
356
- | Implement payment flow | CRITICAL | 7 | Requirements, code, security, tester, adversarial |
357
-
358
- ### Model Selection by Complexity
359
-
360
- | Complexity | Planner | Worker | Validators |
361
- | ---------- | ------- | ------ | ---------- |
362
- | TRIVIAL | - | level1 | - |
363
- | SIMPLE | - | level2 | 1 (level2) |
364
- | STANDARD | level2 | level2 | 2 (level2) |
365
- | CRITICAL | level3 | level2 | 5 (level2) |
366
-
367
- Levels map to provider-specific models. Configure with `zeroshot providers setup <provider>` or
368
- `settings.providerSettings`. (Legacy `maxModel` applies to Claude only.)
369
-
370
85
  <details>
371
- <summary><strong>Custom Workflows (Framework Mode)</strong></summary>
372
-
373
- Zeroshot is message-driven, so you can define any agent topology.
374
-
375
- - Expert panels: parallel specialists -> aggregator -> decision
376
- - Staged gates: sequential validators, each with veto power
377
- - Hierarchical: supervisor dynamically spawns workers
378
- - Dynamic: conductor adds agents mid-execution
379
-
380
- **Coordination primitives:**
86
+ <summary><strong>Command reference</strong></summary>
381
87
 
382
- - Message bus (pub/sub topics)
383
- - Triggers (wake agents on conditions)
384
- - Ledger (SQLite, crash recovery)
385
- - Dynamic spawning (CLUSTER_OPERATIONS)
386
-
387
- #### Creating Custom Clusters with a Provider CLI
388
-
389
- Start your provider CLI and describe your cluster:
390
-
391
- ```
392
- Create a zeroshot cluster config for security-critical features:
393
-
394
- 1. Implementation agent (level2) implements the feature
395
- 2. FOUR parallel validators:
396
- - Security validator: OWASP checks, SQL injection, XSS, CSRF
397
- - Performance validator: No N+1 queries, proper indexing
398
- - Privacy validator: GDPR compliance, data minimization
399
- - Code reviewer: General code quality
400
-
401
- 3. ALL validators must approve before merge
402
- 4. If ANY validator rejects, implementation agent fixes and resubmits
403
- 5. Use level3 for security validator (highest stakes)
404
-
405
- Look at cluster-templates/base-templates/full-workflow.json
406
- and create a similar cluster. Save to cluster-templates/security-review.json
88
+ ```bash
89
+ # Run
90
+ zeroshot run <input> # issue number / URL / key / markdown file / inline text
91
+ zeroshot run 123 --worktree # isolate in a git worktree
92
+ zeroshot run 123 --docker # isolate in a container
93
+ zeroshot run 123 --pr # worktree + open a pull request
94
+ zeroshot run 123 --ship # worktree + PR + auto-merge on approval
95
+ zeroshot run 123 -d # background (daemon)
96
+ zeroshot run 123 --provider gemini # override the provider for this run
97
+
98
+ # Monitor & manage
99
+ zeroshot list # all clusters (--json)
100
+ zeroshot status <id> # cluster details
101
+ zeroshot logs <id> -f # stream logs
102
+ zeroshot resume <id> [prompt] # resume a stopped/failed run
103
+ zeroshot stop <id> # graceful stop
104
+ zeroshot kill <id> # force kill
105
+ zeroshot export <id> # export the conversation
106
+
107
+ # Library & config
108
+ zeroshot providers # list providers / set-default / setup
109
+ zeroshot agents list # available agents (agents show <name>)
110
+ zeroshot settings # view / get / set settings
111
+ zeroshot cmdproof check <id> # reuse a verified command result
407
112
  ```
408
113
 
409
- Built-in validation checks for missing triggers, deadlocks, and invalid type wiring before running.
410
-
411
- See [CLAUDE.md](./CLAUDE.md) for the cluster schema and examples.
412
-
413
114
  </details>
414
115
 
415
- ## Crash Recovery
116
+ ## Providers and backends
416
117
 
417
- All state is persisted in the SQLite ledger. You can resume at any time:
118
+ Zeroshot shells out to provider CLIs; it stores no API keys and manages no auth. Pick a default and override per run.
418
119
 
419
- ```bash
420
- zeroshot resume cluster-bold-panther
421
- ```
422
-
423
- ## Isolation Modes
424
-
425
- ### Git Worktree (Default for --pr/--ship)
120
+ | Provider | CLI |
121
+ | ------------ | -------------------------------------- |
122
+ | Claude Code | `npm i -g @anthropic-ai/claude-code` |
123
+ | OpenAI Codex | `npm i -g @openai/codex` |
124
+ | Gemini CLI | `npm i -g @google/gemini-cli` |
125
+ | OpenCode | see [opencode.ai](https://opencode.ai) |
426
126
 
427
127
  ```bash
428
- zeroshot run 123 --worktree
128
+ zeroshot providers # see what's installed
129
+ zeroshot providers set-default codex
130
+ zeroshot run 123 --provider gemini
429
131
  ```
430
132
 
431
- Lightweight isolation using git worktree. Creates a separate working directory with its own branch. Auto-enabled with `--pr` and `--ship`.
432
-
433
- ### Docker Container
133
+ Issue backends are **auto-detected from your git remote**: **GitHub, GitLab, Jira, and Azure DevOps**. Paste a number, key, or URL:
434
134
 
435
135
  ```bash
436
- zeroshot run 123 --docker
136
+ zeroshot run 123 # GitHub
137
+ zeroshot run https://gitlab.com/org/repo/-/issues/456 # GitLab
138
+ zeroshot run PROJ-789 # Jira
139
+ zeroshot run https://dev.azure.com/org/project/_workitems/edit/999 # Azure DevOps
437
140
  ```
438
141
 
439
- Full isolation in a fresh container. Your workspace stays untouched. Useful for risky experiments or parallel runs.
142
+ Each backend needs its own CLI installed (`gh`, `glab`, `jira`, or `az`). See [`docs/providers.md`](docs/providers.md) for model levels and setup.
440
143
 
441
- ### When to Use Which
144
+ ## Isolation
442
145
 
443
- | Scenario | Recommended |
444
- | ------------------------------------ | ---------------------- |
445
- | Quick task, review changes yourself | No isolation (default) |
446
- | PR workflow, code review | `--worktree` or `--pr` |
447
- | Risky experiment, might break things | `--docker` |
448
- | Running multiple tasks in parallel | `--docker` |
449
- | Full automation, no review needed | `--ship` |
146
+ By default, agents modify files only; they do **not** commit or push. Opt into isolation to let the loop own a branch (the flags cascade: `--ship` → `--pr` → `--worktree`).
450
147
 
451
- **Default behavior:** Agents modify files only; they do not commit or push unless using an isolation mode that explicitly allows it.
148
+ | Mode | Flag | Use when |
149
+ | ------------ | ------------ | ------------------------------------------------ |
150
+ | None | _(default)_ | quick task, you review the changes yourself |
151
+ | Git worktree | `--worktree` | PR workflows, lightweight branch isolation |
152
+ | Docker | `--docker` | risky experiments, parallel runs, full isolation |
452
153
 
453
154
  <details>
454
- <summary><strong>Docker Credential Mounts</strong></summary>
455
-
456
- When using `--docker`, zeroshot mounts credential directories so agents can access provider CLIs and tools like AWS, Azure, and kubectl.
155
+ <summary><strong>Docker credential mounts</strong></summary>
457
156
 
458
- **Default mounts**: `gh`, `git`, `ssh` (GitHub CLI, git config, SSH keys)
459
-
460
- **Available presets**: `gh`, `git`, `ssh`, `aws`, `azure`, `kube`, `terraform`, `gcloud`, `claude`, `codex`, `gemini`
157
+ When using `--docker`, Zeroshot mounts credential directories so agents can reach provider CLIs and tools. Defaults: `gh`, `git`, `ssh`. Presets include `aws`, `azure`, `kube`, `terraform`, `gcloud`, and the provider configs.
461
158
 
462
159
  ```bash
463
- # Configure via settings (persistent)
464
- zeroshot settings set dockerMounts '["gh", "git", "ssh", "aws", "azure"]'
465
-
466
- # View current config
467
- zeroshot settings get dockerMounts
468
-
469
- # Per-run override
160
+ zeroshot settings set dockerMounts '["gh","git","ssh","aws"]'
470
161
  zeroshot run 123 --docker --mount ~/.aws:/root/.aws:ro
471
-
472
- # Provider credentials
473
- zeroshot run 123 --docker --mount ~/.config/codex:/home/node/.config/codex:ro
474
- zeroshot run 123 --docker --mount ~/.config/gemini:/home/node/.config/gemini:ro
475
-
476
- # Disable all mounts
477
162
  zeroshot run 123 --docker --no-mounts
478
-
479
- # CI: env var override
480
- ZEROSHOT_DOCKER_MOUNTS='["aws","azure"]' zeroshot run 123 --docker
481
163
  ```
482
164
 
483
- See `docs/providers.md` for provider CLI setup and mount details.
484
-
485
- **Custom mounts** (mix presets with explicit paths):
165
+ See [`docs/providers.md`](docs/providers.md) for mount details.
486
166
 
487
- ```bash
488
- zeroshot settings set dockerMounts '[
489
- "gh",
490
- "git",
491
- {"host": "~/.myconfig", "container": "$HOME/.myconfig", "readonly": true}
492
- ]'
493
- ```
167
+ </details>
494
168
 
495
- **Container home**: Presets use `$HOME` placeholder. Default: `/root`. Override with:
169
+ ## Scope and status
496
170
 
497
- ```bash
498
- zeroshot settings set dockerContainerHome '/home/node'
499
- # Or per-run:
500
- zeroshot run 123 --docker --container-home /home/node
501
- ```
171
+ Zeroshot performs best when a task has **clear acceptance criteria**. If you can't say what "done" means, an independent verifier can't confirm it.
502
172
 
503
- **Env var passthrough**: Presets auto-pass related env vars (for example, `aws` -> `AWS_REGION`, `AWS_PROFILE`). Add custom:
173
+ | Task | Good fit? | Why |
174
+ | ----------------------------------------------- | --------- | ----------------------- |
175
+ | Add rate limiting (sliding window, per-IP, 429) | Yes | clear requirements |
176
+ | Refactor auth to JWT | Yes | defined end state |
177
+ | Fix a login bug | Yes | success is measurable |
178
+ | "Make the app faster" | No | needs exploration first |
179
+ | "Improve the codebase" | No | no acceptance criteria |
504
180
 
505
- ```bash
506
- zeroshot settings set dockerEnvPassthrough '["MY_API_KEY", "TF_VAR_*"]'
507
- ```
181
+ - **Pre-1.0 in spirit.** Interfaces still move between releases; pin your version. (The npm version auto-increments on every merge, so read it as a build counter, not a stability promise.)
182
+ - **Crash-safe.** All state persists to a SQLite ledger; `zeroshot resume <id>` continues at any time.
183
+ - **No TUI in this release.** Monitor with `zeroshot logs <id> -f`, `zeroshot list`, and `zeroshot status <id>`.
508
184
 
509
- </details>
185
+ <details>
186
+ <summary><strong>Architecture, quality gates and command proofs</strong></summary>
510
187
 
511
- ## Resources
188
+ Zeroshot is a message-driven coordination layer: a conductor classifies each task by complexity and type, a workflow template selects agents and validators, agents publish results to a SQLite ledger, and validators approve or reject with specific findings.
512
189
 
513
- - [CLAUDE.md](./CLAUDE.md) - Architecture, cluster config schema, agent primitives
514
- - `docs/providers.md` - Provider setup, model levels, and Docker mounts
515
- - `docs/context-management.md` - Context selection, context packs, and state snapshots
516
- - [Discord](https://discord.gg/PdZ3UEXB) - Support and community
517
- - `zeroshot export <id>` - Export conversation to markdown
518
- - `sqlite3 ~/.zeroshot/*.db` - Direct ledger access for debugging
190
+ - **Required handoff quality gates**: in `--pr`/`--ship` flows, the git-pusher fails closed until every configured gate has fresh passing evidence.
191
+ - **Cmdproof**: make expensive exact commands reusable across agents with `zeroshot cmdproof check <id>`.
519
192
 
520
- <details>
521
- <summary><strong>Troubleshooting</strong></summary>
522
-
523
- | Issue | Fix |
524
- | ----------------------------- | ----------------------------------------------------------------------------------------- |
525
- | `claude: command not found` | `npm i -g @anthropic-ai/claude-code && claude auth login` |
526
- | `codex: command not found` | `npm i -g @openai/codex && codex login` |
527
- | `gemini: command not found` | `npm i -g @google/gemini-cli && gemini auth login` |
528
- | `gh: command not found` | [Install GitHub CLI](https://cli.github.com/) |
529
- | `--docker` fails | Docker must be running: `docker ps` to verify |
530
- | Cluster stuck | `zeroshot resume <id>` to continue |
531
- | Agent keeps failing | Check `zeroshot logs <id>` for actual error |
532
- | `zeroshot: command not found` | `npm install -g @the-open-engine/zeroshot` |
533
- | Agents misbehave | `/analyze-cluster-postmortem <id>` in Claude Code (creates issue if fix is generalizable) |
193
+ See [CLAUDE.md](./CLAUDE.md) for the cluster schema, primitives, and the conductor's classification model.
534
194
 
535
195
  </details>
536
196
 
537
- ## Contributing
197
+ ## The Open Engine
538
198
 
539
- See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
199
+ Zeroshot is **Layer 01 · Verification** of [The Open Engine](https://theopenengine.com), the open stack for autonomous software production. Generating code is easy; trusting it is not. The engine is layered because trust is layered:
540
200
 
541
- Please read [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) before participating.
201
+ | | Layer | Status |
202
+ | ------ | -------------------------- | --------------------------- |
203
+ | **01** | **Verification: Zeroshot** | This repo · open · shipping |
204
+ | 02 | Constraints: **Opcore** | Sibling · alpha |
205
+ | 03-05 | Intent · Context · Runtime | In development |
542
206
 
543
- For security issues, see [SECURITY.md](SECURITY.md).
207
+ Zeroshot runs the loop: an agent writes the change, and an **independent** verifier decides whether it holds: approve, or a reproducible failure. **Opcore** is the sibling layer, a deterministic, local, read-only **constraints** gate for coding agents (currently private alpha `0.1.0-alpha.0`, built in the open, not yet published). Verification asks _"does this meet the goal?"_; constraints ask _"is this within tolerance?"_
544
208
 
545
- ## TUI
209
+ Each layer ships the same way: extracted from the platform we run, then opened. **Trust nothing. Verify everything.**
546
210
 
547
- The TUI is not included in this release. Use `zeroshot logs -f`, `zeroshot logs -w`,
548
- `zeroshot list`, and `zeroshot status <id>` for monitoring.
211
+ ## Contributing
212
+
213
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) before participating, and [SECURITY.md](SECURITY.md) for security reports. More in [`docs/`](docs/) and [CLAUDE.md](./CLAUDE.md).
214
+
215
+ <!-- discord-placeholder -->
549
216
 
550
- ---
217
+ Questions and help: [Discord](https://discord.gg/fZyzf2Cut9).
551
218
 
552
- MIT - [The Open Engine Company](https://github.com/the-open-engine)
219
+ ## License
553
220
 
554
- Built on [Claude Code](https://claude.com/product/claude-code) by Anthropic.
221
+ MIT. [The Open Engine Company](https://github.com/the-open-engine).