ultra-builder-pro-cli 0.10.0 → 0.11.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 (92) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/README.md +1 -1
  3. package/adapters/_shared/codex-assets.cjs +23 -341
  4. package/adapters/_shared/runtime-assets.cjs +24 -0
  5. package/adapters/_shared/tests/runtime-assets.test.cjs +11 -4
  6. package/adapters/claude.js +28 -5
  7. package/adapters/kimi.js +15 -138
  8. package/adapters/opencode.js +14 -47
  9. package/adapters/tests/claude.test.cjs +22 -8
  10. package/adapters/tests/codex.test.cjs +19 -6
  11. package/adapters/tests/kimi.test.cjs +11 -11
  12. package/adapters/tests/opencode.test.cjs +11 -7
  13. package/agents/code-reviewer.md +24 -85
  14. package/agents/debugger.md +30 -132
  15. package/agents/review-code.md +24 -104
  16. package/agents/review-comments.md +20 -83
  17. package/agents/review-coordinator.md +40 -137
  18. package/agents/review-design.md +21 -118
  19. package/agents/review-errors.md +22 -70
  20. package/agents/review-spec.md +36 -0
  21. package/agents/review-tests.md +20 -76
  22. package/agents/tdd-runner.md +26 -84
  23. package/commands/learn.md +5 -36
  24. package/commands/ultra-change.md +5 -43
  25. package/commands/ultra-deliver.md +4 -46
  26. package/commands/ultra-dev.md +4 -48
  27. package/commands/ultra-doctor.md +4 -30
  28. package/commands/ultra-init.md +5 -47
  29. package/commands/ultra-plan.md +5 -48
  30. package/commands/ultra-research.md +5 -54
  31. package/commands/ultra-status.md +5 -44
  32. package/commands/ultra-test.md +5 -45
  33. package/commands/ultra-think.md +5 -40
  34. package/docs/PLAN.zh-CN.md +3 -3
  35. package/docs/ROADMAP.md +1 -1
  36. package/docs/SKILL-AUTHORING.md +75 -0
  37. package/package.json +3 -2
  38. package/skills/cc-collab/SKILL.md +16 -18
  39. package/skills/code-review-expert/SKILL.md +39 -114
  40. package/skills/code-review-expert/references/correctness-reliability.md +30 -0
  41. package/skills/code-review-expert/references/design-boundaries.md +26 -0
  42. package/skills/code-review-expert/references/removal-plan.md +17 -45
  43. package/skills/codex-collab/SKILL.md +23 -28
  44. package/skills/codex-collab/evals/evals.json +18 -23
  45. package/skills/integration-rules/SKILL.md +28 -67
  46. package/skills/learn/SKILL.md +46 -106
  47. package/skills/security-rules/SKILL.md +34 -56
  48. package/skills/testing-rules/SKILL.md +28 -52
  49. package/skills/ultra-change/SKILL.md +57 -114
  50. package/skills/ultra-deliver/SKILL.md +49 -87
  51. package/skills/ultra-dev/SKILL.md +42 -105
  52. package/skills/ultra-doctor/SKILL.md +39 -72
  53. package/skills/ultra-init/SKILL.md +59 -140
  54. package/skills/ultra-plan/SKILL.md +48 -88
  55. package/skills/ultra-research/SKILL.md +59 -152
  56. package/skills/ultra-research/references/architecture.md +38 -0
  57. package/skills/ultra-research/references/problem-product.md +39 -0
  58. package/skills/ultra-research/references/quality-delivery.md +34 -0
  59. package/skills/ultra-research/references/synthesis.md +38 -0
  60. package/skills/ultra-research/references/users-scope.md +40 -0
  61. package/skills/ultra-review/SKILL.md +54 -98
  62. package/skills/ultra-review/references/unified-schema.md +76 -101
  63. package/skills/ultra-review/scripts/review_wait.py +242 -77
  64. package/skills/ultra-status/SKILL.md +29 -51
  65. package/skills/ultra-test/SKILL.md +37 -72
  66. package/skills/ultra-think/SKILL.md +43 -102
  67. package/skills/ultra-verify/SKILL.md +44 -84
  68. package/skills/ultra-verify/evals/evals.json +24 -27
  69. package/spec/schemas/command-manifest.schema.json +7 -25
  70. package/spec/schemas/skill-manifest.schema.json +9 -79
  71. package/skills/code-review-expert/references/code-quality-checklist.md +0 -112
  72. package/skills/code-review-expert/references/integration-checklist.md +0 -46
  73. package/skills/code-review-expert/references/security-checklist.md +0 -100
  74. package/skills/code-review-expert/references/solid-checklist.md +0 -65
  75. package/skills/ultra-research/steps/step-00-problem-validation.md +0 -154
  76. package/skills/ultra-research/steps/step-01-opportunity-discovery.md +0 -172
  77. package/skills/ultra-research/steps/step-02-market-assessment.md +0 -195
  78. package/skills/ultra-research/steps/step-03-competitive-landscape.md +0 -197
  79. package/skills/ultra-research/steps/step-04-product-strategy.md +0 -196
  80. package/skills/ultra-research/steps/step-05-assumptions-validation.md +0 -234
  81. package/skills/ultra-research/steps/step-10-user-personas.md +0 -169
  82. package/skills/ultra-research/steps/step-11-user-scenarios.md +0 -181
  83. package/skills/ultra-research/steps/step-20-user-stories.md +0 -156
  84. package/skills/ultra-research/steps/step-21-features-scope.md +0 -157
  85. package/skills/ultra-research/steps/step-22-success-metrics.md +0 -195
  86. package/skills/ultra-research/steps/step-30-architecture-context.md +0 -154
  87. package/skills/ultra-research/steps/step-31-solution-strategy.md +0 -172
  88. package/skills/ultra-research/steps/step-32-building-blocks.md +0 -188
  89. package/skills/ultra-research/steps/step-40-deployment.md +0 -123
  90. package/skills/ultra-research/steps/step-41-quality-risks.md +0 -135
  91. package/skills/ultra-research/steps/step-99-synthesis.md +0 -188
  92. package/skills/ultra-review/scripts/review_verdict_update.py +0 -99
@@ -1,111 +1,73 @@
1
1
  ---
2
2
  name: ultra-deliver
3
- description: "Converge an implementation, approved specification learning, independent review axes, and release evidence into one recoverable baseline."
4
- user-invocable: true
5
- runtime: all
6
- mcp_tools_required:
7
- - change.list
8
- - change.get
9
- - change.context
10
- - change.breadcrumb
11
- - change.learning_resolve
12
- - change.converge
13
- - change.archive
14
- cli_fallback: "direct user interaction"
3
+ description: Converge verified implementation, specification learning, review evidence, and release artifacts into a recoverable baseline. Use when an initial baseline or active change has current passing evidence and is ready to archive or release.
15
4
  ---
16
5
 
17
- # ultra-deliver — Converge, Archive, Release
6
+ # Converge and deliver
18
7
 
19
- Deliver the current baseline or one continuous-change packet. Change lifecycle writes
20
- use MCP only; `.ultra/test-report.json`, review sessions, and delivery reports are
21
- evidence artifacts.
8
+ Deliver one baseline or continuous change. Change lifecycle writes use MCP; test,
9
+ review, and delivery reports are evidence artifacts.
22
10
 
23
- ## 1. Bind the delivery
11
+ ## Bind current evidence
24
12
 
25
- 1. Call `change.list` for active, blocked, and ready changes.
26
- 2. Bind exactly one relevant change; require an id when ambiguous. Initial baseline
27
- delivery may use `change_id: null`.
28
- 3. Call `change.breadcrumb`. A stale/blocked context or incomplete linked task blocks.
29
- 4. Verify `.ultra/test-report.json` exists, passed, matches the change, and records the
30
- current full HEAD plus at least one public seam.
31
- 5. Verify the latest review session matches the same HEAD and has passing independent
32
- `spec_fidelity` and `engineering_standards` axes.
13
+ 1. Call `change.list` and bind exactly one relevant change, or a null change id for an
14
+ initial baseline.
15
+ 2. Call `change.breadcrumb`. Block on stale context, incomplete linked tasks, or
16
+ unresolved readiness.
17
+ 3. Require a passing test report for the current full HEAD and at least one declared
18
+ public seam.
19
+ 4. Require current independent `spec_fidelity` and `engineering_standards` review
20
+ verdicts. Evidence from another checkout, commit, task set, or change is invalid.
33
21
 
34
- Do not reuse evidence from another checkout, commit, task set, or change.
22
+ ## Reconcile the baseline
35
23
 
36
- ## 2. Reconcile specification learning
24
+ Call `change.get` for authoritative learning candidates.
37
25
 
38
- Call `change.get` for authoritative `learning_candidates`; use the packet's
39
- `spec-learning.json` only as the inspectable projection.
26
+ - Resolve every proposed item as approved or rejected.
27
+ - Apply each approved item to its declared baseline target, verify the edit, then mark
28
+ it applied.
29
+ - Preserve rejection reasons as decision evidence.
30
+ - Confirm previously applied items remain represented in the target document.
40
31
 
41
- - `proposed`: require approve or reject through `change.learning_resolve`.
42
- - `approved`: update the declared baseline target, verify the edit, then mark `apply`.
43
- - `rejected`: preserve the reason as decision evidence.
44
- - `applied`: verify the target still contains the accepted behavior.
32
+ Reconcile accepted delta content and documentation impact into baseline documents.
33
+ Record updated paths or a specific no-change reason. Unknown documentation impact,
34
+ unresolved placeholders, and behavior that exists only in the delta block convergence.
45
35
 
46
- Any proposed or approved candidate blocks convergence. This is the mandatory path that
47
- keeps baseline specs alive after daily changes; it is not cross-session memory.
36
+ ## Verify the release candidate
48
37
 
49
- Reconcile accepted `delta/` content and declared documentation impact into baseline
50
- documents. Record `baseline_updates`, or a specific no-change reason. No unresolved
51
- placeholder, unknown docs impact, or delivered-only-in-delta behavior may remain.
38
+ Use a clean, reviewed release commit. Show any remaining diff and obtain explicit
39
+ authorization before staging or committing. Never stage unrelated user changes.
52
40
 
53
- ## 3. Verify the release candidate
41
+ Run the exact repository commands needed for focused regression, relevant full tests,
42
+ static checks, production build, package/install/doctor smoke when distributed, the
43
+ public seam, and rollback or recovery sanity. Any post-verification edit invalidates
44
+ the affected evidence.
54
45
 
55
- Require a clean, reviewed release commit. If changes remain, show the diff and obtain
56
- explicit approval before committing. Never auto-stage unrelated user changes.
46
+ Compile final change context at the release commit with the convergence gate. It must
47
+ be ready before calling `change.converge`.
57
48
 
58
- Run exact project commands for:
49
+ ## Converge and archive
59
50
 
60
- 1. focused regression/acceptance feedback loop;
61
- 2. full relevant tests;
62
- 3. static checks and production build;
63
- 4. package/install/doctor smoke where the product is distributed;
64
- 5. public-seam acceptance and rollback/recovery sanity.
51
+ Submit structured evidence for the reviewed diff and seam, test signals, baseline and
52
+ delta, documentation, both independent review axes, and incident diagnosis when
53
+ applicable. Do not collapse review axes or replace exact signal fields with prose.
65
54
 
66
- Record commands, exit results, and current HEAD. Any post-test edit invalidates the
67
- test and review gates.
55
+ Resolve named blockers, rerun invalidated gates, then call `change.archive` with the
56
+ summary and baseline updates.
68
57
 
69
- ## 4. Compile final role context
58
+ ## Optional release
70
59
 
71
- Call `change.context` at the release commit with `role=review`, `gate=convergence`,
72
- current required refs/digests, the public seam, exact verification command, and the
73
- single next action `Archive the converged change`. Readiness must be `ready`.
60
+ Only when release authorization is in scope:
74
61
 
75
- ## 5. Converge
76
-
77
- Call `change.converge` with evidence rows for:
78
-
79
- - `diff`: reviewed release diff and public seam;
80
- - `tests`: exact signal object (`command`, expected/observed red, observed green,
81
- deterministic, duration when known) and seam;
82
- - `spec`: baseline/delta and applied learning evidence;
83
- - `docs`: updated paths or explicit non-applicability;
84
- - `review`, `axis=spec_fidelity`;
85
- - `review`, `axis=engineering_standards`;
86
- - `diagnosis` for incidents.
87
-
88
- Do not collapse the two review axes or substitute prose for the signal fields. If
89
- convergence returns blockers, fix the named source and rerun the invalidated gates.
90
-
91
- ## 6. Archive and release
92
-
93
- After `ready=true`, call `change.archive` with summary and `baseline_updates` (or the
94
- validated no-change reason). Then:
95
-
96
- 1. determine the semantic version from user-visible compatibility;
62
+ 1. determine the semantic version from compatibility impact;
97
63
  2. update version and changelog;
98
- 3. rerun release verification if version files changed;
99
- 4. create a non-force commit/tag and push only with explicit release authorization;
100
- 5. publish the package/release through the repository's authenticated workflow;
101
- 6. verify the remote tag/release and registry version independently.
102
-
103
- Write `.ultra/delivery-report.json` with change id, archived status, commit, version,
104
- commands, package/release identifiers, baseline updates, rollback notes, and timestamp.
64
+ 3. rerun checks invalidated by version changes;
65
+ 4. create a non-force commit and tag;
66
+ 5. push and publish through the repository's authenticated workflow;
67
+ 6. independently verify the remote commit, tag, release, and registry version.
105
68
 
106
- ## Completion gate
69
+ Write the delivery report with the change id, archive status, commit, version, exact
70
+ commands, release identifiers, baseline updates, rollback notes, and timestamp.
107
71
 
108
- Delivery is complete only when the change is archived, local and remote commit/tag
109
- agree, registry/release verification is current, and the worktree contains no
110
- unexplained scope. Report the outcome first, exact evidence next, and residual risks
111
- last. Never say “published” based only on a local version bump.
72
+ Delivery is complete only when local and remote evidence agree and the worktree has no
73
+ unexplained scope. A local version bump is not publication evidence.
@@ -1,120 +1,57 @@
1
1
  ---
2
2
  name: ultra-dev
3
- description: "Execute one fresh-context vertical slice through a public seam with strict red-green evidence, bounded recovery, and specification learning."
4
- user-invocable: true
5
- runtime: all
6
- mcp_tools_required:
7
- - task.update
8
- - task.get
9
- - task.list
10
- - change.get
11
- - change.context
12
- - change.breadcrumb
13
- - change.learning_propose
3
+ description: Execute one authoritative Ultra task through a bounded fresh context, a red-green feedback loop, live-path verification, and review. Use when a dependency-ready planned slice is ready for implementation.
14
4
  ---
15
5
 
16
- # ultra-dev — One Slice, One Feedback Loop
6
+ # Execute one vertical slice
17
7
 
18
- Drive one task from `pending` to `completed`. Task status lives in
19
- `.ultra/state.db`; generated task JSON and context frontmatter are read-only.
8
+ Drive one task from `pending` to `completed` without widening its contract silently.
20
9
 
21
10
  ## Authority and recovery
22
11
 
23
- If `task.list`, `task.get`, or `task.update` fails, stop. Never write raw SQLite,
24
- `.ultra/tasks/tasks.json`, or projected status fields. On
25
- `LEGACY_STATE_MIGRATION_REQUIRED`, use the documented migration command before work.
12
+ Task state changes use `task.update`. Never write raw SQLite, generated task JSON, or
13
+ projected status fields. If task MCP access fails, stop and route state health to
14
+ `ultra-doctor`.
26
15
 
27
- At entry, read `change.breadcrumb` when a change is active. A blocked or stale
28
- breadcrumb is an implementation blocker, not an advisory warning.
16
+ Read `change.breadcrumb` when a change is active. Stale context, blocked readiness,
17
+ unknown documentation impact, or a HEAD mismatch blocks implementation.
29
18
 
30
- `.ultra/workflow-state.json` is a compact recovery checkpoint only. Record command,
31
- task, branch, current step, status, and timestamp; do not copy prompts, codebase
32
- summaries, or provider memory into it.
33
-
34
- ## 1. Select and compile the slice
19
+ ## Workflow
35
20
 
36
21
  1. Select the requested task, otherwise the first dependency-ready pending task.
37
- 2. Call `task.get`; verify dependencies, ownership, acceptance, public seam, and exact
38
- verification command.
39
- 3. If linked to a change, call `change.get`, then compile `change.context` with:
40
- `role=implement`, `gate=implementation`, the smallest required references, and the
41
- task's execution contract.
42
- 4. Stop on missing/stale references, budget overflow, unknown documentation impact,
43
- or a HEAD mismatch. Do not compensate by loading the whole repository.
44
- 5. Mark the task `in_progress` with `task.update` and checkpoint the step.
45
-
46
- The default slice is a `tracer_bullet`. An `expand_contract` must already be approved;
47
- implementation does not widen its own contract silently.
48
-
49
- ## 2. Establish red
50
-
51
- Before production logic changes:
52
-
53
- 1. Reproduce the smallest observable symptom at the declared public seam.
54
- 2. Add or identify the regression/contract test.
55
- 3. Run the exact command and record:
56
- - command;
57
- - expected failure;
58
- - observed red result;
59
- - deterministic/non-deterministic classification;
60
- - duration when useful.
61
-
62
- For a new feature, red means an assertion expressing missing behavior. For a refactor,
63
- establish a green characterization baseline first. Documentation/config-only tasks may
64
- use a structural validator instead of a failing test, but must state why.
65
-
66
- If red cannot be observed, stop and correct the task contract; do not implement against
67
- an unproven hypothesis.
68
-
69
- ## 3. Implement the minimum complete path
70
-
71
- - Trace entry point → domain rule → side effect → public seam.
72
- - Search for existing utilities and dependencies before adding helpers.
73
- - Keep IO at boundaries and domain behavior testable.
74
- - Include required validation, errors, observability, recovery, and documentation.
75
- - Preserve unrelated dirty worktree changes and stay within allowed paths.
76
- - Verify each meaningful increment through the same feedback loop.
77
-
78
- If implementation reveals a stable invariant or public behavior absent from the
79
- baseline, call `change.learning_propose` with its evidence and target document. Do not
80
- edit the baseline silently and do not store the discovery as Ultra memory.
81
-
82
- ## 4. Establish green and inspect reachability
83
-
84
- Run, in order:
85
-
86
- 1. the exact red command until the observed failure becomes green;
87
- 2. adjacent focused tests;
88
- 3. type check/lint/build proportionate to the change;
89
- 4. the live public-seam acceptance path;
90
- 5. final diff and worktree scope inspection.
91
-
92
- Record exact commands and zero-failure results. “Compiled” or “unit tests pass” is not
93
- enough when the new module is not connected to a consumer.
94
-
95
- ## 5. Review gate
96
-
97
- Checkpoint `status=pre_review`, then invoke `/ultra-review all`. The review must produce
98
- independent `spec_fidelity` and `engineering_standards` verdicts. Fix all P0/P1 issues,
99
- rerun affected tests, and recheck until both axes pass. The primary host owns final
100
- verification; review workers never mutate durable Ultra state.
101
-
102
- ## 6. Complete the task
103
-
104
- First call `task.update` with `status=completed` and completion commit/evidence
105
- supported by the task contract. Then, for a linked change, recompile
106
- `change.context` at the final HEAD with:
107
-
108
- - `role=implement`, `gate=verification`;
109
- - exact required references and current digests;
110
- - the public seam and verification command;
111
- - a single next action, normally `Run ultra-test for this change`.
112
-
113
- This ordering ensures the snapshot records the completed task state. Clear the active
114
- workflow checkpoint, call `change.breadcrumb`, and report exactly one next action.
22
+ 2. Call `task.get` and verify acceptance, dependencies, ownership, public seam, and
23
+ exact verification command.
24
+ 3. For a linked change, call `change.get`, then compile `change.context` for the
25
+ implementation role and gate with the smallest required references.
26
+ 4. Mark the task `in_progress` only after the context is ready.
27
+ 5. Establish the feedback-loop baseline before changing production logic:
28
+ - reproduce the smallest observable symptom at the declared seam;
29
+ - add or identify the contract or regression test;
30
+ - record the exact command, expected signal, and observed result.
31
+
32
+ A feature starts with an assertion for missing behavior. A refactor starts from a
33
+ green characterization baseline. Documentation or configuration work may use a
34
+ structural validator when no logic test applies.
35
+ 6. Implement the minimum complete path from entry point to public seam. Reuse existing
36
+ utilities, keep IO at boundaries, include required errors and recovery, and preserve
37
+ unrelated worktree changes.
38
+ 7. If the work reveals a stable requirement or public behavior absent from the
39
+ baseline, call `change.learning_propose`. Do not edit the baseline silently or store
40
+ the discovery as private Ultra memory.
41
+ 8. Verify in this order:
42
+ - the original feedback-loop command;
43
+ - adjacent focused tests;
44
+ - proportionate static checks and build;
45
+ - the live public-seam acceptance path;
46
+ - final diff and worktree scope.
47
+ 9. Run `ultra-review` against the current diff. Fix blocking findings, rerun invalidated
48
+ checks, and require independent specification-fidelity and engineering verdicts.
49
+ 10. Call `task.update` with `status=completed` and exact evidence. For a linked change,
50
+ recompile the verification context at the final HEAD, then call
51
+ `change.breadcrumb`.
115
52
 
116
53
  ## Completion evidence
117
54
 
118
- Report task/change id, changed paths, red signal, green commands, public-seam result,
119
- review session, spec-learning candidates, and remaining blockers. If any item is
120
- missing, leave the task in progress or blocked rather than claiming completion.
55
+ Report the task and change ids, changed paths, baseline signal, passing commands,
56
+ public-seam result, review session, specification-learning candidates, and one next
57
+ action. Leave the task in progress or blocked when required evidence is missing.
@@ -1,98 +1,65 @@
1
1
  ---
2
2
  name: ultra-doctor
3
- description: "Inspect Ultra state, projection, session, incident, and active-change health; optionally run explicit backup-first mechanical recovery."
4
- user-invocable: true
5
- runtime: all
6
- mcp_tools_required:
7
- - system.doctor
8
- cli_fallback: "system doctor"
3
+ description: Diagnose Ultra state, projection, session, incident, change-artifact, and installed-plugin health with bounded recovery. Use when Ultra state appears missing, projections disagree, hooks fail, or MCP operations report degraded health.
9
4
  ---
10
5
 
11
- # ultra-doctor — Runtime Diagnostics and Recovery
6
+ # Diagnose and recover the Ultra runtime
12
7
 
13
- Use this workflow when Ultra state appears empty, projections disagree with
14
- `state.db`, a hook reports a missing adapter, sessions are orphaned, a change
15
- artifact is missing, or MCP operations return degraded projection metadata.
8
+ Default to read-only diagnosis. Repair only after the user explicitly authorizes it.
16
9
 
17
- ## Default is read-only
10
+ ## Project-state diagnosis
18
11
 
19
- Call `system.doctor` with `{ "repair": false }` unless the user explicitly
20
- requests repair. Read-only diagnosis reports:
12
+ Call `system.doctor` with `{ "repair": false }` and inspect:
21
13
 
22
14
  - SQLite integrity and required tables;
23
15
  - open structured incidents;
24
- - projection queue failures and event/projection cursor lag;
16
+ - event and projection cursor lag;
17
+ - failed or interrupted projection jobs;
25
18
  - orphan sessions;
26
19
  - missing active-change artifact roots;
27
- - the external ownership boundary for Memory and code graph.
20
+ - the boundary to separately installed memory and code-graph providers.
28
21
 
29
- Do not infer health from `tasks.json`. Do not mutate provider state, delete
30
- artifacts, rebuild a graph, or collect memory during diagnosis.
22
+ Do not infer health from generated task JSON. Do not mutate external provider state,
23
+ delete artifacts, or collect memory during diagnosis.
31
24
 
32
- ## Interpret the report
25
+ ## Interpret failures
33
26
 
34
- | Check | Meaning | Next action |
35
- |---|---|---|
36
- | `state_db` fail | schema/integrity problem | stop ordinary workflow; preserve DB evidence |
37
- | `incidents` fail | a structured runtime failure remains open | report code, source, retryability, and evidence |
38
- | `projections` fail | state commit is ahead of generated views or a projector failed | explicit repair is appropriate when authorized |
39
- | `sessions` fail | an orphan execution lease exists | repair may mark/reconcile it; never kill unrelated processes blindly |
40
- | `change_artifacts` fail | DB points to a missing active packet | recover from version control/backup or recreate deliberately |
41
- | `external_providers` pass | ownership is correctly external | provider availability must be checked with its own plugin/tool |
27
+ - State integrity failure blocks ordinary workflows and requires preserving database
28
+ evidence before recovery.
29
+ - An open incident requires its code, source, retryability, and evidence.
30
+ - Projection lag may be mechanically repairable when authority is healthy.
31
+ - An orphan session may be reconciled; never kill unrelated processes blindly.
32
+ - A missing change artifact requires version-control, backup, or deliberate recreation
33
+ evidence rather than silent regeneration.
42
34
 
43
- ## Explicit repair mode
35
+ ## Explicit repair
44
36
 
45
- Only after the user asks for repair, call `system.doctor` with
46
- `{ "repair": true }`, or use the fallback:
37
+ After authorization, call `system.doctor` with `{ "repair": true }` or use the
38
+ installed `ultra-tools system doctor --repair` fallback. The runtime must create a
39
+ timestamped state database backup before any mechanical repair.
47
40
 
48
- ```bash
49
- ultra-tools system doctor --repair
50
- ```
41
+ Repair is limited to documented recovery operations such as reconciling orphan
42
+ sessions, consuming staleness events, requeueing interrupted or failed projections,
43
+ and regenerating projections from authoritative state. If backup fails, stop. Always
44
+ inspect the post-repair report; a completed repair action does not imply healthy state.
51
45
 
52
- The runtime must create `.ultra/backups/state-<timestamp>.db` before any
53
- mechanical repair. Repair is bounded to:
46
+ ## Installed-plugin failures
54
47
 
55
- - boot recovery for orphan sessions;
56
- - durable consumption of spec-staleness events;
57
- - requeueing projection jobs left `running` beyond the interruption cutoff;
58
- - requeueing failed projection jobs;
59
- - regenerating projections from authoritative state.
48
+ When a hook points to a missing installed file:
60
49
 
61
- If backup fails, repair must stop with `BACKUP_FAILED`. A repair result is not
62
- automatically healthy; inspect the returned post-repair report and keep any
63
- remaining incident unresolved.
50
+ 1. Capture the hook manifest path and missing target.
51
+ 2. Run the installer doctor for the actual host and install scope.
52
+ 3. Preserve provenance, asset-hash, and host-contract findings.
53
+ 4. Reinstall through the host adapter rather than patching a cache directory.
54
+ 5. Rerun installer doctor, `system.doctor`, and a host hook smoke test.
64
55
 
65
- ## Hook/path failures
66
-
67
- For an installed hook that points to a missing cached file:
68
-
69
- 1. capture the exact hook config path and missing target;
70
- 2. run the separate read-only installer boundary check:
71
- `npx ultra-builder-pro-cli --<runtime> --local --doctor --json` (or use
72
- `--global` when that is the actual install scope);
73
- 3. preserve its provenance, asset-hash, and host-contract findings;
74
- 4. reinstall or regenerate the host-native plugin through the adapter;
75
- 5. rerun both installer doctor and `system.doctor`, then a host hook smoke test.
76
-
77
- `system.doctor` diagnoses project `.ultra/state.db` and workflow recovery.
78
- Installer `ubp --doctor` diagnoses the installed plugin files and host wiring.
79
- Neither report substitutes for the other.
80
-
81
- Do not bypass a broken hook by changing application implementation, and do not
82
- treat a hook failure as project-code evidence.
56
+ Project doctor covers `.ultra/state.db`; installer doctor covers packaged files and
57
+ host wiring. Neither substitutes for the other.
83
58
 
84
59
  ## Output
85
60
 
86
- Lead with `healthy` or `degraded`, list only failing checks, and include:
87
-
88
- - incident ids/codes and sources;
89
- - event vs projected cursor;
90
- - whether repair ran;
91
- - backup path when repair ran;
92
- - unresolved actions and their owner (`Ultra`, host plugin, or external provider).
93
-
94
- ## What this skill does not do
61
+ Lead with `healthy` or `degraded`. List failing checks, incident identifiers, cursor
62
+ lag, whether repair ran, the backup path, and each unresolved action with its owner.
95
63
 
96
- - It does not fix project code or semantic specification conflicts.
97
- - It does not delete state, force-reset git, or close live healthy sessions.
98
- - It does not install, query, refresh, or repair external Memory/graph providers.
64
+ Do not fix application code, delete state, reset Git, close healthy sessions, or
65
+ install and repair external providers through this workflow.