ultra-builder-pro-cli 0.16.0 → 0.17.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/.ultra-template/specs/research-distillate.md +4 -3
- package/CHANGELOG.md +86 -0
- package/README.md +54 -24
- package/adapters/_shared/codex-assets.cjs +10 -5
- package/adapters/_shared/handbook.cjs +1 -1
- package/adapters/_shared/interaction-contract.cjs +61 -0
- package/adapters/claude.js +1 -1
- package/adapters/opencode.js +1 -1
- package/bin/orchestrator.js +175 -19
- package/commands/ultra-change.md +1 -1
- package/commands/ultra-deliver.md +3 -3
- package/commands/ultra-init.md +1 -1
- package/commands/ultra-plan.md +1 -1
- package/commands/ultra-research.md +2 -2
- package/commands/ultra-review.md +10 -0
- package/commands/ultra-status.md +1 -1
- package/commands/ultra-test.md +1 -1
- package/docs/AGENT-CONTEXT.md +11 -8
- package/docs/ARCHITECTURE.md +67 -9
- package/docs/LEGACY-CLI-CROSSWALK.md +163 -0
- package/docs/PLAN.zh-CN.md +19 -13
- package/docs/RUNTIME-COMPAT-MATRIX.md +2 -2
- package/docs/WORKFLOW-LIFECYCLE.md +123 -59
- package/hooks/pre_stop_check.py +3 -2
- package/mcp-server/lib/baseline-workflow.cjs +84 -16
- package/mcp-server/lib/change-workflow.cjs +55 -35
- package/mcp-server/lib/context-spine.cjs +171 -105
- package/mcp-server/lib/git-bootstrap.cjs +240 -0
- package/mcp-server/lib/init-project.cjs +178 -41
- package/mcp-server/lib/project-breadcrumb.cjs +14 -14
- package/mcp-server/lib/state-db.cjs +257 -10
- package/mcp-server/lib/state-ops.cjs +64 -1
- package/mcp-server/lib/workflow-state.cjs +300 -205
- package/mcp-server/server.cjs +58 -34
- package/orchestrator/auto-merge.cjs +19 -0
- package/orchestrator/daemon.cjs +104 -0
- package/orchestrator/parallel-orchestrator.cjs +371 -49
- package/orchestrator/session-runner.cjs +354 -25
- package/package.json +2 -1
- package/skills/ultra-change/SKILL.md +69 -94
- package/skills/ultra-deliver/SKILL.md +37 -65
- package/skills/ultra-dev/SKILL.md +50 -52
- package/skills/ultra-doctor/SKILL.md +34 -49
- package/skills/ultra-init/SKILL.md +78 -105
- package/skills/ultra-plan/SKILL.md +78 -99
- package/skills/ultra-research/SKILL.md +99 -113
- package/skills/ultra-review/SKILL.md +38 -53
- package/skills/ultra-review/references/review-modes.md +5 -3
- package/skills/ultra-review/references/unified-schema.md +26 -6
- package/skills/ultra-review/scripts/review_wait.py +12 -0
- package/skills/ultra-status/SKILL.md +34 -44
- package/skills/ultra-test/SKILL.md +61 -54
- package/skills/ultra-think/SKILL.md +37 -51
- package/skills/ultra-think/references/decision-dialogue.md +87 -111
- package/spec/cli-protocol.md +35 -0
- package/spec/mcp-tools.yaml +145 -28
- package/spec/schemas/delivery-report.v1.schema.json +1 -46
- package/spec/schemas/state-db.sql +8 -2
- package/spec/schemas/test-report.v1.schema.json +45 -14
- package/ultra-tools/cli.cjs +1 -1
- package/ultra-tools/commands/session.cjs +10 -3
- package/ultra-tools/commands/status.cjs +19 -14
- package/ultra-tools/commands/system.cjs +2 -2
- package/ultra-tools/commands/task.cjs +3 -0
|
@@ -1,109 +1,82 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-init
|
|
3
|
-
description:
|
|
3
|
+
description: Create or recover Ultra project authority for a new repository, an existing codebase, or an older Ultra installation. Use when `.ultra` is absent, initialization is incomplete, or doctor reports a migration or initialization fault.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Ultra
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
`task.init_project`
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- `
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
The
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
research, missing discovery/product/architecture refs, stale evidence, revision or
|
|
84
|
-
worktree drift, unaccepted known failures, blocking unknowns, and blocking gaps. A
|
|
85
|
-
successful convergence atomically marks the baseline ready and completes the init run.
|
|
86
|
-
|
|
87
|
-
## Recovery
|
|
88
|
-
|
|
89
|
-
- Record deterministic blockers on the current workflow; never create a parallel run.
|
|
90
|
-
- Use `system.doctor` repair only for supported schema, projection, session, incident,
|
|
91
|
-
archive, or legacy workflow-provenance recovery. A recovered legacy change workflow
|
|
92
|
-
remains blocked for real baseline evidence; repair cannot invent research or approve
|
|
93
|
-
a baseline.
|
|
94
|
-
- Treat context budgets as advisory. Missing authority, evidence, output, or approval
|
|
95
|
-
is blocking.
|
|
96
|
-
- Store only references to external memory and code-graph providers.
|
|
97
|
-
|
|
98
|
-
## Completion
|
|
99
|
-
|
|
100
|
-
Read `baseline.get`, `workflow.get`, and `system.doctor` after convergence. Report
|
|
101
|
-
classification evidence, scope, revision, worktree snapshot, migration backups,
|
|
102
|
-
research run and output health, verification, gaps, approval, and one route.
|
|
103
|
-
|
|
104
|
-
Initialization is complete only when the baseline is `ready`, the init workflow is
|
|
105
|
-
`completed`, the research workflow is `completed`, and
|
|
106
|
-
`baseline.research_run_id` names that exact research run with healthy outputs. Route
|
|
107
|
-
every newly converged or already initialized baseline through `ultra-change`; planning
|
|
108
|
-
starts only after that command persists a complete Change Contract, profile, and
|
|
109
|
-
research disposition. Otherwise return the exact current workflow step or blocker.
|
|
6
|
+
# Initialize project authority
|
|
7
|
+
|
|
8
|
+
Initialization is a bounded setup capability. It creates or repairs the repository and
|
|
9
|
+
Ultra authority; it does not perform product research, approve a baseline, or choose
|
|
10
|
+
the next semantic workflow.
|
|
11
|
+
|
|
12
|
+
## Inspect before mutation
|
|
13
|
+
|
|
14
|
+
1. Identify the repository root, existing `.ultra` state, Git state, meaningful source,
|
|
15
|
+
monorepo boundaries, and current owner request.
|
|
16
|
+
2. If `.ultra/state.db` exists, run `system.doctor` read-only and resume with
|
|
17
|
+
`task.init_project` only when its report permits it.
|
|
18
|
+
3. Otherwise call `task.init_project` with `mode: "auto"`, the project name, and an
|
|
19
|
+
explicit scope only when the repository contains multiple plausible roots.
|
|
20
|
+
4. Leave `git_mode` as `auto` unless the user explicitly requires a non-Git workspace.
|
|
21
|
+
|
|
22
|
+
Use repository evidence to classify:
|
|
23
|
+
|
|
24
|
+
- `greenfield`: no meaningful delivered application behavior is present;
|
|
25
|
+
- `brownfield`: source, runtime, API, data, deployment, or tests describe an existing
|
|
26
|
+
maintained system;
|
|
27
|
+
- `migrated`: older Ultra authority was preserved but is not a trusted baseline.
|
|
28
|
+
|
|
29
|
+
The model may override an automatic classification only with evidence or an explicit
|
|
30
|
+
user decision. Classification must not infer product scope, an MVP, or a release plan.
|
|
31
|
+
|
|
32
|
+
## Interaction boundary
|
|
33
|
+
|
|
34
|
+
Read `../ultra-think/references/decision-dialogue.md` before asking a material question.
|
|
35
|
+
Inspect observable facts yourself. Use the host's native question UI when available and
|
|
36
|
+
plain direct interaction otherwise. Ask only when repository scope, replacement of
|
|
37
|
+
healthy authority, destructive recovery, or another material owner decision is truly
|
|
38
|
+
unresolved. Normalize clear intent already present in the request without asking again.
|
|
39
|
+
|
|
40
|
+
## Deterministic initialization contract
|
|
41
|
+
|
|
42
|
+
`task.init_project` owns these steps:
|
|
43
|
+
|
|
44
|
+
1. `inspect-authority`
|
|
45
|
+
2. `classify-repository`
|
|
46
|
+
3. `scaffold-authority`
|
|
47
|
+
4. `verify-initialization`
|
|
48
|
+
|
|
49
|
+
The operation must:
|
|
50
|
+
|
|
51
|
+
- create or migrate `.ultra/state.db` with a backup before schema migration;
|
|
52
|
+
- install only missing scaffold assets on resume;
|
|
53
|
+
- preserve existing artifacts and unrelated work;
|
|
54
|
+
- preserve an existing Git repository and HEAD;
|
|
55
|
+
- initialize Git and a safe `.gitignore` entry when Git is absent;
|
|
56
|
+
- report an unborn repository as `initial_commit_required` without manufacturing a
|
|
57
|
+
commit, remote, tag, or push;
|
|
58
|
+
- read back the created DB, classification, projection, and Git result before
|
|
59
|
+
completing the init workflow.
|
|
60
|
+
|
|
61
|
+
Projection-only projects must use the exact backup-first migration command returned by
|
|
62
|
+
the runtime. A migrated compatibility baseline requires a new brownfield adoption with
|
|
63
|
+
`replace_migrated: true`. Replacing a healthy baseline requires explicit replacement
|
|
64
|
+
authority. Corrupt DB, WAL, SHM, and backups must be preserved until the user chooses a
|
|
65
|
+
documented recovery operation.
|
|
66
|
+
|
|
67
|
+
## Completion and handoff
|
|
68
|
+
|
|
69
|
+
Initialization is complete when the init workflow is `completed`, the current schema is
|
|
70
|
+
healthy, the scaffold is readable, and repository classification and Git state are
|
|
71
|
+
durable. Research status may still be `not_started`; that is not incomplete init.
|
|
72
|
+
|
|
73
|
+
Read the returned `allowed_transitions` and `required_transition`:
|
|
74
|
+
|
|
75
|
+
- a required transition represents a hard recovery invariant and must be followed;
|
|
76
|
+
- otherwise the host model recommends among the allowed capabilities using the user's
|
|
77
|
+
goal and current evidence;
|
|
78
|
+
- start `ultra-research` only when the user invoked it or the host selects it after init.
|
|
79
|
+
|
|
80
|
+
Report classification, scope, schema and backup result, Git state, init workflow id,
|
|
81
|
+
baseline state, and allowed transitions. Do not claim that a baseline is ready until a
|
|
82
|
+
separate research/adoption workflow has recorded and converged it.
|
|
@@ -1,103 +1,82 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-plan
|
|
3
|
-
description:
|
|
3
|
+
description: Turn an accepted Ultra Change Contract into dependency-valid, DB-backed vertical task contracts. Use when research obligations are resolved and implementation needs an executable plan.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
2. Require
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
a contract blocker.
|
|
84
|
-
|
|
85
|
-
Call `task.dependency_topo` with the current `change_id`, then call
|
|
86
|
-
`plan.export` with `change_id`, `format: "json"`, and
|
|
87
|
-
`out_path: ".ultra/execution-plan.json"`. Export records `plan_exported`; it does
|
|
88
|
-
not approve the plan. Read the same change back with `plan.get`.
|
|
89
|
-
The exported artifact is change-bound and may not include tasks from another active
|
|
90
|
-
or historical change. Recompile `change.context`
|
|
91
|
-
for the first task; it derives its execution contract and context refs from DB and
|
|
92
|
-
rejects a conflicting prompt override. Missing required refs block readiness; context
|
|
93
|
-
size is advisory.
|
|
94
|
-
|
|
95
|
-
Record `verify-plan` with `.ultra/execution-plan.json` as its sole output, then call
|
|
96
|
-
`workflow.complete` with
|
|
97
|
-
`approval.approved_by` and `approval.approval_note`. Do not send a task summary: MCP
|
|
98
|
-
derives the complete task set from every task owned by the change. Completion
|
|
99
|
-
revalidates every task contract, change ownership, dependency existence, graph cycles,
|
|
100
|
-
the exact exported topology, approval, and current output digests; it also advances
|
|
101
|
-
the linked change workflow to context compilation.
|
|
102
|
-
Return the persisted topology, first task/public seam,
|
|
103
|
-
approval evidence, plan workflow id, and one `ultra-dev` route.
|
|
6
|
+
# Build an executable plan
|
|
7
|
+
|
|
8
|
+
The model owns decomposition and technical design. MCP owns plan state, task contracts,
|
|
9
|
+
dependency integrity, output digests, and recovery. Planning must stay inside the
|
|
10
|
+
accepted Change Contract without adding ceremonial approval.
|
|
11
|
+
|
|
12
|
+
## Bind current authority
|
|
13
|
+
|
|
14
|
+
1. Read doctor, baseline, change, decisions, existing plan runs, tasks, and current
|
|
15
|
+
checkout.
|
|
16
|
+
2. Require one mutable change with a healthy baseline or recorded incident bypass.
|
|
17
|
+
3. Complete the exact change-bound research disposition before planning.
|
|
18
|
+
4. Resume the matching plan run or start one bound to the change and baseline.
|
|
19
|
+
|
|
20
|
+
Read `references/semantic-preflight.md` and inspect requirements, real consumers,
|
|
21
|
+
state, tests, deployment, and recovery paths.
|
|
22
|
+
|
|
23
|
+
## Design with model autonomy
|
|
24
|
+
|
|
25
|
+
Build a candidate plan privately. Ask the user only if the plan would change accepted
|
|
26
|
+
scope, public behavior, compatibility, security, material cost, external effects, or
|
|
27
|
+
recovery. Use the host's native question UI when available and the interaction protocol
|
|
28
|
+
in `../ultra-think/references/decision-dialogue.md`.
|
|
29
|
+
|
|
30
|
+
When the candidate remains inside the accepted Change Contract, proceed without a
|
|
31
|
+
second approval. A user may still request a plan review before persistence; that is an
|
|
32
|
+
interaction preference, not a runtime invariant.
|
|
33
|
+
|
|
34
|
+
Record:
|
|
35
|
+
|
|
36
|
+
1. `validate-baseline`
|
|
37
|
+
2. `analyze-requirements`
|
|
38
|
+
3. `analyze-codebase`
|
|
39
|
+
4. `design-slices`
|
|
40
|
+
5. `validate-dependencies`
|
|
41
|
+
6. `persist-task-contracts`
|
|
42
|
+
7. `verify-plan`
|
|
43
|
+
|
|
44
|
+
Design a walking skeleton and subsequent vertical slices. Every slice reaches a real
|
|
45
|
+
consumer and owns its validation, side effects, errors, documentation, migration,
|
|
46
|
+
observability, and recovery obligations. Avoid unconsumed horizontal scaffolding.
|
|
47
|
+
|
|
48
|
+
## Persist task contracts
|
|
49
|
+
|
|
50
|
+
Create each task with:
|
|
51
|
+
|
|
52
|
+
- observable outcome and stable trace;
|
|
53
|
+
- `slice_kind`, public seam, and exact verification command;
|
|
54
|
+
- structured acceptance mapped to Change acceptance ids;
|
|
55
|
+
- bounded context refs and reasons;
|
|
56
|
+
- documentation impact, ownership, dependencies, and affected files when known.
|
|
57
|
+
|
|
58
|
+
Use estimates only when evidence supports them. A quick change has exactly one task.
|
|
59
|
+
Read every task back from DB. Never read or write `.ultra/tasks/tasks.json` directly;
|
|
60
|
+
it is a generated projection, not authority.
|
|
61
|
+
|
|
62
|
+
If a semantic `change.update` invalidated existing tasks, reconcile every affected
|
|
63
|
+
task contract against the current intent, acceptance, decisions, and research
|
|
64
|
+
evidence. Rebind the complete execution contract while clearing `stale` through
|
|
65
|
+
`task.update`; MCP rejects a marker-only clear, validates the read-back, and records
|
|
66
|
+
the current Change authority digest. Never clear staleness merely to pass a gate.
|
|
67
|
+
|
|
68
|
+
Validate the change-scoped graph with `task.dependency_topo`. Export
|
|
69
|
+
`.ultra/execution-plan.json` with `plan.export`, read it through `plan.get`, and record
|
|
70
|
+
it as the `verify-plan` output.
|
|
71
|
+
|
|
72
|
+
Call `workflow.complete`. `approval` is optional: include it only when a material plan
|
|
73
|
+
decision actually required and received user approval. MCP derives task coverage and
|
|
74
|
+
topology from DB and must reject incomplete contracts, uncovered acceptance, cycles,
|
|
75
|
+
cross-change tasks, stale research, or a mismatched export.
|
|
76
|
+
|
|
77
|
+
Do not advance or complete the Change workflow; change capture is already complete.
|
|
78
|
+
Compile task context later for the consumer that needs it.
|
|
79
|
+
|
|
80
|
+
Return topology, first executable slices, public seams, verification commands, plan
|
|
81
|
+
workflow id, and allowed transitions. The host may recommend parallel or sequential
|
|
82
|
+
execution based on dependency and conflict evidence.
|