ultra-builder-pro-cli 0.5.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 (206) hide show
  1. package/.ultra-template/delivery-report.json +9 -0
  2. package/.ultra-template/docs/research/README.md +53 -0
  3. package/.ultra-template/specs/architecture.md +250 -0
  4. package/.ultra-template/specs/discovery.md +248 -0
  5. package/.ultra-template/specs/product.md +223 -0
  6. package/.ultra-template/tasks/contexts/TEMPLATE.md +57 -0
  7. package/.ultra-template/tasks/tasks.json +33 -0
  8. package/.ultra-template/test-report.json +8 -0
  9. package/CHANGELOG.md +194 -0
  10. package/LICENSE +21 -0
  11. package/README.md +187 -0
  12. package/adapters/_shared/codex-assets.cjs +1128 -0
  13. package/adapters/_shared/codex-ultra-tools-entry.cjs +11 -0
  14. package/adapters/_shared/file-ops.cjs +115 -0
  15. package/adapters/_shared/frontmatter.cjs +52 -0
  16. package/adapters/_shared/handbook.cjs +144 -0
  17. package/adapters/_shared/md-to-toml.cjs +54 -0
  18. package/adapters/_shared/path-rewrite.cjs +79 -0
  19. package/adapters/_shared/rtk-detect.cjs +86 -0
  20. package/adapters/_shared/runtime-assets.cjs +70 -0
  21. package/adapters/_shared/settings-merge.cjs +76 -0
  22. package/adapters/_shared/tests/file-ops.test.cjs +54 -0
  23. package/adapters/_shared/tests/frontmatter.test.cjs +47 -0
  24. package/adapters/_shared/tests/handbook.test.cjs +86 -0
  25. package/adapters/_shared/tests/md-to-toml.test.cjs +48 -0
  26. package/adapters/_shared/tests/path-rewrite.test.cjs +60 -0
  27. package/adapters/_shared/tests/resolve-target.test.cjs +85 -0
  28. package/adapters/_shared/tests/rtk-detect.test.cjs +116 -0
  29. package/adapters/_shared/tests/runtime-assets.test.cjs +107 -0
  30. package/adapters/_shared/tests/settings-merge.test.cjs +85 -0
  31. package/adapters/_shared/tests/validate.test.cjs +30 -0
  32. package/adapters/_shared/validate.cjs +24 -0
  33. package/adapters/claude.js +182 -0
  34. package/adapters/codex.js +385 -0
  35. package/adapters/gemini.js +204 -0
  36. package/adapters/opencode.js +506 -0
  37. package/adapters/tests/claude.test.cjs +117 -0
  38. package/adapters/tests/codex-hook.test.cjs +90 -0
  39. package/adapters/tests/codex.test.cjs +356 -0
  40. package/adapters/tests/gemini.test.cjs +112 -0
  41. package/adapters/tests/opencode.test.cjs +246 -0
  42. package/agents/code-reviewer.md +102 -0
  43. package/agents/debugger.md +127 -0
  44. package/agents/review-code.md +125 -0
  45. package/agents/review-comments.md +98 -0
  46. package/agents/review-coordinator.md +146 -0
  47. package/agents/review-design.md +133 -0
  48. package/agents/review-errors.md +87 -0
  49. package/agents/review-tests.md +93 -0
  50. package/agents/tdd-runner.md +92 -0
  51. package/bin/handbook.js +54 -0
  52. package/bin/install.js +254 -0
  53. package/bin/orchestrator.js +214 -0
  54. package/commands/learn.md +41 -0
  55. package/commands/ultra-deliver.md +45 -0
  56. package/commands/ultra-dev.md +50 -0
  57. package/commands/ultra-init.md +51 -0
  58. package/commands/ultra-plan.md +49 -0
  59. package/commands/ultra-research.md +59 -0
  60. package/commands/ultra-status.md +46 -0
  61. package/commands/ultra-test.md +48 -0
  62. package/commands/ultra-think.md +45 -0
  63. package/docs/AGENT-CONTEXT.md +143 -0
  64. package/docs/ARCHITECTURE.md +197 -0
  65. package/docs/COMMIT-HASH-BACKFILL.md +101 -0
  66. package/docs/LEGACY-HERMES.md +1175 -0
  67. package/docs/PLAN.zh-CN.md +1683 -0
  68. package/docs/ROADMAP.md +102 -0
  69. package/docs/RUNTIME-COMPAT-MATRIX.md +98 -0
  70. package/docs/STATE-DB-ACCESS-POLICY.md +109 -0
  71. package/docs/USER-HANDBOOK-CONTRACT.md +61 -0
  72. package/hooks/README.md +24 -0
  73. package/hooks/active_task_context.py +44 -0
  74. package/hooks/adapters/codex.py +302 -0
  75. package/hooks/health_check.py +61 -0
  76. package/hooks/pre_stop_check.py +56 -0
  77. package/hooks/subagent_tracker.py +116 -0
  78. package/hooks/workflow_checkpoint.py +56 -0
  79. package/hooks/workflow_context.py +63 -0
  80. package/hooks/workflow_resume.py +50 -0
  81. package/mcp-server/lib/init-project.cjs +162 -0
  82. package/mcp-server/lib/llm-client.cjs +157 -0
  83. package/mcp-server/lib/llm-client.test.cjs +156 -0
  84. package/mcp-server/lib/plan-store.cjs +96 -0
  85. package/mcp-server/lib/plan-store.test.cjs +132 -0
  86. package/mcp-server/lib/prd-parser.cjs +110 -0
  87. package/mcp-server/lib/prd-parser.test.cjs +171 -0
  88. package/mcp-server/lib/pricing.cjs +53 -0
  89. package/mcp-server/lib/projector.cjs +158 -0
  90. package/mcp-server/lib/state-db.cjs +113 -0
  91. package/mcp-server/lib/state-db.test.cjs +116 -0
  92. package/mcp-server/lib/state-ops.cjs +725 -0
  93. package/mcp-server/lib/task-expander.cjs +123 -0
  94. package/mcp-server/lib/task-expander.test.cjs +253 -0
  95. package/mcp-server/lib/telemetry.cjs +72 -0
  96. package/mcp-server/lib/topo.cjs +131 -0
  97. package/mcp-server/lib/topo.test.cjs +158 -0
  98. package/mcp-server/server.cjs +482 -0
  99. package/mcp-server/tests/circuit-breaker.test.cjs +125 -0
  100. package/mcp-server/tests/commit-hash-flow.test.cjs +117 -0
  101. package/mcp-server/tests/concurrency-update.test.cjs +96 -0
  102. package/mcp-server/tests/concurrency.test.cjs +112 -0
  103. package/mcp-server/tests/db-ops.test.cjs +117 -0
  104. package/mcp-server/tests/init-project.test.cjs +141 -0
  105. package/mcp-server/tests/migrate.test.cjs +144 -0
  106. package/mcp-server/tests/projector.test.cjs +130 -0
  107. package/mcp-server/tests/server-contract.test.cjs +750 -0
  108. package/mcp-server/tests/staleness.test.cjs +190 -0
  109. package/mcp-server/tests/state-ops.test.cjs +286 -0
  110. package/mcp-server/tests/tagged-tasks.test.cjs +163 -0
  111. package/mcp-server/tests/telemetry.test.cjs +205 -0
  112. package/orchestrator/auto-merge.cjs +109 -0
  113. package/orchestrator/code-graph-watcher.cjs +121 -0
  114. package/orchestrator/daemon.cjs +112 -0
  115. package/orchestrator/dispatch-rules.cjs +93 -0
  116. package/orchestrator/parallel-orchestrator.cjs +195 -0
  117. package/orchestrator/planner/expand-prompt.cjs +62 -0
  118. package/orchestrator/planner/expand-prompt.test.cjs +52 -0
  119. package/orchestrator/planner/plan-builder.cjs +116 -0
  120. package/orchestrator/planner/plan-builder.test.cjs +165 -0
  121. package/orchestrator/planner/prd-prompt.cjs +44 -0
  122. package/orchestrator/planner/prd-prompt.test.cjs +30 -0
  123. package/orchestrator/recovery.cjs +70 -0
  124. package/orchestrator/session-runner.cjs +224 -0
  125. package/orchestrator/skill-miner.cjs +133 -0
  126. package/orchestrator/tests/auto-merge.test.cjs +216 -0
  127. package/orchestrator/tests/code-graph-watcher.test.cjs +183 -0
  128. package/orchestrator/tests/daemon.test.cjs +260 -0
  129. package/orchestrator/tests/dispatch-rules.test.cjs +122 -0
  130. package/orchestrator/tests/parallel-orchestrator.test.cjs +233 -0
  131. package/orchestrator/tests/phase-8b-gate.test.cjs +183 -0
  132. package/orchestrator/tests/recovery.test.cjs +190 -0
  133. package/orchestrator/tests/session-runner.test.cjs +314 -0
  134. package/orchestrator/tests/skill-miner.test.cjs +147 -0
  135. package/orchestrator/tests/worktree-manager.test.cjs +148 -0
  136. package/orchestrator/worktree-manager.cjs +131 -0
  137. package/output-styles/coding-vibes.md +67 -0
  138. package/output-styles/structural-thinking.md +61 -0
  139. package/package.json +109 -0
  140. package/settings.json +8 -0
  141. package/skills/cc-collab/SKILL.md +41 -0
  142. package/skills/code-review-expert/SKILL.md +118 -0
  143. package/skills/code-review-expert/references/code-quality-checklist.md +112 -0
  144. package/skills/code-review-expert/references/integration-checklist.md +46 -0
  145. package/skills/code-review-expert/references/removal-plan.md +52 -0
  146. package/skills/code-review-expert/references/security-checklist.md +100 -0
  147. package/skills/code-review-expert/references/solid-checklist.md +65 -0
  148. package/skills/codex-collab/SKILL.md +52 -0
  149. package/skills/codex-collab/evals/evals.json +40 -0
  150. package/skills/gemini-collab/SKILL.md +51 -0
  151. package/skills/gemini-collab/evals/evals.json +42 -0
  152. package/skills/integration-rules/SKILL.md +71 -0
  153. package/skills/learn/SKILL.md +117 -0
  154. package/skills/security-rules/SKILL.md +60 -0
  155. package/skills/testing-rules/SKILL.md +56 -0
  156. package/skills/ultra-deliver/SKILL.md +171 -0
  157. package/skills/ultra-dev/SKILL.md +324 -0
  158. package/skills/ultra-init/SKILL.md +148 -0
  159. package/skills/ultra-plan/SKILL.md +314 -0
  160. package/skills/ultra-research/SKILL.md +156 -0
  161. package/skills/ultra-research/steps/step-00-problem-validation.md +154 -0
  162. package/skills/ultra-research/steps/step-01-opportunity-discovery.md +172 -0
  163. package/skills/ultra-research/steps/step-02-market-assessment.md +195 -0
  164. package/skills/ultra-research/steps/step-03-competitive-landscape.md +197 -0
  165. package/skills/ultra-research/steps/step-04-product-strategy.md +196 -0
  166. package/skills/ultra-research/steps/step-05-assumptions-validation.md +234 -0
  167. package/skills/ultra-research/steps/step-10-user-personas.md +169 -0
  168. package/skills/ultra-research/steps/step-11-user-scenarios.md +181 -0
  169. package/skills/ultra-research/steps/step-20-user-stories.md +156 -0
  170. package/skills/ultra-research/steps/step-21-features-scope.md +157 -0
  171. package/skills/ultra-research/steps/step-22-success-metrics.md +195 -0
  172. package/skills/ultra-research/steps/step-30-architecture-context.md +154 -0
  173. package/skills/ultra-research/steps/step-31-solution-strategy.md +172 -0
  174. package/skills/ultra-research/steps/step-32-building-blocks.md +188 -0
  175. package/skills/ultra-research/steps/step-40-deployment.md +123 -0
  176. package/skills/ultra-research/steps/step-41-quality-risks.md +135 -0
  177. package/skills/ultra-research/steps/step-99-synthesis.md +188 -0
  178. package/skills/ultra-review/SKILL.md +437 -0
  179. package/skills/ultra-review/references/unified-schema.md +127 -0
  180. package/skills/ultra-review/scripts/review_verdict_update.py +99 -0
  181. package/skills/ultra-review/scripts/review_wait.py +120 -0
  182. package/skills/ultra-status/SKILL.md +162 -0
  183. package/skills/ultra-test/SKILL.md +195 -0
  184. package/skills/ultra-think/SKILL.md +109 -0
  185. package/skills/ultra-verify/SKILL.md +111 -0
  186. package/skills/ultra-verify/evals/evals.json +51 -0
  187. package/skills/ultra-verify/references/confidence-system.md +38 -0
  188. package/skills/ultra-verify/references/cross-verify-modes.md +73 -0
  189. package/skills/ultra-verify/scripts/verify_wait.py +131 -0
  190. package/spec/cli-protocol.md +118 -0
  191. package/spec/mcp-tools.yaml +658 -0
  192. package/spec/schemas/command-manifest.schema.json +47 -0
  193. package/spec/schemas/context-file.v4.5.schema.json +54 -0
  194. package/spec/schemas/mcp-tools.schema.json +136 -0
  195. package/spec/schemas/skill-manifest.schema.json +94 -0
  196. package/spec/schemas/state-db.sql +154 -0
  197. package/spec/schemas/tasks.v4.5.schema.json +66 -0
  198. package/ultra-tools/cli.cjs +121 -0
  199. package/ultra-tools/commands/db.cjs +175 -0
  200. package/ultra-tools/commands/legacy-memory.cjs +159 -0
  201. package/ultra-tools/commands/migrate.cjs +354 -0
  202. package/ultra-tools/commands/session.cjs +180 -0
  203. package/ultra-tools/commands/status.cjs +158 -0
  204. package/ultra-tools/commands/task.cjs +95 -0
  205. package/ultra-tools/legacy-memory.test.cjs +80 -0
  206. package/ultra-tools/status-command.test.cjs +132 -0
@@ -0,0 +1,169 @@
1
+ # Step 10: User Personas
2
+
3
+ ## MANDATORY EXECUTION RULES
4
+
5
+ - WEB SEARCH REQUIRED — validate personas against real user research data
6
+ - DEFINE 2-3 PERSONAS — not 1 (too narrow), not 5+ (too diluted)
7
+ - PERSONAS ARE ABOUT GOALS AND PAIN POINTS — not demographics
8
+ - CONNECT to step-00 (Q3: Desperate Specificity) and step-01 (Opportunities)
9
+ - WRITE output to spec file BEFORE presenting to user
10
+ - ALL output in English (spec files); conversation in Chinese
11
+
12
+ ## PREREQUISITES
13
+
14
+ - Round 0 completed (steps 00-05) with [C], OR user chose "Feature Only" starting at step-10
15
+ - `.ultra/specs/product.md` exists
16
+
17
+ ## CONTEXT BOUNDARIES
18
+
19
+ - Focus: WHO are we building for? What drives them? What blocks them?
20
+ - Personas represent real archetypes, not fictional characters
21
+ - Each persona must connect to prioritized opportunities from step-01
22
+ - This is Round 1 start — user scenarios follow in step-11
23
+
24
+ ## SEARCH STRATEGY (MANDATORY)
25
+
26
+ Execute these web searches in parallel:
27
+
28
+ ```
29
+ Search: "{{product_domain}} user persona research"
30
+ Search: "{{product_domain}} target audience profile behavior"
31
+ Search: "{{product_domain}} user needs pain points survey"
32
+ Search: "{{product_domain}} jobs to be done customer segment"
33
+ ```
34
+
35
+ ## EXECUTION SEQUENCE
36
+
37
+ ### 1. Gather User Context
38
+
39
+ Ask user via AskUserQuestion:
40
+ "Based on our discovery work, who are the 2-3 types of people who would use this most? What do you already know about them?"
41
+
42
+ Cross-reference with:
43
+ - Step-00 §0: Target User Profile
44
+ - Step-01 §1: Prioritized Opportunities
45
+ - Step-04 §4: Target Segments
46
+
47
+ ### 2. Research Real User Behavior
48
+
49
+ For each potential persona, search for:
50
+ - How they currently solve the problem (workflows, tools)
51
+ - What frustrates them most (forums, reviews, social media)
52
+ - What motivates their work (career goals, KPIs)
53
+ - How they discover and adopt new tools
54
+
55
+ ### 3. Build Persona Profiles
56
+
57
+ For each persona (2-3), define:
58
+
59
+ | Element | What to capture |
60
+ |---------|----------------|
61
+ | Name & Role | Descriptive title, not a real name |
62
+ | Context | Where they work, team size, industry |
63
+ | Goals | What they're trying to achieve (2-3) |
64
+ | Pain points | What blocks them (2-3, connected to opportunities) |
65
+ | Current workflow | How they solve the problem today |
66
+ | Success metric | How THEY measure their own success |
67
+ | Adoption trigger | What would make them try a new solution |
68
+ | Objections | Why they might NOT adopt (barriers) |
69
+
70
+ ### 4. Write Output
71
+
72
+ **WRITE IMMEDIATELY** to `.ultra/specs/product.md` §1-2:
73
+
74
+ ```markdown
75
+ ## §1 Problem Statement
76
+
77
+ ### Core Problem
78
+ [One paragraph describing the problem, grounded in step-00 validation]
79
+
80
+ ### Who It Affects
81
+ [Brief overview connecting problem to specific user types]
82
+
83
+ ### Current Impact
84
+ - **Time cost**: [Hours/week wasted on workarounds]
85
+ - **Money cost**: [$ lost to inefficiency]
86
+ - **Opportunity cost**: [What they can't do because of this problem]
87
+
88
+ ## §2 User Personas
89
+
90
+ ### Persona 1: [Descriptive Name] (Primary)
91
+
92
+ **Role**: [Job title / context]
93
+ **Context**: [Where they work, team dynamics, industry]
94
+
95
+ **Goals**:
96
+ 1. [Primary goal — what gets them promoted]
97
+ 2. [Secondary goal — what they care about daily]
98
+ 3. [Tertiary goal — nice to have]
99
+
100
+ **Pain Points**:
101
+ 1. [Pain 1] — Connects to Opportunity [O#] from §1
102
+ 2. [Pain 2] — Connects to Opportunity [O#] from §1
103
+ 3. [Pain 3] — Source: [URL or user quote]
104
+
105
+ **Current Workflow**:
106
+ > [Step-by-step description of how they solve this today]
107
+ > Tools used: [List of current tools/processes]
108
+ > Time spent: [X hours/week]
109
+
110
+ **Success Metric**: [How they measure their own success]
111
+ **Adoption Trigger**: [What would make them try our solution]
112
+ **Objections**: [Why they might resist — e.g., "too busy to learn new tool"]
113
+
114
+ ### Persona 2: [Descriptive Name] (Secondary)
115
+ [Same structure]
116
+
117
+ ### Persona 3: [Descriptive Name] (Tertiary — optional)
118
+ [Same structure]
119
+
120
+ ### Persona Prioritization
121
+
122
+ | Persona | Urgency | Willingness to Pay | Reachability | Priority |
123
+ |---------|---------|-------------------|-------------|----------|
124
+ | [P1] | High | High | Medium | **Primary** |
125
+ | [P2] | Medium | Medium | High | **Secondary** |
126
+ | [P3] | Low | Low | High | **Tertiary** |
127
+ ```
128
+
129
+ ### 5. Present to User and Gate
130
+
131
+ Show the Persona profiles. Ask user to validate:
132
+ - Do these feel like real people they know?
133
+ - Is anything missing from the profiles?
134
+ - Is the prioritization correct?
135
+
136
+ ```
137
+ [C] Continue — Personas validated, proceed to User Scenarios
138
+ [R] Revise — Adjust persona details or prioritization
139
+ [A] Add — Include an additional persona
140
+ ```
141
+
142
+ **HALT — wait for user response before proceeding.**
143
+
144
+ ### 6. Handle Response
145
+
146
+ - **[C]**: Load next step: `./step-11-user-scenarios.md`
147
+ - **[R]**: Revise personas, update product.md §1-2, re-present
148
+ - **[A]**: Add persona (max 3 total), update, re-present
149
+
150
+ ## SUCCESS METRICS
151
+
152
+ - 2-3 personas defined with goals, pain points, and current workflows
153
+ - Each persona connects to opportunities from step-01
154
+ - Personas grounded in web research, not pure imagination
155
+ - Clear prioritization with rationale
156
+ - Output written to product.md §1-2
157
+
158
+ ## FAILURE MODES
159
+
160
+ - Demographic-only personas ("25-35 year old male in tech")
161
+ - Too many personas (>3 dilutes focus)
162
+ - Pain points not connected to validated opportunities
163
+ - No current workflow description
164
+ - Missing adoption triggers and objections
165
+ - Not writing output before presenting to user
166
+
167
+ ## NEXT STEP
168
+
169
+ After user selects [C], read and follow: `./step-11-user-scenarios.md`
@@ -0,0 +1,181 @@
1
+ # Step 11: User Scenarios
2
+
3
+ ## MANDATORY EXECUTION RULES
4
+
5
+ - DEFINE 3-5 SCENARIOS — each with trigger, flow, and outcome
6
+ - SCENARIOS ARE USER JOURNEYS — not feature lists
7
+ - CONNECT each scenario to a specific persona from step-10
8
+ - INCLUDE the emotional arc — frustration → discovery → relief
9
+ - WRITE output to spec file BEFORE presenting to user
10
+ - ALL output in English (spec files); conversation in Chinese
11
+
12
+ ## PREREQUISITES
13
+
14
+ - Step 10 (User Personas) completed with [C]
15
+ - `.ultra/specs/product.md` §1-2 exist
16
+
17
+ ## CONTEXT BOUNDARIES
18
+
19
+ - Focus: In what situations do users encounter this problem? What's the journey?
20
+ - Scenarios describe WHEN and HOW users interact, not WHAT the product does
21
+ - Each scenario should be a story the user can picture happening
22
+ - Prioritize scenarios by frequency and pain severity
23
+
24
+ ## EXECUTION SEQUENCE
25
+
26
+ ### 1. Identify Key Scenarios
27
+
28
+ For each persona from step-10, ask:
29
+ - What triggers them to need a solution? (the "aha" moment)
30
+ - What's the most common situation? (daily/weekly use)
31
+ - What's the most painful situation? (highest frustration)
32
+ - What's the most valuable situation? (highest ROI)
33
+
34
+ Ask user via AskUserQuestion:
35
+ "For [Primary Persona], what's the most common situation where they hit this problem? Walk me through a typical day."
36
+
37
+ ### 2. Map Scenario Details
38
+
39
+ For each scenario (3-5), capture:
40
+
41
+ | Element | Description |
42
+ |---------|-------------|
43
+ | Trigger | What event causes the user to need a solution? |
44
+ | Context | Where are they? What device? What time pressure? |
45
+ | Current flow | How they handle it today (the painful way) |
46
+ | Desired flow | How they WISH they could handle it |
47
+ | Success outcome | What does "done well" look like? |
48
+ | Failure outcome | What happens if they fail? |
49
+ | Frequency | How often does this scenario occur? |
50
+ | Emotional arc | Frustration → Action → Resolution |
51
+
52
+ ### 3. Prioritize Scenarios
53
+
54
+ Score by:
55
+ - **Frequency** (1-5): How often does this happen?
56
+ - **Pain severity** (1-5): How painful is the current experience?
57
+ - **Value** (1-5): How much value does solving this create?
58
+
59
+ Priority Score = Frequency × Pain × Value
60
+
61
+ ### 4. Write Output
62
+
63
+ **WRITE IMMEDIATELY** to `.ultra/specs/product.md` §3:
64
+
65
+ ```markdown
66
+ ## §3 User Scenarios
67
+
68
+ ### Scenario Overview
69
+
70
+ | # | Scenario | Persona | Frequency | Pain | Value | Score |
71
+ |---|----------|---------|-----------|------|-------|-------|
72
+ | S1 | [Name] | [P1] | 5 | 4 | 5 | 100 |
73
+ | S2 | [Name] | [P1] | 4 | 5 | 4 | 80 |
74
+ | S3 | [Name] | [P2] | 3 | 4 | 4 | 48 |
75
+ | S4 | [Name] | [P2] | 2 | 3 | 3 | 18 |
76
+
77
+ ### Scenario 1: [Descriptive Name] ⭐ Primary
78
+
79
+ **Persona**: [Persona Name]
80
+ **Frequency**: [Daily / Weekly / Monthly]
81
+
82
+ **Trigger**: [What event causes this scenario]
83
+ **Context**: [Where, when, device, time pressure]
84
+
85
+ **Current Flow** (painful):
86
+ 1. [Step 1 — what they do today]
87
+ 2. [Step 2 — where friction occurs]
88
+ 3. [Step 3 — workaround they use]
89
+ 4. [Step 4 — outcome and time wasted]
90
+
91
+ > 💬 *"[User quote or typical complaint that captures the frustration]"*
92
+
93
+ **Desired Flow** (with our product):
94
+ 1. [Step 1 — trigger detected]
95
+ 2. [Step 2 — streamlined action]
96
+ 3. [Step 3 — fast resolution]
97
+ 4. [Step 4 — outcome achieved in less time]
98
+
99
+ **Success Outcome**: [What "done well" looks like — specific and measurable]
100
+ **Failure Outcome**: [What happens if they fail — consequences]
101
+ **Emotional Arc**: [Frustration with X] → [Discovery of solution] → [Relief / satisfaction]
102
+
103
+ ### Scenario 2: [Descriptive Name]
104
+ [Same structure]
105
+
106
+ ### Scenario 3: [Descriptive Name]
107
+ [Same structure]
108
+
109
+ ### Round 1 Summary
110
+
111
+ **User & Scenario Discovery Confidence**:
112
+ - **Persona accuracy**: [X]% — [One-line assessment]
113
+ - **Scenario coverage**: [X]% — [One-line assessment]
114
+ - **Overall R1 confidence**: [X]%
115
+ ```
116
+
117
+ ### 5. Write Round 1 Research Report
118
+
119
+ **WRITE** to `.ultra/docs/research/user-scenario-{date}.md`:
120
+
121
+ ```markdown
122
+ # Round 1: User & Scenario Discovery
123
+
124
+ > **Confidence**: [X]%
125
+ > **Steps completed**: 10-11
126
+ > **Completed**: [date]
127
+
128
+ ## Key Findings
129
+ [3-5 bullet points]
130
+
131
+ ## Personas Defined
132
+ [Names and one-line descriptions]
133
+
134
+ ## Scenarios Prioritized
135
+ [Top 3 with scores]
136
+
137
+ ## Surprises
138
+ [What was unexpected]
139
+ ```
140
+
141
+ ### 6. Present to User and Gate
142
+
143
+ Show the User Scenarios summary. Ask:
144
+ - Do these scenarios feel realistic?
145
+ - Is anything missing from the journey?
146
+ - Is the prioritization right?
147
+
148
+ ```
149
+ [C] Continue — Scenarios validated, proceed to Round 2 (Feature Definition)
150
+ [R] Revise — Adjust scenario details or prioritization
151
+ [A] Add — Include additional scenario
152
+ ```
153
+
154
+ **HALT — wait for user response before proceeding.**
155
+
156
+ ### 7. Handle Response
157
+
158
+ - **[C]**: Load next step: `./step-20-user-stories.md`
159
+ - **[R]**: Revise scenarios, update product.md §3, re-present
160
+ - **[A]**: Add scenario (max 5 total), update, re-present
161
+
162
+ ## SUCCESS METRICS
163
+
164
+ - 3-5 scenarios defined with full detail
165
+ - Each scenario connected to a persona
166
+ - Current flow AND desired flow documented
167
+ - Scenarios prioritized by Frequency × Pain × Value
168
+ - Round 1 research report written
169
+ - Output written to product.md §3
170
+
171
+ ## FAILURE MODES
172
+
173
+ - Scenarios that describe features instead of user journeys
174
+ - Missing the "current flow" (how users cope today)
175
+ - No emotional arc (scenarios feel clinical, not human)
176
+ - All scenarios for one persona (need coverage across personas)
177
+ - Not writing output before presenting to user
178
+
179
+ ## NEXT STEP
180
+
181
+ After user selects [C], read and follow: `./step-20-user-stories.md`
@@ -0,0 +1,156 @@
1
+ # Step 20: User Stories & Acceptance Criteria
2
+
3
+ ## MANDATORY EXECUTION RULES
4
+
5
+ - DERIVE stories from scenarios (step-11) — not invented from thin air
6
+ - EVERY story has acceptance criteria — no story ships without testable conditions
7
+ - USE standard format: "As a [persona], I want [action], so that [benefit]"
8
+ - PRIORITIZE using MoSCoW: Must / Should / Could / Won't
9
+ - WRITE output to spec file BEFORE presenting to user
10
+ - ALL output in English (spec files); conversation in Chinese
11
+
12
+ ## PREREQUISITES
13
+
14
+ - Step 11 (User Scenarios) completed with [C]
15
+ - `.ultra/specs/product.md` §1-3 exist
16
+
17
+ ## CONTEXT BOUNDARIES
18
+
19
+ - Focus: What specific capabilities does the product need?
20
+ - Stories must trace back to scenarios and personas
21
+ - This is about WHAT the product does, not HOW it's built
22
+ - Acceptance criteria must be testable and specific
23
+
24
+ ## EXECUTION SEQUENCE
25
+
26
+ ### 1. Extract Stories from Scenarios
27
+
28
+ For each scenario from step-11, decompose into user stories:
29
+
30
+ **Mapping**: Scenario → Stories
31
+ - S1 (highest priority scenario) → 3-5 stories
32
+ - S2 → 2-4 stories
33
+ - S3 → 2-3 stories
34
+ - Total: 8-15 stories for MVP
35
+
36
+ ### 2. Write Stories with Acceptance Criteria
37
+
38
+ For each story:
39
+
40
+ ```
41
+ As a [Persona Name],
42
+ I want [specific action],
43
+ so that [measurable benefit].
44
+
45
+ Acceptance Criteria:
46
+ - Given [context], when [action], then [expected result]
47
+ - Given [context], when [edge case], then [expected result]
48
+ - [Performance requirement if applicable]
49
+ ```
50
+
51
+ ### 3. Prioritize with MoSCoW
52
+
53
+ Discuss with user via AskUserQuestion:
54
+ "Here are the stories I've derived from our scenarios. For MVP, which are Must-Have vs Nice-to-Have?"
55
+
56
+ | Priority | Definition | Guidance |
57
+ |----------|-----------|---------|
58
+ | **Must** | Product is useless without this | Blocks primary scenario |
59
+ | **Should** | Important but workaround exists | Enhances primary scenario |
60
+ | **Could** | Nice to have if time allows | Supports secondary scenarios |
61
+ | **Won't** | Explicitly excluded for now | Out of scope (with rationale) |
62
+
63
+ ### 4. Write Output
64
+
65
+ **WRITE IMMEDIATELY** to `.ultra/specs/product.md` §4:
66
+
67
+ ```markdown
68
+ ## §4 User Stories & Features
69
+
70
+ ### Story Map Overview
71
+
72
+ | ID | Story | Persona | Scenario | Priority | Complexity |
73
+ |----|-------|---------|----------|----------|-----------|
74
+ | US-01 | [Short title] | [P1] | S1 | Must | [S/M/L] |
75
+ | US-02 | [Short title] | [P1] | S1 | Must | [S/M/L] |
76
+ | US-03 | [Short title] | [P1] | S2 | Must | [S/M/L] |
77
+ | US-04 | [Short title] | [P2] | S2 | Should | [S/M/L] |
78
+ | ... | ... | ... | ... | ... | ... |
79
+
80
+ ### Must-Have Stories
81
+
82
+ #### US-01: [Title]
83
+ **As a** [Persona], **I want** [action], **so that** [benefit].
84
+
85
+ **Acceptance Criteria**:
86
+ - [ ] Given [context], when [action], then [result]
87
+ - [ ] Given [context], when [edge case], then [result]
88
+ - [ ] [Performance: response time < Xms]
89
+
90
+ **Traces to**: Scenario [S#], Opportunity [O#]
91
+ **Complexity**: [S/M/L] — [Brief rationale]
92
+
93
+ #### US-02: [Title]
94
+ [Same structure]
95
+
96
+ #### US-03: [Title]
97
+ [Same structure]
98
+
99
+ ### Should-Have Stories
100
+
101
+ #### US-04: [Title]
102
+ [Same structure]
103
+
104
+ ### Could-Have Stories
105
+
106
+ #### US-07: [Title]
107
+ [Same structure]
108
+
109
+ ### Story Statistics
110
+ - **Total stories**: [N]
111
+ - **Must-have**: [N] ([X]%)
112
+ - **Should-have**: [N] ([X]%)
113
+ - **Could-have**: [N] ([X]%)
114
+ - **Traceability**: [X]% of stories trace to scenarios
115
+ ```
116
+
117
+ ### 5. Present to User and Gate
118
+
119
+ Show the User Stories summary. Ask:
120
+ - Are the Must-Have stories correct?
121
+ - Any stories missing?
122
+ - Are acceptance criteria testable?
123
+
124
+ ```
125
+ [C] Continue — Stories validated, proceed to Features & Scope
126
+ [R] Revise — Adjust stories, priorities, or acceptance criteria
127
+ [A] Add — Include additional stories
128
+ ```
129
+
130
+ **HALT — wait for user response before proceeding.**
131
+
132
+ ### 6. Handle Response
133
+
134
+ - **[C]**: Load next step: `./step-21-features-scope.md`
135
+ - **[R]**: Revise stories, update product.md §4, re-present
136
+ - **[A]**: Add stories, update, re-present
137
+
138
+ ## SUCCESS METRICS
139
+
140
+ - 8-15 user stories derived from scenarios
141
+ - Every story has testable acceptance criteria
142
+ - MoSCoW prioritization applied with user input
143
+ - Stories trace back to scenarios and personas
144
+ - Output written to product.md §4
145
+
146
+ ## FAILURE MODES
147
+
148
+ - Stories not connected to any scenario
149
+ - Acceptance criteria are vague ("it should work well")
150
+ - All stories are Must-Have (no real prioritization happened)
151
+ - Too many stories (>20 for MVP — scope creep)
152
+ - Not writing output before presenting to user
153
+
154
+ ## NEXT STEP
155
+
156
+ After user selects [C], read and follow: `./step-21-features-scope.md`
@@ -0,0 +1,157 @@
1
+ # Step 21: Features & Scope Definition
2
+
3
+ ## MANDATORY EXECUTION RULES
4
+
5
+ - EXPLICITLY DEFINE what is OUT of scope — this prevents scope creep
6
+ - GROUP stories into features — features are implementable units
7
+ - EVERY exclusion needs a RATIONALE — "not now" is not enough
8
+ - WRITE output to spec file BEFORE presenting to user
9
+ - ALL output in English (spec files); conversation in Chinese
10
+
11
+ ## PREREQUISITES
12
+
13
+ - Step 20 (User Stories) completed with [C]
14
+ - `.ultra/specs/product.md` §1-4 exist
15
+
16
+ ## CONTEXT BOUNDARIES
17
+
18
+ - Focus: Group stories into features, define scope boundaries
19
+ - Features are clusters of related stories that deliver a capability
20
+ - "Features Out" is as important as "Features In"
21
+ - Reference step-04 (Strategic Trade-offs) for scope decisions
22
+
23
+ ## EXECUTION SEQUENCE
24
+
25
+ ### 1. Group Stories into Features
26
+
27
+ Cluster related user stories into features:
28
+
29
+ ```
30
+ Feature A: [Name]
31
+ ├── US-01: [Story]
32
+ ├── US-02: [Story]
33
+ └── US-03: [Story]
34
+
35
+ Feature B: [Name]
36
+ ├── US-04: [Story]
37
+ └── US-05: [Story]
38
+ ```
39
+
40
+ Each feature should be:
41
+ - Independently valuable (delivers user value on its own)
42
+ - Estimable (can assess complexity)
43
+ - Testable (can verify it works end-to-end)
44
+
45
+ ### 2. Define Scope Boundaries
46
+
47
+ For each potential feature, classify:
48
+
49
+ | Classification | Meaning |
50
+ |---------------|---------|
51
+ | **In scope (MVP)** | Must-have stories, ships in v1 |
52
+ | **In scope (v2)** | Should-have stories, planned for later |
53
+ | **Out of scope** | Won't build — with explicit rationale |
54
+
55
+ ### 3. Document "Features Out"
56
+
57
+ For each excluded feature, document:
58
+ - What it is
59
+ - Why it's excluded (reference strategic trade-offs from step-04)
60
+ - When it might be reconsidered
61
+ - What users should do instead
62
+
63
+ This prevents:
64
+ - Future scope creep ("but we said we'd do X")
65
+ - Re-debating settled decisions
66
+ - Building things that conflict with strategy
67
+
68
+ ### 4. Write Output
69
+
70
+ **WRITE IMMEDIATELY** to `.ultra/specs/product.md` §5:
71
+
72
+ ```markdown
73
+ ## §5 Feature Scope
74
+
75
+ ### Features In (MVP)
76
+
77
+ #### Feature 1: [Name]
78
+ - **Description**: [What this feature does]
79
+ - **Stories**: US-01, US-02, US-03
80
+ - **User value**: [What user can do with this]
81
+ - **Priority**: Must-Have
82
+ - **Complexity**: [S/M/L]
83
+
84
+ #### Feature 2: [Name]
85
+ - **Description**: [What this feature does]
86
+ - **Stories**: US-04, US-05
87
+ - **User value**: [What user can do with this]
88
+ - **Priority**: Must-Have
89
+ - **Complexity**: [S/M/L]
90
+
91
+ #### Feature 3: [Name]
92
+ [Same structure]
93
+
94
+ ### Features In (v2 — Planned)
95
+
96
+ #### Feature 4: [Name]
97
+ - **Description**: [What this feature does]
98
+ - **Stories**: US-07, US-08
99
+ - **Rationale for deferral**: [Why not MVP]
100
+ - **Trigger to build**: [When to reconsider]
101
+
102
+ ### Features Out (Explicitly Excluded)
103
+
104
+ | Feature | Rationale | Reconsider When | Alternative |
105
+ |---------|-----------|----------------|-------------|
106
+ | [Feature X] | [Why excluded — reference strategy §4] | [Condition] | [What users do instead] |
107
+ | [Feature Y] | [Why excluded] | [Condition] | [Alternative] |
108
+ | [Feature Z] | [Why excluded] | [Condition] | [Alternative] |
109
+
110
+ ### Scope Summary
111
+ - **MVP features**: [N] features, [N] stories
112
+ - **v2 features**: [N] features, [N] stories
113
+ - **Excluded features**: [N] features
114
+ - **Scope confidence**: [X]%
115
+ ```
116
+
117
+ ### 5. Present to User and Gate
118
+
119
+ Show the Feature Scope summary. Ask:
120
+ - Is the MVP scope right? Too big? Too small?
121
+ - Are the exclusions correct?
122
+ - Any missing features?
123
+
124
+ ```
125
+ [C] Continue — Scope locked, proceed to Success Metrics
126
+ [R] Revise — Adjust feature grouping or scope boundaries
127
+ [E] Expand — Move something from v2 to MVP
128
+ [T] Trim — Move something from MVP to v2
129
+ ```
130
+
131
+ **HALT — wait for user response before proceeding.**
132
+
133
+ ### 6. Handle Response
134
+
135
+ - **[C]**: Load next step: `./step-22-success-metrics.md`
136
+ - **[R]**: Revise features, update product.md §5, re-present
137
+ - **[E]/[T]**: Adjust scope, update, re-present
138
+
139
+ ## SUCCESS METRICS
140
+
141
+ - Stories grouped into coherent features
142
+ - Clear MVP vs v2 scope boundary
143
+ - Every exclusion has a rationale and reconsideration trigger
144
+ - Features trace to user stories and scenarios
145
+ - Output written to product.md §5
146
+
147
+ ## FAILURE MODES
148
+
149
+ - No "Features Out" section (everything is in scope)
150
+ - Features that don't map to any user stories
151
+ - Exclusion rationale is just "not now" (needs specific reason)
152
+ - MVP scope is too large (>5-7 features for a first version)
153
+ - Not writing output before presenting to user
154
+
155
+ ## NEXT STEP
156
+
157
+ After user selects [C], read and follow: `./step-22-success-metrics.md`