ultra-builder-pro-cli 0.10.0 → 0.11.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 (92) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/README.md +1 -1
  3. package/adapters/_shared/codex-assets.cjs +23 -341
  4. package/adapters/_shared/runtime-assets.cjs +24 -0
  5. package/adapters/_shared/tests/runtime-assets.test.cjs +11 -4
  6. package/adapters/claude.js +28 -5
  7. package/adapters/kimi.js +15 -138
  8. package/adapters/opencode.js +14 -47
  9. package/adapters/tests/claude.test.cjs +22 -8
  10. package/adapters/tests/codex.test.cjs +19 -6
  11. package/adapters/tests/kimi.test.cjs +11 -11
  12. package/adapters/tests/opencode.test.cjs +11 -7
  13. package/agents/code-reviewer.md +24 -85
  14. package/agents/debugger.md +30 -132
  15. package/agents/review-code.md +24 -104
  16. package/agents/review-comments.md +20 -83
  17. package/agents/review-coordinator.md +40 -137
  18. package/agents/review-design.md +21 -118
  19. package/agents/review-errors.md +22 -70
  20. package/agents/review-spec.md +36 -0
  21. package/agents/review-tests.md +20 -76
  22. package/agents/tdd-runner.md +26 -84
  23. package/commands/learn.md +5 -36
  24. package/commands/ultra-change.md +5 -43
  25. package/commands/ultra-deliver.md +4 -46
  26. package/commands/ultra-dev.md +4 -48
  27. package/commands/ultra-doctor.md +4 -30
  28. package/commands/ultra-init.md +5 -47
  29. package/commands/ultra-plan.md +5 -48
  30. package/commands/ultra-research.md +5 -54
  31. package/commands/ultra-status.md +5 -44
  32. package/commands/ultra-test.md +5 -45
  33. package/commands/ultra-think.md +5 -40
  34. package/docs/PLAN.zh-CN.md +3 -3
  35. package/docs/ROADMAP.md +1 -1
  36. package/docs/SKILL-AUTHORING.md +75 -0
  37. package/package.json +3 -2
  38. package/skills/cc-collab/SKILL.md +16 -18
  39. package/skills/code-review-expert/SKILL.md +39 -114
  40. package/skills/code-review-expert/references/correctness-reliability.md +30 -0
  41. package/skills/code-review-expert/references/design-boundaries.md +26 -0
  42. package/skills/code-review-expert/references/removal-plan.md +17 -45
  43. package/skills/codex-collab/SKILL.md +23 -28
  44. package/skills/codex-collab/evals/evals.json +18 -23
  45. package/skills/integration-rules/SKILL.md +28 -67
  46. package/skills/learn/SKILL.md +46 -106
  47. package/skills/security-rules/SKILL.md +34 -56
  48. package/skills/testing-rules/SKILL.md +28 -52
  49. package/skills/ultra-change/SKILL.md +57 -114
  50. package/skills/ultra-deliver/SKILL.md +49 -87
  51. package/skills/ultra-dev/SKILL.md +42 -105
  52. package/skills/ultra-doctor/SKILL.md +39 -72
  53. package/skills/ultra-init/SKILL.md +59 -140
  54. package/skills/ultra-plan/SKILL.md +48 -88
  55. package/skills/ultra-research/SKILL.md +59 -152
  56. package/skills/ultra-research/references/architecture.md +38 -0
  57. package/skills/ultra-research/references/problem-product.md +39 -0
  58. package/skills/ultra-research/references/quality-delivery.md +34 -0
  59. package/skills/ultra-research/references/synthesis.md +38 -0
  60. package/skills/ultra-research/references/users-scope.md +40 -0
  61. package/skills/ultra-review/SKILL.md +54 -98
  62. package/skills/ultra-review/references/unified-schema.md +76 -101
  63. package/skills/ultra-review/scripts/review_wait.py +242 -77
  64. package/skills/ultra-status/SKILL.md +29 -51
  65. package/skills/ultra-test/SKILL.md +37 -72
  66. package/skills/ultra-think/SKILL.md +43 -102
  67. package/skills/ultra-verify/SKILL.md +44 -84
  68. package/skills/ultra-verify/evals/evals.json +24 -27
  69. package/spec/schemas/command-manifest.schema.json +7 -25
  70. package/spec/schemas/skill-manifest.schema.json +9 -79
  71. package/skills/code-review-expert/references/code-quality-checklist.md +0 -112
  72. package/skills/code-review-expert/references/integration-checklist.md +0 -46
  73. package/skills/code-review-expert/references/security-checklist.md +0 -100
  74. package/skills/code-review-expert/references/solid-checklist.md +0 -65
  75. package/skills/ultra-research/steps/step-00-problem-validation.md +0 -154
  76. package/skills/ultra-research/steps/step-01-opportunity-discovery.md +0 -172
  77. package/skills/ultra-research/steps/step-02-market-assessment.md +0 -195
  78. package/skills/ultra-research/steps/step-03-competitive-landscape.md +0 -197
  79. package/skills/ultra-research/steps/step-04-product-strategy.md +0 -196
  80. package/skills/ultra-research/steps/step-05-assumptions-validation.md +0 -234
  81. package/skills/ultra-research/steps/step-10-user-personas.md +0 -169
  82. package/skills/ultra-research/steps/step-11-user-scenarios.md +0 -181
  83. package/skills/ultra-research/steps/step-20-user-stories.md +0 -156
  84. package/skills/ultra-research/steps/step-21-features-scope.md +0 -157
  85. package/skills/ultra-research/steps/step-22-success-metrics.md +0 -195
  86. package/skills/ultra-research/steps/step-30-architecture-context.md +0 -154
  87. package/skills/ultra-research/steps/step-31-solution-strategy.md +0 -172
  88. package/skills/ultra-research/steps/step-32-building-blocks.md +0 -188
  89. package/skills/ultra-research/steps/step-40-deployment.md +0 -123
  90. package/skills/ultra-research/steps/step-41-quality-risks.md +0 -135
  91. package/skills/ultra-research/steps/step-99-synthesis.md +0 -188
  92. package/skills/ultra-review/scripts/review_verdict_update.py +0 -99
@@ -1,151 +1,70 @@
1
1
  ---
2
2
  name: ultra-init
3
- description: "Initialize Ultra Builder Pro project: detect context, confirm with user, scaffold .ultra/ via task.init_project, set up git."
4
- user-invocable: true
5
- runtime: all
6
- mcp_tools_required:
7
- - task.init_project
8
- cli_fallback: "task init-project"
3
+ description: Initialize an Ultra Builder Pro project with authoritative state, baseline specification files, and optional Git setup. Use when a repository has not yet been initialized for the Ultra workflow.
9
4
  ---
10
5
 
11
- # ultra-init — Phase 3.1
6
+ # Initialize an Ultra project
12
7
 
13
- 把当前工作目录(或 `--target-dir`)初始化为一个 Ultra Builder Pro 项目:拉起
14
- `.ultra/` 骨架、初始化权威 `state.db`、建立持续变更目录、写入 `tasks.json`
15
- 初始元数据,并按需配置 git。
8
+ Create the project-local Ultra runtime without inventing product requirements or
9
+ business tasks.
16
10
 
17
- 真实的目录搭建 + 模板拷贝 + tasks.json 注入统一由 **MCP tool `task.init_project`** 完成;
18
- MCP 不可达时回退 `ultra-tools task init-project`。
11
+ ## Inputs
19
12
 
20
- ## 设计要点(对比 pre-Phase-3 行为)
13
+ Use the current working directory unless the user names another target. Inspect
14
+ existing project manifests to infer:
21
15
 
22
- - **无 Claude 独占依赖**:`task.init_project` + `ultra-tools init-project` 两条路径
23
- 都不调 Claude 原生工具,Claude Code、OpenCode、Codex 三个 runtime 都能走通。
24
- - **模板内置**:`.ultra/` 骨架来自仓内 `templates/.ultra/`;不再依赖 `~/.claude/.ultra-template/`。
25
- - **幂等**:二次 init 默认拒绝,`--overwrite` 才会备份旧 `.ultra/` 为
26
- `.ultra.backup.<ts>` 后重建。
16
+ - project name;
17
+ - project type;
18
+ - primary technologies;
19
+ - whether Git and `.ultra/` already exist.
20
+
21
+ Ask only about unresolved ambiguity, optional Git initialization, or permission to
22
+ replace an existing `.ultra/` directory. Never infer permission to overwrite it.
27
23
 
28
24
  ## Workflow
29
25
 
30
- ### Step 0: 状态检测(skill 调用方做)
31
-
32
- 在调 `task.init_project` 之前,调用方(Claude / CLI / SDK)需要先判断:
33
-
34
- - `target_dir/.ultra/` 是否已存在 → 决定是否需要 `overwrite=true`
35
- - `target_dir/.git/` 是否已存在 → 影响 Step 3 的分支
36
- - 读 `package.json` / `Cargo.toml` / `pyproject.toml` / `go.mod` 推断项目类型和栈
37
- - 如果调用方是 Claude,可在此用 `TaskCreate` 跟踪 Step 0–4 的 session 内进度
38
- (这是 runtime 的 session-local 跟踪,不走 MCP)
39
-
40
- ### Step 1: 补全参数
41
-
42
- 入参不足时补:
43
-
44
- | 字段 | 缺省 |
45
- |------|------|
46
- | `project_name` | 当前目录名(`path.basename(target_dir)`) |
47
- | `project_type` | Step 0 识别结果;多技术栈 → `fullstack` |
48
- | `stack` | Step 0 识别到的依赖(逗号分隔多值,如 `react,express,postgres`) |
49
- | `git_init` | `.git/` 不存在 → 询问用户 |
50
-
51
- ### Step 1.5: 交互确认(仅当检测到模糊或重入)
52
-
53
- 触发条件:
54
- - `target_dir/.ultra/` 已存在(重入)
55
- - 识别到多项目类型(Web + API)
56
- - 显式 `--interactive` 标志
57
-
58
- 交互渠道:
59
- - **Claude runtime**:调 `AskUserQuestion`(原生)
60
- - **其他 runtime**:使用 Host 原生提问界面;若当前表面不支持交互,
61
- 要求用户通过显式命令行参数选择
62
-
63
- 确认 4 个问题:
64
- 1. 项目类型(可多选,`detected` 标签打在识别项)
65
- 2. 技术栈(可多选)
66
- 3. 已有 `.git/` → 保留 / 重置备份 / 不用 git
67
- 4. 已有 `.ultra/` → 覆盖(备份) / 保留 / 取消
68
-
69
- ### Step 2: 调 `task.init_project` 拉起骨架
70
-
71
- **MCP 主路径**:
72
- ```jsonc
73
- // call: task.init_project
74
- {
75
- "target_dir": "/abs/path/to/project",
76
- "project_name": "my-app",
77
- "project_type": "fullstack",
78
- "stack": "react,express,postgres",
79
- "overwrite": false
80
- }
81
- // response
82
- {
83
- "created_path": "/abs/path/to/project/.ultra",
84
- "status": "created",
85
- "copied_files": [
86
- "specs/discovery.md", "specs/product.md", "specs/architecture.md",
87
- "tasks/tasks.json", "tasks/contexts/TEMPLATE.md",
88
- "changes/active/.gitkeep", "changes/archive/.gitkeep",
89
- "docs/research/README.md",
90
- "test-report.json", "delivery-report.json"
91
- ],
92
- "state_db_path": "/abs/path/to/project/.ultra/state.db"
93
- }
94
- ```
95
-
96
- **CLI 回退路径**(`UBP_MCP=off` 或 MCP 调用返回网络错):
97
- ```bash
98
- ultra-tools task init-project \
99
- --target-dir "$TARGET" \
100
- --project-name "$NAME" \
101
- --project-type "$TYPE" \
102
- --stack "$STACK" \
103
- $([ "$OVERWRITE" = "1" ] && echo --overwrite)
104
- ```
105
- CLI 最后一行是 `{ "ok": true, "data": { ... } }`(见 spec/cli-protocol.md §2)。
106
-
107
- **错误处理**:
108
- - `ULTRA_DIR_EXISTS` → Step 1.5 重新询问是否 overwrite
109
- - `TEMPLATE_MISSING` → 致命;提示检查 `templates/.ultra/` 是否被 gitignore 吞了
110
- - `TARGET_NOT_DIR` / `VALIDATION_ERROR` → 返回调用方,修参数
111
- - `IO_ERROR` → retriable=true;最多重试 2 次
112
-
113
- ### Step 3: Git 集成
114
-
115
- 根据 Step 1.5 结果:
116
-
117
- - **初始化新仓**:`git init` + 写 `.gitignore`(排除 `.ultra/backups/`、`node_modules/`、
118
- 敏感文件等项目通用规则)+ 写基础 `README.md`(若不存在)。
119
- - **保留现有 `.git/`**:仅追加 `.gitignore` 里的 `.ultra/backups/` 一行(若缺失)。
120
- - **不用 git**:跳过。
121
-
122
- 提示建议第一个 commit:`git add . && git commit -m "feat: initialize Ultra Builder Pro"`,
123
- 但不代为执行(commit 是用户决策)。
124
-
125
- ### Step 4: 成功总结 + 下一步
126
-
127
- 用中文输出:
128
- - ✅ `.ultra/` 骨架(specs / tasks / changes / docs / reports)
129
- - ✅ `.ultra/state.db` 已初始化为当前 schema,后续不再依赖第一次写操作懒创建
130
- - ✅ tasks.json 注入元数据(name / type / stack / created / updated)
131
- - ✅ git 状态(按选择)
132
- - ⚠️ **下一步**:跑 `/ultra-research` 做 17 步 discovery 填 spec;不要跳过直接 `/ultra-plan`
133
-
134
- ## 调用方式(按 runtime)
135
-
136
- | Runtime | 调用形态 |
137
- |---------|----------|
138
- | Claude | `/ultra-init [name] [type] [stack] [git]` — 命令薄壳拉起此 skill |
139
- | OpenCode | `/ultra-init …` 同上(agent frontmatter 小写化) |
140
- | Codex | `codex exec "run /ultra-init …"`(Phase 4.4 adapter 接) |
141
-
142
- ## 输出锚点
143
-
144
- - `target_dir/.ultra/tasks/tasks.json` — project.name / project.type / project.stack 已注入
145
- - `target_dir/.ultra/specs/{discovery,product,architecture}.md` — 带 `[NEEDS CLARIFICATION]` 标记
146
- - 若 `overwrite=true`:`target_dir/.ultra.backup.<ts>/` 保存旧骨架
147
-
148
- ## 不做的事
149
-
150
- - **不**创建业务 task(业务 task 由 `/ultra-plan` 在 spec 填完后批量创建)
151
- - **不**调 web:离线可执行
26
+ 1. Resolve the absolute target directory and verify that it exists.
27
+ 2. Derive the project metadata from repository evidence. Treat user-provided values
28
+ as authoritative when they conflict with inference.
29
+ 3. If `.ultra/` exists, stop and ask whether to keep it, cancel, or recreate it with
30
+ `overwrite: true`. Explain that recreation first preserves a timestamped backup.
31
+ 4. Call `task.init_project` with the smallest complete input:
32
+
33
+ ```json
34
+ {
35
+ "target_dir": "/absolute/project/path",
36
+ "project_name": "example",
37
+ "project_type": "fullstack",
38
+ "stack": "react,node,postgres",
39
+ "overwrite": false
40
+ }
41
+ ```
42
+
43
+ 5. Verify the returned `.ultra` path, `state_db_path`, status, and copied-file list.
44
+ Confirm that the returned state database and baseline specification files exist.
45
+ 6. If the user requested Git setup, initialize Git only when needed and add narrowly
46
+ scoped ignore rules. Do not stage or commit without explicit authorization.
47
+
48
+ If the MCP server cannot start, use the installed
49
+ `ultra-tools task init-project` command only when it is available. The CLI and MCP
50
+ must use the same initializer. Do not simulate initialization by creating projection
51
+ files manually.
52
+
53
+ ## Failure handling
54
+
55
+ - `ULTRA_DIR_EXISTS`: return to the overwrite decision; do not retry automatically.
56
+ - `TEMPLATE_MISSING`: stop and report an installation/package integrity failure.
57
+ - `TARGET_NOT_DIR` or `VALIDATION_ERROR`: correct the input and retry once.
58
+ - `IO_ERROR`: report the affected path and preserve any backup or partial evidence.
59
+
60
+ ## Authority and output
61
+
62
+ `.ultra/state.db` is the durable Ultra authority. Generated JSON and Markdown are
63
+ projections or workflow artifacts and must not be edited to create state.
64
+
65
+ Report the initialized path, state database path, backup path when present, Git
66
+ action, and one next action. Route incomplete product intent to `ultra-research`;
67
+ route an already validated baseline to `ultra-plan`.
68
+
69
+ Do not create business tasks, browse the web, or rewrite an existing README as part
70
+ of initialization.
@@ -1,109 +1,69 @@
1
1
  ---
2
2
  name: ultra-plan
3
- description: "Turn a validated baseline, active delta, or approved PRD into fresh-context vertical slices with public seams and exact verification contracts."
4
- user-invocable: true
5
- runtime: all
6
- mcp_tools_required:
7
- - task.create
8
- - task.parse_prd
9
- - task.dependency_topo
10
- - plan.export
11
- - plan.get
12
- - change.get
13
- - change.context
14
- - change.breadcrumb
3
+ description: Convert a validated baseline, active delta, or approved PRD into dependency-valid vertical slices with bounded context and exact verification. Use when requirements are ready to become authoritative Ultra tasks.
15
4
  ---
16
5
 
17
- # ultra-plan — Fresh-Context Execution Planning
6
+ # Plan fresh-context execution
18
7
 
19
- Produce a dependency-valid plan whose tasks can be executed in isolated contexts.
20
- `.ultra/state.db` is authoritative; the projector owns task JSON and context
21
- frontmatter.
8
+ Produce a task graph whose slices can be completed independently and verified through
9
+ live product seams. `.ultra/state.db` remains authoritative; task JSON and context
10
+ Markdown are generated projections.
22
11
 
23
- ## Failure boundary
12
+ ## Entry gate
24
13
 
25
- Start with a state-backed MCP read. On `LEGACY_STATE_MIGRATION_REQUIRED`, stop and
26
- instruct:
14
+ Start with a state-backed MCP read. If state or schema health blocks access, stop and
15
+ route to `ultra-doctor`. Never read or write `.ultra/tasks/tasks.json` as a fallback.
27
16
 
28
- ```bash
29
- ultra-tools migrate --from=4.4 --to=4.5 --source-dir <project-root>
30
- ```
17
+ Choose one input:
31
18
 
32
- Never read or write `.ultra/tasks/tasks.json` as authority. If task MCP mutation is
33
- unavailable, stop; there is no task-creation CLI fallback.
19
+ - validated baseline specifications;
20
+ - one active change packet;
21
+ - a raw PRD through the approval-gated mode below.
34
22
 
35
- ## Inputs
23
+ Ask only for product, scope, cost, or risk decisions that cannot be derived from
24
+ current evidence. A material unresolved assumption blocks persistence.
36
25
 
37
- Choose exactly one:
38
-
39
- - validated baseline specs under `.ultra/specs/`;
40
- - one active change packet (`intent.md`, `delta/`, `plan.md`);
41
- - raw PRD using the approval-gated direct mode below.
26
+ ## Planning rules
42
27
 
43
- Ask only for a product or risk decision that cannot be derived from current evidence.
44
- Record assumptions explicitly; unresolved material assumptions block planning.
28
+ 1. Trace acceptance through an entry point, domain behavior, side effects, and a
29
+ user-observable or public seam.
30
+ 2. Prefer a walking skeleton or `tracer_bullet` before horizontal layers.
31
+ 3. Give each task one outcome, bounded ownership, explicit dependencies, required
32
+ references, and one deterministic verification command.
33
+ 4. Use the context budget returned by the current Ultra contract. Widen it only when
34
+ an approved slice cannot be split without losing correctness.
35
+ 5. Add integration checkpoints at actual boundaries, not after arbitrary task counts.
36
+ 6. Put validation, errors, recovery, documentation, and migrations in the task that
37
+ owns the behavior.
38
+ 7. Reject scaffolding with no reachable consumer.
45
39
 
46
- ## Planning rules
40
+ Every persisted task must include its slice kind, public seam, verification command,
41
+ acceptance evidence, ownership, dependencies, documentation impact, and linked change
42
+ id when applicable.
47
43
 
48
- 1. Trace acceptance through a live entry point, domain behavior, side effects, and a
49
- user-observable/public seam.
50
- 2. Prefer a walking skeleton / `tracer_bullet` before horizontal layers.
51
- 3. Make each task completable in a fresh context: one outcome, bounded references,
52
- explicit dependencies, and one deterministic verification command.
53
- 4. Keep the default context packet at or below 12 files, 12k approximate tokens, and
54
- 40% of the fresh context budget.
55
- 5. Use `expand_contract` only when a wider change is approved and cannot be split
56
- without losing correctness.
57
- 6. Create integration checkpoints at real seams, not after arbitrary task counts.
58
- 7. Include error, recovery, documentation, and migration work in the task that owns
59
- the behavior; do not create unreachable scaffolding tasks.
60
-
61
- ## Task contract
62
-
63
- Every `task.create` must carry or be paired with:
64
-
65
- - outcome and acceptance assertions;
66
- - priority, complexity, dependencies, and ownership paths;
67
- - linked `change_id` when planning a delta;
68
- - `slice_kind`: `tracer_bullet`, `expand_contract`, or `integration_checkpoint`;
69
- - `public_seam`;
70
- - exact `verification_command`;
71
- - required context references and their reasons;
72
- - expected red/green signal for fixes and incidents;
73
- - documentation impact.
74
-
75
- After each task is persisted, compile `change.context` with `role=plan` and
76
- `gate=planning` when it belongs to a change. A blocked readiness result must be fixed
77
- before the task is called executable.
78
-
79
- ## Spec mode / change mode
44
+ ## Baseline or change mode
80
45
 
81
46
  1. Read the smallest authoritative references that define acceptance.
82
- 2. Build a task DAG in memory and check file-ownership conflicts.
83
- 3. Present the outcome, order, cost/risk concentration, and walking-skeleton seam.
84
- 4. Obtain approval when the plan materially changes scope or cost.
85
- 5. Persist tasks through `task.create`.
86
- 6. Call `task.dependency_topo`; cycles or missing dependencies are blocking.
87
- 7. Call `plan.export`, then verify it with `plan.get` rather than reparsing the file.
88
- 8. For an active change, call `change.breadcrumb` and report its one next action.
89
-
90
- ## PRD direct mode
47
+ 2. Build the task DAG in memory and check dependency and ownership conflicts.
48
+ 3. Present the proposed outcome, execution order, risk concentration, and first live
49
+ seam. Obtain approval if scope, cost, or delivery semantics change materially.
50
+ 4. Persist approved tasks with `task.create`.
51
+ 5. For change-linked tasks, compile `change.context` with the planning role and gate.
52
+ Resolve every readiness blocker before calling a task executable.
53
+ 6. Call `task.dependency_topo`; cycles and missing dependencies block completion.
54
+ 7. Call `plan.export`, then verify the persisted result with `plan.get`.
55
+ 8. Call `change.breadcrumb` when a change is active and return one next action.
56
+
57
+ ## PRD mode
91
58
 
92
59
  1. Call `task.parse_prd` with `dry_run: true`.
93
- 2. Show the proposed vertical slices, topology, conflict surface, and estimated cost.
94
- 3. Require explicit approval. Rejection performs no state write.
95
- 4. On approval, repeat the same parse with `dry_run: false`, then `plan.export`.
96
- 5. Verify dry-run and persisted task ids match; mismatch is a deterministic failure.
97
-
98
- ## Context body
99
-
100
- Human-readable task context may explain intent, acceptance, seam, red/green signal,
101
- and relevant references. It must not duplicate entire specs, provider memory, or a
102
- static codebase tour. The next worker should be able to begin from the manifest and
103
- verify the slice without recovering the planner's full conversation.
60
+ 2. Show the proposed slices, topology, conflict surface, and cost estimate.
61
+ 3. Require explicit approval; rejection performs no state write.
62
+ 4. On approval, repeat with `dry_run: false`, export the plan, and verify that the
63
+ dry-run and persisted task identities agree.
104
64
 
105
65
  ## Completion gate
106
66
 
107
- Planning is complete only when the DAG is valid, every task is reachable through a
108
- public seam, every command is executable, every change-linked task has a ready Context
109
- Manifest v2 snapshot, and no required documentation or decision is unknown.
67
+ Planning is complete only when the DAG is valid, each task reaches a public seam, each
68
+ verification command is executable, every change-linked context is ready, and no
69
+ required documentation or decision remains unknown.
@@ -1,156 +1,63 @@
1
1
  ---
2
2
  name: ultra-research
3
- description: "Think-Driven Interactive Discovery - Deep research with step-file architecture for high-density output"
4
- user-invocable: true
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.
5
4
  ---
6
5
 
7
- # Ultra Research v2 — Step-File Architecture
8
-
9
- ## Overview
10
-
11
- Transform vague ideas into complete, high-confidence specifications through progressive interactive discovery. Each research step is a self-contained instruction file loaded just-in-time for maximum LLM attention density.
12
-
13
- **Philosophy**: Research is collaborative. Each decision validated with user before proceeding. All findings must have 90%+ confidence. Every claim needs a source.
14
-
15
- ## WORKFLOW ARCHITECTURE
16
-
17
- ### Core Principles
18
-
19
- - **Step-File Design**: Each step is a self-contained .md file with full execution instructions
20
- - **Just-In-Time Loading**: Only the current step file is in context — never load future steps
21
- - **Sequential Enforcement**: Steps must be completed in order, no skipping
22
- - **Write-Immediately**: Every step writes its output to the spec file BEFORE presenting to user
23
- - **User Gate**: User must explicitly confirm [C] Continue before proceeding to next step
24
- - **State Tracking**: Track per-session progress via the runtime's native TaskCreate/TaskUpdate (session-local). Research does NOT write business tasks to state.db — it only emits spec files. Business tasks are created later by `/ultra-plan` via MCP `task.create`.
25
- - **Web-First**: Every analysis step REQUIRES web search with citations. No search = no proceed.
26
-
27
- ### Step Processing Rules
28
-
29
- 1. **READ COMPLETELY**: Always read the entire step file before taking any action
30
- 2. **FOLLOW SEQUENCE**: Execute all numbered sections in order
31
- 3. **SEARCH FIRST**: Execute web searches BEFORE generating analysis
32
- 4. **WRITE IMMEDIATELY**: Append content to spec file as soon as analysis is complete
33
- 5. **WAIT FOR INPUT**: Present [C] Continue — halt and wait for user selection
34
- 6. **LOAD NEXT**: When user confirms, Read the next step file and follow it
35
-
36
- ### Critical Rules (NO EXCEPTIONS)
37
-
38
- - NEVER load multiple step files simultaneously
39
- - ALWAYS read entire step file before execution
40
- - NEVER skip steps or optimize the sequence
41
- - ALWAYS write output to spec file before presenting to user
42
- - ALWAYS halt at [C] Continue and wait for user input
43
- - NEVER proceed without user confirmation
44
- - NEVER rely solely on training data — web search is mandatory for factual claims
45
-
46
- ## STEP SEQUENCE
47
-
48
- ### Round 0: Product Discovery & Strategy
49
-
50
- | Step | File | Focus | Output |
51
- |------|------|-------|--------|
52
- | 00 | `step-00-problem-validation.md` | Validate the problem is real and worth solving | discovery.md §0 |
53
- | 01 | `step-01-opportunity-discovery.md` | Opportunity Solution Tree (Teresa Torres) | discovery.md §1 |
54
- | 02 | `step-02-market-assessment.md` | TAM/SAM/SOM with dual approach | discovery.md §2 |
55
- | 03 | `step-03-competitive-landscape.md` | Competitors + Porter's Five Forces | discovery.md §3 |
56
- | 04 | `step-04-product-strategy.md` | Vision, segments, value prop, trade-offs | discovery.md §4 |
57
- | 05 | `step-05-assumptions-validation.md` | Risk assumptions + experiment design | discovery.md §5 |
58
-
59
- ### Round 1: User & Scenario Discovery
60
-
61
- | Step | File | Focus | Output |
62
- |------|------|-------|--------|
63
- | 10 | `step-10-user-personas.md` | 2-3 personas with goals, pain points, context | product.md §1-2 |
64
- | 11 | `step-11-user-scenarios.md` | 3-5 user scenarios with trigger/flow/outcome | product.md §3 |
65
-
66
- ### Round 2: Feature Definition
67
-
68
- | Step | File | Focus | Output |
69
- |------|------|-------|--------|
70
- | 20 | `step-20-user-stories.md` | User stories with acceptance criteria | product.md §4 |
71
- | 21 | `step-21-features-scope.md` | Feature prioritization + explicit exclusions | product.md §5 |
72
- | 22 | `step-22-success-metrics.md` | Business + user metrics with targets | product.md §6 |
73
-
74
- ### Round 3: Architecture Design
75
-
76
- | Step | File | Focus | Output |
77
- |------|------|-------|--------|
78
- | 30 | `step-30-architecture-context.md` | Quality goals, constraints, system context | architecture.md §1-3 |
79
- | 31 | `step-31-solution-strategy.md` | Tech stack selection with rationale | architecture.md §4 |
80
- | 32 | `step-32-building-blocks.md` | Module decomposition + runtime scenarios | architecture.md §5-6 |
81
-
82
- ### Round 4: Quality & Deployment
83
-
84
- | Step | File | Focus | Output |
85
- |------|------|-------|--------|
86
- | 40 | `step-40-deployment.md` | Infrastructure, environments, CI/CD | architecture.md §7-9 |
87
- | 41 | `step-41-quality-risks.md` | Quality scenarios, risks, tech debt | architecture.md §10-12 |
88
-
89
- ### Synthesis
90
-
91
- | Step | File | Focus | Output |
92
- |------|------|-------|--------|
93
- | 99 | `step-99-synthesis.md` | Distillate + validation + quality summary | research-distillate.md |
94
-
95
- ## ACTIVATION
96
-
97
- When invoked, follow this sequence:
98
-
99
- ### 1. Pre-Research Check
100
-
101
- - If `.ultra/specs/product.md` has [NEEDS CLARIFICATION] → proceed with research
102
- - If `.ultra/specs/` doesn't exist → suggest `/ultra-init` first
103
- - If specs 100% complete → suggest skip to `/ultra-plan`
104
-
105
- ### 2. Project Type Detection
106
-
107
- Ask user to determine research scope:
108
-
109
- | Type | Steps | Focus |
110
- |------|-------|-------|
111
- | Full Project | 00-99 | All rounds |
112
- | Product Only | 00-22 | Discovery + product |
113
- | Feature Only | 10-22 | User scenarios + features (skip discovery) |
114
- | Architecture Change | 30-41 | Architecture + deployment |
115
- | Custom | User selects | Specific steps |
116
-
117
- **Round 0 skip conditions**: Skip if user provides existing market research, validated strategy docs, or explicitly states "I already know the market".
118
-
119
- ### 3. Begin Step Execution
120
-
121
- Read the first applicable step file:
122
- ```
123
- Read: skills/ultra-research/steps/step-{NN}-{name}.md
124
- ```
125
-
126
- Follow every instruction in that file. When the step is complete and user confirms [C], read the next step file.
127
-
128
- ### 4. Output Files
129
-
130
- | File | Content |
131
- |------|---------|
132
- | `.ultra/specs/discovery.md` | §0-5: Problem, Opportunities, Market, Competition, Strategy, Assumptions |
133
- | `.ultra/specs/product.md` | §1-6: Problem, Personas, Scenarios, Stories, Scope, Metrics |
134
- | `.ultra/specs/architecture.md` | §1-12: arc42 structure |
135
- | `.ultra/specs/research-distillate.md` | Token-efficient summary for /ultra-plan consumption |
136
- | `.ultra/docs/research/*.md` | Per-round research reports |
137
-
138
- ## QUALITY STANDARDS
139
-
140
- | Element | Requirement |
141
- |---------|-------------|
142
- | Sources | Every factual claim has URL citation |
143
- | Confidence | 90%+ for recommendations |
144
- | Code | Production-ready (no TODO/demo) |
145
- | Trade-offs | Quantified pros/cons |
146
- | Next steps | Specific, actionable items |
147
-
148
- ## COMPLETION
149
-
150
- Research is complete when:
151
- - All selected steps have [C] confirmed by user
152
- - All spec files have no [NEEDS CLARIFICATION] markers
153
- - Research distillate generated
154
- - All recommendations have 90%+ confidence
155
-
156
- **Next**: Run `/ultra-plan` to generate task breakdown from complete specs.
6
+ # Build a validated baseline
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.
10
+
11
+ ## Preflight
12
+
13
+ 1. Require an initialized `.ultra/specs/` directory. Route to `ultra-init` when it is
14
+ absent.
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`.
24
+
25
+ Read a reference completely only when its lane is selected. Do not load all lanes by
26
+ default.
27
+
28
+ ## Evidence discipline
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.
38
+
39
+ ## Workflow
40
+
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 and report one next action.
54
+
55
+ ## Completion gate
56
+
57
+ Research is complete when the selected scope has enough evidence for planning, every
58
+ material decision is recorded, required acceptance is testable, architecture respects
59
+ known constraints, and unresolved items are either blocking or explicitly outside the
60
+ accepted scope.
61
+
62
+ Route a validated baseline to `ultra-plan`. Do not create business tasks, write Ultra
63
+ state, or maintain a second condensed specification that can drift from the baseline.
@@ -0,0 +1,38 @@
1
+ # Architecture research
2
+
3
+ Read this reference when the system boundary, quality attributes, integration seams,
4
+ technology choice, or implementation constraints are unresolved.
5
+
6
+ ## Current system evidence
7
+
8
+ Start from the current checkout:
9
+
10
+ - entry points and external interfaces;
11
+ - domain boundaries and authoritative state;
12
+ - data flows and side effects;
13
+ - existing dependencies and deployment topology;
14
+ - failure, recovery, authorization, and observability paths.
15
+
16
+ Do not design a replacement architecture before identifying the live path and the
17
+ constraint that requires change.
18
+
19
+ ## Decision method
20
+
21
+ For each material architecture decision:
22
+
23
+ 1. state the required capability and quality constraints;
24
+ 2. identify credible options already compatible with the system when possible;
25
+ 3. use official primary documentation for library or platform behavior;
26
+ 4. evaluate integration cost, operability, failure modes, migration, and rollback;
27
+ 5. record the selected option, rejected alternatives that may recur, and the evidence
28
+ that would reopen the decision.
29
+
30
+ Do not compare technologies for ceremony. A single established repository pattern is
31
+ the default when it satisfies the contract.
32
+
33
+ ## Record the result
34
+
35
+ Update the architecture specification with system context, boundaries, building
36
+ blocks, runtime flow, authoritative state, external contracts, quality scenarios,
37
+ deployment constraints, and accepted decisions. Connect each required behavior to a
38
+ reachable public seam and a verification approach.