ultra-builder-pro-cli 0.17.1 → 0.18.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.
package/README.md CHANGED
@@ -1,303 +1,436 @@
1
- # ultra-builder-pro-cli
1
+ # Ultra Builder Pro
2
2
 
3
- Multi-runtime plugin suite + autonomous coding factory for the Ultra Builder Pro
4
- agent engineering system. It ships native plugins for **Claude Code · OpenCode ·
5
- Codex · Kimi Code** and orchestrates PRD →
6
- dependency graph → resumable dependency-wave execution → convergence-gated
7
- integration with a single authoritative `.ultra/state.db`.
3
+ **An adaptive delivery harness for AI coding agents.**
4
+
5
+ Ultra Builder Pro helps Claude Code, Codex, OpenCode, and Kimi Code carry a
6
+ software project from an unclear request to a verified, recoverable delivery.
7
+ It keeps the user and the agent aligned, preserves project authority across
8
+ sessions, and prevents specifications from quietly drifting away from the code.
9
+
10
+ It is not another model and it is not a rigid step-by-step autopilot. The active
11
+ host agent still investigates, reasons, recommends, and implements. Ultra adds
12
+ the durable workflow state, evidence gates, recovery paths, and host-native
13
+ tools needed to make that work dependable over time.
8
14
 
9
15
  <div align="center">
10
16
 
11
- [![Version](https://img.shields.io/badge/version-0.16.0-blue)](./CHANGELOG.md)
12
- [![Tests](https://img.shields.io/badge/tests-passing-brightgreen)](#verification)
17
+ [![npm](https://img.shields.io/npm/v/ultra-builder-pro-cli?label=npm)](https://www.npmjs.com/package/ultra-builder-pro-cli)
18
+ [![Tests](https://img.shields.io/badge/tests-passing-brightgreen)](#development-and-verification)
13
19
  [![License: MIT](https://img.shields.io/badge/license-MIT-green)](./LICENSE)
14
20
  [![Node](https://img.shields.io/badge/node-%E2%89%A522-informational)](./package.json)
15
21
 
16
22
  </div>
17
23
 
18
- ---
19
-
20
- ## What it does
21
-
22
- - **Builds host-native plugins from one allowlist.** Claude Code, OpenCode,
23
- Codex, and Kimi Code receive their own command/skill, agent, hook, and MCP
24
- representation.
25
- Install and uninstall are symmetric on every supported host; `ubp --doctor`
26
- verifies the installed asset hashes and host entry points without mutation.
27
- - **Shares state across runtimes.** `.ultra/state.db` (SQLite + WAL) is the
28
- authoritative source for baselines, changes, decision threads, workflows, tasks,
29
- sessions, events, incidents, projection jobs, and telemetry. `tasks.json` and context markdown are
30
- generated projections, not handwritten.
31
- - **Aligns the owner and agent without questionnaire overload.** The host resolves
32
- observable facts first, then presents exactly one load-bearing decision with
33
- evidence, a recommendation, credible alternatives, and the durable effect. The
34
- normalized answer and owner-approved artifact checkpoint live in the DB; prompts
35
- and transcripts do not. Matching workflows stop until that authority is current.
36
- - **Keeps memory ownership explicit.** Ultra Builder Pro does not collect
37
- prompts, transcripts, observations, summaries, or cross-session memory.
38
- Install cloud-mem/claude-mem separately if persistent memory is wanted.
39
- - **Runs current plans without a second model credential.** The current host
40
- derives task objects; `task.parse_prd` validates them → `lib/topo.cjs` waves →
41
- `.ultra/execution-plan.json` → parallel worktree sessions. Execution pauses at
42
- the first wave whose tasks have not converged through Ultra gates. An explicit
43
- auto-merge is accepted only for a change task with a matching completion commit,
44
- ready dev evidence, and a current task review; transport success alone preserves
45
- the worktree.
46
- - **Keeps daily work convergent.** `/ultra-change` creates a bounded delta and
47
- complete Change Contract, classifies risk, records whether bounded research is
48
- required, and leaves planning and context compilation to their actual consumers.
49
- Context Manifest v3 assigns a role/gate, verifies required references, reports
50
- fresh-context budget pressure as advisory warnings, and exposes mechanically valid
51
- transitions without choosing the semantic route. Research stores typed,
52
- source-digested semantic records;
53
- planning proves Change acceptance coverage; `/ultra-deliver` requires applied specification
54
- learning plus docs/test/mode-bound two-axis review evidence and a schema-validated
55
- baseline reconciliation manifest before archive. `/ultra-doctor` reports incidents,
56
- projection lag, orphan sessions, and backup-first mechanical recovery.
57
- Incident changes additionally require a five-section `diagnosis.md` covering
58
- reproduction, hypotheses, root cause, regression test, and recovery.
59
- - **Adopts existing repositories without pretending they are new.** `ultra-init`
60
- classifies greenfield, brownfield, and monorepo scope. Brownfield adoption records
61
- current specifications, repository/runtime evidence, worktree snapshot, known-red
62
- verification, categorized gaps, unknowns, and explicit approval without rewriting
63
- application code. v4.4 and v4.5 projection-only projects have backup-first imports.
64
- - **Keeps external context external.** Memory and code-graph providers retain
65
- their own content; Ultra stores only provider/project/revision/status metadata
66
- references in a compiled change context.
67
-
68
- ## Quickstart
24
+ ## Why it exists
25
+
26
+ AI coding works well inside one conversation. Real projects last much longer.
27
+ After several sessions, teams commonly find that:
28
+
29
+ - the agent no longer knows which decisions are authoritative;
30
+ - implementation changed but product and architecture documents did not;
31
+ - a new session repeats research or asks the same questions again;
32
+ - an existing codebase is treated like a blank new product;
33
+ - a rigid workflow blocks reasonable work, while an unstructured workflow loses
34
+ traceability;
35
+ - “tests passed” or “work completed” cannot be tied back to the exact change,
36
+ task, commit, and acceptance criteria.
37
+
38
+ Ultra Builder Pro addresses those gaps with four ideas:
39
+
40
+ 1. **Adaptive workflow, not a fixed pipeline.** MCP exposes valid capabilities
41
+ and hard recovery requirements. The host model recommends the next semantic
42
+ action from the user's goal and current evidence.
43
+ 2. **Low-load user alignment.** The agent investigates observable facts itself
44
+ and asks the user only for material intent, scope, risk, or authorization
45
+ decisions—normally one dependent decision at a time.
46
+ 3. **Durable project authority.** `.ultra/state.db` records baselines, changes,
47
+ decisions, workflows, tasks, evidence digests, sessions, incidents, and
48
+ recovery state across hosts and sessions.
49
+ 4. **Convergent delivery.** Research, plans, implementation, tests, review, and
50
+ specification updates must agree before a change is archived.
51
+
52
+ For example, if the user asks an agent to add organization SSO to an existing
53
+ application, Ultra helps the agent inspect the real authentication path, capture
54
+ the intended compatibility and recovery contract, ask only the unresolved
55
+ product decision, plan and implement against current evidence, update affected
56
+ specifications, and preserve the exact verification and review result. A later
57
+ session resumes from that authority instead of reconstructing it from chat.
58
+
59
+ ## The mental model
60
+
61
+ ```mermaid
62
+ flowchart LR
63
+ U["User<br/>intent and material decisions"] <--> H["Host agent<br/>reasoning and implementation"]
64
+ H <--> S["Ultra skills<br/>task-specific workflows"]
65
+ S <--> M["Ultra MCP<br/>state, evidence, freshness, recovery"]
66
+ M <--> D[(".ultra/state.db")]
67
+ H --> A["Code, specifications,<br/>tests and review artifacts"]
68
+ A --> M
69
+ K["Lifecycle hooks<br/>breadcrumb and projection protection"] --> M
70
+ ```
71
+
72
+ The responsibility split is deliberate:
73
+
74
+ | Owner | Responsibility |
75
+ |---|---|
76
+ | **User** | Product intent, material scope and trade-offs, destructive actions, publishing and deployment authorization |
77
+ | **Host model** | Fact-finding, synthesis, research coverage, route recommendation, reversible implementation decisions |
78
+ | **Ultra MCP** | Durable state, evidence references, digests, freshness, locks, valid transitions and hard recovery |
79
+ | **Host adapter** | Native Skill discovery, user questions, tool invocation, installation, and runtime wiring |
80
+ | **Hooks** | Fast lifecycle observation, current breadcrumb injection, and protection of generated projections |
81
+
82
+ The MCP does not replace the model's judgment. A hook does not decide product
83
+ strategy. A prompt does not become durable authority merely because it appeared
84
+ in a conversation.
85
+
86
+ ## What you get
87
+
88
+ - Native plugins for **Claude Code**, **OpenCode**, **Codex**, and **Kimi Code**.
89
+ - One workflow vocabulary across all four hosts.
90
+ - Deterministic initialization for new, existing, monorepo, and older Ultra
91
+ projects.
92
+ - Evidence-backed greenfield research and brownfield adoption.
93
+ - A durable Change Contract for every ongoing feature, fix, refactor, or
94
+ incident.
95
+ - Context compilation that detects stale plans, tasks, references, and
96
+ specifications.
97
+ - Risk-selected testing and independent specification/engineering review.
98
+ - Crash-safe sessions, worktree recovery, circuit breakers, and backup-first
99
+ state migration.
100
+ - Read-only installation and project diagnostics.
101
+ - Optional dependency-wave worker orchestration for already-approved plans.
102
+
103
+ ## When to use it
104
+
105
+ Ultra Builder Pro is useful when:
106
+
107
+ - a project will span multiple agent sessions;
108
+ - more than one supported host may work on the same repository;
109
+ - product or architecture specifications must stay synchronized with delivery;
110
+ - an existing codebase needs a trustworthy baseline before new changes;
111
+ - failures must be diagnosable and recoverable;
112
+ - user decisions, agent reasoning, and mechanical enforcement need clear
113
+ boundaries.
114
+
115
+ It is probably unnecessary for a disposable one-file experiment or a change
116
+ that does not need durable project context.
117
+
118
+ ## Install
119
+
120
+ Requirements:
121
+
122
+ - Node.js 22 or newer;
123
+ - Git for the normal project workflow;
124
+ - one or more supported coding-agent hosts.
125
+
126
+ Install globally into all detected host configuration directories:
127
+
128
+ ```bash
129
+ npx --yes ultra-builder-pro-cli@latest --all --global
130
+ ```
131
+
132
+ Or install only one host:
133
+
134
+ ```bash
135
+ npx --yes ultra-builder-pro-cli@latest --claude --global
136
+ npx --yes ultra-builder-pro-cli@latest --opencode --global
137
+ npx --yes ultra-builder-pro-cli@latest --codex --global
138
+ npx --yes ultra-builder-pro-cli@latest --kimi --global
139
+ ```
140
+
141
+ Use `--local` instead of `--global` to install into the current project's host
142
+ configuration:
143
+
144
+ ```bash
145
+ npx --yes ultra-builder-pro-cli@latest --all --local
146
+ ```
147
+
148
+ Verify the installation without changing it:
69
149
 
70
150
  ```bash
71
- # Install into one runtime (local = current project's config dir)
72
- npx ultra-builder-pro-cli --claude --local
73
- npx ultra-builder-pro-cli --opencode --local
74
- npx ultra-builder-pro-cli --codex --local
75
- npx ultra-builder-pro-cli --kimi --local
151
+ npx --yes ultra-builder-pro-cli@latest --all --global --doctor
152
+ npx --yes ultra-builder-pro-cli@latest --all --global --doctor --json
153
+ ```
76
154
 
77
- # Or blanket-install to every supported runtime you have
78
- npx ultra-builder-pro-cli --all --local
155
+ After installing or upgrading, start a new Claude Code, OpenCode, or Codex
156
+ session. In Kimi Code, run `/reload` or start a new session.
79
157
 
80
- # Global (into the runtime's ~/.config-style dir)
81
- npx ultra-builder-pro-cli --claude --global
82
- npx ultra-builder-pro-cli --kimi --global
158
+ Plugin installation does not mutate durable user instructions. To preview and
159
+ explicitly converge a legacy handbook into the complete host-native engineering
160
+ contract, use full mode:
83
161
 
84
- # Uninstall (symmetric)
85
- npx ultra-builder-pro-cli --all --local --uninstall
162
+ ```bash
163
+ npx --yes --package ultra-builder-pro-cli@latest \
164
+ ubp-handbook preview --runtime codex --full > /tmp/ubp-codex-handbook.md
165
+ # Inspect the preview, then copy the confirmation token printed to the terminal.
166
+ npx --yes --package ultra-builder-pro-cli@latest \
167
+ ubp-handbook apply --runtime codex --full \
168
+ --confirm "PASTE_64_CHARACTER_TOKEN_HERE"
169
+ ```
86
170
 
87
- # Read-only installation provenance and drift diagnosis
88
- npx ultra-builder-pro-cli --all --local --doctor
89
- npx ultra-builder-pro-cli --all --local --doctor --json
171
+ Replace `codex` with `claude`, `opencode`, or `kimi` for the other hosts. The
172
+ apply command rejects a missing or stale preview token, creates a timestamped
173
+ backup, follows user-managed handbook symlinks, and preserves supported
174
+ marker-delimited content owned by other providers. Without `--full`, only the
175
+ small Ultra runtime block is merged.
176
+
177
+ ### Host invocation
178
+
179
+ | Host | Example |
180
+ |---|---|
181
+ | Claude Code | `/ultra-builder-pro:ultra-init` |
182
+ | OpenCode | `/ultra-init` |
183
+ | Codex | `$ultra-builder-pro:ultra-init` |
184
+ | Kimi Code | `/ultra-builder-pro:ultra-init` |
185
+
186
+ The same naming applies to `ultra-research`, `ultra-change`, `ultra-plan`,
187
+ `ultra-dev`, `ultra-test`, `ultra-review`, `ultra-deliver`, `ultra-status`,
188
+ `ultra-think`, and `ultra-doctor`.
189
+
190
+ See the
191
+ [Runtime Compatibility Matrix](./docs/RUNTIME-COMPAT-MATRIX.md) for exact
192
+ host-specific presentation and lifecycle differences.
193
+
194
+ ## How to use it
195
+
196
+ ### 1. Start a new project
197
+
198
+ From the project root, invoke `ultra-init`.
199
+
200
+ Initialization:
201
+
202
+ - identifies the repository root and scope;
203
+ - classifies the repository as greenfield, brownfield, or migrated;
204
+ - initializes Git when needed;
205
+ - creates `.ultra/` and schema 18 project authority;
206
+ - verifies that the scaffold and database can be read back;
207
+ - completes without silently starting research, creating a commit, adding a
208
+ remote, or pushing anything.
209
+
210
+ Then explicitly invoke `ultra-research`. For a new product, the agent evaluates
211
+ the complete research catalog but executes only the areas that matter. It
212
+ resolves observable facts itself and asks for material product decisions as
213
+ needed. Once the evidence and specifications are accurate, the user approves
214
+ the baseline.
215
+
216
+ The common path after baseline approval is:
217
+
218
+ ```text
219
+ ultra-change
220
+ -> optional ultra-think or bounded ultra-research
221
+ -> ultra-plan when planning is needed
222
+ -> ultra-dev
223
+ -> risk-selected ultra-test
224
+ -> ultra-review
225
+ -> ultra-deliver
90
226
  ```
91
227
 
92
- After install, start a new host session/task and point it at the project.
93
- Claude Code and OpenCode expose native command forms. Codex exposes the same workflows as namespaced plugin
94
- skills such as `$ultra-builder-pro:ultra-init`, `$ultra-builder-pro:ultra-plan`,
95
- and `$ultra-builder-pro:ultra-dev`; `command-map.json` records the eleven legacy
96
- command mappings (`ultra-review` remains a directly invocable skill). Kimi Code
97
- uses native namespaced commands such as `/ultra-builder-pro:ultra-init` and
98
- `/ultra-builder-pro:ultra-plan`; run `/reload` or start a new Kimi session after
99
- install or update.
100
- See [`docs/RUNTIME-COMPAT-MATRIX.md`](./docs/RUNTIME-COMPAT-MATRIX.md)
101
- for per-runtime capabilities.
102
-
103
- Start with `ultra-init` in both new and existing projects. Auto classification is
104
- based on delivered-system evidence: application source, tests, deployment, or
105
- persisted-state/schema signals make a repository brownfield; a Git repository,
106
- manifest, README, or starter documentation alone remains greenfield. An empty project
107
- opens a `draft` greenfield baseline and an existing system opens an `adopting`
108
- brownfield baseline. Initialization completes after classification, local Git setup,
109
- scaffold creation, and read-back verification; it never starts research implicitly.
110
- When `ultra-research` is explicitly invoked, the host dispositions each of seventeen
111
- coverage areas as `execute`, `verify_existing`, `reuse`, `not_applicable`, or accepted
112
- `deferred`. It performs only the necessary work before `baseline.record` and explicit
113
- `baseline.converge`; initialization never treats blank templates as a trusted baseline
114
- and never selects an MVP. Auto mode preserves existing
115
- Git or initializes `main` and adds a symlink-safe `.ultra` ignore rule; an unborn
116
- repository requires an owner-approved local checkpoint commit before the baseline can
117
- be recorded. It never creates a remote, tag, or push. Existing active work may
118
- continue only when its durable change workflow was bound to a healthy ready baseline;
119
- the expected HEAD, worktree, spec, and source-evidence drift created by that change is
120
- advisory until delivery reconciliation. Loss of approved-ready status or structural
121
- baseline evidence blocks ordinary work. An incident requires an explicit break-glass
122
- approver and leaves a blocking reconciliation gap at archive; new ordinary work always
123
- requires a healthy ready baseline. See
124
- [`docs/WORKFLOW-LIFECYCLE.md`](./docs/WORKFLOW-LIFECYCLE.md) for exact write,
125
- transition, invalidation, and recovery semantics.
126
- The semantic crosswalk to the original Claude Code harness is
127
- [`docs/LEGACY-CLI-CROSSWALK.md`](./docs/LEGACY-CLI-CROSSWALK.md).
128
-
129
- ## Three-layer architecture
130
-
131
- | Layer | Purpose | When it's used |
132
- |-------|---------|----------------|
133
- | **skill** (`skills/ultra-*/`) | Knowledge — prompts, workflows, prose | Runtime's native skill/prompt loader picks them up after install |
134
- | **MCP** (`mcp-server/`) | Authoritative state — reads/writes `.ultra/state.db` via stdio JSON-RPC | Primary path for task / session / event / plan operations |
135
- | **CLI** (`ultra-tools`, `bin/*`) | Selected initialization, recovery, diagnostics, and orchestration surfaces | `ultra-tools task init-project`, `ultra-tools system doctor`, `ubp-orchestrator execute-plan` |
136
-
137
- The layers share one `.ultra/state.db`, but the CLI is not a mirror of every MCP
138
- tool: continuous change mutations are MCP-only and fail closed. See
139
- [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md) for the full contract and
140
- [`spec/cli-protocol.md`](./spec/cli-protocol.md) for the 50 live contracts.
141
- Review, impact discovery, skill resolution, and decision presentation stay on each
142
- host's native surfaces; MCP stores normalized decision authority but never generates
143
- questions. The generated Codex capability map documents those replacements without
144
- advertising non-existent MCP tools.
145
-
146
- The package boundary is deliberate: twelve public Ultra workflow skills, four
147
- internal review-rule skills, host-specific collaboration companions, and the
148
- minimal host bootstrap required by Kimi. Browser, deployment, skill-discovery,
149
- and framework guidance belong to their original plugins.
150
-
151
- ## Runtime capability matrix
152
-
153
- | Feature | Claude Code | OpenCode | Codex CLI | Kimi Code 0.26+ |
154
- |------------------------------|:-----------:|:--------:|:---------:|:---------------:|
155
- | Custom commands | ✅ | ✅ | ✅ | ✅ (namespaced) |
156
- | Skill loader | ✅ | ✅ | ✅ (personal plugin) | ✅ (native plugin) |
157
- | MCP server (stdio) | ✅ | ✅ | ✅ (plugin `.mcp.json`) | ✅ (`mcpServers`) |
158
- | Workflow hooks | ✅ (native plugin) | ✅ (native JS plugin) | ✅ (native plugin) | ✅ with documented compact limitation |
159
- | Sub-agents | ✅ | ✅ | ✅ (9 native TOML agents) | ✅ via `Agent` / `AgentSwarm` prompt templates |
160
- | Session worktree isolation | ✅ (driven by `orchestrator/session-runner.cjs`) | ✅ | ✅ | ✅ |
161
- | Dependency-wave dispatch + optional verified auto-merge | ✅ (`ubp-orchestrator execute-plan`) | ✅ | ✅ | ✅ |
162
-
163
- Full details in [`docs/RUNTIME-COMPAT-MATRIX.md`](./docs/RUNTIME-COMPAT-MATRIX.md)
164
- (10 sections, with per-runtime deviations called out).
165
-
166
- ## Typical workflow
228
+ That diagram is a common path, not a mandatory pipeline. A small current task
229
+ can take a shorter valid route; a high-risk or unclear change can require more
230
+ research, planning, checking, or user alignment.
231
+
232
+ ### 2. Adopt an existing project
233
+
234
+ Run the same `ultra-init` entry point. Ultra detects delivered-system evidence
235
+ such as application source, APIs, persistence, tests, or deployment
236
+ configuration and classifies the repository as brownfield.
237
+
238
+ Brownfield adoption does not ask the agent to invent a new MVP or rewrite the
239
+ product story. It builds a current-system baseline from:
240
+
241
+ - observable code and runtime behavior;
242
+ - existing product and architecture documents;
243
+ - build, lint, type-check, and test results;
244
+ - APIs, data, permissions, integrations, deployment, and recovery seams;
245
+ - known failures, documentation drift, technical debt, and unresolved unknowns.
246
+
247
+ During `ultra-research`, the host model selects the smallest evidence-backed set
248
+ of applicable catalog areas. Every included area receives one explicit
249
+ disposition:
250
+
251
+ - `execute` — produce fresh evidence;
252
+ - `verify_existing` — validate an existing artifact;
253
+ - `reuse` — reuse evidence that is still current;
254
+ - `not_applicable` — exclude it with evidence and rationale;
255
+ - `deferred` — record the consequence and accepted owner.
256
+
257
+ The catalog is not a mandatory document set or questionnaire. Omitted areas
258
+ create no workflow rows; an explicit exclusion is recorded only when retaining
259
+ that rationale is useful.
260
+
261
+ Older projection-only Ultra projects are preserved and routed through a
262
+ backup-first migration or rebaseline. Use `ultra-doctor` when initialization
263
+ reports migration or authority damage; do not overwrite old state manually.
264
+
265
+ ### 3. Make daily changes
266
+
267
+ After the baseline is ready, start features, fixes, refactors, and incidents
268
+ with `ultra-change`.
269
+
270
+ `ultra-change` records the accepted outcome, scope, acceptance criteria,
271
+ compatibility boundary, recovery strategy, documentation impact, risk profile,
272
+ and research disposition. Capturing intent does not automatically start every
273
+ downstream workflow.
274
+
275
+ The host then recommends one valid capability:
276
+
277
+ - `ultra-think` for a material unresolved decision or diagnosis;
278
+ - bounded `ultra-research` for a real evidence gap;
279
+ - `ultra-plan` for task decomposition and dependency planning;
280
+ - `ultra-dev` when a current task contract is already executable;
281
+ - `ultra-status` when the user needs the current authority and available routes;
282
+ - `ultra-doctor` when state or installation health is degraded.
283
+
284
+ Semantic changes invalidate dependent tasks and compiled context. A stale task
285
+ cannot be revived by flipping a status flag; its complete execution contract
286
+ must be reconciled against the current Change authority.
287
+
288
+ ### 4. Deliver and continue
289
+
290
+ `ultra-deliver` verifies that implementation, acceptance evidence, testing,
291
+ review findings, specification learning, and baseline reconciliation agree. It
292
+ then archives the local Ultra change authority.
293
+
294
+ Delivery does **not** grant permission to commit, push, publish, tag, deploy, or
295
+ perform another external effect. Those actions remain separate and require the
296
+ user's explicit request.
297
+
298
+ The next piece of daily work starts with a new `ultra-change`.
299
+
300
+ ## Core workflows
301
+
302
+ | Workflow | Purpose |
303
+ |---|---|
304
+ | `ultra-init` | Classify the repository and create or recover project authority |
305
+ | `ultra-research` | Build or refresh an evidence-backed baseline with adaptive coverage |
306
+ | `ultra-think` | Resolve one material decision or perform bounded diagnosis |
307
+ | `ultra-change` | Capture the durable contract for one feature, fix, refactor, or incident |
308
+ | `ultra-plan` | Create current task contracts, dependencies, acceptance coverage, and execution context |
309
+ | `ultra-dev` | Implement one owned vertical slice and record exact evidence |
310
+ | `ultra-test` | Run the risk-selected verification profile and persist the gate result |
311
+ | `ultra-review` | Coordinate independent specification-fidelity and engineering review |
312
+ | `ultra-deliver` | Reconcile specifications, close local authority, and archive the change |
313
+ | `ultra-status` | Read the current breadcrumb, blockers, evidence, and allowed transitions |
314
+ | `ultra-doctor` | Diagnose installation or project-state faults and expose safe recovery |
315
+ | `learn` | Turn one approved, verified reusable procedure into a portable user skill |
316
+
317
+ ## What lives in `.ultra/`
318
+
319
+ ```text
320
+ .ultra/
321
+ state.db # sole durable Ultra authority
322
+ specs/ # current product and architecture baseline
323
+ changes/
324
+ active/ # current Change artifacts
325
+ archive/ # immutable delivered Change artifacts
326
+ docs/research/ # evidence reports for selected research areas
327
+ reports/ # test, review, and delivery evidence
328
+ tasks/
329
+ tasks.json # generated projection, never the authority
330
+ contexts/ # bounded role/task context artifacts
331
+ ```
332
+
333
+ The host agent writes semantic specifications and evidence artifacts. MCP
334
+ validates their references and digests, records workflow state, and rejects
335
+ stale or illegal transitions. Generated Markdown and JSON help humans and tools
336
+ inspect the project, but `.ultra/state.db` remains authoritative.
337
+
338
+ Ultra does not store chain-of-thought, raw prompts, transcripts, cross-session
339
+ memory, or code-graph content. Memory and graph systems remain separate
340
+ providers; Ultra may store only bounded metadata references to them.
341
+
342
+ ## Optional orchestration
343
+
344
+ The normal workflow can be driven interactively by the host agent. For an
345
+ already-approved plan, `ubp-orchestrator` can dispatch dependency-ready tasks
346
+ into isolated Git worktrees:
167
347
 
168
348
  ```bash
169
- # 1. Bootstrap deterministic authority. This completes init but not research/baseline.
170
- ultra-tools task init-project --project-name myapp --mode auto
171
-
172
- # Projection-only projects from prior releases use one backup-first import:
173
- ultra-tools migrate --from=4.4 --to=4.5 --source-dir .
174
- ultra-tools migrate --from=4.5 --to=18.0 --source-dir .
175
-
176
- # 2. Invoke ultra-research explicitly. The host dispositions each coverage area,
177
- # executes/verifies/reuses only what is necessary, and asks one material decision at
178
- # a time through the host-native question surface. Record evidence and obtain
179
- # baseline approval only after the selected coverage converges.
180
-
181
- # 3. Optional worker automation. Configure a real shell-free worker first:
182
- # {"orchestrator":{"command":"/absolute/path/to/ultra-worker","command_args":[]}}
183
- # Then resume current dependency waves until the first non-converged wave.
184
- # A paused result is expected while dev/test/review evidence is still open.
185
- # Worktrees are preserved by default. Empty, cyclic, stale, duplicate-task,
186
- # cross-change, and stale or unverified plans fail before a session is created.
187
- # Each worker checkout resolves `.ultra` to the one central authority; reserved
188
- # UBP_DB_PATH / UBP_ROOT_DIR / UBP_AUTHORITY_ROOT bindings cannot be overridden.
189
349
  ubp-orchestrator execute-plan
190
- # Add --auto-merge only when the worker records the exact completion commit,
191
- # ready dev steps, and a current task review before it exits.
350
+ ```
351
+
352
+ The orchestrator is intentionally not a replacement for Ultra gates. A worker
353
+ process exiting successfully does not complete a task. Task evidence, current
354
+ dev state, testing, review, integration, and baseline reconciliation still have
355
+ to converge. Worktrees with uncommitted or unintegrated work are preserved for
356
+ recovery.
192
357
 
193
- # 4. Monitor cost, progress, and runtime health
358
+ See [Architecture](./docs/ARCHITECTURE.md) and
359
+ [Workflow Lifecycle](./docs/WORKFLOW-LIFECYCLE.md) before enabling automated
360
+ worker execution or verified auto-merge.
361
+
362
+ ## CLI utilities
363
+
364
+ | Binary | Purpose |
365
+ |---|---|
366
+ | `ultra-builder-pro-cli` / `ubp` | Install, update, uninstall, and diagnose host plugins |
367
+ | `ultra-tools` | Inspect and maintain project tasks, sessions, state, migration, and recovery |
368
+ | `ubp-orchestrator` | Execute current dependency waves or supervise configured workers |
369
+ | `ubp-handbook` | Preview or apply either the bounded Ultra block or the explicit full host-native handbook |
370
+
371
+ Useful read-only checks:
372
+
373
+ ```bash
194
374
  ultra-tools status
195
375
  ultra-tools status --cost --since 24h
196
376
  ultra-tools session list --json
197
377
  ultra-tools system doctor
198
378
  ```
199
379
 
200
- Or let the skills drive it. In Codex, invoke
201
- `$ultra-builder-pro:ultra-init` → `$ultra-builder-pro:ultra-research` →
202
- `$ultra-builder-pro:ultra-change` → `$ultra-builder-pro:ultra-plan` →
203
- `$ultra-builder-pro:ultra-dev` → `$ultra-builder-pro:ultra-test` →
204
- `$ultra-builder-pro:ultra-review` → `$ultra-builder-pro:ultra-deliver`; after the
205
- baseline is delivered, daily work starts with `$ultra-builder-pro:ultra-change`, while
206
- `$ultra-builder-pro:ultra-status` reads the compact authoritative breadcrumb.
207
- Kimi uses the corresponding
208
- `/ultra-builder-pro:ultra-*` namespace. Other runtimes retain their native
209
- command form.
210
-
211
- The arrows above show a common capability path, not a mandatory pipeline. After
212
- initialization the user or host explicitly selects research. During daily work,
213
- `ultra-change` may hand off to bounded research, planning, an already-current task,
214
- thinking, or status according to intent and evidence. MCP exposes allowed transitions
215
- and hard recovery requirements; the active host recommends the semantic route.
216
-
217
- ## CLI surface
380
+ Ultra MCP does not require `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or another
381
+ model-provider key. It validates and persists structures derived by the active
382
+ host's existing model session.
218
383
 
219
- | Binary | Purpose |
220
- |--------|---------|
221
- | `ultra-builder-pro-cli` / `ubp` | Installer — `--claude / --opencode / --codex / --kimi / --all`, `--local / --global`, `--uninstall`; read-only install checks via `--doctor [--json]` |
222
- | `ubp-orchestrator` | Current completed-plan runner (`execute-plan`) and optional explicit-worker daemon (`run`, `start`, `stop`, `status`) |
223
- | `ultra-tools` | State-layer CLI — `task`, `session`, `status`, `db`, `migrate`; explicit `legacy-memory` archive/prune migration |
224
- | `ubp-handbook` | Preview/apply the managed Ultra contract in `CLAUDE.md` / `AGENTS.md`, with backup |
384
+ ## Troubleshooting
225
385
 
226
- ## Verification
386
+ - **Installed workflows are missing:** start a new host session. Kimi users can
387
+ run `/reload`.
388
+ - **An installed Hook or MCP path is stale:** run
389
+ `npx --yes ultra-builder-pro-cli@latest --all --global --doctor --json`, then
390
+ reinstall only the degraded host.
391
+ - **Project state is unhealthy:** invoke `ultra-doctor` or run
392
+ `ultra-tools system doctor`. Repairs and schema migrations are backup-first.
393
+ - **A projection disagrees with MCP:** trust `.ultra/state.db`; do not repair
394
+ `tasks.json` or generated context Markdown by hand.
395
+ - **A workflow appears blocked:** use `ultra-status` to read the exact current
396
+ workflow, blocker, owner decision, and mechanically valid transitions.
397
+ - **Kimi reports a native-module ABI error:** ensure an external Node.js 22+
398
+ executable is available on `PATH`; the generated Kimi MCP launcher uses
399
+ `env node`.
400
+
401
+ For exact recovery commands and invariants, see
402
+ [Workflow Lifecycle](./docs/WORKFLOW-LIFECYCLE.md) and
403
+ [State DB Access Policy](./docs/STATE-DB-ACCESS-POLICY.md).
404
+
405
+ ## Development and verification
227
406
 
228
407
  ```bash
229
408
  npm install
230
409
  npm run test:all
231
- python3 -m pytest hooks/tests -q
232
- npm audit
233
- # Or run the complete publish gate:
410
+ npm run test:hooks
411
+ npm audit --omit=dev --audit-level=high
412
+
413
+ # Complete release gate
234
414
  npm run verify:release
235
415
  ```
236
416
 
237
- Individual suites: `test:state`, `test:orch`, `test:spec`, `test:rest`.
238
-
239
- ## Troubleshooting
240
-
241
- - **`state.db` locked**: close any `ubp-orchestrator` daemon, then
242
- `ultra-tools db integrity`. SQLite WAL tolerates readers + one writer;
243
- two writers require orchestrated access (see
244
- [`docs/STATE-DB-ACCESS-POLICY.md`](./docs/STATE-DB-ACCESS-POLICY.md)).
245
- - **`git/config.lock` contention during parallel run**: Node's single-thread
246
- `execFileSync` serializes worktree creation, so this shouldn't happen —
247
- but if you see it, `ubp-orchestrator status` will list stale worktrees
248
- and `node -e "require('./orchestrator/worktree-manager.cjs').releaseAll(process.cwd())"`
249
- cleans them up.
250
- - **Installed commands don't show up**: check the runtime's actual config
251
- dir (`ultra-builder-pro-cli --<runtime> --local` writes to the host-specific
252
- project dir such as `./.claude`, `./.opencode`, or `./.kimi-code`;
253
- `--global` writes to the user-level dir). The
254
- install log prints the exact target path. Restart Claude Code/OpenCode or
255
- start a new Codex task after changing an installed plugin. In Kimi Code,
256
- run `/reload` or start a new session.
257
- - **Kimi MCP reports a native-module ABI error**: Kimi 0.26/0.27 embeds a different
258
- Node ABI from the package installer. The generated plugin intentionally runs
259
- the MCP with `env node`; keep a Node.js `>=22` executable on `PATH` when
260
- starting Kimi.
261
- - **Installed hook/MCP path is missing or stale**: run
262
- `npx ultra-builder-pro-cli --<runtime> --local --doctor` first. It compares
263
- the recorded install provenance with current asset hashes and validates the
264
- host-specific hook, MCP, plugin, and runtime-manifest entry points. Reinstall
265
- only after preserving the degraded report as evidence.
266
- - **Projection tasks exist but state.db has no tasks**: run the exact v4.4 or v4.5
267
- `ultra-tools migrate` command returned by MCP, verify the backup and imported counts,
268
- then run `ultra-init` to replace the compatibility row with a reviewed brownfield
269
- baseline.
270
- - **Old or corrupt state.db**: `ultra-tools system doctor` is read-only;
271
- `ultra-tools system doctor --repair` upgrades supported schemas with two backup
272
- checkpoints. A corrupt database is never overwritten automatically. After explicit
273
- owner approval, restore a verified managed copy with
274
- `ultra-tools system restore --backup <path> --confirm REPLACE_CORRUPT_ULTRA_STATE`,
275
- or preserve the corrupt DB and legacy projection before rebuilding authority with
276
- `ultra-tools system rebaseline --project-name <name> --confirm REBASELINE_CORRUPT_ULTRA_STATE`.
277
- - **Legacy Ultra memory data remains on disk**: inspect first with
278
- `ultra-tools legacy-memory inspect`, archive with
279
- `ultra-tools legacy-memory archive`, then prune only with the explicit
280
- confirmation token printed by the command. Nothing is deleted implicitly.
281
- - **MCP model credentials**: Ultra MCP does not require `ANTHROPIC_API_KEY`,
282
- `OPENAI_API_KEY`, or another provider key. The active host uses its existing
283
- model session to derive PRD tasks or child tasks; `task.parse_prd` and
284
- `task.expand` only validate ownership, graph shape, and atomic persistence.
417
+ Individual Node suites are available as `test:state`, `test:orch`, `test:spec`,
418
+ and `test:rest`.
285
419
 
286
420
  ## Documentation
287
421
 
288
- | Doc | What's in it |
289
- |-----|--------------|
290
- | [`docs/PLAN.zh-CN.md`](./docs/PLAN.zh-CN.md) | Historical 12-phase plan and decision log with a current-boundary overlay |
291
- | [`docs/ROADMAP.md`](./docs/ROADMAP.md) | One-page English roadmap + phase status |
292
- | [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md) | Single-page system architecture |
293
- | [`docs/WORKFLOW-LIFECYCLE.md`](./docs/WORKFLOW-LIFECYCLE.md) | Baseline classification, DB writes, status machines, gates, invalidation, and recovery |
294
- | [`docs/AGENT-CONTEXT.md`](./docs/AGENT-CONTEXT.md) | Canonical runtime context contract |
295
- | [`docs/USER-HANDBOOK-CONTRACT.md`](./docs/USER-HANDBOOK-CONTRACT.md) | Shared user-handbook policy and host renderings |
296
- | [`docs/RUNTIME-COMPAT-MATRIX.md`](./docs/RUNTIME-COMPAT-MATRIX.md) | Per-runtime capability matrix |
297
- | [`docs/STATE-DB-ACCESS-POLICY.md`](./docs/STATE-DB-ACCESS-POLICY.md) | Multi-process write contract |
298
- | [`docs/COMMIT-HASH-BACKFILL.md`](./docs/COMMIT-HASH-BACKFILL.md) | Two-commit task-completion flow |
299
- | [`CHANGELOG.md`](./CHANGELOG.md) | v0.1 → current release notes |
422
+ | Document | Purpose |
423
+ |---|---|
424
+ | [Architecture](./docs/ARCHITECTURE.md) | Components, authority boundaries, and live integration paths |
425
+ | [Workflow Lifecycle](./docs/WORKFLOW-LIFECYCLE.md) | Command ownership, transitions, invalidation, recovery, and convergence |
426
+ | [Runtime Compatibility Matrix](./docs/RUNTIME-COMPAT-MATRIX.md) | Claude Code, OpenCode, Codex, and Kimi presentation details |
427
+ | [Legacy CLI Crosswalk](./docs/LEGACY-CLI-CROSSWALK.md) | What was preserved, strengthened, or replaced from the original Ultra Builder Pro |
428
+ | [Agent Context](./docs/AGENT-CONTEXT.md) | Context Manifest and host-agent execution contract |
429
+ | [User Handbook Contract](./docs/USER-HANDBOOK-CONTRACT.md) | Shared user-level policy and managed host renderings |
430
+ | [State DB Access Policy](./docs/STATE-DB-ACCESS-POLICY.md) | Multi-process authority and write rules |
431
+ | [Roadmap](./docs/ROADMAP.md) | Current and historical delivery scope |
432
+ | [Changelog](./CHANGELOG.md) | Release history |
300
433
 
301
434
  ## License
302
435
 
303
- MIT — see [`LICENSE`](./LICENSE).
436
+ MIT — see [LICENSE](./LICENSE).