ultra-builder-pro-cli 5.0.1 → 6.0.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 (159) hide show
  1. package/CHANGELOG.md +103 -3
  2. package/README.md +67 -478
  3. package/README.zh-CN.md +49 -422
  4. package/adapters/_shared/frontmatter.cjs +1 -18
  5. package/adapters/_shared/plugin-core.cjs +17 -83
  6. package/adapters/_shared/runtime-assets.cjs +6 -120
  7. package/adapters/claude.js +8 -24
  8. package/adapters/codex.js +13 -32
  9. package/bin/install.js +35 -57
  10. package/docs/PLUGIN-ISOLATION-CONTRACT.md +13 -101
  11. package/docs/examples/drive/claude-reviewer.sh +53 -0
  12. package/docs/examples/drive/claude-writer.sh +43 -0
  13. package/engine/FORMATS.md +1051 -0
  14. package/engine/checks.cjs +139 -0
  15. package/engine/cli.cjs +148 -0
  16. package/engine/completion.cjs +48 -0
  17. package/engine/context.cjs +94 -0
  18. package/engine/drive.cjs +220 -0
  19. package/engine/expect-worker.cjs +5 -0
  20. package/engine/expect.cjs +33 -0
  21. package/engine/formats.cjs +189 -0
  22. package/engine/git-state.cjs +112 -0
  23. package/engine/ledger.cjs +205 -0
  24. package/engine/loading.cjs +28 -0
  25. package/engine/merge.cjs +273 -0
  26. package/engine/milestone.cjs +89 -0
  27. package/engine/plan.cjs +232 -0
  28. package/engine/project.cjs +5 -0
  29. package/engine/signals.cjs +3 -0
  30. package/engine/states.cjs +175 -0
  31. package/hooks/session-start.cjs +54 -0
  32. package/package.json +17 -52
  33. package/skills/ultra/SKILL.md +395 -0
  34. package/.ultra-template/changes/abandoned/.gitkeep +0 -0
  35. package/.ultra-template/changes/active/.gitkeep +0 -1
  36. package/.ultra-template/changes/archive/.gitkeep +0 -1
  37. package/.ultra-template/contexts/TEMPLATE.md +0 -135
  38. package/.ultra-template/decisions/.gitkeep +0 -1
  39. package/.ultra-template/evidence/.gitkeep +0 -1
  40. package/.ultra-template/north-star.md +0 -52
  41. package/.ultra-template/project-brief.md +0 -28
  42. package/.ultra-template/research/.gitkeep +0 -1
  43. package/.ultra-template/specs/architecture.md +0 -81
  44. package/.ultra-template/specs/discovery.md +0 -74
  45. package/.ultra-template/specs/product.md +0 -80
  46. package/.ultra-template/specs/research-distillate.md +0 -57
  47. package/.ultra-template/tasks.json +0 -4
  48. package/.ultra-template/test-report.json +0 -44
  49. package/adapters/_shared/host-profile.cjs +0 -5
  50. package/adapters/grok.js +0 -242
  51. package/adapters/kimi.js +0 -232
  52. package/adapters/opencode.js +0 -408
  53. package/adapters/zcode.js +0 -375
  54. package/bin/delegate-worker.cjs +0 -5
  55. package/bin/delegate.cjs +0 -5
  56. package/docs/ARCHITECTURE.md +0 -274
  57. package/docs/ARTIFACT-AUTHORITY.md +0 -305
  58. package/docs/DECISIONS.md +0 -229
  59. package/docs/PHILOSOPHY.md +0 -261
  60. package/docs/RUNTIME-COMPAT-MATRIX.md +0 -316
  61. package/docs/SKILL-AUTHORING.md +0 -113
  62. package/docs/WORKFLOW-LIFECYCLE.md +0 -350
  63. package/docs/evals/adversarial-review-2026-08-14.md +0 -84
  64. package/docs/evals/ultra-5-0-journey-results.md +0 -62
  65. package/docs/evals/ultra-5-0-live-acp-conformance.md +0 -93
  66. package/docs/evals/ultra-5-0-route-journeys.md +0 -145
  67. package/docs/evals/zcode-automation-2026-08-14.md +0 -103
  68. package/hooks/README.md +0 -52
  69. package/hooks/_common.py +0 -1779
  70. package/hooks/adapters/codex.py +0 -295
  71. package/hooks/adapters/grok.py +0 -134
  72. package/hooks/adapters/kimi.py +0 -156
  73. package/hooks/adapters/zcode.py +0 -227
  74. package/hooks/block_dangerous_commands.py +0 -201
  75. package/hooks/compact_context.py +0 -224
  76. package/hooks/mid_workflow_recall.py +0 -47
  77. package/hooks/post_edit_guard.py +0 -215
  78. package/hooks/session_context.py +0 -741
  79. package/skills/ultra-change/SKILL.md +0 -165
  80. package/skills/ultra-change/references/change-contract.md +0 -199
  81. package/skills/ultra-change/references/execution-grant.md +0 -109
  82. package/skills/ultra-change/references/primary-transfer.md +0 -273
  83. package/skills/ultra-change/scripts/validate_primary_transfer.cjs +0 -1928
  84. package/skills/ultra-delegate/SKILL.md +0 -195
  85. package/skills/ultra-delegate/patches/zcode-acp-0.1.0-zcode-0.16.5.patch +0 -184
  86. package/skills/ultra-delegate/references/delegation-contract.md +0 -138
  87. package/skills/ultra-delegate/scripts/acp-conformance.cjs +0 -287
  88. package/skills/ultra-delegate/scripts/acp-driver.cjs +0 -762
  89. package/skills/ultra-delegate/scripts/agent-execution-driver.cjs +0 -320
  90. package/skills/ultra-delegate/scripts/cli-driver.cjs +0 -61
  91. package/skills/ultra-delegate/scripts/delegate-profiles/kimi-read-only.md +0 -15
  92. package/skills/ultra-delegate/scripts/delegate-profiles/kimi-write.md +0 -17
  93. package/skills/ultra-delegate/scripts/delegate-worker.cjs +0 -328
  94. package/skills/ultra-delegate/scripts/delegate.cjs +0 -690
  95. package/skills/ultra-delegate/scripts/delegate_wait.py +0 -86
  96. package/skills/ultra-delegate/scripts/host-profile.cjs +0 -267
  97. package/skills/ultra-deliver/SKILL.md +0 -194
  98. package/skills/ultra-deliver/references/baseline-reconciliation.md +0 -41
  99. package/skills/ultra-dev/SKILL.md +0 -265
  100. package/skills/ultra-dev/references/debugging.md +0 -22
  101. package/skills/ultra-domain-modeling/SKILL.md +0 -79
  102. package/skills/ultra-grilling/SKILL.md +0 -121
  103. package/skills/ultra-grilling/references/reframing.md +0 -76
  104. package/skills/ultra-init/SKILL.md +0 -143
  105. package/skills/ultra-init/references/brownfield-adoption.md +0 -32
  106. package/skills/ultra-init/scripts/init_project.cjs +0 -1031
  107. package/skills/ultra-plan/SKILL.md +0 -160
  108. package/skills/ultra-plan/references/task-evidence-v2.md +0 -300
  109. package/skills/ultra-plan/scripts/validate_task_evidence.cjs +0 -859
  110. package/skills/ultra-research/SKILL.md +0 -167
  111. package/skills/ultra-research/references/00-problem-validation.md +0 -36
  112. package/skills/ultra-research/references/01-opportunity-discovery.md +0 -33
  113. package/skills/ultra-research/references/02-market-assessment.md +0 -31
  114. package/skills/ultra-research/references/03-alternatives.md +0 -31
  115. package/skills/ultra-research/references/04-product-strategy.md +0 -41
  116. package/skills/ultra-research/references/05-assumptions-validation.md +0 -31
  117. package/skills/ultra-research/references/10-user-personas.md +0 -30
  118. package/skills/ultra-research/references/11-user-scenarios.md +0 -28
  119. package/skills/ultra-research/references/20-user-stories.md +0 -31
  120. package/skills/ultra-research/references/21-features-scope.md +0 -38
  121. package/skills/ultra-research/references/22-success-metrics.md +0 -33
  122. package/skills/ultra-research/references/30-architecture-context.md +0 -30
  123. package/skills/ultra-research/references/31-solution-strategy.md +0 -28
  124. package/skills/ultra-research/references/32-building-blocks.md +0 -28
  125. package/skills/ultra-research/references/40-deployment.md +0 -29
  126. package/skills/ultra-research/references/41-quality-risks.md +0 -28
  127. package/skills/ultra-research/references/99-synthesis.md +0 -59
  128. package/skills/ultra-research/references/north-star-v2.md +0 -168
  129. package/skills/ultra-research/references/wayfinding.md +0 -50
  130. package/skills/ultra-research/scripts/validate_north_star.cjs +0 -1174
  131. package/skills/ultra-review/SKILL.md +0 -275
  132. package/skills/ultra-review/references/adversarial-evaluation.md +0 -31
  133. package/skills/ultra-review/references/code.md +0 -17
  134. package/skills/ultra-review/references/comments.md +0 -12
  135. package/skills/ultra-review/references/design.md +0 -12
  136. package/skills/ultra-review/references/errors.md +0 -13
  137. package/skills/ultra-review/references/review-modes.md +0 -29
  138. package/skills/ultra-review/references/spec.md +0 -18
  139. package/skills/ultra-review/references/tests.md +0 -12
  140. package/skills/ultra-review/references/unified-schema.md +0 -284
  141. package/skills/ultra-review/references/worker-packet.md +0 -183
  142. package/skills/ultra-review/scripts/review_wait.py +0 -2943
  143. package/skills/ultra-status/SKILL.md +0 -209
  144. package/skills/ultra-status/references/route-contract.md +0 -100
  145. package/skills/ultra-tdd/SKILL.md +0 -91
  146. package/skills/ultra-tdd/references/templates/README.md +0 -20
  147. package/skills/ultra-tdd/references/templates/feature-flag-default-audit.sh +0 -79
  148. package/skills/ultra-tdd/references/templates/persistence-real.ts +0 -78
  149. package/skills/ultra-tdd/references/templates/testcontainer-postgres.py +0 -78
  150. package/skills/ultra-tdd/references/templates/testcontainer-postgres.ts +0 -73
  151. package/skills/ultra-tdd/references/templates/vertical-slice.ts +0 -66
  152. package/skills/ultra-tdd/references/test-execution.md +0 -23
  153. package/skills/ultra-test/SKILL.md +0 -244
  154. package/skills/ultra-test/references/export-syntax.md +0 -18
  155. package/skills/ultra-test/scripts/validate_review_transport.cjs +0 -549
  156. package/skills/ultra-test/scripts/worktree_digest.cjs +0 -576
  157. package/skills/ultra-think/SKILL.md +0 -56
  158. package/skills/ultra-think/references/autonomy-boundary.md +0 -48
  159. package/skills/ultra-think/references/interaction-boundary.md +0 -42
@@ -1,209 +0,0 @@
1
- ---
2
- name: ultra-status
3
- description: Infer the current Ultra route, baseline gaps, stale evidence, task risk, and installation health from repository files and host manifests. Use when the owner asks what is complete, blocked, stale, unhealthy, or useful to do next.
4
- ---
5
-
6
- # Route from artifacts without changing them
7
-
8
- This router is read-only. It separates verified files, model inference, and unavailable
9
- evidence, then recommends one explicit public capability without invoking it. It never
10
- persists a workflow-position field.
11
-
12
- ## Route modes
13
-
14
- | Mode | Entry | Observable exit | Next |
15
- |---|---|---|---|
16
- | `route` | Owner asks what is current or what to do next | One artifact-derived Route Card names the matched facts, unavailable evidence, and one recommended route | The named explicit route, or `idle` |
17
- | `history` | Owner asks what changed, was rejected, or was superseded | Relevant decisions, Git revisions, archived/abandoned Changes, and unresolved contradictions are summarized without becoming authority | Return to `route` or the owner-selected revision route |
18
- | `installation` | Owner asks whether Ultra is discovered and healthy on a Host | Installed version, provenance, Skill/hook discovery, drift, and reachable repair are reported read-only | Recommend the exact install/update/Doctor repair |
19
- | `delegation` | Owner asks about a worker, handoff, ACP/CLI event, or terminal result | Transport observations and canonical authority are shown separately with a retry/cancel/integration path | Return to the requesting primary route |
20
- | `recovery` | Authority is absent, ambiguous, stale, malformed, or temporarily unreadable | The earliest unsafe or unavailable fact and cheapest safe repair, retry, cancel, abandon, or fresh-session path are named | Recommend only the repair-capable explicit route |
21
-
22
- Follow `references/route-contract.md` and use its `UBP Route Card` as the default output,
23
- not an optional appendix. Expand history, installation, delegation, or recovery details
24
- only when requested or needed to explain why the normal route is unavailable. Status is
25
- a `router`: the Owner invokes it for read-only diagnosis, its Host implicit bit remains
26
- off, and it supplies no continuation authority. Other public Skills derive their own
27
- cards from the shared reference rather than invoking Status.
28
-
29
- ## Before you start
30
-
31
- 1. Read `../ultra-change/references/change-contract.md` and apply its **Active Change
32
- authority resolution** before reading any active `intent.md` or relying on a current
33
- `change_id`. A positively observed absent `.ultra` uses the existing `ultra-init`
34
- route. Otherwise continue only from the rule's stable zero-or-one result. A typed
35
- diagnostic stops semantic routing from an ambiguous active Change, but it does not
36
- stop Status: switch to `recovery` mode and report the diagnostic plus safe Git and
37
- directory observations without reading any ambiguous `intent.md` as authority. With
38
- one valid active Change, read `.ultra/tasks.json`, then tasks whose `change_id` matches it and the
39
- frontier task's `context_file` and `## Resume Note`. `.ultra/tasks.json` is the sole
40
- task-status authority. A Status or Complexity header in a legacy context is a
41
- migration diagnostic; the ledger wins. Historical and abandoned tasks never define
42
- the frontier.
43
- 2. After stable authority resolution, read `.ultra/project-brief.md`,
44
- `.ultra/north-star.md`, `CONTEXT.md`, relevant `.ultra/decisions/`, specifications,
45
- active, archived, or abandoned Changes, and evidence. In `recovery` mode, read only
46
- unaffected canonical files and safe directory/Git observations; do not interpret an
47
- ambiguous active intent. An abandoned Change supplies historical boundary and
48
- recovery context; it never defines the current route.
49
- 3. Inspect Git `HEAD`, worktree status, and installed host manifests without repair.
50
- 4. When the active Change records a `durable work-package` Execution Grant, report it
51
- as recorded authorization data — grant id, cited decision, and its recorded
52
- subject, scope, topology, allowed effects, budgets, and invalidation — and state
53
- plainly that stored grant text is inactive until a consuming Agent stably
54
- verifies it per `../ultra-change/references/execution-grant.md`. Status itself
55
- neither activates nor continues the grant; a `session-local` grant is reported as
56
- requiring fresh owner activation.
57
-
58
- ## Definition of done
59
-
60
- - Emit the current Route Card with an exact mode, observable exit, unfinished work, and
61
- one next route or safe recovery path.
62
- - Evaluate the artifact route in order and name the evidence supporting the match.
63
- - Keep stale test evidence, dirty worktree state, baseline gaps, and task graph risks
64
- visible without converting them into semantic failure.
65
- - Report exact installation drift and a reachable repair without mutating it.
66
- - Recommend one route and why; never launch it.
67
-
68
- ## Infer the route
69
-
70
- | Observable files and current need | Recommendation |
71
- |---|---|
72
- | No `.ultra/` | `ultra-init` |
73
- | Project Brief has no usable one-line and no legacy `## One-line` exists | `ultra-init` |
74
- | Project Brief or legacy seed exists and North Star status is `unresearched`, legacy, invalid, or not accepted for the current boundary | `ultra-research` |
75
- | A new request exists and no active Change exists | `ultra-change` |
76
- | More than one active Change exists | Diagnose the conflicting directories and ask the owner which one remains active; do not route or move either automatically |
77
- | A primary-transfer handoff directory exists under `.ultra/.runtime/handoffs/` | Report its protocol state read-only (`offered`, `blocked`, `active`, or a terminal state) from `OFFER.json`/`ACK.json`/`RESULT.json`, verified with `node <ultra-change-skill-dir>/scripts/validate_primary_transfer.cjs <repository-root>`; receipts are derived observations, never authority |
78
- | An ACK-ready handoff has no terminal RESULT | The accepted receiver is the sole canonical writer for that work package; report the in-flight transfer and never route canonical writes to another Agent |
79
- | A handoff is `blocked` or its live re-verification is stale | Report the mismatched observation and the recovery path (fresh handoff id after owner re-confirmation); do not repair receipts |
80
- | The active intent is `draft` or has a blocking unresolved decision | `ultra-change` to finish and accept the contract |
81
- | The active `Research Disposition` names required exit evidence that is not satisfied | `ultra-research` for the named question and selected lenses |
82
- | Research evidence exists but the accepted intent has not reconciled it | `ultra-change` to update the bounded contract |
83
- | The accepted North Star revision or digest differs from the active intent trace | `ultra-change`; report the stale observation, preserve old evidence, and reconcile IDs before execution |
84
- | An active Change exists and `.ultra/tasks.json` has no tasks whose `change_id` matches it | `ultra-plan` |
85
- | The Change has exactly one `in_progress` task | `ultra-dev`, naming that task |
86
- | Only `pending` tasks remain (the frontier) | Report them as frontier candidates with their unresolved dependencies and recommend one exact task id for an explicit owner invocation of `ultra-dev`; a pending row is not active work and never auto-selects a route |
87
- | A ledger row says `completed` but its current `ultra-task-evidence-v2` record or task-review binding is missing, stale, or structurally invalid | `ultra-dev` to repair evidence and completion provenance; do not infer a context status or silently demote the row |
88
- | All matching tasks are completed, each has current `ultra-task-evidence-v2` plus a consumed task review, and no current report matches this Change | `ultra-test` |
89
- | A current false report has implementation, test, or wiring findings selected for repair | `ultra-dev` after owner disposition |
90
- | A current false report has missing external or product evidence selected for collection | `ultra-research` after owner disposition |
91
- | A current false report has an acceptance, scope, or existing-promise change selected for reconciliation | `ultra-change` after owner disposition; use `ultra-think` internally for one consequential trade-off |
92
- | Every current finding is explicitly accepted, deferred, or otherwise dispositioned | `ultra-deliver`, subject to its one orphan-export gate |
93
- | Report passed and all report identities match current files | `ultra-deliver` |
94
- | No active Change and no new request | Report the idle state; do not manufacture work |
95
-
96
- An explicit `[NEEDS CLARIFICATION]` is evidence of an unresolved field, not proof that
97
- the entire project requires Research. Judge whether it can change the current boundary.
98
- Do not add `research_complete`, a score, or another state bit to replace that judgment.
99
-
100
- A test-report is stale when its `change_id` is not the active Change, its `task_ids` are not
101
- the exact ordered ids of tasks whose `change_id` matches that Change, `git_commit`
102
- differs from `HEAD`, or its `worktree.diff_digest` or `intent_digest` differs from
103
- running
104
- `node <ultra-test-skill-dir>/scripts/worktree_digest.cjs --project <repository-root> --change-id <change_id>`.
105
- A dirty worktree is a warning, not evidence of failure.
106
- The product-worktree digest has one fixed boundary: it excludes `.ultra/evidence/**`,
107
- whose command and external-observation entries bind raw bytes as
108
- `raw_evidence_sha256` before stable exact record bytes are bound as `evidence_digest`.
109
- Status must therefore use the exact ordered `task_evidence` projection and strict receipt
110
- consumers below for evidence provenance; it never adds another exclusion or treats
111
- excluded publication bytes as absent evidence.
112
-
113
- Freshness also requires the exact ordered `task_evidence` projection. Its
114
- `evidence_digest`, `task_review_session`, and `task_review_summary_digest` must match the
115
- current record and retained review — or, for an `external-manual` record, its
116
- `task_review_receipt_ref` and `task_review_receipt_digest` must match the current
117
- record and the bounded stable receipt bytes reverified through the sensor's
118
- `--verify-external-receipt` mode, and take its `--projection` output verbatim.
119
- Recheck whichever branch the record declares and never rewrite one branch into the
120
- other. For each item, take every command and
121
- external-observation `raw_evidence_ref` to bounded stable
122
- repository-contained bytes from an ordinary regular non-symlink file opened nonblocking
123
- and no-follow, with an 8 MiB ceiling and path/descriptor identity checks around the read.
124
- Recompute `raw_evidence_sha256` from that one snapshot and require an exact match, then
125
- recompute the stable exact `evidence.json` bytes as `evidence_digest` before comparing
126
- the projection. A raw or record mismatch routes to the owning task's explicit Dev repair.
127
- Run
128
- `node <ultra-plan-skill-dir>/scripts/validate_task_evidence.cjs <evidence-ref>`, and
129
- compare `task_id`, `schema`, `evidence_ref`, `task_review_session`, and
130
- `task_review_summary_digest` with the current ledger row, final evidence record, and
131
- retained strict task-review summary. The task evidence `subject` is an independently
132
- captured completion-snapshot freshness observation made after validated task Review and
133
- immediately before evidence publication. Its `task_review` separately binds the retained strict summary; neither Worker Packet v1 nor its nullable summary worktree digest proves
134
- the subject. Do not require that earlier observation to equal the report's later
135
- aggregate worktree digest. Recheck current Acceptance, criterion and verification type,
136
- owner record, review summary, and cited affected artifacts independently.
137
-
138
- Replay the report's strict aggregate review summary with the existing Review summary
139
- waiter, then run
140
- `node <ultra-test-skill-dir>/scripts/validate_review_transport.cjs --summary <summary-path> --report .ultra/test-report.json`.
141
- Require the exact `packet_digest`, `admission_digest`, `subject_digest`, and `summary_digest` bindings, plus session, summary path, execution mode, ordered findings, and report root subject.
142
- Each structural validator or sensor reports identity and provenance observations and never decides semantic acceptance, review quality, or `passed`.
143
- Any mismatch makes the report stale and routes repair to the responsible workflow.
144
-
145
- `passed: false` does not itself select a repair. Preserve each finding, ask for owner
146
- disposition where scope or risk changes, then route by the accepted response above.
147
- For a current task-review `REQUEST_CHANGES`, consume the exact validated current
148
- `SUMMARY.json.findings` array and preserve every finding id. Route every current P0/P1
149
- to resolution or authoritative disposition and refresh its affected evidence; never
150
- reuse a finding count or list from an older summary. P2 and P3 findings remain report
151
- entries or owner-selected backlog and never re-open a task on their own.
152
- Likewise, ledger completion and structurally valid v2 evidence are necessary for a
153
- current Test claim but never sufficient to manufacture `passed: true`. A validator
154
- reports schema, identity, provenance, and freshness observations only. It cannot decide
155
- whether an inspection supports a criterion, supply an `owner-judgment`, or turn an
156
- external receipt into product truth.
157
-
158
- Status remains read-only when later work invalidates a completed task. It names the
159
- affected criterion IDs and reason and recommends Dev. Dev records both in the context
160
- Change Log and Resume Note before the ledger-authoritative `completed` to `in_progress`
161
- transition; Status never silently demotes a task.
162
-
163
- A budget stop or `owner checkpoint` is displayed as-is: report the exhausted budget,
164
- the in-progress task it stopped, and the reachable owner decision (extend, retry,
165
- cancel, or abandon). Status never infers continuation, extension, or any semantic
166
- verdict from a budget stop, and never treats a pending frontier row as the active
167
- task behind one.
168
-
169
- The repository has one primary writer for canonical `.ultra` files. Native review
170
- workers and delegated CLIs may inspect or write isolated source roots, but their results
171
- return to that writer. Concurrent canonical writes require separate worktrees and
172
- explicit integration; this router does not invent locks or silently merge ledgers.
173
-
174
- Report the accepted North Star revision and digest, every active Change trace mismatch,
175
- and unresolved `FP-*`/`NS-*`/`HC-*` reference. A mismatch is stale evidence, never a
176
- mechanical verdict about truth or permission; supersession does not delete prior task,
177
- review, Test, or delivery evidence.
178
-
179
- On a fresh session, use the current Change's exact matching contexts and closing Resume
180
- Note to reconstruct the card. Do not rerun completed Research or infer route from chat
181
- memory. In `history` mode, distinguish mutable draft edits from superseding accepted
182
- decision records and keep rejected or abandoned alternatives visible when they explain
183
- the current boundary.
184
-
185
- ## Surface risk and installation health
186
-
187
- List unmet task dependencies, more than one matching `in_progress` task under the
188
- single-writer contract, broken `trace_to` or `context_file` paths, stale subject or
189
- acceptance identities, unresolved task-review findings, and concrete evidence that a
190
- task can no longer resume reliably. A timestamp, complexity value, file count, or task
191
- count is context for the model, never a staleness or quality verdict.
192
-
193
- Compare the selected host's plugin path, skill inventory, version, provenance, and hook
194
- manifest with installed files. Recommend `ubp install` or `ubp update` as the repair;
195
- this read-only Skill never performs it.
196
-
197
- ## When the owner decides
198
-
199
- The owner chooses the next public workflow, risk disposition, and any reinstall.
200
- Contradictory facts remain visible instead of being resolved by routing heuristics.
201
-
202
- ## References
203
-
204
- - `../ultra-change/references/change-contract.md` — canonical Active Change authority resolution.
205
- - `references/route-contract.md` — canonical Route Card, checkpoint, continuation, and recovery contract.
206
- - `../ultra-think/SKILL.md` — read only when contradictory evidence creates one real
207
- decision rather than a mechanical repair.
208
- - `../ultra-think/references/autonomy-boundary.md` — read before recommending a route
209
- that would reduce an accepted commitment.
@@ -1,100 +0,0 @@
1
- # Route Contract
2
-
3
- This reference defines the owner-visible navigation surface shared by every public
4
- Ultra Skill. A Route Card is a derived observation from canonical project files, Git,
5
- and the current run. It is not workflow authority, a stage marker, or permission to
6
- continue.
7
-
8
- ## Route Card
9
-
10
- Show a compact `UBP Route Card` at entry, at a material checkpoint, when pausing or
11
- blocked, at the observable exit, and before moving to another public Skill. Keep an
12
- unchanged field short, but never omit an unresolved decision or unfinished obligation.
13
-
14
- | Field | Meaning |
15
- |---|---|
16
- | `Route` | The current public Skill, or `idle` when no workflow is active |
17
- | `Mode` | One mode declared by that Skill |
18
- | `Why` | The current problem or evidence gap |
19
- | `Outcome` | The owner-visible result this route is trying to produce |
20
- | `Accepted boundary` | Accepted scope, exclusions, and authority that cover this run |
21
- | `Position` | Artifact-derived navigation such as selected reports or remaining tasks |
22
- | `Exit condition` | Observable evidence or owner decision that ends this mode |
23
- | `Delta` | Material facts changed since the prior card |
24
- | `Reality` | Live path, verification state, fakes, limitations, and unknowns |
25
- | `Decision needed` | One material owner decision, or `none` |
26
- | `Next` | The smallest covered continuation or one recommended public route |
27
- | `Not done` | Obligations left at a pause or exit |
28
-
29
- `Position` may report exact mechanical observations such as selected lenses with
30
- reports, dependency-ready tasks, or an ACP session waiting for permission. Never turn a
31
- count, validator result, finding total, or transport event into semantic progress or a
32
- numeric completion score.
33
-
34
- ## Material checkpoints
35
-
36
- Stop and obtain the Owner's current decision before any of these changes or effects:
37
-
38
- 1. a new or reduced North Star, specification, or Change commitment;
39
- 2. a material delta to an active Change outcome, acceptance, non-goal, or public seam;
40
- 3. evidence that materially changes the feasible direction or product boundary;
41
- 4. wider Execution Grant scope, effects, budget, expiry, or Agent/provider topology;
42
- 5. transfer of the canonical writer;
43
- 6. unresolved P0/P1, risk acceptance, or the same root cause surviving three failed fixes;
44
- 7. finalization, archive, commit, push, tag, publication, deployment, real installation,
45
- credentials, provider spend, or another external or irreversible effect.
46
-
47
- Naming, internal design, ordinary technical choices, task decomposition, covered local
48
- edits and tests, and non-material evidence reconciliation remain model-owned inside the
49
- accepted boundary. Do not ask for confirmation when `Decision needed` is `none`.
50
-
51
- ## Continuation
52
-
53
- Public modes belong to one of three invocation classes; model-only disciplines form a
54
- fourth class:
55
-
56
- | Invocation class | Owner entry | Model continuation |
57
- |---|---:|---:|
58
- | `explicit-entry` | yes | no |
59
- | `grant-continuable` | yes | only under a valid Execution Grant covering that mode |
60
- | `router` | yes | no; the Owner invokes read-only diagnosis explicitly |
61
- | `model-discipline` | no | only as an internal method of a covered workflow |
62
-
63
- Host metadata is only a coarse discovery bit. Before continuing, the Skill itself must
64
- verify its selected mode, the same active `change_id`, the valid Execution Grant,
65
- allowed local effects, stop conditions, and any material checkpoint. A coarse Host bit
66
- never permits an explicit-entry mode. Without a covering grant, stop with a Route Card
67
- and recommend the exact explicit route; never invoke another public Skill merely because
68
- its files appear ready.
69
-
70
- Within an accepted Change and valid grant, show the Route Card before each public Skill
71
- transition and continue without a confirmation question only when the next mode and all
72
- effects are covered. A material checkpoint still pauses. `Next` is either `continue:
73
- <route>/<mode>` when covered or `recommend: <route>/<mode>` when owner invocation is
74
- required.
75
-
76
- Execution events such as tool calls, plans, usage, permission requests, worker output,
77
- ACP updates, and process termination are transport observations. They may populate
78
- `Position`, `Delta`, or `Reality`; they never decide acceptance, task completion, or the
79
- next semantic route.
80
-
81
- ## Recovery and degraded diagnosis
82
-
83
- On a fresh session or Host, reconstruct the card from the accepted North Star, Project
84
- Brief, active Change authority, task ledger and matching contexts, decisions, evidence,
85
- Git, and current installation/runtime observations. Read the closing `## Resume Note`
86
- for only the current work package. Do not rerun completed Research or create a route
87
- ledger to remember where the conversation stopped.
88
-
89
- If authority is absent, ambiguous, stale, malformed, or temporarily unreadable, stop
90
- semantic writes but keep read-only diagnosis reachable. Report the exact fact that
91
- prevents a normal route and the cheapest safe repair, retry, cancel, abandon, or fresh
92
- session path. Never describe a blocked route as an endless in-progress workflow.
93
-
94
- Owner revisions remain recoverable: edit a draft in place, supersede an accepted
95
- decision with a new owner record, and preserve Git/history. Status may summarize that
96
- history on request, but no event log becomes a second source of truth.
97
-
98
- When context pressure threatens reliable continuation, finish the nearest safe write,
99
- refresh the canonical context's Resume Note, show a final card, and recommend a fresh
100
- session. Context size is an observation, not a hard semantic gate.
@@ -1,91 +0,0 @@
1
- ---
2
- name: ultra-tdd
3
- description: Drive one slice of behavior through red then green — a failing test on a confirmed seam, then the smallest code that passes it. Use when another skill is about to write or change behavior and needs the feedback loop that proves the code actually runs, including a small change that goes straight to implementation.
4
- ---
5
-
6
- # Write one failing test on a seam, then just enough code to pass it
7
-
8
- Without feedback from code that actually ran, the work is blind flying. This is
9
- the loop that supplies it, and it serves Goal 3, Production-Ready.
10
-
11
- ## Before you start
12
-
13
- 1. When called from a planned Change, read
14
- `../ultra-change/references/change-contract.md` and apply its **Active Change
15
- authority resolution** before reading any active `intent.md`, resolving the current
16
- `change_id` or task, reading its context, running the baseline, or executing red-green
17
- product edits. A stable zero result stops with no current task; any typed diagnostic,
18
- including non-unique authority, stops with its repair before the baseline, red-green,
19
- or any product write. After one valid authority, read its intent, `.ultra/tasks.json`,
20
- and the matching current task context for the seams confirmed during planning. For a
21
- micro edit outside the Ultra lifecycle, no active task context is required; use the
22
- accepted request, maintained specification, and an existing repository seam, and
23
- create no Ultra task or delivery claim.
24
- 2. Run the repository's existing test command once, unchanged, to see what
25
- passing currently looks like. Read `references/test-execution.md` before recording
26
- that run or any red/green evidence.
27
- 3. Read `CONTEXT.md` for vocabulary — test names carry the domain words.
28
-
29
- ## Definition of done
30
-
31
- - One slice is complete: one seam, one test, one minimal implementation.
32
- - The test was observed failing before the implementation existed, and observed
33
- passing after. Both runs are real command output.
34
- - The test reads as a specification of behavior through a public interface, and
35
- survives replacing the implementation underneath it.
36
-
37
- ## Seams, and what a good test on one looks like
38
-
39
- A seam is a place where behavior can change without editing at that place — the
40
- module interface. Tests live on seams and never reach for internals. Prefer a
41
- seam that already exists, take the highest one that works, and one is the ideal
42
- number. Verify behavior through that public interface: a name like "user can
43
- checkout with a valid cart" shows at a glance what capability exists, and one
44
- logical assertion per test keeps it readable.
45
-
46
- ## Red, then green
47
-
48
- Write the failing test first and run it, so that red is observed rather than
49
- assumed. Then write the smallest code that turns it green. Predict no later
50
- tests and add no speculative capability. Then take the next slice.
51
-
52
- Refactoring is not part of this loop; `ultra-review` owns it when observed duplication,
53
- coupling, or a boundary defect supplies evidence that restructuring is worthwhile.
54
-
55
- ## Three patterns that produce tests worth deleting
56
-
57
- | Pattern | How you recognize it |
58
- |---|---|
59
- | Implementation-coupled | Mocks an internal collaborator, tests a private method, asserts on call counts or ordering, or reaches past the interface into the database. The check: behavior is unchanged after restructuring, yet the test breaks. |
60
- | Tautological | Recomputes the expected value the same way the implementation does, so it can never fail. Expected values come from an independent source — a known literal, a hand-worked example, the specification. |
61
- | All tests first | Writing every test before any implementation tests imagined behavior. It captures shape rather than user-visible behavior, is insensitive to real change, and freezes the test structure before the implementation is understood. Take one test, one implementation, and repeat. |
62
-
63
- ## Mock only at the system boundary
64
-
65
- External APIs, time and randomness, sometimes the filesystem. Prefer a real test
66
- library over mocking the database. Your own classes, modules and internal
67
- collaborators stay real.
68
-
69
- Design for that boundary: inject dependencies, and give each external operation
70
- its own named function rather than one generic fetcher — mocking then needs no
71
- conditional logic, and which endpoints a test touches stays visible. When a real
72
- dependency is the right answer, copy
73
- `references/templates/testcontainer-postgres.ts` or
74
- `references/templates/testcontainer-postgres.py`, and
75
- `references/templates/vertical-slice.ts` for a path that runs end to end.
76
-
77
- ## When the owner decides
78
-
79
- Weakening an assertion, skipping a relevant test, or adjusting an expected value
80
- to obtain green output crosses the C5 boundary — stop and surface it. A test that
81
- is genuinely wrong about the specification is a specification question, so it
82
- goes to the owner as one.
83
-
84
- ## References
85
-
86
- - `../ultra-change/references/change-contract.md` — canonical Active Change authority resolution.
87
- - `../ultra-think/references/autonomy-boundary.md` — read before replacing a real
88
- dependency with a fake, or when a test stands between the work and green.
89
- - `references/templates/README.md` — read when choosing which enabling template
90
- fits the dependency you need to make real.
91
- - `references/test-execution.md` — exact command, failure and result evidence contract.
@@ -1,20 +0,0 @@
1
- # Enabling templates
2
-
3
- These runnable examples make the real integration path cheaper than a fake. Read this
4
- index when `ultra-tdd` reaches a database, feature flag, or multi-layer seam, then copy
5
- only the smallest relevant file into the project and adapt it to repository conventions.
6
-
7
- | Template | When to copy |
8
- |---|---|
9
- | [testcontainer-postgres.ts](testcontainer-postgres.ts) | A TypeScript/Node test needs real Postgres instead of an internal Repository mock |
10
- | [testcontainer-postgres.py](testcontainer-postgres.py) | A pytest test needs real Postgres instead of a `MagicMock` Repository |
11
- | [vertical-slice.ts](vertical-slice.ts) | One test must prove HTTP → use case → database → response |
12
- | [persistence-real.ts](persistence-real.ts) | A Repository needs real storage rather than an in-memory `Map` |
13
- | [feature-flag-default-audit.sh](feature-flag-default-audit.sh) | A Change must surface default-off flags that could hide unfinished work |
14
-
15
- The templates travel with the `ultra-tdd` skill; they are rule-side examples, not
16
- project authority. Do not copy this directory wholesale into `.ultra/`.
17
-
18
- Each template must remain runnable after its documented dependencies are installed,
19
- name the exact verification command in its header, stay short enough to inspect before
20
- use, and state which Ultra principle makes the example preferable.
@@ -1,79 +0,0 @@
1
- #!/usr/bin/env bash
2
- # feature-flag-default-audit.sh
3
- #
4
- # Surface every `default off` / `enabled: false` / commented-out feature so the
5
- # user knows what is *quietly* disabled. Catches the "agent shipped task by
6
- # turning the feature off" failure mode v7 fixes.
7
- #
8
- # Usage:
9
- # bash feature-flag-default-audit.sh [path]
10
- #
11
- # Default path: src/ (override with first arg)
12
- #
13
- # PHILOSOPHY: enables C5 (Bounded Autonomy) — default-off without rationale is
14
- # scope reduction in disguise; this surfaces it so the user can decide.
15
-
16
- set -euo pipefail
17
-
18
- ROOT="${1:-src}"
19
- if [ ! -d "$ROOT" ]; then
20
- echo "[audit] path not found: $ROOT" >&2
21
- exit 1
22
- fi
23
-
24
- echo "## Feature-flag default audit"
25
- echo "Path: $ROOT"
26
- echo "Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
27
- echo ""
28
-
29
- # Patterns we care about. Adjust per project conventions.
30
- patterns=(
31
- '\benabled:\s*false\b'
32
- '\bdefault\s*[:=]\s*false\b'
33
- '\bDISABLED\s*=\s*true\b'
34
- '\bif\s*\(\s*false\s*\)'
35
- 'FEATURE_[A-Z_]+\s*=\s*false'
36
- )
37
-
38
- found_any=0
39
- for p in "${patterns[@]}"; do
40
- hits=$(grep -REn "$p" "$ROOT" \
41
- --include='*.ts' --include='*.tsx' \
42
- --include='*.js' --include='*.jsx' \
43
- --include='*.py' --include='*.go' \
44
- --include='*.rs' --include='*.sol' \
45
- --include='*.yaml' --include='*.yml' \
46
- --include='*.json' --include='*.toml' 2>/dev/null || true)
47
-
48
- if [ -n "$hits" ]; then
49
- found_any=1
50
- echo "### Pattern: $p"
51
- echo '```'
52
- echo "$hits"
53
- echo '```'
54
- echo ""
55
- fi
56
- done
57
-
58
- # Also surface TODO-style "off until later" markers
59
- todo_hits=$(grep -REn '(TODO|FIXME).*(enable|turn on|flip on)' "$ROOT" 2>/dev/null || true)
60
- if [ -n "$todo_hits" ]; then
61
- found_any=1
62
- echo "### TODOs to re-enable later"
63
- echo '```'
64
- echo "$todo_hits"
65
- echo '```'
66
- echo ""
67
- fi
68
-
69
- if [ "$found_any" -eq 0 ]; then
70
- echo "_No default-off features detected._"
71
- exit 0
72
- fi
73
-
74
- echo "---"
75
- echo ""
76
- echo "**Action**: For each entry above, confirm with the user whether it is:"
77
- echo "- (A) Pre-launch: feature is built but gated until release — fine"
78
- echo "- (B) Genuine kill-switch: stays off in normal operation — fine, document why"
79
- echo "- (C) Hiding incomplete work: agent shipped task by turning it off — **must fix**"
@@ -1,78 +0,0 @@
1
- /**
2
- * Real-persistence Repository skeleton (TypeScript)
3
- *
4
- * Why this exists: in-memory `Map` Repositories are a v7 anti-pattern. They
5
- * pass tests, don't survive restart, hide migration bugs, and silently break
6
- * production. This template shows the minimum real Repository.
7
- *
8
- * Required deps:
9
- * pnpm add pg
10
- * # Optional ORM: drizzle / prisma / kysely
11
- *
12
- * PHILOSOPHY: enables C4 progress.json `persistence_real` dimension. Pair with
13
- * testcontainer-postgres.ts for the test side.
14
- */
15
-
16
- import type { Pool, PoolClient } from 'pg';
17
-
18
- // Domain entity — keep separate from row shape
19
- export type User = {
20
- id: number;
21
- email: string;
22
- createdAt: Date;
23
- };
24
-
25
- // Optional: row→entity mapper if column names differ from field names
26
- function rowToUser(row: { id: number; email: string; created_at: Date }): User {
27
- return { id: row.id, email: row.email, createdAt: row.created_at };
28
- }
29
-
30
- export class UserRepo {
31
- constructor(private readonly pool: Pool) {}
32
-
33
- async create(input: { email: string }): Promise<User> {
34
- const { rows } = await this.pool.query<{
35
- id: number;
36
- email: string;
37
- created_at: Date;
38
- }>(
39
- `INSERT INTO users (email) VALUES ($1)
40
- RETURNING id, email, created_at`,
41
- [input.email],
42
- );
43
- return rowToUser(rows[0]);
44
- }
45
-
46
- async findById(id: number): Promise<User | null> {
47
- const { rows } = await this.pool.query<{
48
- id: number;
49
- email: string;
50
- created_at: Date;
51
- }>(
52
- `SELECT id, email, created_at FROM users WHERE id = $1`,
53
- [id],
54
- );
55
- return rows[0] ? rowToUser(rows[0]) : null;
56
- }
57
-
58
- // Multi-statement work — pass in a client to keep it on a single connection
59
- async withTransaction<T>(work: (client: PoolClient) => Promise<T>): Promise<T> {
60
- const client = await this.pool.connect();
61
- try {
62
- await client.query('BEGIN');
63
- const result = await work(client);
64
- await client.query('COMMIT');
65
- return result;
66
- } catch (e) {
67
- await client.query('ROLLBACK');
68
- throw e;
69
- } finally {
70
- client.release();
71
- }
72
- }
73
- }
74
-
75
- // What this template intentionally does NOT do (and why):
76
- // - No `Map<number, User>` field. That is the in-memory anti-pattern v7 surfaces.
77
- // - No silent error swallowing (catch + return-null). Errors propagate; callers handle.
78
- // - No mock-friendly singleton. Inject the Pool so testcontainers work cleanly.
@@ -1,78 +0,0 @@
1
- """
2
- Testcontainer-Postgres starter (Python / pytest)
3
-
4
- Why this exists: Real DB in tests catches migration drift, schema bugs, and
5
- concurrency issues that mocked Repositories silently miss. Prefer this to
6
- `MagicMock(spec=Repo)` for any Repository or Service that touches data.
7
-
8
- Required deps:
9
- pip install testcontainers[postgres] psycopg[binary] pytest
10
-
11
- Verify:
12
- pytest tests/repo/test_user_repo_testcontainer.py -v
13
-
14
- PHILOSOPHY: enables C2 (Enabling > Defensive) — the cheaper path becomes the
15
- right path, so agents stop reaching for mocks under pressure.
16
- """
17
-
18
- from __future__ import annotations
19
-
20
- import psycopg
21
- import pytest
22
- from testcontainers.postgres import PostgresContainer
23
-
24
-
25
- @pytest.fixture(scope="module")
26
- def pg():
27
- """Module-scoped real Postgres. Slow on first pull, fast after."""
28
- with PostgresContainer("postgres:16-alpine") as c:
29
- with psycopg.connect(c.get_connection_url()) as conn:
30
- with conn.cursor() as cur:
31
- cur.execute("""
32
- CREATE TABLE users (
33
- id SERIAL PRIMARY KEY,
34
- email TEXT UNIQUE NOT NULL,
35
- created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
36
- );
37
- """)
38
- conn.commit()
39
- yield c
40
-
41
-
42
- @pytest.fixture
43
- def conn(pg):
44
- """Per-test connection with truncate-reset so each test is independent."""
45
- with psycopg.connect(pg.get_connection_url()) as c:
46
- with c.cursor() as cur:
47
- cur.execute("TRUNCATE users RESTART IDENTITY CASCADE")
48
- c.commit()
49
- yield c
50
-
51
-
52
- def make_user_repo(conn):
53
- """Replace with import from your real Repository."""
54
- class UserRepo:
55
- def create(self, email: str) -> dict:
56
- with conn.cursor() as cur:
57
- cur.execute(
58
- "INSERT INTO users (email) VALUES (%s) RETURNING id, email, created_at",
59
- (email,),
60
- )
61
- row = cur.fetchone()
62
- conn.commit()
63
- return {"id": row[0], "email": row[1], "created_at": row[2]}
64
-
65
- def find_by_id(self, user_id: int) -> dict | None:
66
- with conn.cursor() as cur:
67
- cur.execute("SELECT id, email, created_at FROM users WHERE id = %s", (user_id,))
68
- row = cur.fetchone()
69
- return None if row is None else {"id": row[0], "email": row[1], "created_at": row[2]}
70
-
71
- return UserRepo()
72
-
73
-
74
- def test_insert_and_fetch_round_trips(conn):
75
- repo = make_user_repo(conn)
76
- created = repo.create("a@example.com")
77
- found = repo.find_by_id(created["id"])
78
- assert found == created