ultra-builder-pro-cli 0.25.0 → 0.26.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 (241) hide show
  1. package/.ultra-template/contexts/TEMPLATE.md +87 -0
  2. package/.ultra-template/decisions/.gitkeep +1 -0
  3. package/.ultra-template/evidence/.gitkeep +1 -0
  4. package/.ultra-template/north-star.md +46 -0
  5. package/.ultra-template/research/.gitkeep +1 -0
  6. package/.ultra-template/specs/discovery.md +2 -2
  7. package/.ultra-template/tasks.json +3 -0
  8. package/.ultra-template/test-report.json +27 -0
  9. package/CHANGELOG.md +49 -0
  10. package/README.md +217 -579
  11. package/adapters/_shared/delegate-profiles/kimi-read-only.md +15 -0
  12. package/adapters/_shared/delegate-profiles/kimi-write.md +17 -0
  13. package/adapters/_shared/file-ops.cjs +76 -2
  14. package/adapters/_shared/host-profile.cjs +97 -0
  15. package/adapters/_shared/plugin-core.cjs +204 -0
  16. package/adapters/_shared/runtime-assets.cjs +31 -96
  17. package/adapters/claude.js +92 -291
  18. package/adapters/codex.js +309 -842
  19. package/adapters/grok.js +143 -1469
  20. package/adapters/kimi.js +124 -1053
  21. package/adapters/opencode.js +230 -742
  22. package/bin/delegate-worker.cjs +323 -0
  23. package/bin/delegate.cjs +456 -0
  24. package/bin/install.js +38 -11
  25. package/docs/ARCHITECTURE.md +122 -216
  26. package/docs/ARTIFACT-AUTHORITY.md +90 -268
  27. package/docs/DECISIONS.md +75 -87
  28. package/docs/PHILOSOPHY.md +177 -0
  29. package/docs/PLUGIN-ISOLATION-CONTRACT.md +62 -39
  30. package/docs/RUNTIME-COMPAT-MATRIX.md +99 -156
  31. package/docs/SKILL-AUTHORING.md +94 -73
  32. package/docs/WORKFLOW-LIFECYCLE.md +93 -189
  33. package/hooks/README.md +17 -37
  34. package/hooks/_common.py +113 -0
  35. package/hooks/adapters/codex.py +9 -16
  36. package/hooks/adapters/grok.py +5 -5
  37. package/hooks/adapters/kimi.py +8 -14
  38. package/hooks/block_dangerous_commands.py +95 -0
  39. package/hooks/compact_context.py +65 -0
  40. package/hooks/mid_workflow_recall.py +25 -0
  41. package/hooks/post_edit_guard.py +105 -0
  42. package/hooks/session_context.py +30 -0
  43. package/package.json +17 -52
  44. package/skills/ultra-change/SKILL.md +97 -50
  45. package/skills/ultra-change/references/change-contract.md +40 -1
  46. package/skills/ultra-delegate/SKILL.md +82 -0
  47. package/skills/ultra-delegate/references/delegation-contract.md +51 -0
  48. package/skills/ultra-delegate/scripts/delegate_wait.py +86 -0
  49. package/skills/ultra-deliver/SKILL.md +61 -42
  50. package/skills/ultra-deliver/references/baseline-reconciliation.md +39 -20
  51. package/skills/ultra-dev/SKILL.md +96 -62
  52. package/skills/ultra-dev/references/debugging.md +22 -0
  53. package/skills/ultra-domain-modeling/SKILL.md +79 -0
  54. package/skills/ultra-grilling/SKILL.md +79 -0
  55. package/skills/ultra-init/SKILL.md +94 -37
  56. package/skills/ultra-init/references/brownfield-adoption.md +33 -83
  57. package/skills/ultra-init/scripts/init_project.cjs +84 -0
  58. package/skills/ultra-plan/SKILL.md +88 -68
  59. package/skills/ultra-research/SKILL.md +62 -48
  60. package/skills/ultra-research/references/00-problem-validation.md +5 -5
  61. package/skills/ultra-research/references/01-opportunity-discovery.md +3 -3
  62. package/skills/ultra-research/references/02-market-assessment.md +5 -4
  63. package/skills/ultra-research/references/03-competitive-landscape.md +3 -3
  64. package/skills/ultra-research/references/04-product-strategy.md +3 -3
  65. package/skills/ultra-research/references/05-assumptions-validation.md +5 -5
  66. package/skills/ultra-research/references/10-user-personas.md +3 -2
  67. package/skills/ultra-research/references/11-user-scenarios.md +3 -3
  68. package/skills/ultra-research/references/20-user-stories.md +4 -3
  69. package/skills/ultra-research/references/21-features-scope.md +3 -2
  70. package/skills/ultra-research/references/22-success-metrics.md +3 -3
  71. package/skills/ultra-research/references/30-architecture-context.md +3 -3
  72. package/skills/ultra-research/references/31-solution-strategy.md +3 -3
  73. package/skills/ultra-research/references/32-building-blocks.md +3 -3
  74. package/skills/ultra-research/references/40-deployment.md +3 -3
  75. package/skills/ultra-research/references/41-quality-risks.md +3 -3
  76. package/skills/ultra-research/references/99-synthesis.md +7 -7
  77. package/skills/ultra-review/SKILL.md +59 -32
  78. package/skills/ultra-review/references/code.md +17 -0
  79. package/skills/ultra-review/references/comments.md +12 -0
  80. package/skills/ultra-review/references/design.md +12 -0
  81. package/skills/ultra-review/references/errors.md +13 -0
  82. package/skills/ultra-review/references/spec.md +13 -0
  83. package/skills/ultra-review/references/tests.md +12 -0
  84. package/skills/ultra-review/references/worker-packet.md +40 -0
  85. package/skills/ultra-review/scripts/review_wait.py +26 -15
  86. package/skills/ultra-status/SKILL.md +61 -36
  87. package/skills/ultra-tdd/SKILL.md +81 -0
  88. package/skills/ultra-tdd/references/templates/README.md +20 -0
  89. package/skills/ultra-tdd/references/templates/feature-flag-default-audit.sh +79 -0
  90. package/skills/ultra-tdd/references/templates/persistence-real.ts +78 -0
  91. package/skills/ultra-tdd/references/templates/testcontainer-postgres.py +78 -0
  92. package/skills/ultra-tdd/references/templates/testcontainer-postgres.ts +73 -0
  93. package/skills/ultra-tdd/references/templates/vertical-slice.ts +66 -0
  94. package/skills/ultra-tdd/references/test-execution.md +18 -0
  95. package/skills/ultra-test/SKILL.md +70 -30
  96. package/skills/ultra-test/references/export-syntax.md +18 -0
  97. package/skills/ultra-test/scripts/worktree_digest.cjs +54 -0
  98. package/skills/ultra-think/SKILL.md +49 -27
  99. package/skills/ultra-think/references/autonomy-boundary.md +48 -0
  100. package/skills/ultra-think/references/interaction-boundary.md +18 -33
  101. package/.ultra-template/docs/research/README.md +0 -55
  102. package/.ultra-template/reports/templates/delivery-report.json +0 -17
  103. package/.ultra-template/reports/templates/test-report.json +0 -18
  104. package/.ultra-template/tasks/tasks.json +0 -15
  105. package/.ultra-template/templates/task-context.md +0 -19
  106. package/adapters/_shared/codex-assets.cjs +0 -725
  107. package/adapters/_shared/codex-ultra-tools-entry.cjs +0 -11
  108. package/adapters/_shared/interaction-contract.cjs +0 -129
  109. package/adapters/_shared/path-rewrite.cjs +0 -79
  110. package/adapters/_shared/runtime-native.cjs +0 -132
  111. package/adapters/_shared/settings-merge.cjs +0 -76
  112. package/agents/code-reviewer.md +0 -42
  113. package/agents/debugger.md +0 -40
  114. package/agents/review-code.md +0 -49
  115. package/agents/review-comments.md +0 -38
  116. package/agents/review-coordinator.md +0 -56
  117. package/agents/review-design.md +0 -40
  118. package/agents/review-errors.md +0 -43
  119. package/agents/review-spec.md +0 -39
  120. package/agents/review-tests.md +0 -40
  121. package/agents/tdd-runner.md +0 -38
  122. package/bin/orchestrator.js +0 -383
  123. package/commands/ultra-change.md +0 -10
  124. package/commands/ultra-deliver.md +0 -10
  125. package/commands/ultra-dev.md +0 -10
  126. package/commands/ultra-doctor.md +0 -10
  127. package/commands/ultra-init.md +0 -10
  128. package/commands/ultra-plan.md +0 -10
  129. package/commands/ultra-research.md +0 -10
  130. package/commands/ultra-review.md +0 -10
  131. package/commands/ultra-status.md +0 -10
  132. package/commands/ultra-test.md +0 -10
  133. package/commands/ultra-think.md +0 -10
  134. package/docs/AGENT-CONTEXT.md +0 -191
  135. package/docs/COMMIT-HASH-BACKFILL.md +0 -51
  136. package/docs/LEGACY-CLI-CROSSWALK.md +0 -175
  137. package/docs/ROADMAP.md +0 -101
  138. package/docs/STATE-DB-ACCESS-POLICY.md +0 -161
  139. package/hooks/active_task_context.py +0 -152
  140. package/hooks/context_envelope.py +0 -100
  141. package/hooks/health_check.py +0 -196
  142. package/hooks/pre_stop_check.py +0 -66
  143. package/hooks/runtime_paths.py +0 -396
  144. package/hooks/subagent_tracker.py +0 -88
  145. package/hooks/workflow_checkpoint.py +0 -76
  146. package/hooks/workflow_context.py +0 -48
  147. package/hooks/workflow_resume.py +0 -84
  148. package/mcp-server/hook-context.cjs +0 -38
  149. package/mcp-server/hook-event.cjs +0 -34
  150. package/mcp-server/lib/archive-journal.cjs +0 -1119
  151. package/mcp-server/lib/archive-mutation-worker.py +0 -365
  152. package/mcp-server/lib/artifact-registry.cjs +0 -1232
  153. package/mcp-server/lib/baseline-workflow.cjs +0 -1193
  154. package/mcp-server/lib/canonical-json.cjs +0 -19
  155. package/mcp-server/lib/change-authority.cjs +0 -26
  156. package/mcp-server/lib/change-packet.cjs +0 -790
  157. package/mcp-server/lib/change-workflow.cjs +0 -65
  158. package/mcp-server/lib/context-envelope.cjs +0 -581
  159. package/mcp-server/lib/context-paths.cjs +0 -142
  160. package/mcp-server/lib/decision-records.cjs +0 -423
  161. package/mcp-server/lib/delivery-transaction.cjs +0 -471
  162. package/mcp-server/lib/doctor-backup-worker.cjs +0 -328
  163. package/mcp-server/lib/doctor.cjs +0 -627
  164. package/mcp-server/lib/git-bootstrap.cjs +0 -651
  165. package/mcp-server/lib/init-project.cjs +0 -1021
  166. package/mcp-server/lib/kernel-change-workflow.cjs +0 -2029
  167. package/mcp-server/lib/legacy-change-workflow.cjs +0 -3032
  168. package/mcp-server/lib/managed-file-write.cjs +0 -172
  169. package/mcp-server/lib/plan-checkpoint.cjs +0 -177
  170. package/mcp-server/lib/plan-publication-worker.cjs +0 -830
  171. package/mcp-server/lib/plan-store.cjs +0 -794
  172. package/mcp-server/lib/prd-parser.cjs +0 -83
  173. package/mcp-server/lib/pricing.cjs +0 -44
  174. package/mcp-server/lib/project-context.cjs +0 -178
  175. package/mcp-server/lib/projector.cjs +0 -386
  176. package/mcp-server/lib/provider-refs.cjs +0 -42
  177. package/mcp-server/lib/runtime-paths.cjs +0 -1687
  178. package/mcp-server/lib/runtime-state.cjs +0 -222
  179. package/mcp-server/lib/safe-project-file.cjs +0 -385
  180. package/mcp-server/lib/stage-checkpoints.cjs +0 -463
  181. package/mcp-server/lib/state-authority.cjs +0 -95
  182. package/mcp-server/lib/state-db.cjs +0 -1580
  183. package/mcp-server/lib/state-ops.cjs +0 -1428
  184. package/mcp-server/lib/task-contract.cjs +0 -404
  185. package/mcp-server/lib/task-expander.cjs +0 -105
  186. package/mcp-server/lib/task-ledger.cjs +0 -1964
  187. package/mcp-server/lib/telemetry.cjs +0 -85
  188. package/mcp-server/lib/topo.cjs +0 -131
  189. package/mcp-server/lib/ultra-facade.cjs +0 -2684
  190. package/mcp-server/lib/worker-packet.cjs +0 -358
  191. package/mcp-server/server.cjs +0 -437
  192. package/orchestrator/auto-merge.cjs +0 -128
  193. package/orchestrator/daemon.cjs +0 -264
  194. package/orchestrator/dispatch-rules.cjs +0 -78
  195. package/orchestrator/parallel-orchestrator.cjs +0 -903
  196. package/orchestrator/planner/plan-builder.cjs +0 -125
  197. package/orchestrator/recovery.cjs +0 -188
  198. package/orchestrator/session-close-journal-worker.cjs +0 -5
  199. package/orchestrator/session-close-journal.cjs +0 -1014
  200. package/orchestrator/session-runner.cjs +0 -1153
  201. package/orchestrator/worktree-manager.cjs +0 -282
  202. package/settings.json +0 -7
  203. package/skills/cc-collab/SKILL.md +0 -42
  204. package/skills/code-review-expert/SKILL.md +0 -43
  205. package/skills/code-review-expert/references/correctness-reliability.md +0 -30
  206. package/skills/code-review-expert/references/design-boundaries.md +0 -26
  207. package/skills/code-review-expert/references/removal-plan.md +0 -24
  208. package/skills/codex-collab/SKILL.md +0 -49
  209. package/skills/codex-collab/evals/evals.json +0 -35
  210. package/skills/integration-rules/SKILL.md +0 -32
  211. package/skills/security-rules/SKILL.md +0 -38
  212. package/skills/testing-rules/SKILL.md +0 -32
  213. package/skills/ultra-doctor/SKILL.md +0 -41
  214. package/skills/ultra-plan/references/semantic-preflight.md +0 -20
  215. package/skills/ultra-verify/SKILL.md +0 -46
  216. package/skills/ultra-verify/evals/evals.json +0 -46
  217. package/skills/ultra-verify/references/cross-verify-modes.md +0 -28
  218. package/skills/ultra-verify/references/evidence-status.md +0 -21
  219. package/skills/ultra-verify/scripts/verify_wait.py +0 -94
  220. package/spec/cli-protocol.md +0 -102
  221. package/spec/mcp-tools.yaml +0 -312
  222. package/spec/schemas/baseline-reconciliation.v1.schema.json +0 -73
  223. package/spec/schemas/change-delta.v1.schema.json +0 -153
  224. package/spec/schemas/command-manifest.schema.json +0 -29
  225. package/spec/schemas/context-file.v4.5.schema.json +0 -54
  226. package/spec/schemas/delivery-report.v1.schema.json +0 -66
  227. package/spec/schemas/documentation-reconciliation.v1.schema.json +0 -106
  228. package/spec/schemas/mcp-tools.schema.json +0 -136
  229. package/spec/schemas/skill-manifest.schema.json +0 -24
  230. package/spec/schemas/state-db.sql +0 -641
  231. package/spec/schemas/task-ledger.v2.schema.json +0 -296
  232. package/spec/schemas/tasks.v4.5.schema.json +0 -96
  233. package/spec/schemas/test-report.v1.schema.json +0 -225
  234. package/ultra-tools/cli.cjs +0 -129
  235. package/ultra-tools/commands/db.cjs +0 -226
  236. package/ultra-tools/commands/legacy-memory.cjs +0 -159
  237. package/ultra-tools/commands/migrate.cjs +0 -1386
  238. package/ultra-tools/commands/session.cjs +0 -213
  239. package/ultra-tools/commands/status.cjs +0 -559
  240. package/ultra-tools/commands/system.cjs +0 -498
  241. package/ultra-tools/commands/task.cjs +0 -105
@@ -1,75 +1,96 @@
1
1
  # Skill authoring contract
2
2
 
3
- Ultra Builder Pro keeps one portable source workflow and adapts only runtime metadata
4
- or host invocation details. This contract follows OpenAI Skills guidance and the Agent
5
- Skills progressive-disclosure format:
6
-
7
- - <https://learn.chatgpt.com/docs/build-skills>
8
- - <https://learn.chatgpt.com/docs/customization/overview>
9
- - <https://agentskills.io/specification>
10
- - <https://agentskills.io/skill-creation/best-practices>
11
-
12
- ## Surface ownership
13
-
14
- | Content | Owner |
15
- |---|---|
16
- | Repeatable task procedure and conditional references | `skills/<name>/SKILL.md` |
17
- | Codex display, invocation policy, and dependencies | `skills/<name>/agents/openai.yaml` after adaptation |
18
- | Host launcher | `commands/<name>.md` |
19
- | Durable repository or user engineering policy | `AGENTS.md` or the host equivalent |
20
- | Deterministic lifecycle enforcement | one hook implementation |
21
- | Live external data or actions | MCP server or connector |
22
- | Bounded delegated role | `agents/<name>.md` |
23
-
24
- Do not duplicate a rule across these surfaces.
25
-
26
- ## Portable `SKILL.md`
27
-
28
- Source frontmatter contains only `name` and `description`. The description says what
29
- the Skill does and when it should activate. The body uses imperative, outcome-oriented
30
- steps and includes only information an agent cannot reliably infer from the task,
31
- repository, or host policy.
32
-
33
- Keep the main file compact. Move conditional domain detail to `references/`, reusable
34
- deterministic work to `scripts/`, and output material to `assets/`. Reference a file
35
- only from the main workflow or one directly relevant reference.
36
-
37
- ## Language
38
-
39
- The standards do not prohibit Chinese. Ultra source prompts use English as a project
40
- policy because one source is transformed for Claude Code, Codex, OpenCode, Kimi Code,
41
- and Grok Build. The host or user instruction controls the response language; a workflow must not
42
- hard-code the user's output language unless language is itself part of the task.
43
-
44
- Maintainer documentation may use the language appropriate for its audience. English
45
- source prompts are a portability rule, not a claim that multilingual Skills are invalid.
46
-
47
- ## Content that does not belong in a Skill prompt
48
-
49
- - release notes, migration history, old-version behavior, or implementation diary;
50
- - host tool inventories, model pins, package paths, and dependency metadata shared by
51
- only one runtime;
52
- - generic engineering doctrine already owned by user or repository instructions;
53
- - one-off project facts, volatile external facts, or copied datasets;
54
- - duplicated command bodies, hook policy, MCP schemas, or private memory behavior;
55
- - arbitrary coverage, confidence, complexity, option-count, or severity thresholds;
56
- - pattern matching that turns TODOs, mocks, catch blocks, or line counts directly into
57
- findings without a reachable impact;
58
- - tutorial-style old/new or good/bad comparisons that do not change the workflow;
59
- - menus of hypothetical alternatives when one repository default already satisfies the
60
- contract.
61
-
62
- Comparison is appropriate only when the task requires a real decision or verification:
63
- compare credible alternatives against shared constraints, accepted specification
64
- against delivered behavior, or independent analyses against authoritative evidence.
65
-
66
- ## Review checklist
67
-
68
- 1. Does the description state a precise use condition?
69
- 2. Is every instruction reusable for this Skill rather than copied global policy?
70
- 3. Is host-specific metadata outside the portable prompt?
71
- 4. Does each conditional reference earn its context cost?
72
- 5. Are judgments evidence-based rather than threshold-based?
73
- 6. Are commands thin and agents bounded?
74
- 7. Do positive and negative trigger evals cover accidental activation?
75
- 8. Do source, five generated runtimes, and package contents pass validation?
3
+ Ultra Skills are portable model-facing methods. They describe outcomes, evidence, and
4
+ owner boundaries; host-specific discovery and invocation policy belong in adapters.
5
+
6
+ ## Role selection
7
+
8
+ Choose exactly one role before writing:
9
+
10
+ - **user-invoked**: a complete owner-selected workflow with a durable outcome;
11
+ - **model-invoked**: a reusable discipline used by at least two canonical workflows;
12
+ - **router**: read-only diagnosis that recommends the smallest next public route.
13
+
14
+ A user workflow may recommend but must not invoke another user workflow. A discipline
15
+ with only one real caller should be inlined.
16
+
17
+ ## Portable frontmatter
18
+
19
+ Source `SKILL.md` frontmatter contains only:
20
+
21
+ ```yaml
22
+ ---
23
+ name: lower-case-hyphen-name
24
+ description: What this produces and the concrete situations that trigger it.
25
+ ---
26
+ ```
27
+
28
+ Adapters generate Claude/Grok/Kimi invocation flags and Codex `agents/openai.yaml`.
29
+ Do not put host paths, dependency declarations, plugin policy, or release history in
30
+ source frontmatter.
31
+
32
+ ## Required shape
33
+
34
+ Every Skill has one outcome-led title and these semantic sections:
35
+
36
+ ```text
37
+ ## Before you start
38
+ ## Definition of done
39
+ ## <workflow-specific process>
40
+ ## When the owner decides
41
+ ## References
42
+ ```
43
+
44
+ User workflows begin by reading `.ultra/tasks.json`, the unfinished task's
45
+ `context_file` and Resume Note, `CONTEXT.md`, and relevant decisions. They name the
46
+ files they write and read them back. Completion criteria must be observable without a
47
+ semantic validator.
48
+
49
+ Use positive leading words consistently: tracer bullet, seam, deep module, red,
50
+ frontier, and fog of war. Explain a branch by its checkable result, not the model's
51
+ reason for choosing it.
52
+
53
+ ## Progressive disclosure
54
+
55
+ Keep resident `SKILL.md` short enough to load on every invocation. Move focused detail
56
+ into `references/` and deterministic validation or waiting into `scripts/`.
57
+
58
+ - Load one research step or review lens at a time.
59
+ - Keep one canonical copy of grilling, TDD, review, domain language, and autonomy rules.
60
+ - Cross-reference another model-invoked Skill by relative path.
61
+ - Do not hide the primary workflow in a script.
62
+ - A script may check paths, schemas, counts, hashes, process status, or other mechanical
63
+ facts; it may not decide semantic completeness.
64
+
65
+ Rule-side executable examples live with the consuming Skill. They are never copied
66
+ wholesale into project authority.
67
+
68
+ ## Language and host neutrality
69
+
70
+ Model-facing Skills, references, scripts, comments, and identifiers are English.
71
+ Shared Skills never mention `.claude`, `.codex`, `.opencode`, `.kimi`, `.grok`, or a
72
+ host-only question surface. Use “host-native question surface” and put the translation
73
+ in the adapter.
74
+
75
+ ## Safety boundary
76
+
77
+ The owner decides intent, acceptance, reductions, material risk, irreversible actions,
78
+ and external effects. The model owns investigation, design, decomposition, evidence
79
+ interpretation, reversible implementation detail, and final expression.
80
+
81
+ Semantic gaps are diagnostics. A Skill must not invent a hard gate based on counters,
82
+ regexes, similarity, context estimates, or workflow position. Every real hard effect
83
+ guard names its invariant, authoritative input, blocked effect, and reachable repair.
84
+
85
+ ## Validation
86
+
87
+ For every changed Skill:
88
+
89
+ 1. run the Skill Creator validator;
90
+ 2. resolve every relative reference in the source and installed artifact;
91
+ 3. verify its role metadata on all five hosts;
92
+ 4. test the accepted workflow with representative valid and adversarial inputs;
93
+ 5. confirm no retired runtime vocabulary or host-specific path entered portable text.
94
+
95
+ The repository's `tests/skill-authoring.test.cjs` and
96
+ `tests/v026-contract.test.cjs` mechanize the portable parts of this contract.
@@ -1,230 +1,134 @@
1
1
  # Ultra Builder Pro workflow lifecycle
2
2
 
3
- Ultra is an adaptive capability graph, not an automatically chained pipeline. The
4
- current Skill inspects authority and recommends a next capability. The user explicitly
5
- starts that capability. Skills own semantic procedure; the seven-tool MCP kernel owns
6
- persistence and mechanical safety across Claude Code, Codex, OpenCode, Kimi Code, and
7
- Grok Build.
8
-
9
- ## Capability graph
10
-
11
- ```mermaid
12
- flowchart TD
13
- START["Project"] --> INIT["ultra-init"]
14
- INIT --> RESEARCH["ultra-research"]
15
- RESEARCH --> THINK["ultra-think when a material decision remains"]
16
- THINK --> RESEARCH
17
- RESEARCH --> CHANGE["ultra-change"]
18
- CHANGE --> ROUTE{"What does this Change actually need?"}
19
- ROUTE -->|"Evidence gap"| CR["bounded ultra-research"]
20
- CR --> ROUTE
21
- ROUTE -->|"Implementation"| PLAN["ultra-plan"]
22
- PLAN --> DEV["ultra-dev for one owned Task"]
23
- DEV --> MORE{"More executable Tasks?"}
24
- MORE -->|"Yes"| DEV
25
- MORE -->|"No"| ASSESS{"What evidence is still warranted?"}
26
- ROUTE -->|"No implementation; current evidence is sufficient"| ASSESS
27
- ASSESS -->|"Risk-selected verification"| TEST["ultra-test"]
28
- ASSESS -->|"Independent review"| REVIEW["ultra-review"]
29
- ASSESS -->|"Caller accepts current packet and explicit omissions"| DELIVER["ultra-deliver"]
30
- TEST -->|"implementation gap"| DEV
31
- TEST -->|"review warranted"| REVIEW
32
- TEST -->|"caller accepts evidence"| DELIVER
33
- REVIEW -->|"implementation issue"| DEV
34
- REVIEW -->|"contract issue"| PLAN
35
- REVIEW -->|"accepted"| DELIVER
36
- DELIVER --> CHANGE
37
- STATUS["ultra-status"] -.-> INIT
38
- STATUS -.-> CHANGE
39
- DOCTOR["ultra-doctor"] -.-> INIT
40
- DOCTOR -.-> CHANGE
41
- ```
3
+ Ultra v0.26 has no fixed runtime state machine. Skills define checkable entry and exit
4
+ criteria; repository files record facts; the host model chooses the route.
42
5
 
43
- The graph is guidance, not database authorization. The host model selects the evidence
44
- needed by the actual Change route and records every deliberate omission in the delivery
45
- handoff. When implementation occurs, its Plan, Task contract, and Context remain
46
- mandatory execution authority; Research, Test, and Review are used according to the
47
- actual evidence and risk rather than as universal archive gates. `ultra-status` is
48
- read-only. `ultra-doctor` repairs mechanical authority only.
49
-
50
- ## Shared command contract
51
-
52
- Every public Skill follows the same boundary:
53
-
54
- 1. read the current `ultra.context`;
55
- 2. inspect checkout/runtime facts directly;
56
- 3. identify the smallest unresolved semantic choice;
57
- 4. recommend a route and ask only when user intent is not already explicit;
58
- 5. persist normalized facts through typed `ultra.record`;
59
- 6. update the owning semantic/evidence files;
60
- 7. save or accept the stage through `ultra.checkpoint`;
61
- 8. read back current authority;
62
- 9. report diagnostics and recommend, but do not launch, the next Skill.
63
-
64
- No command records ceremonial steps merely to satisfy SQLite.
65
-
66
- ## Capability ownership
67
-
68
- | Skill | Semantic owner | Durable output |
69
- |---|---|---|
70
- | `ultra-init` | repository classification, scope, Git/runtime bootstrap | initialized local authority and empty/imported team checkpoint |
71
- | `ultra-research` | adaptive evidence coverage and accepted baseline | baseline specs, research evidence, Decision Records, baseline checkpoint |
72
- | `ultra-think` | one load-bearing owner decision or bounded diagnosis | normalized Decision Record and applied references |
73
- | `ultra-change` | feature/fix/refactor/incident contract | active Change intent, classification, delta and decision scope |
74
- | `ultra-plan` | Task contracts, topology, ownership, acceptance coverage | accepted Plan checkpoint, deterministic plan files, team checkpoint |
75
- | `ultra-dev` | one owned vertical Task implementation | Worker Packet output, task outcome, implementation evidence checkpoint |
76
- | `ultra-test` | risk-selected executable validation | test report and accepted test checkpoint |
77
- | `ultra-review` | independent spec fidelity and engineering quality | specialist artifacts, coordinated summary, accepted review checkpoint |
78
- | `ultra-deliver` | documentation/spec reconciliation and local archive | delivery evidence, converged baseline, immutable archive, team checkpoint |
79
- | `ultra-status` | current Context rendering | no state mutation |
80
- | `ultra-doctor` | mechanical health, migration, backup and repair | diagnostic/repair report; no product decision |
81
-
82
- ## Context and decisions
83
-
84
- One canonical Context Envelope flows through Skill, Hook, Session, Agent, and compact
85
- recovery. Accepted Decision Records are always visible, including when no workflow is
86
- active. A new session therefore resumes from accepted intent rather than reconstructing
87
- it from conversation.
88
-
89
- Decision history is append-only through supersession:
6
+ ## Capability flow
90
7
 
91
8
  ```text
92
- proposed -> accepted -> superseded
93
- -> rejected
94
- ```
9
+ ultra-init
10
+ ├─ unresolved external claims ─► ultra-research
11
+ └─ bounded requested outcome ──► ultra-change
95
12
 
96
- The status of a proposal never grants execution authority. The accepted record, its
97
- digest, applied references, and the owning checkpoint do.
13
+ ultra-change ─► ultra-plan ─► ultra-dev (per task) ─► ultra-test ─► ultra-deliver
14
+ ▲ │ │
15
+ └── replan ◄──────┘ └── findings return to owner/model
98
16
 
99
- ## Checkpoints, not fixed steps
17
+ ultra-status read-only router at any point
18
+ ultra-delegate orthogonal bounded execution on another CLI
19
+ ```
100
20
 
101
- Stage authority is revisioned:
21
+ Arrows are recommendations, not automatic invocation. The owner explicitly selects
22
+ each public workflow.
102
23
 
103
- ```text
104
- draft revision N
105
- -> accepted revision N
106
- -> accepted revision N+1 supersedes N
107
- ```
24
+ ## Common entry contract
108
25
 
109
- Semantic diagnostics remain recorded but do not reject the model's explicit
110
- checkpoint conclusion. A structural, digest, path, publication, or concurrency
111
- conflict keeps the same draft mutable. Plan export is part of Plan checkpoint
112
- publication, so changing a Task contract before acceptance cannot invalidate an
113
- already-recorded “export step.” There is no locked intermediate run to cancel or
114
- manually repair.
26
+ Every user-invoked Skill reads, in order:
115
27
 
116
- Accepted checkpoints are immutable evidence. New facts create a replacement draft.
117
- Only archive history is terminal; subsequent product work opens a new Change.
28
+ 1. `.ultra/tasks.json`;
29
+ 2. the unfinished task's `context_file` and closing `## Resume Note`;
30
+ 3. `CONTEXT.md` and relevant `.ultra/decisions/`;
31
+ 4. the active Change, specifications, evidence, and Git state relevant to its scope.
118
32
 
119
- ## Change lifecycle
33
+ Missing files produce a precise recovery or initialization recommendation. They do not
34
+ cause the Skill to invent a state transition.
120
35
 
121
- Live v0.24 writes only:
36
+ ## Initialization
122
37
 
123
- ```text
124
- active -> archived
125
- |
126
- -> cancelled
127
- ```
38
+ `ultra-init` distinguishes owner authorization from claims requiring evidence. It
39
+ creates the file skeleton, preserves unknowns as `[NEEDS CLARIFICATION]`, initializes
40
+ Git when absent, and records only repository-observable brownfield facts. It does not
41
+ perform research or launch another workflow.
128
42
 
129
- `blocked`, `ready`, and `needs_attention` are derived diagnostics, not absorbing Change
130
- states. An active Change may be revised. The Deliver Skill inspects the relevant Task,
131
- Context, test, review, documentation, and delivery evidence, decides semantic
132
- sufficiency, and records deliberate omissions. Archive validates the explicit handoff,
133
- current authority, reconciliation structure, and safe recoverable filesystem/DB
134
- transaction without enforcing a fixed stage sequence. Archived bytes remain immutable.
43
+ ## Research
135
44
 
136
- Older `ready` or `blocked` rows are readable migration history. They do not authorize
137
- new work until migration/revalidation derives current checkpoint authority.
45
+ `ultra-research` maps unresolved claims to the smallest useful subset of seventeen
46
+ focused references. Reports are written immediately. Three material checkpoints can
47
+ change later scope; the owner resolves those checkpoints. The final distillate records
48
+ Git blob hashes of the specifications it summarizes.
138
49
 
139
- ## Task and Session lifecycle
50
+ ## Change reconciliation
140
51
 
141
- Task durable outcomes remain portable:
52
+ `ultra-change` first compares requested behavior with product truth and current code.
53
+ It classifies changes by the resulting commitments:
142
54
 
143
- ```text
144
- pending -> in_progress -> completed
145
- | | |
146
- | -> blocked -> in_progress (explicit reopen)
147
- -> blocked
148
- -> cancelled
149
- ```
55
+ - expansion and correction may proceed inside accepted intent;
56
+ - a reduction waits for explicit owner authority.
150
57
 
151
- `in_progress`, Worker ownership, leases, PIDs, heartbeats, worktrees, and completion
152
- commit backfill are checkout-local. They are not published to Git.
153
- Reopening a completed Task clears the local completion/session fields, preserves the
154
- prior completion commit in an append-only `task_reopened` event, and requires a new
155
- durable outcome before it can be completed again.
58
+ The output is one active Change intent with observable outcome, acceptance, seams,
59
+ non-goals, and trace anchors.
156
60
 
157
- `ultra.session acquire` atomically:
61
+ ## Planning
158
62
 
159
- 1. checks a real lease/CAS conflict;
160
- 2. compiles or reuses the exact Context Envelope;
161
- 3. creates an immutable Worker Packet;
162
- 4. allocates the lease/worktree;
163
- 5. returns packet path/digest and exact execution boundary.
63
+ `ultra-plan` confirms the scope posture and public seams, then writes a task graph and
64
+ one context file per task. Feature tasks are tracer bullets. A contract task precedes
65
+ cross-process or cross-top-level-boundary implementations; integration checkpoints
66
+ appear after several slices. Cycles and broken trace paths are repaired before handoff.
164
67
 
165
- A missing semantic detail is diagnostic, not a transport failure. A genuine lease,
166
- digest, unsafe path, or concurrent authority conflict fails closed. Optional
167
- orchestration can dispatch only a Change-owned Task with an accepted Plan checkpoint
168
- and assigned Worker Packet.
68
+ ## Task development
169
69
 
170
- ## Team sync
70
+ `ultra-dev` writes the implementation plan into the task context before code. It uses
71
+ `ultra-tdd` on confirmed seams, records six evidence dimensions, and keeps ledger and
72
+ context status synchronized. The closing Resume Note is rewritten even when work stops
73
+ early.
171
74
 
172
- `.ultra/tasks/tasks.json` is a tracked, digest-chained team checkpoint. It carries
173
- portable baseline, Change, Decision summary/reference, accepted Stage Checkpoint, Task
174
- contract, dependency, and durable outcome records. It excludes local execution state.
75
+ Task review uses six independent lenses. Findings move through stable JSON artifacts,
76
+ not intermediate worker chatter. Refactoring happens after the evidence makes real
77
+ duplication or coupling visible.
175
78
 
176
- `ultra.sync` supports:
79
+ ## Whole-system audit
177
80
 
178
- - `inspect`: side-effect-free condition and migration advice;
179
- - `migrate`: exact-byte backup-first legacy conversion;
180
- - `import`: schema/digest/ancestry/CAS validation and clean fast-forward;
181
- - `publish`: reconcile incoming Git authority, then publish one new generation.
81
+ `ultra-test` runs once after the ledger is complete. It checks anti-patterns, coverage,
82
+ wiring, E2E behavior, performance, and security. It names the exact Git commit and
83
+ never turns an orphan, failed command, stub, or omission into permission to alter scope.
182
84
 
183
- Same-record concurrent edits return a typed conflict. Ultra does not silently choose
184
- one intent. Imported accepted baseline authority requires checkout-local source/spec
185
- revalidation before descendant publication.
85
+ ## Delivery
186
86
 
187
- Metadata-only Ultra commits do not make a baseline stale. Source or specification
188
- drift remains visible and may require revalidation.
87
+ `ultra-deliver` reconciles actual outcome, specifications, documentation, current test
88
+ report, aggregate review, build, version impact, omissions, and rollback. It archives
89
+ the Change with `git mv` after local reconciliation.
189
90
 
190
- ## Hook lifecycle
91
+ Commit, push, tag, publication, release, and deployment are independent external
92
+ effects. Readiness grants none automatically.
191
93
 
192
- Hooks do not drive the capability graph. They:
94
+ ## Status routing
193
95
 
194
- - inject a bounded Context Envelope where the host consumes it;
195
- - protect the team checkpoint and generated projections from direct writes;
196
- - save/restore minimal compact recovery state;
197
- - record minimal lifecycle identifiers;
198
- - return advisory Stop context.
96
+ `ultra-status` infers the smallest next route from observable files:
199
97
 
200
- When a host ignores Hook stdout, the adapter records health/events only and every Skill
201
- reads `ultra.context` explicitly. Hook limitations are never presented as successful
202
- context injection.
98
+ - no healthy skeleton → init;
99
+ - unresolved evidence-bearing claim → research;
100
+ - requested outcome without active Change → change;
101
+ - active Change without executable ledger → plan;
102
+ - pending or in-progress task → dev;
103
+ - completed ledger without current report → test;
104
+ - current report and unarchived Change → deliver.
203
105
 
204
- ## Recovery
106
+ It also checks installation provenance, stale reports, old in-progress work, and
107
+ unresolved markers. It does not mutate artifacts.
205
108
 
206
- Use `ultra.context` first; legacy input must return a discoverable migration action
207
- instead of blocking diagnosis. Use `ultra.sync migrate` for semantic conversion and
208
- `ultra.doctor { repair: true }` for mechanical backup/recovery.
109
+ ## Artifact closure
209
110
 
210
- Migration supports v4.4/v4.5 projections and v0.22/v0.23 database/ledger authority.
211
- It is exact-byte backup-first, transactional, and fail-closed on conflict. Legacy
212
- workflow/dialogue rows survive as history but do not authorize current work.
111
+ Every durable output has a later reader:
213
112
 
214
- Repair never invents a product choice, edits a semantic artifact to make it pass, or
215
- asks the user to hand-edit SQLite.
113
+ - init's north star and specification skeletons are read by all later workflows;
114
+ - research reports are traced into specifications, Change reconciliation, planning,
115
+ and delivery;
116
+ - Change intent is consumed through planning, development, audit, review, status, and
117
+ delivery;
118
+ - task ledger and contexts are the common resume input, while task evidence feeds
119
+ review, whole-system audit, and delivery;
120
+ - the current test report is consumed by status and delivery;
121
+ - delivery moves with the Change into archive and remains historical evidence.
216
122
 
217
- ## Hard-error boundary
123
+ `ultra-status` intentionally writes nothing. Review, Hook, compact, and delegation
124
+ files are derived observations with explicit rebuild or rerun paths. No route creates
125
+ an unowned drift log, Change plan, technical-debt report, or second delivery summary.
218
126
 
219
- Only these classes fail the tool call:
127
+ ## Interruption and cross-host continuation
220
128
 
221
- - database/schema corruption;
222
- - unsafe path, symlink, or identity swap;
223
- - actual digest, CAS, or lease concurrency conflict;
224
- - missing/incompatible native runtime;
225
- - permission failure;
226
- - archive/publish/deploy or another irreversible external-effect failure.
129
+ Before stopping, the active task context records current facts, exact verification,
130
+ open questions, Completion, and a closing Resume Note. The next session or host repeats
131
+ the common entry contract and compares the working tree with those claims.
227
132
 
228
- Evidence gaps, incomplete exploration, stale optional context, missing reports, or
229
- other semantic insufficiency are structured diagnostics. The model remains responsible
230
- for investigating, revising, accepting, or explicitly recording an omission.
133
+ This path remains valid when hooks and `ubp` are disabled. A compact snapshot may be
134
+ used as a hint, then checked against canonical files and Git.
package/hooks/README.md CHANGED
@@ -1,42 +1,22 @@
1
- # Ultra Builder Pro workflow hooks
1
+ # Ultra Builder Pro hooks
2
2
 
3
- These Hooks observe only Ultra-owned state. Session health/context recognizes an
4
- initialized `.ultra/.runtime/state.db` and reads the canonical Context Envelope.
5
- Direct writes to the MCP-owned Git checkpoint and checkout-local projections remain
6
- blocked; context, compact, stop, and agent lifecycle behavior is recovery-oriented and
7
- does not turn semantic diagnostics into refusal gates.
3
+ Ultra ships five small file-first hooks. Every hook first looks for a `.ultra/`
4
+ directory and exits silently when the workflow is not active.
8
5
 
9
- | Lifecycle | Hook | Purpose |
6
+ | Hook | Lifecycle | Purpose |
10
7
  |---|---|---|
11
- | Session start | `health_check.py` | Read-only integrity, incident, projection, session, and change-artifact checks |
12
- | Shared helper | `context_envelope.py` | Read the same bounded Context Envelope used by MCP, Skills, Sessions, and Workers |
13
- | Session start | `workflow_context.py` | Inject the compact envelope with accepted intent, never raw interaction or provider payloads |
14
- | Before edit | `active_task_context.py` | Protect `.ultra/tasks/tasks.json` (Git team checkpoint) and `.ultra/.runtime/projections/tasks.json` (local view), then restate the same DB-derived task breadcrumb |
15
- | Before compact | `workflow_checkpoint.py` | Validate and atomically save a minimal workflow checkpoint |
16
- | After compact/resume | `workflow_resume.py` | Prefer the DB breadcrumb; restore the minimal file checkpoint only when no active change owns recovery |
17
- | Stop | `pre_stop_check.py` | Report an incomplete workflow boundary and allow stop |
18
- | Subagent lifecycle | `subagent_tracker.py` | Append minimal start/stop metadata to the authoritative DB event stream |
8
+ | `session_context.py` | Session start | Inject the one-line north star and current acceptance criteria |
9
+ | `mid_workflow_recall.py` | Before source reads or edits | Restate current acceptance only |
10
+ | `compact_context.py` | Before/after compaction | Save and restore a disposable snapshot derived from files and Git |
11
+ | `post_edit_guard.py` | After edits | Record mechanical evidence observations without deciding completion |
12
+ | `block_dangerous_commands.py` | Before shell execution | Block a narrow named external effect until the exact command is owner-authorized |
19
13
 
20
- The plugin deliberately does not capture prompts, tool observations, transcripts, summaries, general
21
- conversational memory, or code-graph payloads. It does retain project-local Ultra workflow memory in
22
- `.ultra/`. Generic command blocking and post-edit policy are user/repository governance. General
23
- memory and graph content belongs to separately installed providers.
14
+ `_common.py` is a shared library, not a lifecycle registration. Compact snapshots and
15
+ progress observations live under ignored `.ultra/.runtime/` or `.ultra/progress/`; the
16
+ canonical semantic facts remain the owner-readable files and Git.
24
17
 
25
- `subagent_tracker.py` passes only agent id/type and the host session id to the bundled
26
- `hook-event.cjs` helper. The helper binds the current change/task and appends
27
- `subagent_started` or `subagent_stopped` to `state.db`; it never stores transcript
28
- paths, messages, or a parallel JSONL lifecycle log.
29
-
30
- `context_envelope.py` is an imported library, not an additional lifecycle registration.
31
- Registering it separately would duplicate hook execution. The checkpoint is a recovery artifact, not a second authority. A valid newer
32
- live workflow wins; a newer valid checkpoint may restore a missing or older
33
- live file; corrupt, non-object, or terminal checkpoints are ignored.
34
-
35
- Runtime wiring:
36
-
37
- - Claude Code: native `hooks/hooks.json` with `${CLAUDE_PLUGIN_ROOT}` paths.
38
- - Codex: native `hooks/hooks.json` through `hooks/adapters/codex.py` for wire normalization.
39
- - OpenCode: native JavaScript plugin events; the Python hook suite is not copied.
40
- - Kimi Code: native lifecycle events through its wire adapter.
41
- - Grok Build: camelCase lifecycle events; ignored stdout channels are used for
42
- observation only, and every Skill rereads authoritative Context at entry.
18
+ Claude Code runs the hooks directly. Codex, Kimi Code, and Grok Build use the small
19
+ wire adapters under `hooks/adapters/`. OpenCode calls the same scripts from its native
20
+ JavaScript plugin. A hook failure is advisory except for the explicitly classified
21
+ external effects in `block_dangerous_commands.py`, whose denial includes a reachable
22
+ SHA-256-scoped authorization path.