ultra-builder-pro-cli 0.13.0 → 0.15.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 (172) hide show
  1. package/.ultra-template/docs/research/README.md +11 -7
  2. package/.ultra-template/specs/architecture.md +36 -36
  3. package/.ultra-template/specs/discovery.md +46 -33
  4. package/.ultra-template/specs/product.md +38 -29
  5. package/.ultra-template/specs/research-distillate.md +48 -0
  6. package/.ultra-template/tasks/contexts/TEMPLATE.md +11 -28
  7. package/CHANGELOG.md +86 -1
  8. package/README.md +40 -26
  9. package/adapters/_shared/codex-assets.cjs +29 -165
  10. package/adapters/_shared/file-ops.cjs +6 -2
  11. package/adapters/_shared/runtime-assets.cjs +1 -0
  12. package/adapters/claude.js +3 -2
  13. package/adapters/codex.js +1 -0
  14. package/adapters/kimi.js +3 -2
  15. package/adapters/opencode.js +33 -122
  16. package/agents/review-coordinator.md +9 -6
  17. package/docs/AGENT-CONTEXT.md +21 -11
  18. package/docs/ARCHITECTURE.md +41 -13
  19. package/docs/PLAN.zh-CN.md +3 -2
  20. package/docs/ROADMAP.md +9 -5
  21. package/docs/RUNTIME-COMPAT-MATRIX.md +6 -6
  22. package/docs/STATE-DB-ACCESS-POLICY.md +27 -25
  23. package/docs/WORKFLOW-LIFECYCLE.md +266 -0
  24. package/hooks/README.md +6 -1
  25. package/hooks/active_task_context.py +22 -50
  26. package/hooks/context_spine.py +61 -332
  27. package/hooks/health_check.py +29 -18
  28. package/hooks/pre_stop_check.py +28 -33
  29. package/hooks/subagent_tracker.py +54 -85
  30. package/hooks/workflow_checkpoint.py +39 -47
  31. package/hooks/workflow_context.py +4 -9
  32. package/hooks/workflow_resume.py +48 -128
  33. package/mcp-server/breadcrumb.cjs +22 -0
  34. package/mcp-server/hook-event.cjs +34 -0
  35. package/mcp-server/lib/archive-journal.cjs +17 -5
  36. package/mcp-server/lib/baseline-workflow.cjs +158 -18
  37. package/mcp-server/lib/change-workflow.cjs +550 -85
  38. package/mcp-server/lib/context-spine.cjs +242 -24
  39. package/mcp-server/lib/doctor.cjs +33 -3
  40. package/mcp-server/lib/init-project.cjs +210 -16
  41. package/mcp-server/lib/plan-store.cjs +4 -1
  42. package/mcp-server/lib/prd-parser.cjs +14 -41
  43. package/mcp-server/lib/pricing.cjs +7 -10
  44. package/mcp-server/lib/project-breadcrumb.cjs +145 -0
  45. package/mcp-server/lib/projector.cjs +57 -3
  46. package/mcp-server/lib/spec-learning.cjs +79 -2
  47. package/mcp-server/lib/state-db.cjs +145 -8
  48. package/mcp-server/lib/state-ops.cjs +160 -9
  49. package/mcp-server/lib/task-expander.cjs +9 -38
  50. package/mcp-server/lib/workflow-state.cjs +2292 -0
  51. package/mcp-server/server.cjs +182 -50
  52. package/orchestrator/daemon.cjs +1 -2
  53. package/orchestrator/dispatch-rules.cjs +5 -31
  54. package/orchestrator/planner/plan-builder.cjs +21 -12
  55. package/package.json +14 -6
  56. package/skills/cc-collab/SKILL.md +2 -2
  57. package/skills/codex-collab/SKILL.md +2 -3
  58. package/skills/ultra-change/SKILL.md +53 -68
  59. package/skills/ultra-change/references/change-contract.md +36 -0
  60. package/skills/ultra-deliver/SKILL.md +69 -79
  61. package/skills/ultra-deliver/references/baseline-reconciliation.md +20 -0
  62. package/skills/ultra-dev/SKILL.md +54 -59
  63. package/skills/ultra-doctor/SKILL.md +40 -71
  64. package/skills/ultra-init/SKILL.md +96 -103
  65. package/skills/ultra-init/references/brownfield-adoption.md +2 -2
  66. package/skills/ultra-plan/SKILL.md +79 -75
  67. package/skills/ultra-plan/references/semantic-preflight.md +18 -0
  68. package/skills/ultra-research/SKILL.md +87 -60
  69. package/skills/ultra-research/references/00-problem-validation.md +36 -0
  70. package/skills/ultra-research/references/01-opportunity-discovery.md +33 -0
  71. package/skills/ultra-research/references/02-market-assessment.md +30 -0
  72. package/skills/ultra-research/references/03-competitive-landscape.md +31 -0
  73. package/skills/ultra-research/references/04-product-strategy.md +32 -0
  74. package/skills/ultra-research/references/05-assumptions-validation.md +31 -0
  75. package/skills/ultra-research/references/10-user-personas.md +29 -0
  76. package/skills/ultra-research/references/11-user-scenarios.md +28 -0
  77. package/skills/ultra-research/references/20-user-stories.md +30 -0
  78. package/skills/ultra-research/references/21-features-scope.md +29 -0
  79. package/skills/ultra-research/references/22-success-metrics.md +28 -0
  80. package/skills/ultra-research/references/30-architecture-context.md +30 -0
  81. package/skills/ultra-research/references/31-solution-strategy.md +28 -0
  82. package/skills/ultra-research/references/32-building-blocks.md +28 -0
  83. package/skills/ultra-research/references/40-deployment.md +29 -0
  84. package/skills/ultra-research/references/41-quality-risks.md +28 -0
  85. package/skills/ultra-research/references/99-synthesis.md +35 -0
  86. package/skills/ultra-review/SKILL.md +57 -73
  87. package/skills/ultra-review/references/review-modes.md +27 -0
  88. package/skills/ultra-review/references/unified-schema.md +25 -0
  89. package/skills/ultra-review/scripts/review_wait.py +40 -3
  90. package/skills/ultra-status/SKILL.md +41 -45
  91. package/skills/ultra-test/SKILL.md +48 -55
  92. package/skills/ultra-verify/SKILL.md +22 -31
  93. package/skills/ultra-verify/references/{confidence-system.md → evidence-status.md} +3 -3
  94. package/skills/ultra-verify/scripts/verify_wait.py +54 -54
  95. package/spec/cli-protocol.md +7 -2
  96. package/spec/mcp-tools.yaml +422 -73
  97. package/spec/schemas/baseline-reconciliation.v1.schema.json +73 -0
  98. package/spec/schemas/delivery-report.v1.schema.json +111 -0
  99. package/spec/schemas/mcp-tools.schema.json +1 -1
  100. package/spec/schemas/state-db.sql +82 -1
  101. package/spec/schemas/tasks.v4.5.schema.json +8 -1
  102. package/spec/schemas/test-report.v1.schema.json +194 -0
  103. package/ultra-tools/cli.cjs +1 -1
  104. package/ultra-tools/commands/migrate.cjs +3 -3
  105. package/ultra-tools/commands/status.cjs +213 -12
  106. package/.ultra-template/delivery-report.json +0 -9
  107. package/.ultra-template/test-report.json +0 -8
  108. package/adapters/_shared/tests/file-ops.test.cjs +0 -54
  109. package/adapters/_shared/tests/frontmatter.test.cjs +0 -47
  110. package/adapters/_shared/tests/handbook.test.cjs +0 -101
  111. package/adapters/_shared/tests/path-rewrite.test.cjs +0 -60
  112. package/adapters/_shared/tests/provenance.test.cjs +0 -133
  113. package/adapters/_shared/tests/resolve-target.test.cjs +0 -75
  114. package/adapters/_shared/tests/runtime-assets.test.cjs +0 -131
  115. package/adapters/_shared/tests/settings-merge.test.cjs +0 -85
  116. package/adapters/_shared/tests/validate.test.cjs +0 -30
  117. package/adapters/tests/claude.test.cjs +0 -137
  118. package/adapters/tests/codex-hook.test.cjs +0 -115
  119. package/adapters/tests/codex.test.cjs +0 -423
  120. package/adapters/tests/kimi-hook.test.cjs +0 -122
  121. package/adapters/tests/kimi.test.cjs +0 -259
  122. package/adapters/tests/opencode.test.cjs +0 -371
  123. package/mcp-server/lib/archive-journal.test.cjs +0 -35
  124. package/mcp-server/lib/baseline-workflow.test.cjs +0 -477
  125. package/mcp-server/lib/change-workflow.test.cjs +0 -971
  126. package/mcp-server/lib/context-spine.test.cjs +0 -93
  127. package/mcp-server/lib/doctor.test.cjs +0 -148
  128. package/mcp-server/lib/llm-client.cjs +0 -157
  129. package/mcp-server/lib/llm-client.test.cjs +0 -156
  130. package/mcp-server/lib/plan-store.test.cjs +0 -132
  131. package/mcp-server/lib/prd-parser.test.cjs +0 -171
  132. package/mcp-server/lib/runtime-state.test.cjs +0 -92
  133. package/mcp-server/lib/spec-learning.test.cjs +0 -67
  134. package/mcp-server/lib/state-db.test.cjs +0 -314
  135. package/mcp-server/lib/task-expander.test.cjs +0 -324
  136. package/mcp-server/lib/topo.test.cjs +0 -158
  137. package/mcp-server/tests/circuit-breaker.test.cjs +0 -125
  138. package/mcp-server/tests/commit-hash-flow.test.cjs +0 -117
  139. package/mcp-server/tests/concurrency-update.test.cjs +0 -96
  140. package/mcp-server/tests/concurrency.test.cjs +0 -112
  141. package/mcp-server/tests/db-ops.test.cjs +0 -121
  142. package/mcp-server/tests/init-project.test.cjs +0 -393
  143. package/mcp-server/tests/migrate.test.cjs +0 -232
  144. package/mcp-server/tests/projector.test.cjs +0 -162
  145. package/mcp-server/tests/server-contract.test.cjs +0 -1471
  146. package/mcp-server/tests/staleness.test.cjs +0 -190
  147. package/mcp-server/tests/state-db.test.cjs +0 -106
  148. package/mcp-server/tests/state-ops.test.cjs +0 -449
  149. package/mcp-server/tests/tagged-tasks.test.cjs +0 -163
  150. package/mcp-server/tests/telemetry.test.cjs +0 -219
  151. package/orchestrator/planner/expand-prompt.cjs +0 -62
  152. package/orchestrator/planner/expand-prompt.test.cjs +0 -52
  153. package/orchestrator/planner/plan-builder.test.cjs +0 -165
  154. package/orchestrator/planner/prd-prompt.cjs +0 -44
  155. package/orchestrator/planner/prd-prompt.test.cjs +0 -30
  156. package/orchestrator/tests/auto-merge.test.cjs +0 -216
  157. package/orchestrator/tests/daemon.test.cjs +0 -311
  158. package/orchestrator/tests/dispatch-rules.test.cjs +0 -124
  159. package/orchestrator/tests/parallel-orchestrator.test.cjs +0 -233
  160. package/orchestrator/tests/phase-8b-gate.test.cjs +0 -183
  161. package/orchestrator/tests/recovery.test.cjs +0 -190
  162. package/orchestrator/tests/session-runner.test.cjs +0 -314
  163. package/orchestrator/tests/skill-miner.test.cjs +0 -147
  164. package/orchestrator/tests/worktree-manager.test.cjs +0 -148
  165. package/skills/ultra-research/references/architecture.md +0 -38
  166. package/skills/ultra-research/references/problem-product.md +0 -39
  167. package/skills/ultra-research/references/quality-delivery.md +0 -34
  168. package/skills/ultra-research/references/synthesis.md +0 -38
  169. package/skills/ultra-research/references/users-scope.md +0 -40
  170. package/ultra-tools/legacy-memory.test.cjs +0 -80
  171. package/ultra-tools/status-command.test.cjs +0 -181
  172. package/ultra-tools/system-command.test.cjs +0 -309
@@ -1,75 +1,102 @@
1
1
  ---
2
2
  name: ultra-research
3
- description: Turn uncertain product or architecture intent into evidence-backed baseline specifications with explicit decisions and traceable acceptance. Use when an Ultra project has unresolved requirements that are not ready for planning.
3
+ description: Establish or extend an evidence-backed Ultra product and architecture baseline through the complete semantic research workflow, with resumable step state and traceable outputs. Use when initialization routes to research, baseline evidence is incomplete, or the owner explicitly requests bounded research for an active change.
4
4
  ---
5
5
 
6
- # Build a validated baseline
6
+ # Establish research authority
7
7
 
8
- Research only the uncertainty that blocks a durable product, architecture, or delivery
9
- decision. Do not force a fixed discovery ceremony onto a well-defined change.
8
+ Use host reasoning for evidence gathering, product judgment, questions, and artifact
9
+ content. Use Ultra MCP for run selection, state transitions, output digests, blockers,
10
+ and baseline convergence. Never ask MCP to generate research content.
10
11
 
11
- ## Preflight
12
+ ## Bind the run
12
13
 
13
- 1. Require an initialized `.ultra/specs/` directory and call `baseline.get`. Route to
14
- `ultra-init` when state or the baseline is absent. Preserve its mode and id.
15
- 2. Read the current specification files and repository evidence before asking the
16
- user to repeat known facts.
17
- 3. Define the intended deliverable, unresolved decisions, and evidence standard.
18
- 4. Select only the research lanes that the uncertainty requires:
19
- - problem and product: `references/problem-product.md`;
20
- - users and scope: `references/users-scope.md`;
21
- - architecture: `references/architecture.md`;
22
- - quality and delivery: `references/quality-delivery.md`;
23
- - final traceability: `references/synthesis.md`.
14
+ 1. Call `baseline.get`. Route absent, migrated, unreadable, or corrupt authority to
15
+ `ultra-init` or `ultra-doctor` as reported.
16
+ 2. Call `workflow.list` for `kind: "research"` and the bound baseline or change. Resume
17
+ the active, blocked, or ready run; use `workflow.get` before doing more work.
18
+ 3. When no run exists:
19
+ - start `full` for an initial greenfield baseline;
20
+ - start `adoption` for a brownfield baseline;
21
+ - use `product`, `feature`, `architecture`, or `custom` only when the owner
22
+ explicitly selected that bounded scope for an active change.
24
23
 
25
- Read a reference completely only when its lane is selected. Do not load all lanes by
26
- default.
24
+ Never infer an MVP, reduced product posture, skipped step, or release phase. Full and
25
+ adoption modes execute all seventeen semantic steps. A custom run records every
26
+ excluded step and its selection reason in DB.
27
27
 
28
- ## Evidence discipline
28
+ ## Execute one recoverable step at a time
29
29
 
30
- - Prefer the current checkout and existing project artifacts for repository facts.
31
- - Browse only when a claim is external, unstable, or requires primary-source support.
32
- - Prefer official and primary sources; cite each consequential external claim near the
33
- statement it supports.
34
- - Separate observed facts, evidence-backed inferences, user decisions, and unresolved
35
- assumptions.
36
- - Do not manufacture confidence percentages, market numbers, personas, competitors,
37
- or options when evidence does not support them.
30
+ Read only the reference matching `workflow.next_step.step_id`:
38
31
 
39
- ## Workflow
32
+ | Step | Reference |
33
+ |---|---|
34
+ | `00-problem-validation` | `references/00-problem-validation.md` |
35
+ | `01-opportunity-discovery` | `references/01-opportunity-discovery.md` |
36
+ | `02-market-assessment` | `references/02-market-assessment.md` |
37
+ | `03-competitive-landscape` | `references/03-competitive-landscape.md` |
38
+ | `04-product-strategy` | `references/04-product-strategy.md` |
39
+ | `05-assumptions-validation` | `references/05-assumptions-validation.md` |
40
+ | `10-user-personas` | `references/10-user-personas.md` |
41
+ | `11-user-scenarios` | `references/11-user-scenarios.md` |
42
+ | `20-user-stories` | `references/20-user-stories.md` |
43
+ | `21-features-scope` | `references/21-features-scope.md` |
44
+ | `22-success-metrics` | `references/22-success-metrics.md` |
45
+ | `30-architecture-context` | `references/30-architecture-context.md` |
46
+ | `31-solution-strategy` | `references/31-solution-strategy.md` |
47
+ | `32-building-blocks` | `references/32-building-blocks.md` |
48
+ | `40-deployment` | `references/40-deployment.md` |
49
+ | `41-quality-risks` | `references/41-quality-risks.md` |
50
+ | `99-synthesis` | `references/99-synthesis.md` |
40
51
 
41
- 1. Build a short research agenda from the selected lanes and the decisions they must
42
- unlock.
43
- 2. Gather evidence before recommending a direction. Ask one concise question when a
44
- user decision is load-bearing; batch independent low-impact questions only when it
45
- improves flow.
46
- 3. Present material tradeoffs before recording a decision. Comparisons are appropriate
47
- only when real alternatives share meaningful criteria.
48
- 4. Update the relevant baseline specification sections. Preserve source links,
49
- decisions, rejected alternatives when useful, acceptance criteria, and explicit
50
- open questions. Do not duplicate the same narrative across several files.
51
- 5. Validate cross-document consistency and trace each required behavior from problem
52
- or constraint to acceptance and architecture.
53
- 6. Use `references/synthesis.md` for the completion check.
54
- 7. Record unresolved evidence as the baseline gap ledger: `baseline_blocker`,
55
- `documentation_drift`, `known_defect`, `technical_debt`, `unknown`, or
56
- `future_change`. Keep accepted non-blocking work out of the implementation backlog
57
- until the owner selects it.
58
- 8. Call `baseline.record` with the complete current specification list, bounded evidence
59
- references, actual verification results, provider metadata, explicit unknowns,
60
- classification, and the full gap ledger. Use the returned repository revision for
61
- convergence.
62
- 9. Present the baseline, open gaps, dirty-worktree state, and any known-red verification
63
- to the owner. After explicit approval, call `baseline.converge`, setting acceptance
64
- flags only for the exact known-red or dirty snapshot approved by the owner. Resolve
65
- deterministic blockers before routing.
52
+ For each selected step:
66
53
 
67
- ## Completion gate
54
+ 1. Inspect current repository and specification evidence before asking the owner to
55
+ repeat known facts. Browse only for unstable or external claims, using primary
56
+ sources where possible.
57
+ 2. Separate `Observed`, `Verified`, `Decided`, and `Unknown`. Ask one concise question
58
+ only when the answer changes scope, product intent, security, cost, or another
59
+ load-bearing decision.
60
+ 3. Update the relevant baseline specification or active change research artifact.
61
+ Preserve citations, decisions, drift, and unresolved gaps without duplicating prose.
62
+ 4. Write one immutable step report at
63
+ `.ultra/docs/research/<workflow-id>/<step-id>.md`. It must have a title and the
64
+ sections `Evidence`, `Specification updates`, and `Decisions and unknowns`. Link
65
+ specification anchors and external sources; do not copy transcripts or provider
66
+ payloads.
67
+ 5. Call `workflow.step` with `completed`, bounded evidence references, that step report
68
+ as `research-step-report`, material decisions, and one or more `semantic_records`.
69
+ Each record has a stable `id`, the step-specific `kind` and `attributes` named in
70
+ its reference, a status (`observed`, `verified`, `decided`, `accepted`, `unknown`,
71
+ or `not_applicable`), a concise summary, evidence refs, optional typed links, and a
72
+ project-relative `source_ref` using `path#anchor`. Use the immutable step report as
73
+ the source when later edits could change a shared specification. MCP verifies the
74
+ anchor and stores its digest; `not_applicable` requires an evidence-backed rationale.
75
+ 6. For `99-synthesis` in `full` or `adoption` mode, also bind the current
76
+ `discovery.md`, `product.md`, `architecture.md`, and `research-distillate.md` as
77
+ outputs. This freezes the exact researched baseline without making the reports a
78
+ second specification authority.
79
+ 7. If evidence or owner authority is missing, call `workflow.step` with `blocked` and
80
+ specific blocker codes. Resume that same step after resolution; never skip a
81
+ required step to obtain a ready state.
68
82
 
69
- Research is complete when the selected scope has enough evidence for planning, every
70
- material decision is recorded, required acceptance is testable, architecture respects
71
- known constraints, and unresolved items are either blocking or explicitly outside the
72
- accepted scope.
83
+ ## Converge
73
84
 
74
- Route a converged baseline to `ultra-plan`. Do not create business tasks, write raw
75
- SQLite, or maintain a second condensed specification that can drift from the baseline.
85
+ When all selected steps are ready, call `workflow.complete` and read the completed run
86
+ back. Missing or stale output blocks completion.
87
+
88
+ For initial or adoption research, call `baseline.record` with discovery, product, and
89
+ architecture specification refs; current repository revision and scope; bounded source,
90
+ docs, runtime, test, deployment, and external evidence; actual verification commands
91
+ and results; unknowns; the complete gap ledger; classification; and external provider
92
+ metadata references. Do not store prompts, transcripts, memory, or graph content.
93
+
94
+ Present the recorded revision, worktree snapshot, known failures, blockers, and gaps.
95
+ Only after explicit owner approval call `baseline.converge`. Accept known-red or a
96
+ dirty worktree only when that exact snapshot was approved. Convergence must verify the
97
+ completed full/adoption research run and current output digests.
98
+
99
+ Return the workflow id, all seventeen step-report paths for full/adoption research,
100
+ the four synthesis artifacts, baseline status, open gaps, approval state, and one exact
101
+ next route. A ready initial baseline routes to `ultra-change`; bounded change research
102
+ returns to its change breadcrumb and then `ultra-plan` when the research gate is ready.
@@ -0,0 +1,36 @@
1
+ # Problem validation
2
+
3
+ Use for workflow step `00-problem-validation`.
4
+
5
+ ## Objective
6
+
7
+ Establish the problem, affected actor, current workaround, consequence, and available
8
+ demand evidence. In brownfield adoption, describe the behavior the current system
9
+ already serves before discussing future intent.
10
+
11
+ ## Evidence
12
+
13
+ - Inspect existing product documents, user-facing entry points, support evidence, and
14
+ runtime behavior before asking the owner for facts already present.
15
+ - Treat an owner statement as a decision or claim, not as observed user evidence.
16
+ - Record absent evidence as `Unknown`; do not invent demand, urgency, or a target user.
17
+ - Use external research only when a consequential claim depends on current facts.
18
+
19
+ ## Record
20
+
21
+ Update `discovery.md` with `Observed`, `Verified`, `Decided`, and `Unknown` entries for:
22
+
23
+ - problem and affected actor;
24
+ - current workaround and consequence;
25
+ - demand or usage evidence;
26
+ - the narrowest owner-approved problem boundary;
27
+ - unresolved validation needs.
28
+
29
+ Link the updated specification anchor from the immutable step report required by the
30
+ orchestrator. A missing load-bearing fact becomes a blocker or baseline gap, not a
31
+ guessed answer.
32
+
33
+ ## Semantic record
34
+
35
+ Use kind `problem`. Record `actor`, `current_workaround`, `consequence`, and
36
+ `evidence_status`.
@@ -0,0 +1,33 @@
1
+ # Opportunity discovery
2
+
3
+ Use for workflow step `01-opportunity-discovery`.
4
+
5
+ ## Objective
6
+
7
+ Connect the validated problem to desired outcomes and evidence-backed opportunities.
8
+ Describe opportunities from the actor's perspective rather than as a feature list.
9
+
10
+ ## Evidence
11
+
12
+ - Derive current outcomes from observed workflows, existing behavior, interviews, or
13
+ owner decisions.
14
+ - Preserve causal links between a problem, an unmet outcome, and its evidence.
15
+ - Do not force rankings, solution brainstorming, or a fixed number of opportunities.
16
+ - Record opportunities that lack evidence as unknown or future research.
17
+
18
+ ## Record
19
+
20
+ Update `discovery.md` with:
21
+
22
+ - desired outcomes and their evidence;
23
+ - opportunity statements and affected actors;
24
+ - constraints or dependencies;
25
+ - owner-decided priority when one exists;
26
+ - rejected or deferred opportunities only when that decision is durable.
27
+
28
+ Complete the step with the evidence used and the updated output path.
29
+
30
+ ## Semantic record
31
+
32
+ Use kind `opportunity`. Record `actor`, `desired_outcome`, and `evidence_status`. Link
33
+ the record to its problem when that relation is established.
@@ -0,0 +1,30 @@
1
+ # Market assessment
2
+
3
+ Use for workflow step `02-market-assessment`.
4
+
5
+ ## Objective
6
+
7
+ Record only market facts that materially affect product scope, economics, regulation,
8
+ or delivery. For an internal tool or a brownfield system with no market decision, state
9
+ that boundary and retain the evidence supporting it.
10
+
11
+ ## Evidence
12
+
13
+ - Prefer current primary sources, filings, official statistics, and directly observed
14
+ commercial data.
15
+ - Preserve source date, geography, segment definition, and calculation assumptions.
16
+ - Do not manufacture TAM, growth rates, pricing, or false numeric precision.
17
+ - Separate externally verified facts from owner targets and estimates.
18
+
19
+ ## Record
20
+
21
+ Update `discovery.md` with relevant segment boundaries, commercial or operational
22
+ constraints, source-backed measurements, assumptions, and unknowns. Include a sizing
23
+ model only when the decision genuinely depends on one and the inputs are defensible.
24
+
25
+ Link source references and the updated specification anchor from the immutable step
26
+ report required by the orchestrator.
27
+
28
+ ## Semantic record
29
+
30
+ Use kind `market_constraint`. Record `constraint`, `decision_impact`, and `freshness`.
@@ -0,0 +1,31 @@
1
+ # Competitive landscape
2
+
3
+ Use for workflow step `03-competitive-landscape`.
4
+
5
+ ## Objective
6
+
7
+ Identify the alternatives actors actually use and the consequences for strategy.
8
+ Alternatives may include direct products, adjacent tools, manual workflows, or doing
9
+ nothing.
10
+
11
+ ## Evidence
12
+
13
+ - Use current product documentation, pricing, repositories, filings, or observed user
14
+ workflows.
15
+ - Evaluate only criteria that change the decision at hand.
16
+ - Do not create a ceremonial matrix, fixed competitor count, or unsupported claim of
17
+ superiority.
18
+ - Distinguish a verified capability from marketing language and inference.
19
+
20
+ ## Record
21
+
22
+ Update `discovery.md` with the relevant alternatives, evidence, meaningful differences,
23
+ switching constraints, and durable strategy implications. Record an unknown when a
24
+ credible alternative cannot be verified.
25
+
26
+ Complete the step with evidence references and the updated output path.
27
+
28
+ ## Semantic record
29
+
30
+ Use kind `alternative`. Record `category`, `switching_constraint`, and
31
+ `strategy_implication`.
@@ -0,0 +1,32 @@
1
+ # Product strategy
2
+
3
+ Use for workflow step `04-product-strategy`.
4
+
5
+ ## Objective
6
+
7
+ Turn accepted evidence into a product direction, target boundary, value proposition,
8
+ and explicit tradeoffs.
9
+
10
+ ## Evidence and decisions
11
+
12
+ - Derive constraints from prior research and current system behavior.
13
+ - Ask the owner when a scope, customer, business, or risk decision is load-bearing.
14
+ - Do not infer an MVP, reduced scope, release phase, or commercial posture.
15
+ - Record exclusions only when the owner or an accepted constraint establishes them.
16
+
17
+ ## Record
18
+
19
+ Update `discovery.md` with:
20
+
21
+ - product direction and intended actors;
22
+ - value delivered through observable behavior;
23
+ - chosen tradeoffs and their rationale;
24
+ - constraints, exclusions, and unresolved decisions;
25
+ - any defensibility claim with its supporting evidence.
26
+
27
+ Complete the step with decision and evidence references plus the updated output path.
28
+
29
+ ## Semantic record
30
+
31
+ Use kind `strategy_decision`. Record `tradeoff` and `rationale`, then link the decision
32
+ to the problems, opportunities, or constraints that support it.
@@ -0,0 +1,31 @@
1
+ # Assumptions and validation
2
+
3
+ Use for workflow step `05-assumptions-validation`.
4
+
5
+ ## Objective
6
+
7
+ Make load-bearing assumptions visible and define the smallest credible evidence needed
8
+ to confirm or reject them.
9
+
10
+ ## Method
11
+
12
+ - Extract assumptions from problem, opportunity, market, alternative, and strategy
13
+ claims.
14
+ - Separate already verified facts from assumptions and owner decisions.
15
+ - Prioritize by consequence and uncertainty only when prioritization affects the next
16
+ action; do not assign arbitrary scores.
17
+ - Define a validation signal, evidence source, decision rule, owner, and recovery path.
18
+
19
+ ## Record
20
+
21
+ Update `discovery.md` with the assumption ledger and validation state. Map unresolved
22
+ load-bearing assumptions to blocking unknowns or gaps. Keep non-blocking future work
23
+ out of the implementation task graph until the owner selects it.
24
+
25
+ Link evidence and the updated specification anchor from the immutable step report
26
+ required by the orchestrator.
27
+
28
+ ## Semantic record
29
+
30
+ Use kind `assumption`. Record `category`, `consequence`, `validation_signal`,
31
+ `success_rule`, `failure_rule`, and `ambiguous_rule`.
@@ -0,0 +1,29 @@
1
+ # Actors and jobs
2
+
3
+ Use for workflow step `10-user-personas`.
4
+
5
+ ## Objective
6
+
7
+ Describe evidence-backed actors, their jobs, operating context, goals, constraints, and
8
+ adoption barriers. A role or actor model is sufficient; do not invent demographic
9
+ personas.
10
+
11
+ ## Evidence
12
+
13
+ - Prefer observed workflows, access roles, support evidence, usage data, and owner
14
+ decisions.
15
+ - Link each actor to a real entry point or intended behavior.
16
+ - Mark unverified motivations and pain points as unknown.
17
+ - In brownfield adoption, document the actors represented by current code and runtime,
18
+ even when product research is incomplete.
19
+
20
+ ## Record
21
+
22
+ Update `product.md` with actor identity, job, context, current workflow, desired outcome,
23
+ constraints, and evidence. Record priority only when it is an accepted decision.
24
+
25
+ Complete the step with evidence references and the updated output path.
26
+
27
+ ## Semantic record
28
+
29
+ Use kind `actor`. Record `job`, `current_workflow`, `goal`, and `constraint`.
@@ -0,0 +1,28 @@
1
+ # User scenarios
2
+
3
+ Use for workflow step `11-user-scenarios`.
4
+
5
+ ## Objective
6
+
7
+ Trace the important current and intended journeys from trigger through outcome,
8
+ including failure and recovery.
9
+
10
+ ## Method
11
+
12
+ - Bind each scenario to an evidence-backed actor and entry point.
13
+ - Describe the current path before proposing a changed path in brownfield adoption.
14
+ - Include state changes, external systems, permissions, and observable outcomes.
15
+ - Do not force a fixed scenario count or emotional narrative.
16
+
17
+ ## Record
18
+
19
+ Update `product.md` with scenario id, actor, trigger, preconditions, current or intended
20
+ flow, success outcome, failure outcome, recovery, and evidence. Mark gaps where runtime
21
+ behavior and documentation disagree.
22
+
23
+ Complete the step with evidence references and the updated output path.
24
+
25
+ ## Semantic record
26
+
27
+ Use kind `scenario`. Record `actor_id`, `trigger`, `preconditions`, `flow`, `success`,
28
+ `failure`, and `recovery`.
@@ -0,0 +1,30 @@
1
+ # Behavioral requirements and acceptance
2
+
3
+ Use for workflow step `20-user-stories`.
4
+
5
+ ## Objective
6
+
7
+ Translate accepted scenarios into testable behavior without prematurely designing the
8
+ implementation.
9
+
10
+ ## Method
11
+
12
+ - Use stable requirement identifiers.
13
+ - State preconditions, action, observable result, error behavior, and recovery where
14
+ relevant.
15
+ - Trace every requirement to a scenario, constraint, or owner decision.
16
+ - Preserve current delivered behavior separately from proposed behavior.
17
+ - Do not use priority labels as a substitute for explicit scope decisions.
18
+
19
+ ## Record
20
+
21
+ Update `product.md` with requirements and acceptance criteria that can map to an
22
+ executable check or deliberate manual evidence. Record unknown behavior instead of
23
+ writing vague acceptance.
24
+
25
+ Complete the step with evidence references and the updated output path.
26
+
27
+ ## Semantic record
28
+
29
+ Use kind `requirement`. Record `preconditions`, `action`, `observable_result`,
30
+ `error_recovery`, and `verification`. Link it to its accepted scenario or decision.
@@ -0,0 +1,29 @@
1
+ # Capability and scope boundary
2
+
3
+ Use for workflow step `21-features-scope`.
4
+
5
+ ## Objective
6
+
7
+ Group accepted behavior into coherent capabilities and record what is included,
8
+ excluded, deferred, or unresolved.
9
+
10
+ ## Rules
11
+
12
+ - Preserve the owner's stated product and release posture.
13
+ - Never infer an MVP, reduced version, phase label, or omission from implementation
14
+ convenience.
15
+ - Trace included capabilities to requirements and observable outcomes.
16
+ - Record dependencies, migrations, compatibility, and operational obligations inside
17
+ the capability that owns them.
18
+ - Keep speculative future ideas outside the active scope unless selected.
19
+
20
+ ## Record
21
+
22
+ Update `product.md` with capability boundaries, included requirements, explicit
23
+ exclusions and rationale, dependencies, and unresolved scope decisions.
24
+
25
+ Complete the step with decision evidence and the updated output path.
26
+
27
+ ## Semantic record
28
+
29
+ Use kind `capability`. Record `requirement_ids`, `scope_status`, and `rationale`.
@@ -0,0 +1,28 @@
1
+ # Outcomes and measurements
2
+
3
+ Use for workflow step `22-success-metrics`.
4
+
5
+ ## Objective
6
+
7
+ Define how the owner will know the accepted behavior and product outcome are working,
8
+ including signals that would reveal harmful optimization.
9
+
10
+ ## Method
11
+
12
+ - Derive measurements from accepted outcomes and available instrumentation.
13
+ - State definition, source, observation window, owner, and decision use.
14
+ - Separate current measurements, target decisions, and unavailable telemetry.
15
+ - Do not invent baselines, targets, or a single north-star metric.
16
+
17
+ ## Record
18
+
19
+ Update `product.md` with outcome measures, operational measures, guardrails, evidence
20
+ availability, and unresolved instrumentation needs. A metric that cannot be observed
21
+ must be recorded as a gap or explicit future change.
22
+
23
+ Complete the step with evidence references and the updated output path.
24
+
25
+ ## Semantic record
26
+
27
+ Use kind `metric`. Record `definition`, `source`, `window`, `owner`, and
28
+ `decision_use`.
@@ -0,0 +1,30 @@
1
+ # Architecture context
2
+
3
+ Use for workflow step `30-architecture-context`.
4
+
5
+ ## Objective
6
+
7
+ Establish current system boundaries, quality goals, constraints, actors, external
8
+ systems, and data flows.
9
+
10
+ ## Evidence
11
+
12
+ - Inspect code entry points, configuration, schemas, deployment assets, tests, and
13
+ runtime evidence.
14
+ - Separate observed architecture from intended architecture.
15
+ - Record permissions, data sensitivity, compliance, and organizational constraints
16
+ when they affect the design.
17
+ - Do not infer a greenfield architecture over an existing system.
18
+
19
+ ## Record
20
+
21
+ Update `architecture.md` with system context, external dependencies, trust boundaries,
22
+ data flows, quality goals, constraints, and evidence. Record documentation drift when
23
+ the current checkout contradicts an existing diagram or claim.
24
+
25
+ Complete the step with source or runtime evidence and the updated output path.
26
+
27
+ ## Semantic record
28
+
29
+ Use kind `architecture_context`. Record `boundary`, `inputs_outputs`,
30
+ `trust_authority`, and `consumers`.
@@ -0,0 +1,28 @@
1
+ # Solution strategy
2
+
3
+ Use for workflow step `31-solution-strategy`.
4
+
5
+ ## Objective
6
+
7
+ Record architecture decisions that satisfy accepted behavior and constraints while
8
+ preserving current repository patterns where they remain valid.
9
+
10
+ ## Method
11
+
12
+ - Search for existing implementations and dependencies before proposing new ones.
13
+ - Evaluate alternatives only when more than one credible choice remains and the choice
14
+ materially affects the contract.
15
+ - Record decision drivers, chosen direction, consequences, compatibility, and recovery.
16
+ - Do not force a new stack, fixed option count, scoring model, or arbitrary preference.
17
+
18
+ ## Record
19
+
20
+ Update `architecture.md` with accepted strategy decisions and their evidence. Preserve
21
+ unresolved decisions as blockers rather than selecting on the owner's behalf.
22
+
23
+ Complete the step with decision evidence and the updated output path.
24
+
25
+ ## Semantic record
26
+
27
+ Use kind `architecture_decision`. Record `drivers`, `direction`, `consequences`,
28
+ `compatibility`, and `recovery`.
@@ -0,0 +1,28 @@
1
+ # Building blocks and runtime paths
2
+
3
+ Use for workflow step `32-building-blocks`.
4
+
5
+ ## Objective
6
+
7
+ Map responsibilities, contracts, data ownership, consumers, and runtime behavior across
8
+ the current or accepted architecture.
9
+
10
+ ## Method
11
+
12
+ - Start from real modules and live entry points in brownfield adoption.
13
+ - Define boundaries by responsibility and authority, not by an imposed layer diagram.
14
+ - Trace key scenarios through validation, domain behavior, persistence, integrations,
15
+ observable output, failure, and recovery.
16
+ - Identify unreachable scaffolding, duplicate authority, and undocumented coupling.
17
+
18
+ ## Record
19
+
20
+ Update `architecture.md` with building blocks, public contracts, ownership, dependencies,
21
+ runtime paths, error paths, and evidence. Link each proposed block to a consumer.
22
+
23
+ Complete the step with source evidence and the updated output path.
24
+
25
+ ## Semantic record
26
+
27
+ Use kind `runtime_path`. Record `entry_point`, `state_side_effects`,
28
+ `observable_result`, `failure_recovery`, and `consumers`.
@@ -0,0 +1,29 @@
1
+ # Deployment and operations
2
+
3
+ Use for workflow step `40-deployment`.
4
+
5
+ ## Objective
6
+
7
+ Record how the system is built, configured, migrated, deployed, observed, recovered,
8
+ and rolled back across its actual environments.
9
+
10
+ ## Evidence
11
+
12
+ - Inspect repository-native build and deployment configuration, environment contracts,
13
+ migrations, health checks, and operational documentation.
14
+ - Use current provider documentation only when repository evidence is insufficient.
15
+ - Separate verified deployment behavior from intended delivery design.
16
+ - Never record secrets or fabricate infrastructure that has not been selected.
17
+
18
+ ## Record
19
+
20
+ Update `architecture.md` with environments, topology, CI/CD entry points, configuration,
21
+ migrations, observability, rollback, recovery, cost constraints when relevant, and
22
+ unknowns.
23
+
24
+ Complete the step with file, runtime, or provider evidence and the updated output path.
25
+
26
+ ## Semantic record
27
+
28
+ Use kind `deployment`. Record `environment`, `entry_point`, `config_migration`,
29
+ `observation`, and `rollback_recovery`.
@@ -0,0 +1,28 @@
1
+ # Quality scenarios and risks
2
+
3
+ Use for workflow step `41-quality-risks`.
4
+
5
+ ## Objective
6
+
7
+ Turn quality goals and known failure modes into observable scenarios, mitigations,
8
+ recovery expectations, and a durable risk ledger.
9
+
10
+ ## Method
11
+
12
+ - Cover only qualities material to the accepted system: correctness, availability,
13
+ security, performance, privacy, maintainability, or others supported by evidence.
14
+ - State trigger, operating condition, expected response, measurement, and recovery.
15
+ - Separate known defect, technical debt, uncertain risk, and accepted constraint.
16
+ - Do not assign arbitrary probability or confidence scores.
17
+
18
+ ## Record
19
+
20
+ Update `architecture.md` with quality scenarios, risk evidence, mitigation, owner,
21
+ verification, recovery, technical debt, and architecture decisions where needed.
22
+
23
+ Complete the step with evidence references and the updated output path.
24
+
25
+ ## Semantic record
26
+
27
+ Use kind `risk`. Record `trigger_condition`, `expected_response`, `measurement`,
28
+ `mitigation`, `recovery`, and `owner`.