ultra-builder-pro-cli 0.15.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.
Files changed (71) hide show
  1. package/.ultra-template/specs/research-distillate.md +4 -3
  2. package/CHANGELOG.md +120 -1
  3. package/README.md +67 -30
  4. package/adapters/_shared/codex-assets.cjs +10 -5
  5. package/adapters/_shared/handbook.cjs +3 -2
  6. package/adapters/_shared/interaction-contract.cjs +61 -0
  7. package/adapters/claude.js +1 -1
  8. package/adapters/opencode.js +1 -1
  9. package/bin/orchestrator.js +175 -19
  10. package/commands/ultra-change.md +1 -1
  11. package/commands/ultra-deliver.md +3 -3
  12. package/commands/ultra-init.md +1 -1
  13. package/commands/ultra-plan.md +1 -1
  14. package/commands/ultra-research.md +2 -2
  15. package/commands/ultra-review.md +10 -0
  16. package/commands/ultra-status.md +1 -1
  17. package/commands/ultra-test.md +1 -1
  18. package/commands/ultra-think.md +2 -2
  19. package/docs/AGENT-CONTEXT.md +38 -18
  20. package/docs/ARCHITECTURE.md +91 -13
  21. package/docs/LEGACY-CLI-CROSSWALK.md +163 -0
  22. package/docs/PLAN.zh-CN.md +19 -12
  23. package/docs/ROADMAP.md +5 -3
  24. package/docs/RUNTIME-COMPAT-MATRIX.md +4 -4
  25. package/docs/STATE-DB-ACCESS-POLICY.md +8 -6
  26. package/docs/USER-HANDBOOK-CONTRACT.md +8 -2
  27. package/docs/WORKFLOW-LIFECYCLE.md +179 -39
  28. package/hooks/pre_stop_check.py +3 -2
  29. package/mcp-server/lib/baseline-workflow.cjs +84 -16
  30. package/mcp-server/lib/change-workflow.cjs +107 -39
  31. package/mcp-server/lib/context-spine.cjs +215 -87
  32. package/mcp-server/lib/decision-dialogue.cjs +713 -0
  33. package/mcp-server/lib/doctor.cjs +9 -0
  34. package/mcp-server/lib/git-bootstrap.cjs +240 -0
  35. package/mcp-server/lib/init-project.cjs +178 -41
  36. package/mcp-server/lib/project-breadcrumb.cjs +23 -14
  37. package/mcp-server/lib/state-db.cjs +279 -9
  38. package/mcp-server/lib/state-ops.cjs +64 -1
  39. package/mcp-server/lib/workflow-state.cjs +313 -205
  40. package/mcp-server/server.cjs +112 -34
  41. package/orchestrator/auto-merge.cjs +19 -0
  42. package/orchestrator/daemon.cjs +104 -0
  43. package/orchestrator/parallel-orchestrator.cjs +371 -49
  44. package/orchestrator/session-runner.cjs +354 -25
  45. package/package.json +2 -1
  46. package/skills/ultra-change/SKILL.md +69 -65
  47. package/skills/ultra-deliver/SKILL.md +37 -58
  48. package/skills/ultra-dev/SKILL.md +55 -49
  49. package/skills/ultra-doctor/SKILL.md +44 -49
  50. package/skills/ultra-init/SKILL.md +78 -100
  51. package/skills/ultra-plan/SKILL.md +78 -79
  52. package/skills/ultra-research/SKILL.md +99 -98
  53. package/skills/ultra-review/SKILL.md +38 -47
  54. package/skills/ultra-review/references/review-modes.md +5 -3
  55. package/skills/ultra-review/references/unified-schema.md +26 -6
  56. package/skills/ultra-review/scripts/review_wait.py +12 -0
  57. package/skills/ultra-status/SKILL.md +34 -40
  58. package/skills/ultra-test/SKILL.md +61 -48
  59. package/skills/ultra-think/SKILL.md +47 -47
  60. package/skills/ultra-think/references/decision-dialogue.md +106 -0
  61. package/spec/cli-protocol.md +46 -2
  62. package/spec/mcp-tools.yaml +444 -29
  63. package/spec/schemas/delivery-report.v1.schema.json +1 -46
  64. package/spec/schemas/mcp-tools.schema.json +1 -1
  65. package/spec/schemas/state-db.sql +66 -2
  66. package/spec/schemas/test-report.v1.schema.json +45 -14
  67. package/ultra-tools/cli.cjs +1 -1
  68. package/ultra-tools/commands/session.cjs +10 -3
  69. package/ultra-tools/commands/status.cjs +34 -14
  70. package/ultra-tools/commands/system.cjs +2 -2
  71. package/ultra-tools/commands/task.cjs +3 -0
@@ -1,83 +1,82 @@
1
1
  ---
2
2
  name: ultra-plan
3
- description: Convert a ready Ultra baseline or approved active-change delta into dependency-valid, DB-backed execution contracts and fresh-context vertical slices. Use when accepted requirements are ready for implementation planning or an existing plan must be resumed and verified.
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
- # Persist an executable plan
7
-
8
- Use host reasoning for decomposition, tradeoffs, and approval. Use Ultra MCP for
9
- workflow position, task contracts, graph validation, projection, and recovery.
10
-
11
- ## Bind authority
12
-
13
- 1. Call `system.doctor`, `baseline.get`, `change.list`, and `change.breadcrumb`.
14
- 2. Require a current ready baseline for new ordinary work. Resume an already-authorized
15
- active change when appropriate; an incident uses only its recorded break-glass
16
- authority.
17
- 3. Ensure exactly one active change owns the plan. For initial implementation, open a
18
- standard or major change from the accepted baseline before creating tasks.
19
- 4. Read `references/semantic-preflight.md`. Resolve every blocking Change decision and
20
- complete the exact recorded bounded research selection before starting the plan.
21
- 5. Resume the active `plan` workflow from `workflow.list`, or call `workflow.start`
22
- with its `baseline_id`, `change_id`, subject, and source refs.
23
-
24
- ## Plan through the durable steps
25
-
26
- Record each completed step with `workflow.step`:
27
-
28
- 1. `validate-baseline`: verify baseline and completed research provenance.
29
- 2. `select-posture`: preserve the owner-approved scope and delivery posture. Never
30
- infer an MVP, reduction, phase, or exclusion. Ask only when a proposed plan changes
31
- accepted scope, cost, risk, compatibility, or delivery semantics.
32
- 3. `analyze-requirements`: trace stable requirement ids to acceptance and public seams.
33
- 4. `analyze-codebase`: inspect current entry points, consumers, patterns, state
34
- authority, tests, deployment, and recovery paths before designing new structure.
35
- 5. `design-slices`: design a walking skeleton and subsequent vertical slices. Every
36
- slice must reach a real consumer; include validation, side effects, errors,
37
- documentation, migration, observability, and recovery in the owning slice.
38
- 6. `validate-dependencies`: validate ownership, missing dependencies, cycles, conflict
39
- surfaces, and meaningful integration checkpoints.
40
- 7. `approve-plan`: persist owner approval when the plan makes a material decision.
41
-
42
- ## Persist complete task contracts
43
-
44
- Call `task.create` for each approved task with:
45
-
46
- - one observable `outcome` and stable `trace_to`;
47
- - `slice_kind`, `public_seam`, and exact `verification_command`;
48
- - structured `acceptance` items with their verification;
49
- - bounded `context_refs` with reasons;
50
- - resolved `docs_impact` and durable `ownership`;
51
- - dependencies, affected files when known, estimates only when evidence supports them,
52
- and the owning `change_id`.
53
-
54
- Copy each Change acceptance id into at least one task acceptance item without changing
55
- its meaning. Set `trace_to` to that accepted id, a current research semantic id, or a
56
- real project-relative Markdown `path#anchor`. A quick profile has exactly one task.
57
- The MCP derives the coverage matrix and rejects uncovered acceptance, orphan tasks,
58
- stale research, and oversized quick plans.
59
-
60
- Never read or write `.ultra/tasks.json` or generated context Markdown as authority.
61
- The DB owns the task contract and the projector regenerates both views.
62
- `persist-task-contracts` completes only after `task.get` reads every field back without
63
- a contract blocker.
64
-
65
- Call `task.dependency_topo` with the current `change_id`, then call
66
- `plan.export` with `change_id`, `format: "json"`, and
67
- `out_path: ".ultra/execution-plan.json"`. Export records `plan_exported`; it does
68
- not approve the plan. Read the same change back with `plan.get`.
69
- The exported artifact is change-bound and may not include tasks from another active
70
- or historical change. Recompile `change.context`
71
- for the first task; it derives its execution contract and context refs from DB and
72
- rejects a conflicting prompt override. Missing required refs block readiness; context
73
- size is advisory.
74
-
75
- Record `verify-plan` with `.ultra/execution-plan.json` as its sole output, then call
76
- `workflow.complete` with
77
- `approval.approved_by` and `approval.approval_note`. Do not send a task summary: MCP
78
- derives the complete task set from every task owned by the change. Completion
79
- revalidates every task contract, change ownership, dependency existence, graph cycles,
80
- the exact exported topology, approval, and current output digests; it also advances
81
- the linked change workflow to context compilation.
82
- Return the persisted topology, first task/public seam,
83
- 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.
@@ -1,102 +1,103 @@
1
1
  ---
2
2
  name: ultra-research
3
- description: Establish or extend an evidence-backed Ultra product and architecture baseline through the complete semantic research workflow, with resumable step state and traceable outputs. Use when initialization routes to research, baseline evidence is incomplete, or the owner explicitly requests bounded research for an active change.
3
+ description: Build or refresh an evidence-backed product and architecture baseline with model-selected semantic coverage and low-load user alignment. Use when initialization, brownfield adoption, or an active change has a real evidence gap.
4
4
  ---
5
5
 
6
- # Establish research authority
7
-
8
- Use host reasoning for evidence gathering, product judgment, questions, and artifact
9
- content. Use Ultra MCP for run selection, state transitions, output digests, blockers,
10
- and baseline convergence. Never ask MCP to generate research content.
11
-
12
- ## Bind the run
13
-
14
- 1. Call `baseline.get`. Route absent, migrated, unreadable, or corrupt authority to
15
- `ultra-init` or `ultra-doctor` as reported.
16
- 2. Call `workflow.list` for `kind: "research"` and the bound baseline or change. Resume
17
- the active, blocked, or ready run; use `workflow.get` before doing more work.
18
- 3. When no run exists:
19
- - start `full` for an initial greenfield baseline;
20
- - start `adoption` for a brownfield baseline;
21
- - use `product`, `feature`, `architecture`, or `custom` only when the owner
22
- explicitly selected that bounded scope for an active change.
23
-
24
- Never infer an MVP, reduced product posture, skipped step, or release phase. Full and
25
- adoption modes execute all seventeen semantic steps. A custom run records every
26
- excluded step and its selection reason in DB.
27
-
28
- ## Execute one recoverable step at a time
29
-
30
- Read only the reference matching `workflow.next_step.step_id`:
31
-
32
- | Step | Reference |
33
- |---|---|
34
- | `00-problem-validation` | `references/00-problem-validation.md` |
35
- | `01-opportunity-discovery` | `references/01-opportunity-discovery.md` |
36
- | `02-market-assessment` | `references/02-market-assessment.md` |
37
- | `03-competitive-landscape` | `references/03-competitive-landscape.md` |
38
- | `04-product-strategy` | `references/04-product-strategy.md` |
39
- | `05-assumptions-validation` | `references/05-assumptions-validation.md` |
40
- | `10-user-personas` | `references/10-user-personas.md` |
41
- | `11-user-scenarios` | `references/11-user-scenarios.md` |
42
- | `20-user-stories` | `references/20-user-stories.md` |
43
- | `21-features-scope` | `references/21-features-scope.md` |
44
- | `22-success-metrics` | `references/22-success-metrics.md` |
45
- | `30-architecture-context` | `references/30-architecture-context.md` |
46
- | `31-solution-strategy` | `references/31-solution-strategy.md` |
47
- | `32-building-blocks` | `references/32-building-blocks.md` |
48
- | `40-deployment` | `references/40-deployment.md` |
49
- | `41-quality-risks` | `references/41-quality-risks.md` |
50
- | `99-synthesis` | `references/99-synthesis.md` |
51
-
52
- For each selected step:
53
-
54
- 1. Inspect current repository and specification evidence before asking the owner to
55
- repeat known facts. Browse only for unstable or external claims, using primary
56
- sources where possible.
57
- 2. Separate `Observed`, `Verified`, `Decided`, and `Unknown`. Ask one concise question
58
- only when the answer changes scope, product intent, security, cost, or another
59
- load-bearing decision.
60
- 3. Update the relevant baseline specification or active change research artifact.
61
- Preserve citations, decisions, drift, and unresolved gaps without duplicating prose.
62
- 4. Write one immutable step report at
63
- `.ultra/docs/research/<workflow-id>/<step-id>.md`. It must have a title and the
64
- sections `Evidence`, `Specification updates`, and `Decisions and unknowns`. Link
65
- specification anchors and external sources; do not copy transcripts or provider
66
- payloads.
67
- 5. Call `workflow.step` with `completed`, bounded evidence references, that step report
68
- as `research-step-report`, material decisions, and one or more `semantic_records`.
69
- Each record has a stable `id`, the step-specific `kind` and `attributes` named in
70
- its reference, a status (`observed`, `verified`, `decided`, `accepted`, `unknown`,
71
- or `not_applicable`), a concise summary, evidence refs, optional typed links, and a
72
- project-relative `source_ref` using `path#anchor`. Use the immutable step report as
73
- the source when later edits could change a shared specification. MCP verifies the
74
- anchor and stores its digest; `not_applicable` requires an evidence-backed rationale.
75
- 6. For `99-synthesis` in `full` or `adoption` mode, also bind the current
76
- `discovery.md`, `product.md`, `architecture.md`, and `research-distillate.md` as
77
- outputs. This freezes the exact researched baseline without making the reports a
78
- second specification authority.
79
- 7. If evidence or owner authority is missing, call `workflow.step` with `blocked` and
80
- specific blocker codes. Resume that same step after resolution; never skip a
81
- required step to obtain a ready state.
82
-
83
- ## Converge
84
-
85
- When all selected steps are ready, call `workflow.complete` and read the completed run
86
- back. Missing or stale output blocks completion.
87
-
88
- For initial or adoption research, call `baseline.record` with discovery, product, and
89
- architecture specification refs; current repository revision and scope; bounded source,
90
- docs, runtime, test, deployment, and external evidence; actual verification commands
91
- and results; unknowns; the complete gap ledger; classification; and external provider
92
- metadata references. Do not store prompts, transcripts, memory, or graph content.
93
-
94
- Present the recorded revision, worktree snapshot, known failures, blockers, and gaps.
95
- Only after explicit owner approval call `baseline.converge`. Accept known-red or a
96
- dirty worktree only when that exact snapshot was approved. Convergence must verify the
97
- completed full/adoption research run and current output digests.
98
-
99
- Return the workflow id, all seventeen step-report paths for full/adoption research,
100
- the four synthesis artifacts, baseline status, open gaps, approval state, and one exact
101
- next route. A ready initial baseline routes to `ultra-change`; bounded change research
102
- returns to its change breadcrumb and then `ultra-plan` when the research gate is ready.
6
+ # Research with adaptive coverage
7
+
8
+ The host model owns investigation, synthesis, and coverage judgment. Ultra MCP owns the
9
+ run, evidence references, semantic records, artifact digests, freshness, and
10
+ convergence. The seventeen areas are a coverage catalog, not a mandatory questionnaire
11
+ or a fixed sequence of user conversations.
12
+
13
+ Read `../ultra-think/references/decision-dialogue.md` before asking a material question.
14
+
15
+ ## Bind authority
16
+
17
+ 1. Read `system.doctor`, `baseline.get`, active decisions, and existing research runs.
18
+ 2. Resume the matching active, blocked, or ready run. Do not create parallel authority.
19
+ 3. If none exists, select:
20
+ - `full` for a greenfield baseline;
21
+ - `adoption` for a brownfield baseline;
22
+ - a bounded mode only for a recorded active-change research disposition.
23
+ 4. Before `workflow.start`, inspect current code, docs, tests, runtime, and prior
24
+ artifacts. Provide one disposition for every catalog area in `full` or `adoption`:
25
+ - `execute`: produce fresh evidence;
26
+ - `verify_existing`: verify a current artifact against its source;
27
+ - `reuse`: reuse evidence that is still current;
28
+ - `not_applicable`: exclude with an evidence reference and rationale;
29
+ - `deferred`: record the consequence and owner acceptance when deferral changes the
30
+ accepted scope or leaves material risk.
31
+
32
+ `99-synthesis` must execute, verify, or reuse. A missing disposition is a coverage
33
+ error; a non-executed area with evidence is not an incomplete workflow.
34
+
35
+ ## Coverage catalog
36
+
37
+ Load only the reference for a step that must execute, verify, or reuse:
38
+
39
+ | Area | Reference | Area | Reference |
40
+ |---|---|---|---|
41
+ | `00-problem-validation` | `references/00-problem-validation.md` | `01-opportunity-discovery` | `references/01-opportunity-discovery.md` |
42
+ | `02-market-assessment` | `references/02-market-assessment.md` | `03-competitive-landscape` | `references/03-competitive-landscape.md` |
43
+ | `04-product-strategy` | `references/04-product-strategy.md` | `05-assumptions-validation` | `references/05-assumptions-validation.md` |
44
+ | `10-user-personas` | `references/10-user-personas.md` | `11-user-scenarios` | `references/11-user-scenarios.md` |
45
+ | `20-user-stories` | `references/20-user-stories.md` | `21-features-scope` | `references/21-features-scope.md` |
46
+ | `22-success-metrics` | `references/22-success-metrics.md` | `30-architecture-context` | `references/30-architecture-context.md` |
47
+ | `31-solution-strategy` | `references/31-solution-strategy.md` | `32-building-blocks` | `references/32-building-blocks.md` |
48
+ | `40-deployment` | `references/40-deployment.md` | `41-quality-risks` | `references/41-quality-risks.md` |
49
+ | `99-synthesis` | `references/99-synthesis.md` | | |
50
+
51
+ ## Investigate and interact
52
+
53
+ For each active area:
54
+
55
+ 1. Resolve observable facts from the checkout, runtime, tests, existing specifications,
56
+ and primary sources. Separate `Observed`, `Verified`, `Decided`, and `Unknown`.
57
+ 2. Ask the user only for a material intent, scope, compatibility, risk, or recovery
58
+ decision that evidence cannot answer. Use the host's native question UI when
59
+ available. Present the recommendation and effect; avoid a questionnaire or a dump
60
+ of the hidden research queue.
61
+ 3. Process dependent decisions one at a time. A small group of independent,
62
+ low-cognitive-load facts may be asked together when the host UI supports it.
63
+ 4. Normalize explicit user intent without redundant confirmation. Create durable
64
+ decision state only when a project-bound decision must survive interruption.
65
+ 5. Update the smallest relevant baseline specification or active-change research
66
+ artifact. Do not copy prompts, transcripts, provider payloads, or internal chain of
67
+ thought.
68
+
69
+ For every required workflow step, write
70
+ `.ultra/docs/research/<workflow-id>/<step-id>.md` with `Evidence`,
71
+ `Specification updates`, and `Decisions and unknowns`. Call `workflow.step` with
72
+ bounded evidence, the report output, and typed semantic records. Reused or verified
73
+ evidence must still produce a current report and digest. Block the same step when
74
+ required evidence or owner authority is missing.
75
+
76
+ At synthesis, bind the current `discovery.md`, `product.md`, `architecture.md`, and
77
+ `research-distillate.md` for initial/adoption research.
78
+
79
+ ## Baseline convergence
80
+
81
+ After `workflow.complete`, initial or adoption research calls `baseline.record` with
82
+ the current repository scope and revision, specification refs, evidence, real
83
+ verification results, unknowns, gap ledger, classification, and external provider
84
+ metadata references.
85
+
86
+ If Git is initialized but unborn, present the exact local checkpoint paths and purpose
87
+ for user authorization, then create only that local commit. Never create a remote,
88
+ tag, or push through research. If authorization or identity is missing, preserve the
89
+ run as blocked with `BASELINE_GIT_HEAD_REQUIRED`.
90
+
91
+ Call `baseline.converge` only when the user has accepted the exact baseline snapshot,
92
+ known failures, blocking gaps, and scope. Reuse an unambiguous current approval; do not
93
+ ask twice. MCP must reject stale research, drift, missing evidence, and unaccepted
94
+ failures.
95
+
96
+ Reuse the final research checkpoint approval during baseline convergence; do not ask
97
+ for an equivalent approval again. After initial or adoption convergence,
98
+ `ultra-change` becomes an available transition. Bounded change research returns to
99
+ its owning Change authority.
100
+
101
+ Return a compact coverage summary by disposition, current evidence or decision
102
+ blocker, baseline state, gaps, and allowed transitions. The host chooses the semantic
103
+ recommendation; MCP supplies only valid and required transitions.
@@ -1,65 +1,56 @@
1
1
  ---
2
2
  name: ultra-review
3
- description: Run independent specification-fidelity and engineering reviews over one current Ultra diff and persist bounded review evidence. Use when a task or change needs a read-only review gate before completion, convergence, or delivery.
3
+ description: Independently review one current Ultra plan, task diff, or aggregate change on specification fidelity and engineering standards. Use when current evidence needs a review gate or focused risk analysis.
4
4
  ---
5
5
 
6
- # Review one current diff
6
+ # Review one bounded scope
7
7
 
8
- Keep two verdict axes independent:
8
+ Keep two independent verdict axes:
9
9
 
10
- - `spec_fidelity`: accepted intent, delta, behavior, docs impact, and public seam;
11
- - `engineering_standards`: correctness, safety, tests, maintainability, observability,
12
- integration, and recovery.
10
+ - `spec_fidelity`: accepted intent, behavior, documentation impact, and public seams;
11
+ - `engineering_standards`: correctness, safety, tests, integration, maintainability,
12
+ observability, and recovery.
13
13
 
14
- One axis cannot compensate for the other.
14
+ Neither axis can compensate for the other.
15
15
 
16
- ## Bind durable scope
16
+ ## Bind evidence
17
17
 
18
- 1. Read `references/review-modes.md`. Select exactly one review mode: `task` for one
19
- implementation slice, `change` for aggregate delivery readiness, or `plan` for an
20
- approved plan before implementation. Bind only the evidence defined by that mode.
21
- 2. Resolve one explicit diff range, current full HEAD, change, task set, and accepted
22
- evidence. Stop on an empty or ambiguous scope.
23
- 3. Resume or start a `review` workflow. Record `bind-diff` with revision, paths, mode,
24
- and task set.
25
- 4. Compile `change.context` for `review` using only accepted intent, delta, task
26
- contracts, tests, public seams, and diff paths. Record `compile-context` only when
27
- ready, with the immutable context manifest as the step output.
28
- 5. Create `.ultra/reviews/<session-id>/` with mode, change id, exact task ids, full HEAD,
29
- worktree digest, diff range, scope metadata, and pending verdicts.
18
+ 1. Read `references/review-modes.md` and select `plan`, `task`, or `change` from the
19
+ actual review request.
20
+ 2. Bind one explicit diff or plan artifact, full HEAD, worktree digest, task set,
21
+ acceptance, and current decision state.
22
+ 3. Resume or start the review workflow and record `bind-diff`.
23
+ 4. Compile `change.context` for `review` and record the immutable manifest under
24
+ `compile-context`.
30
25
 
31
- ## Execute independent axes
26
+ An empty, ambiguous, or stale scope cannot pass.
32
27
 
33
- Always run the bounded `review-spec` worker for specification fidelity. Select the
34
- smallest necessary engineering workers using the mode and risk matrix; a change review
35
- for delivery runs every applicable role. Record every selected and skipped role with a
36
- scope-specific rationale. Invoke them through the current host's native bounded-worker
37
- mechanism. Keep workers independent and pass only the current diff plus their role
38
- context.
28
+ ## Select workers by risk
39
29
 
40
- Resolve `references/unified-schema.md` from this Skill directory and pass its absolute
41
- path as `SCHEMA_PATH`. Validate artifacts with `scripts/review_wait.py`; a missing,
42
- invalid, stale, or partial required artifact is not a pass.
30
+ Always run `review-spec`. Select the smallest engineering worker set that covers the
31
+ actual diff and risk. Record every selected and excluded worker with a specific
32
+ rationale; do not run every specialist ceremonially.
43
33
 
44
- Record:
34
+ Invoke workers through the current host's native bounded-worker mechanism and pass
35
+ only their role, current scope, and relevant evidence. Workers are read-only and may
36
+ not decide owner choices or edit source.
45
37
 
46
- - `review-specification` with `spec-fidelity.json` as an output;
47
- - `review-engineering` with every selected engineering artifact as outputs;
48
- - `coordinate-findings` with the coordinated summary output.
38
+ Resolve `references/unified-schema.md` from this Skill directory and pass its absolute
39
+ path as `SCHEMA_PATH`. Validate specialist artifacts with
40
+ `scripts/review_wait.py`. Record outputs under `review-specification`,
41
+ `review-engineering`, and `coordinate-findings`.
49
42
 
50
- The coordinator preserves every specialist finding unchanged in `SUMMARY.json`.
51
- Duplicate root causes may be grouped only in the human-readable summary. Review is
52
- read-only except for review artifacts; implementation fixes are a separate dev action.
43
+ The coordinator preserves every finding unchanged in `SUMMARY.json`; it may group
44
+ duplicate root causes only in the human summary. A new material owner choice remains a
45
+ finding and routes to the interaction protocol.
53
46
 
54
- ## Verify and complete
47
+ ## Complete
55
48
 
56
- Recheck reviewed HEAD, worktree digest, review-context digest, diff, acceptance, task
57
- set, artifact schemas, and both verdicts. Record `verify-review-gate`, then call
58
- `workflow.complete`. MCP
59
- derives each axis and the durable verdict from the specialist outputs, then requires
60
- `SUMMARY.json` to match their complete finding set. Prompt claims and a lossy
61
- coordinator summary cannot replace either axis. Any code, test, spec, or contract edit
62
- invalidates affected review evidence and requires a new or resumed run.
49
+ Recheck HEAD, worktree, context digest, diff, task set, acceptance, artifact schemas,
50
+ and both axes. Record `verify-review-gate`, then call `workflow.complete`. MCP derives
51
+ the durable verdict and rejects missing specialists, lossy coordination, stale
52
+ artifacts, or prompt-supplied conclusions.
63
53
 
64
- Return both axis verdicts first, blocking findings, reviewed revision and paths,
65
- artifact digests, workflow id, skipped-role rationale, and one exact next route.
54
+ Any relevant code, test, specification, or contract edit invalidates the affected
55
+ review evidence. Return both verdict axes, blocking findings, reviewed scope, worker
56
+ selection rationale, artifact digests, and allowed transitions.
@@ -22,6 +22,8 @@ may be skipped with a concrete rationale.
22
22
 
23
23
  ## Selection record
24
24
 
25
- For every available worker, record `selected` or `skipped` and a rationale tied to the
26
- mode, changed paths, public seam, and risk flags. A role is applicable when its evidence
27
- could change either verdict axis. Tool availability alone is not a selection reason.
25
+ Disposition the complete specialist roster: `review-spec`, `review-code`,
26
+ `review-tests`, `review-errors`, `review-design`, and `review-comments`. Record each as
27
+ `selected` or `skipped` with a rationale tied to the mode, changed paths, public seam,
28
+ and risk flags. A role is applicable when its evidence could change either verdict
29
+ axis. Tool availability alone is not a selection reason.
@@ -87,9 +87,9 @@ preference as a defect. Preserve the source specialist's severity during coordin
87
87
  }
88
88
  },
89
89
  "workers": {
90
- "completed": ["review-code", "review-tests"],
90
+ "completed": ["review-spec", "review-code", "review-tests"],
91
91
  "failed": [],
92
- "skipped": []
92
+ "skipped": ["review-errors", "review-design", "review-comments"]
93
93
  },
94
94
  "worker_selection": [
95
95
  {
@@ -97,6 +97,26 @@ preference as a defect. Preserve the source specialist's severity during coordin
97
97
  "status": "selected",
98
98
  "rationale": "The specification axis is required for every review mode."
99
99
  },
100
+ {
101
+ "worker": "review-code",
102
+ "status": "selected",
103
+ "rationale": "The runtime diff changes executable behavior."
104
+ },
105
+ {
106
+ "worker": "review-tests",
107
+ "status": "selected",
108
+ "rationale": "The accepted behavior depends on changed test evidence."
109
+ },
110
+ {
111
+ "worker": "review-errors",
112
+ "status": "skipped",
113
+ "rationale": "The diff does not change an error, fallback, or recovery path."
114
+ },
115
+ {
116
+ "worker": "review-design",
117
+ "status": "skipped",
118
+ "rationale": "The bounded change does not alter module or data-flow boundaries."
119
+ },
100
120
  {
101
121
  "worker": "review-comments",
102
122
  "status": "skipped",
@@ -112,10 +132,10 @@ preference as a defect. Preserve the source specialist's severity during coordin
112
132
  `findings` must contain every specialist finding unchanged. Group duplicates only in
113
133
  the human-readable summary; never delete or merge machine-readable records.
114
134
 
115
- `mode` is `task`, `change`, or `plan`. `worker_selection` contains every selected or
116
- skipped worker exactly once with a scope-specific rationale. Its selected set equals
117
- `workers.completed` plus `workers.failed`; its skipped set equals `workers.skipped`.
118
- `review-spec` is always selected and completed.
135
+ `mode` is `task`, `change`, or `plan`. `worker_selection` contains each member of the
136
+ six-worker roster exactly once with a scope-specific selected or skipped rationale.
137
+ Its selected set equals `workers.completed` plus `workers.failed`; its skipped set
138
+ equals `workers.skipped`. `review-spec` is always selected and completed.
119
139
 
120
140
  The overall verdict is `APPROVE` only when both axes pass, artifacts are complete and
121
141
  current, and no P0 or P1 finding remains. Use `REQUEST_CHANGES` for a failed axis or
@@ -25,6 +25,14 @@ AXIS_VERDICTS = {"PASS", "FAIL", "INCOMPLETE"}
25
25
  OVERALL_VERDICTS = {"APPROVE", "REQUEST_CHANGES", "INCOMPLETE"}
26
26
  REVIEW_MODES = {"task", "change", "plan"}
27
27
  SELECTION_STATUSES = {"selected", "skipped"}
28
+ REVIEW_WORKERS = {
29
+ "review-spec",
30
+ "review-code",
31
+ "review-tests",
32
+ "review-errors",
33
+ "review-design",
34
+ "review-comments",
35
+ }
28
36
  ARTIFACT_STEM = re.compile(r"^[a-z][a-z0-9-]*$")
29
37
  FINDING_FIELDS = {
30
38
  "id", "axis", "severity", "category", "title", "file", "line", "trigger",
@@ -240,6 +248,10 @@ def validate_summary(data):
240
248
  return "selected workers must equal completed and failed workers"
241
249
  if skipped != set(workers["skipped"]):
242
250
  return "skipped worker selection must match workers.skipped"
251
+ if seen_workers != REVIEW_WORKERS:
252
+ missing = sorted(REVIEW_WORKERS - seen_workers)
253
+ extra = sorted(seen_workers - REVIEW_WORKERS)
254
+ return f"worker_selection must disposition the complete roster; missing={missing}, extra={extra}"
243
255
  if "review-spec" not in selected or "review-spec" not in set(workers["completed"]):
244
256
  return "review-spec must be selected and completed"
245
257
  findings = data.get("findings")