ultra-builder-pro-cli 0.26.1 → 3.0.2

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 (75) hide show
  1. package/.ultra-template/contexts/TEMPLATE.md +64 -29
  2. package/.ultra-template/north-star.md +36 -30
  3. package/.ultra-template/project-brief.md +28 -0
  4. package/.ultra-template/specs/product.md +4 -0
  5. package/.ultra-template/specs/research-distillate.md +8 -0
  6. package/.ultra-template/tasks.json +1 -0
  7. package/.ultra-template/test-report.json +18 -1
  8. package/CHANGELOG.md +227 -1
  9. package/README.md +161 -59
  10. package/adapters/_shared/host-profile.cjs +68 -12
  11. package/adapters/_shared/plugin-core.cjs +4 -5
  12. package/adapters/_shared/runtime-assets.cjs +11 -2
  13. package/adapters/zcode.js +375 -0
  14. package/bin/delegate-worker.cjs +20 -0
  15. package/bin/delegate.cjs +94 -25
  16. package/bin/install.js +11 -6
  17. package/docs/ARCHITECTURE.md +109 -25
  18. package/docs/ARTIFACT-AUTHORITY.md +204 -30
  19. package/docs/DECISIONS.md +141 -10
  20. package/docs/PHILOSOPHY.md +61 -8
  21. package/docs/PLUGIN-ISOLATION-CONTRACT.md +6 -0
  22. package/docs/RUNTIME-COMPAT-MATRIX.md +106 -13
  23. package/docs/SKILL-AUTHORING.md +14 -9
  24. package/docs/WORKFLOW-LIFECYCLE.md +211 -53
  25. package/docs/evals/adversarial-review-2026-08-14.md +84 -0
  26. package/docs/evals/zcode-automation-2026-08-14.md +103 -0
  27. package/hooks/README.md +31 -3
  28. package/hooks/_common.py +1699 -33
  29. package/hooks/adapters/zcode.py +227 -0
  30. package/hooks/compact_context.py +176 -17
  31. package/hooks/mid_workflow_recall.py +27 -5
  32. package/hooks/post_edit_guard.py +133 -23
  33. package/hooks/session_context.py +722 -11
  34. package/package.json +6 -3
  35. package/skills/ultra-change/SKILL.md +84 -64
  36. package/skills/ultra-change/references/change-contract.md +130 -32
  37. package/skills/ultra-change/references/execution-grant.md +109 -0
  38. package/skills/ultra-change/references/primary-transfer.md +273 -0
  39. package/skills/ultra-change/scripts/validate_primary_transfer.cjs +1928 -0
  40. package/skills/ultra-delegate/SKILL.md +38 -5
  41. package/skills/ultra-delegate/references/delegation-contract.md +21 -1
  42. package/skills/ultra-deliver/SKILL.md +123 -44
  43. package/skills/ultra-deliver/references/baseline-reconciliation.md +5 -3
  44. package/skills/ultra-dev/SKILL.md +173 -43
  45. package/skills/ultra-grilling/SKILL.md +19 -16
  46. package/skills/ultra-grilling/references/reframing.md +7 -3
  47. package/skills/ultra-init/SKILL.md +99 -87
  48. package/skills/ultra-init/references/brownfield-adoption.md +23 -40
  49. package/skills/ultra-init/scripts/init_project.cjs +968 -21
  50. package/skills/ultra-plan/SKILL.md +83 -46
  51. package/skills/ultra-plan/references/task-evidence-v2.md +300 -0
  52. package/skills/ultra-plan/scripts/validate_task_evidence.cjs +859 -0
  53. package/skills/ultra-research/SKILL.md +119 -68
  54. package/skills/ultra-research/references/{03-competitive-landscape.md → 03-alternatives.md} +6 -6
  55. package/skills/ultra-research/references/04-product-strategy.md +11 -2
  56. package/skills/ultra-research/references/21-features-scope.md +8 -0
  57. package/skills/ultra-research/references/22-success-metrics.md +9 -4
  58. package/skills/ultra-research/references/99-synthesis.md +25 -1
  59. package/skills/ultra-research/references/north-star-v2.md +168 -0
  60. package/skills/ultra-research/references/wayfinding.md +50 -0
  61. package/skills/ultra-research/scripts/validate_north_star.cjs +1174 -0
  62. package/skills/ultra-review/SKILL.md +201 -24
  63. package/skills/ultra-review/references/adversarial-evaluation.md +31 -0
  64. package/skills/ultra-review/references/spec.md +5 -0
  65. package/skills/ultra-review/references/unified-schema.md +146 -11
  66. package/skills/ultra-review/references/worker-packet.md +151 -8
  67. package/skills/ultra-review/scripts/review_wait.py +2653 -63
  68. package/skills/ultra-status/SKILL.md +146 -32
  69. package/skills/ultra-tdd/SKILL.md +14 -4
  70. package/skills/ultra-tdd/references/test-execution.md +6 -1
  71. package/skills/ultra-test/SKILL.md +157 -15
  72. package/skills/ultra-test/scripts/validate_review_transport.cjs +549 -0
  73. package/skills/ultra-test/scripts/worktree_digest.cjs +551 -29
  74. package/skills/ultra-think/SKILL.md +5 -10
  75. package/skills/ultra-think/references/interaction-boundary.md +2 -1
@@ -1,119 +1,131 @@
1
1
  ---
2
2
  name: ultra-init
3
- description: Establish a project's Ultra authority as files — the owner's one-line goal, hard constraints, the three specification skeletons, an empty task ledger, and Git. Use when a repository has no `.ultra` directory yet, or has a partial one left by an interrupted setup, whether the codebase is new or already carries years of history.
3
+ description: Create or recover Ultra's repository-local skeleton and raw Project Brief without performing product research. Use when `.ultra` is absent or partial in a new or existing codebase and later workflows need stable file paths, preserved authority, and Git.
4
4
  ---
5
5
 
6
- # Build the skeleton the rest of the workflow writes into
6
+ # Create the skeleton and capture only the initial project outline
7
7
 
8
- Initialization creates the repository-local authority and nothing else.
9
- It does not perform research, accept a product baseline, choose a Change, or
10
- start another capability — recommend the next one and stop; do not invoke it.
11
-
12
- The dividing line against research is **authorization versus claim**. What the
13
- owner authorizes comes out of their head and evidence cannot overturn it. What
14
- research collects is a claim about the outside world, which evidence can confirm
15
- or refute. A technology choice is a claim, so it is not initialization's business
16
- — and a new project has no configuration files to read anyway.
8
+ Initialization establishes places for later authority and records raw owner intake. It
9
+ does not validate the problem, establish a North Star, build a product or architecture
10
+ baseline, settle domain language, choose a Change, or start another public workflow.
17
11
 
18
12
  ## Before you start
19
13
 
20
- 1. Read `.ultra/tasks.json` if it exists, along with the `context_file` of any
21
- task it names — a partial `.ultra/` means an earlier attempt stopped midway.
22
- 2. Read `CONTEXT.md` at the repository root for vocabulary already settled, and
23
- `.ultra/decisions/` for any entries preserved by a partial setup.
24
- 3. Establish the route's facts from the filesystem, not by asking.
14
+ 1. If `.ultra/changes/active/` exists, resolve at most one active `change_id`. Read
15
+ `.ultra/tasks.json` if it exists, plus the `context_file` and closing `## Resume Note`
16
+ of unfinished tasks matching that id. Historical unfinished rows do not turn a
17
+ partial skeleton into current work. A partial `.ultra/` is recovery work.
18
+ 2. Read `.ultra/project-brief.md`, `.ultra/north-star.md`, `CONTEXT.md`, and relevant
19
+ `.ultra/decisions/` when they exist. Preserve accepted authority byte-for-byte.
20
+ 3. Establish the repository root, Git state, and whether meaningful code or maintained
21
+ documentation exists from the filesystem. Do not ask the owner for those facts.
25
22
 
26
23
  ## Definition of done
27
24
 
28
- - `.ultra/north-star.md` carries the owner's one-line goal in their own words.
29
- - Every `## Hard Constraints` entry has a stable `HC-<n>` id and can veto a
30
- concrete technical decision. "Should be usable" vetoes nothing and is not yet a
31
- constraint; "first paint under two seconds" is. Same bar for the success
32
- metric: a threshold, not an aspiration. See
33
- `../ultra-grilling/references/reframing.md` for what counts as an answer.
34
- - Every file listed under **What gets written** exists; you read each one back
35
- after writing and stopped at the first one missing.
36
- - `.git` exists. Any initial commit is a separately authorized delivery effect.
37
- - Nothing is invented: what is unknown says `[NEEDS CLARIFICATION]`.
38
-
39
- ## Which route
25
+ - `.ultra/project-brief.md` contains raw owner intake: one line, a broad outline,
26
+ explicit inputs already supplied, and open questions handed to Research.
27
+ - For a new skeleton, a structurally complete North Star v2 with status `unresearched`
28
+ and the three specification skeletons exist. Init does not populate `FP-*`, `NS-*`,
29
+ or `HC-*`; recovery preserves any populated authority, and Init does not create
30
+ `CONTEXT.md`.
31
+ - Every packaged path was read back after copying, while every pre-existing file stayed
32
+ byte-identical.
33
+ - `.git` exists. Commit, push, remote creation, and publication remain separate effects.
40
34
 
41
- Check the filesystem in this order and take the first match:
35
+ ## Classify only for preservation
42
36
 
43
- | Check | Route | What changes |
44
- |---|---|---|
45
- | `docs/` holds two or more non-README `.md` files, or `docs/adr/` or `doc/` exists | Documented brownfield | Write everything; cite maintained documents as evidence and preserve their repository paths in `trace_to` when they remain authoritative |
46
- | A language configuration file exists and the row above did not match | Brownfield | Write everything; record what a code scan shows in `architecture.md` and `discovery.md`, marked as observed and unverified |
47
- | Neither | Greenfield | Write everything |
37
+ Use `references/brownfield-adoption.md` when source, runtime configuration, tests, or
38
+ maintained product documentation already exist. Classification changes what must be
39
+ preserved and what Research should inspect; it never authorizes Init to write observed
40
+ product behavior into a specification.
48
41
 
49
- For either brownfield route, read `references/brownfield-adoption.md`. Existing docs
50
- are evidence or an explicitly retained authority; they never justify omitting the
51
- canonical specification skeleton that downstream workflows require.
42
+ ## Draw out the brief, then stop
52
43
 
53
- ## Draw out the intent
44
+ Follow `../ultra-grilling/SKILL.md` with only these required fields:
54
45
 
55
- Follow `../ultra-grilling/SKILL.md`. It is a loop, not a questionnaire, because
56
- the owner cannot state what they want up front. Start from what they already said
57
- when invoking you, restate it for confirmation, and ask only about what is
58
- genuinely missing. Five things come out of it:
59
-
60
- | What you draw out | Where it lands |
46
+ | Raw intake | Project Brief section |
61
47
  |---|---|
62
- | What you want to build, in one sentence, their words | `north-star.md`, `## One-line` |
63
- | What counts as success | `specs/product.md`, behavioral requirements and acceptance |
64
- | What must never happen | `north-star.md`, `## Hard Constraints`, one `HC-<n>` per line |
65
- | Who uses it, and how they cope today | `discovery.md`, marked as the owner's statement |
66
- | **What you already know you are unsure about** | `discovery.md` — research's priority queue |
48
+ | What the owner wants to build, in one sentence and their words | `## One-line` |
49
+ | What it is, broadly for whom or what, intended result, broad boundary | `## Initial Outline` |
50
+ | Constraints, materials, and decisions the owner already volunteered | `## Explicit Inputs` |
51
+ | Questions already visible but requiring evidence or deeper decisions | `## Open Questions for Research` |
67
52
 
68
- When the first domain terms appear, follow `../ultra-domain-modeling/SKILL.md`
69
- and create `CONTEXT.md` at the repository root.
53
+ Ask only enough to distinguish materially different outlines. If an answer would define
54
+ a problem, actor evidence, desired outcome, success measure, product strategy, accepted
55
+ constraint, domain term, requirement, or architecture, record it as an input or open
56
+ question and stop drilling. Research owns that maturation and must not re-ask an answer
57
+ unless evidence conflicts with it.
70
58
 
71
- ## What gets written
59
+ ## Write and recover the skeleton
72
60
 
73
61
  Resolve this loaded Skill's directory, then run
74
- `node <ultra-init-skill-dir>/scripts/init_project.cjs --project <repository-root>`. The script copies
75
- only missing files from `assets/project-template`, preserves every existing authority
76
- file byte-for-byte, and reads the resulting skeleton back. Then fill its semantic
77
- placeholders from verified facts and owner decisions.
62
+ `node <ultra-init-skill-dir>/scripts/init_project.cjs --project <repository-root>`.
63
+ The script stages and reads back only missing files from `assets/project-template`,
64
+ validates the staged North Star from its raw bytes, and then publishes a complete new
65
+ `.ultra/` by atomic rename. Partial recovery publishes each staged file atomically
66
+ without clobbering a concurrent or existing path. A validation or publication failure
67
+ removes a published path only while its current stable identity and digest still match
68
+ this invocation's recorded publication. A workspace edit is preserved and returns the
69
+ typed retryable `initialization_snapshot_changed` diagnostic. Init binds every preserved
70
+ file to one nonblocking, no-follow descriptor/path identity and SHA-256 digest, then
71
+ rechecks all of them before staging, before publication, and before success. It likewise
72
+ captures every staged digest before publication and compares it with a stable target
73
+ snapshot before success. Each file publication takes fresh no-symlink parent-chain and
74
+ resolved-root identity snapshots before and after the effect; detectable directory drift
75
+ stops publication. A failed snapshot `lstat`, `open`, `fstat`, or `read` with no observed
76
+ identity, type, size, or digest change instead returns the typed retryable
77
+ `initialization_snapshot_io_error`; its sanitized `operation`, symbolic `errno`, and
78
+ actionable permission, descriptor-limit, or storage recovery remain in the
79
+ `ultra-init-error-v1` result. The North Star compatibility diagnostic remains
80
+ `preserved_north_star_changed`. A malformed packaged placeholder stops before publication
81
+ with an `ultra-init-error-v1` payload whose `code` is `north_star_template_invalid` and
82
+ whose `diagnostics` preserve the canonical validator entries, including
83
+ `invalid_unresearched_placeholder` for an exact-byte mismatch.
84
+
85
+ This recovery contract assumes a cooperative local workspace. It detects observable
86
+ path-identity or byte drift and preserves the current bytes for retry; it does not claim
87
+ that Node filesystem calls can defeat a malicious operating-system-level replacement.
88
+ Init also binds the root identity of its staging directory. Cleanup recursively removes
89
+ that path only after a fresh no-symlink root rewalk proves the same device and inode. If
90
+ the path was replaced, Init leaves it untouched and returns the retryable typed
91
+ `initialization_cleanup_conflict` diagnostic with the owned identity and manual recovery
92
+ instruction. If a typed initialization failure is already pending, that primary
93
+ diagnostic remains the top-level `ultra-init-error-v1` result and the cleanup diagnostic
94
+ is retained under `cleanup_conflict`, including its identity-bound manual recovery.
95
+ On success every existing file stayed byte-identical and every new file matches its
96
+ packaged digest.
78
97
 
79
98
  ```text
80
- .ultra/north-star.md ## One-line, ## Hard Constraints
81
- .ultra/specs/{product,architecture,discovery}.md ## Observed, ## Decisions, ## Unknowns
82
- .ultra/tasks.json {"tasks": []}
83
- .ultra/test-report.json not-yet-run report with git_commit
84
- .ultra/{contexts,decisions,evidence,research}/ and changes/{active,archive,abandoned}/
85
- CONTEXT.md repository root, once a term is settled
99
+ .ultra/project-brief.md raw intake and initial outline
100
+ .ultra/north-star.md unresearched Research-owned placeholder
101
+ .ultra/specs/{product,architecture,discovery}.md empty specification skeletons
102
+ .ultra/specs/research-distillate.md empty Research synthesis skeleton
103
+ .ultra/{tasks.json,test-report.json} empty or not-yet-run ledgers
104
+ .ultra/{contexts,decisions,evidence,research}/
105
+ .ultra/changes/{active,archive,abandoned}/
86
106
  ```
87
107
 
88
- The copied `.ultra/.gitignore` excludes `.runtime/`, `progress/`, and `reviews/`
89
- without editing the owner's root ignore file. Those paths are exact — hooks and later
90
- skills read them by name. Every section left unfilled carries
91
- `[NEEDS CLARIFICATION]`, and which of those you resolve now has a checkable rule:
92
- **what can be read out of repository files, you fill; what needs investigation,
93
- research fills.**
108
+ The script reports `created_unresearched` for a new placeholder. For a preserved file it
109
+ reports exactly `preserved_unresearched`, `preserved_accepted`, `preserved_legacy`, or
110
+ `preserved_unknown`; unknown or malformed content is never described as authority. For
111
+ a legacy `north-star.md` containing the actual v0.26 headings or the older `## One-line`
112
+ form, keep that file byte-identical.
113
+ When the new Project Brief is still unresolved, copy the legacy one-line verbatim into
114
+ it and list legacy hard constraints under Explicit Inputs without assigning new IDs.
115
+ Research later proposes the accepted North Star; it never rewrites history silently.
94
116
 
95
- Git is not a preference. Reconciliation reads `git log` and `git diff`, staleness
96
- detection compares against `HEAD`, archiving is a `git mv`, and rollback is Git.
97
- If `.git` is absent, run `git init`. Report the uncommitted initialized files and ask
98
- for commit authority only if the owner wants that separate effect now.
117
+ Git supplies revision identity, history, comparison, archive moves, and rollback. Run
118
+ `git init` only when `.git` is absent, then report the uncommitted scaffold.
99
119
 
100
120
  ## When the owner decides
101
121
 
102
- Only the five things above, and only through the grilling loop. Replacing
103
- authority that already exists and looks healthy is the owner's call, never a
104
- convenience on the way to a clean start — preserve it and report what you found.
105
-
106
- Where the host cannot ask at all, leave the one-line goal empty and say plainly
107
- that it is empty. Do not infer it from the directory name. An empty one-line goal
108
- is a **blocking** state, not a note: goal injection, boundary read-back and a
109
- Change's touched-constraints field all read from it, so planning and development
110
- must not start until it is filled. Say that too, and recommend rerunning this
111
- skill on a host that can ask.
122
+ The owner confirms the one-line outline and any replacement of healthy authority. Where
123
+ the host cannot ask, leave unresolved fields explicit and recommend resuming Init on a
124
+ host that can; do not infer intent from the directory name. Recommend Research after a
125
+ usable brief exists, but do not invoke it.
112
126
 
113
127
  ## References
114
128
 
115
- - `../ultra-grilling/SKILL.md` — the loop; read it before the first question.
116
- - `../ultra-domain-modeling/SKILL.md` — read when the first term needs writing.
117
- - `references/brownfield-adoption.md` — read for either existing-code route.
118
- - `../ultra-think/references/autonomy-boundary.md` — read before touching
119
- authority that already exists.
129
+ - `../ultra-grilling/SKILL.md` — read before the first missing brief field.
130
+ - `references/brownfield-adoption.md` — read when maintained behavior already exists.
131
+ - `../ultra-think/references/autonomy-boundary.md` — read before replacing authority.
@@ -1,49 +1,32 @@
1
- # Brownfield adoption
1
+ # Brownfield initialization
2
2
 
3
- Use this procedure only when `ultra-init` detects an existing codebase without a
4
- healthy `.ultra/` authority surface. Initialization records the observable baseline;
5
- it does not redesign the application or accept claims the repository cannot support.
3
+ Use this procedure only when `ultra-init` finds maintained behavior but no healthy,
4
+ complete Ultra skeleton. Init preserves the checkout and prepares an evidence route; it
5
+ does not establish the brownfield baseline.
6
6
 
7
7
  ## Bind the repository boundary
8
8
 
9
- Record the repository root, selected workspace roots, branch, `HEAD`, dirty files,
10
- generated and vendored exclusions, manifests, verification commands, and public
11
- seams. Keep out-of-scope dirty files visible as context without treating them as part
12
- of the selected baseline.
9
+ Identify the repository root, selected workspace roots, branch, `HEAD`, dirty files,
10
+ generated or vendored exclusions, manifests, maintained documents, verification
11
+ commands, and visible public entry points. Resolve these from files and Git instead of
12
+ asking the owner.
13
13
 
14
- ## Inspect the maintained system
14
+ ## Preserve before interpreting
15
15
 
16
- Trace product behavior through real entry points, runtime consumers, persistence,
17
- integrations, permissions, failure paths, tests, deployment, observability, and
18
- recovery. Classify every material statement as `Observed`, `Verified`, `Decided`, or
19
- `Unknown`. Record maintained-document conflicts as drift.
16
+ - Never replace existing `.ultra` files, `CONTEXT.md`, decisions, or maintained project
17
+ documents merely to obtain the current template shape.
18
+ - Treat source, tests, runtime configuration, and documentation as evidence candidates,
19
+ not conclusions Init may promote.
20
+ - Keep out-of-scope dirty files visible in the report without adding them to the
21
+ Project Brief or specification skeletons.
22
+ - Record an exact legacy one-line as raw intake only when the Project Brief is empty.
20
23
 
21
- ## Write the baseline once
24
+ ## Prepare the Research handoff
22
25
 
23
- - Update `.ultra/specs/product.md` with delivered behavior and acceptance.
24
- - Update `.ultra/specs/architecture.md` with boundaries, authority, consumers,
25
- permissions, failures, and recovery.
26
- - Update `.ultra/specs/discovery.md` with scope evidence, known defects, drift, and
27
- unresolved questions.
28
- - Initialize `.ultra/tasks.json` and `.ultra/test-report.json` from the packaged
29
- templates without manufacturing passing results.
26
+ List the concrete paths and live seams that can answer each open baseline question.
27
+ `ultra-research` establishes the observed and accepted baseline from those sources. Init
28
+ does not run verification, classify delivered behavior, reconcile documentation drift,
29
+ or write product, discovery, or architecture conclusions.
30
30
 
31
- Use the specifications as the canonical representation. Do not create a second
32
- baseline ledger, database projection, or generated semantic mirror.
33
-
34
- ## Characterize verification
35
-
36
- Run the repository's existing verification commands. Record each result as `pass`,
37
- `known_red`, or `not_run`; a missing command is not a pass. A critical public seam
38
- without a stable signal is an explicit gap, not an excuse to invent completion.
39
-
40
- ## Converge
41
-
42
- Read every written file back, show the owner the selected scope, observed behavior,
43
- drift, known-red verification, unknowns, and material decisions, and leave unresolved
44
- items marked `[NEEDS CLARIFICATION]`. Adoption is ready when the file set is complete,
45
- the recorded revision matches the inspected checkout, and every material gap remains
46
- visible with its evidence and owner decision where one exists.
47
-
48
- Recommend `ultra-change` for subsequent work and stop; public skills do not invoke one
49
- another.
31
+ Report the preserved files, repository boundary, candidate evidence, and unresolved
32
+ questions. Recommend Research and stop; public workflows never invoke one another.