ultra-builder-pro-cli 0.10.0 → 0.12.1
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.
- package/.ultra-template/specs/architecture.md +54 -223
- package/.ultra-template/specs/discovery.md +34 -231
- package/.ultra-template/specs/product.md +44 -200
- package/.ultra-template/tasks/contexts/TEMPLATE.md +36 -0
- package/.ultra-template/tasks/tasks.json +6 -0
- package/CHANGELOG.md +86 -1
- package/README.md +21 -9
- package/adapters/_shared/codex-assets.cjs +24 -342
- package/adapters/_shared/handbook.cjs +4 -3
- package/adapters/_shared/runtime-assets.cjs +24 -0
- package/adapters/_shared/tests/handbook.test.cjs +4 -0
- package/adapters/_shared/tests/runtime-assets.test.cjs +11 -4
- package/adapters/claude.js +28 -5
- package/adapters/kimi.js +15 -138
- package/adapters/opencode.js +22 -49
- package/adapters/tests/claude.test.cjs +22 -8
- package/adapters/tests/codex.test.cjs +21 -8
- package/adapters/tests/kimi-hook.test.cjs +1 -1
- package/adapters/tests/kimi.test.cjs +11 -11
- package/adapters/tests/opencode.test.cjs +47 -8
- package/agents/code-reviewer.md +24 -85
- package/agents/debugger.md +30 -132
- package/agents/review-code.md +24 -104
- package/agents/review-comments.md +20 -83
- package/agents/review-coordinator.md +40 -137
- package/agents/review-design.md +21 -118
- package/agents/review-errors.md +22 -70
- package/agents/review-spec.md +36 -0
- package/agents/review-tests.md +20 -76
- package/agents/tdd-runner.md +26 -84
- package/commands/learn.md +5 -36
- package/commands/ultra-change.md +5 -43
- package/commands/ultra-deliver.md +4 -46
- package/commands/ultra-dev.md +4 -48
- package/commands/ultra-doctor.md +4 -30
- package/commands/ultra-init.md +5 -47
- package/commands/ultra-plan.md +5 -48
- package/commands/ultra-research.md +5 -54
- package/commands/ultra-status.md +5 -44
- package/commands/ultra-test.md +5 -45
- package/commands/ultra-think.md +5 -40
- package/docs/AGENT-CONTEXT.md +16 -8
- package/docs/ARCHITECTURE.md +32 -5
- package/docs/PLAN.zh-CN.md +8 -6
- package/docs/ROADMAP.md +5 -3
- package/docs/RUNTIME-COMPAT-MATRIX.md +8 -5
- package/docs/SKILL-AUTHORING.md +75 -0
- package/docs/STATE-DB-ACCESS-POLICY.md +17 -11
- package/docs/USER-HANDBOOK-CONTRACT.md +8 -5
- package/hooks/README.md +4 -3
- package/hooks/adapters/codex.py +1 -1
- package/hooks/adapters/kimi.py +1 -1
- package/hooks/context_spine.py +120 -16
- package/hooks/health_check.py +11 -0
- package/hooks/pre_stop_check.py +6 -5
- package/mcp-server/lib/baseline-workflow.cjs +415 -0
- package/mcp-server/lib/baseline-workflow.test.cjs +225 -0
- package/mcp-server/lib/change-workflow.cjs +24 -27
- package/mcp-server/lib/change-workflow.test.cjs +202 -6
- package/mcp-server/lib/context-spine.cjs +74 -9
- package/mcp-server/lib/context-spine.test.cjs +15 -0
- package/mcp-server/lib/doctor.cjs +14 -0
- package/mcp-server/lib/doctor.test.cjs +25 -1
- package/mcp-server/lib/init-project.cjs +49 -14
- package/mcp-server/lib/provider-refs.cjs +42 -0
- package/mcp-server/lib/spec-learning.test.cjs +5 -0
- package/mcp-server/lib/state-db.cjs +63 -4
- package/mcp-server/lib/state-db.test.cjs +8 -3
- package/mcp-server/server.cjs +48 -3
- package/mcp-server/tests/init-project.test.cjs +54 -8
- package/mcp-server/tests/server-contract.test.cjs +99 -2
- package/mcp-server/tests/state-db.test.cjs +11 -2
- package/package.json +3 -2
- package/skills/cc-collab/SKILL.md +16 -18
- package/skills/code-review-expert/SKILL.md +39 -114
- package/skills/code-review-expert/references/correctness-reliability.md +30 -0
- package/skills/code-review-expert/references/design-boundaries.md +26 -0
- package/skills/code-review-expert/references/removal-plan.md +17 -45
- package/skills/codex-collab/SKILL.md +23 -28
- package/skills/codex-collab/evals/evals.json +18 -23
- package/skills/integration-rules/SKILL.md +28 -67
- package/skills/learn/SKILL.md +46 -106
- package/skills/security-rules/SKILL.md +34 -56
- package/skills/testing-rules/SKILL.md +28 -52
- package/skills/ultra-change/SKILL.md +68 -114
- package/skills/ultra-deliver/SKILL.md +58 -86
- package/skills/ultra-dev/SKILL.md +46 -105
- package/skills/ultra-doctor/SKILL.md +45 -72
- package/skills/ultra-init/SKILL.md +62 -147
- package/skills/ultra-init/references/brownfield-adoption.md +65 -0
- package/skills/ultra-plan/SKILL.md +56 -89
- package/skills/ultra-research/SKILL.md +64 -152
- package/skills/ultra-research/references/architecture.md +38 -0
- package/skills/ultra-research/references/problem-product.md +39 -0
- package/skills/ultra-research/references/quality-delivery.md +34 -0
- package/skills/ultra-research/references/synthesis.md +38 -0
- package/skills/ultra-research/references/users-scope.md +40 -0
- package/skills/ultra-review/SKILL.md +54 -98
- package/skills/ultra-review/references/unified-schema.md +76 -101
- package/skills/ultra-review/scripts/review_wait.py +242 -77
- package/skills/ultra-status/SKILL.md +41 -56
- package/skills/ultra-test/SKILL.md +37 -72
- package/skills/ultra-think/SKILL.md +43 -102
- package/skills/ultra-verify/SKILL.md +44 -84
- package/skills/ultra-verify/evals/evals.json +24 -27
- package/spec/cli-protocol.md +4 -0
- package/spec/mcp-tools.yaml +223 -4
- package/spec/schemas/command-manifest.schema.json +7 -25
- package/spec/schemas/mcp-tools.schema.json +1 -1
- package/spec/schemas/skill-manifest.schema.json +9 -79
- package/spec/schemas/state-db.sql +33 -2
- package/ultra-tools/commands/status.cjs +20 -2
- package/ultra-tools/commands/task.cjs +4 -1
- package/ultra-tools/status-command.test.cjs +20 -0
- package/ultra-tools/system-command.test.cjs +5 -0
- package/skills/code-review-expert/references/code-quality-checklist.md +0 -112
- package/skills/code-review-expert/references/integration-checklist.md +0 -46
- package/skills/code-review-expert/references/security-checklist.md +0 -100
- package/skills/code-review-expert/references/solid-checklist.md +0 -65
- package/skills/ultra-research/steps/step-00-problem-validation.md +0 -154
- package/skills/ultra-research/steps/step-01-opportunity-discovery.md +0 -172
- package/skills/ultra-research/steps/step-02-market-assessment.md +0 -195
- package/skills/ultra-research/steps/step-03-competitive-landscape.md +0 -197
- package/skills/ultra-research/steps/step-04-product-strategy.md +0 -196
- package/skills/ultra-research/steps/step-05-assumptions-validation.md +0 -234
- package/skills/ultra-research/steps/step-10-user-personas.md +0 -169
- package/skills/ultra-research/steps/step-11-user-scenarios.md +0 -181
- package/skills/ultra-research/steps/step-20-user-stories.md +0 -156
- package/skills/ultra-research/steps/step-21-features-scope.md +0 -157
- package/skills/ultra-research/steps/step-22-success-metrics.md +0 -195
- package/skills/ultra-research/steps/step-30-architecture-context.md +0 -154
- package/skills/ultra-research/steps/step-31-solution-strategy.md +0 -172
- package/skills/ultra-research/steps/step-32-building-blocks.md +0 -188
- package/skills/ultra-research/steps/step-40-deployment.md +0 -123
- package/skills/ultra-research/steps/step-41-quality-risks.md +0 -135
- package/skills/ultra-research/steps/step-99-synthesis.md +0 -188
- package/skills/ultra-review/scripts/review_verdict_update.py +0 -99
|
@@ -1,98 +1,71 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-doctor
|
|
3
|
-
description:
|
|
4
|
-
user-invocable: true
|
|
5
|
-
runtime: all
|
|
6
|
-
mcp_tools_required:
|
|
7
|
-
- system.doctor
|
|
8
|
-
cli_fallback: "system doctor"
|
|
3
|
+
description: Diagnose Ultra state, projection, session, incident, change-artifact, and installed-plugin health with bounded recovery. Use when Ultra state appears missing, projections disagree, hooks fail, or MCP operations report degraded health.
|
|
9
4
|
---
|
|
10
5
|
|
|
11
|
-
#
|
|
6
|
+
# Diagnose and recover the Ultra runtime
|
|
12
7
|
|
|
13
|
-
|
|
14
|
-
`state.db`, a hook reports a missing adapter, sessions are orphaned, a change
|
|
15
|
-
artifact is missing, or MCP operations return degraded projection metadata.
|
|
8
|
+
Default to read-only diagnosis. Repair only after the user explicitly authorizes it.
|
|
16
9
|
|
|
17
|
-
##
|
|
10
|
+
## Project-state diagnosis
|
|
18
11
|
|
|
19
|
-
Call `system.doctor` with `{ "repair": false }`
|
|
20
|
-
requests repair. Read-only diagnosis reports:
|
|
12
|
+
Call `system.doctor` with `{ "repair": false }` and inspect:
|
|
21
13
|
|
|
22
14
|
- SQLite integrity and required tables;
|
|
23
15
|
- open structured incidents;
|
|
24
|
-
-
|
|
16
|
+
- event and projection cursor lag;
|
|
17
|
+
- failed or interrupted projection jobs;
|
|
25
18
|
- orphan sessions;
|
|
26
19
|
- missing active-change artifact roots;
|
|
27
|
-
-
|
|
20
|
+
- missing, incomplete, or stale project baseline readiness and specification digests;
|
|
21
|
+
- the boundary to separately installed memory and code-graph providers.
|
|
28
22
|
|
|
29
|
-
Do not infer health from
|
|
30
|
-
artifacts,
|
|
23
|
+
Do not infer health from generated task JSON. Do not mutate external provider state,
|
|
24
|
+
delete artifacts, or collect memory during diagnosis.
|
|
31
25
|
|
|
32
|
-
## Interpret
|
|
26
|
+
## Interpret failures
|
|
33
27
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
- State integrity failure blocks ordinary workflows and requires preserving database
|
|
29
|
+
evidence before recovery.
|
|
30
|
+
- An open incident requires its code, source, retryability, and evidence.
|
|
31
|
+
- Projection lag may be mechanically repairable when authority is healthy.
|
|
32
|
+
- An orphan session may be reconciled; never kill unrelated processes blindly.
|
|
33
|
+
- A missing change artifact requires version-control, backup, or deliberate recreation
|
|
34
|
+
evidence rather than silent regeneration.
|
|
35
|
+
- Missing or incomplete baseline evidence routes to `ultra-init`. Doctor repair does
|
|
36
|
+
not approve a baseline, accept known-red verification, or invent adoption evidence.
|
|
37
|
+
Baseline readiness is an advisory workflow check, not state-database corruption and
|
|
38
|
+
not a reason for doctor repair.
|
|
42
39
|
|
|
43
|
-
## Explicit repair
|
|
40
|
+
## Explicit repair
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
`
|
|
42
|
+
After authorization, call `system.doctor` with `{ "repair": true }` or use the
|
|
43
|
+
installed `ultra-tools system doctor --repair` fallback. The runtime must create a
|
|
44
|
+
timestamped state database backup before any mechanical repair.
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
Repair is limited to documented recovery operations such as reconciling orphan
|
|
47
|
+
sessions, consuming staleness events, requeueing interrupted or failed projections,
|
|
48
|
+
and regenerating projections from authoritative state. If backup fails, stop. Always
|
|
49
|
+
inspect the post-repair report; a completed repair action does not imply healthy state.
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
mechanical repair. Repair is bounded to:
|
|
51
|
+
## Installed-plugin failures
|
|
54
52
|
|
|
55
|
-
|
|
56
|
-
- durable consumption of spec-staleness events;
|
|
57
|
-
- requeueing projection jobs left `running` beyond the interruption cutoff;
|
|
58
|
-
- requeueing failed projection jobs;
|
|
59
|
-
- regenerating projections from authoritative state.
|
|
53
|
+
When a hook points to a missing installed file:
|
|
60
54
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
1. Capture the hook manifest path and missing target.
|
|
56
|
+
2. Run the installer doctor for the actual host and install scope.
|
|
57
|
+
3. Preserve provenance, asset-hash, and host-contract findings.
|
|
58
|
+
4. Reinstall through the host adapter rather than patching a cache directory.
|
|
59
|
+
5. Rerun installer doctor, `system.doctor`, and a host hook smoke test.
|
|
64
60
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
For an installed hook that points to a missing cached file:
|
|
68
|
-
|
|
69
|
-
1. capture the exact hook config path and missing target;
|
|
70
|
-
2. run the separate read-only installer boundary check:
|
|
71
|
-
`npx ultra-builder-pro-cli --<runtime> --local --doctor --json` (or use
|
|
72
|
-
`--global` when that is the actual install scope);
|
|
73
|
-
3. preserve its provenance, asset-hash, and host-contract findings;
|
|
74
|
-
4. reinstall or regenerate the host-native plugin through the adapter;
|
|
75
|
-
5. rerun both installer doctor and `system.doctor`, then a host hook smoke test.
|
|
76
|
-
|
|
77
|
-
`system.doctor` diagnoses project `.ultra/state.db` and workflow recovery.
|
|
78
|
-
Installer `ubp --doctor` diagnoses the installed plugin files and host wiring.
|
|
79
|
-
Neither report substitutes for the other.
|
|
80
|
-
|
|
81
|
-
Do not bypass a broken hook by changing application implementation, and do not
|
|
82
|
-
treat a hook failure as project-code evidence.
|
|
61
|
+
Project doctor covers `.ultra/state.db`; installer doctor covers packaged files and
|
|
62
|
+
host wiring. Neither substitutes for the other.
|
|
83
63
|
|
|
84
64
|
## Output
|
|
85
65
|
|
|
86
|
-
Lead with `healthy` or `degraded
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- event vs projected cursor;
|
|
90
|
-
- whether repair ran;
|
|
91
|
-
- backup path when repair ran;
|
|
92
|
-
- unresolved actions and their owner (`Ultra`, host plugin, or external provider).
|
|
93
|
-
|
|
94
|
-
## What this skill does not do
|
|
66
|
+
Lead with `healthy` or `degraded`. List failing authority checks separately from
|
|
67
|
+
baseline warnings, incident identifiers, cursor lag, whether repair ran, the backup
|
|
68
|
+
path, and each unresolved action with its owner.
|
|
95
69
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
- It does not install, query, refresh, or repair external Memory/graph providers.
|
|
70
|
+
Do not fix application code, delete state, reset Git, close healthy sessions, or
|
|
71
|
+
install and repair external providers through this workflow.
|
|
@@ -1,151 +1,66 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-init
|
|
3
|
-
description:
|
|
4
|
-
user-invocable: true
|
|
5
|
-
runtime: all
|
|
6
|
-
mcp_tools_required:
|
|
7
|
-
- task.init_project
|
|
8
|
-
cli_fallback: "task init-project"
|
|
3
|
+
description: Initialize Ultra Builder Pro or resume greenfield and brownfield baseline adoption. Use when a repository lacks Ultra state or its project baseline is missing, draft, adopting, or blocked.
|
|
9
4
|
---
|
|
10
5
|
|
|
11
|
-
#
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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:离线可执行
|
|
6
|
+
# Initialize or adopt a project
|
|
7
|
+
|
|
8
|
+
Create project-local Ultra state, then route the repository according to its actual
|
|
9
|
+
baseline status. Do not treat an existing codebase as a new product.
|
|
10
|
+
|
|
11
|
+
## Preflight
|
|
12
|
+
|
|
13
|
+
Use the current working directory unless the user names another target. Inspect the
|
|
14
|
+
root, project manifests, Git state, and `.ultra/` without mutation.
|
|
15
|
+
|
|
16
|
+
If `.ultra/` exists, call `baseline.get` and `system.doctor`:
|
|
17
|
+
|
|
18
|
+
- a healthy `ready` baseline routes to `ultra-change` or `ultra-status`;
|
|
19
|
+
- `draft`, `adopting`, or baseline-blocked state resumes this workflow;
|
|
20
|
+
- state integrity or migration failure routes to `ultra-doctor`;
|
|
21
|
+
- recreation requires explicit authorization and must preserve the returned backup.
|
|
22
|
+
|
|
23
|
+
Never overwrite `.ultra/` merely because the repository is old or its documents are
|
|
24
|
+
incomplete.
|
|
25
|
+
|
|
26
|
+
## Bootstrap
|
|
27
|
+
|
|
28
|
+
When `.ultra/` is absent, derive project name, type, and stack from repository evidence,
|
|
29
|
+
then call `task.init_project` with `mode: "auto"`. Use an explicit `greenfield` or
|
|
30
|
+
`brownfield` mode only when the user has made that classification authoritative.
|
|
31
|
+
|
|
32
|
+
Verify the returned mode, baseline id and status, state database path, initial
|
|
33
|
+
projection, and copied specification files.
|
|
34
|
+
|
|
35
|
+
## Route by mode
|
|
36
|
+
|
|
37
|
+
### Greenfield
|
|
38
|
+
|
|
39
|
+
The new baseline begins as `draft`. Route unresolved product or architecture intent to
|
|
40
|
+
`ultra-research`. That workflow records evidence and converges the baseline before
|
|
41
|
+
planning. Do not create implementation tasks during initialization.
|
|
42
|
+
|
|
43
|
+
### Brownfield
|
|
44
|
+
|
|
45
|
+
Read `references/brownfield-adoption.md` completely. Adopt current behavior from the
|
|
46
|
+
checkout, tests, maintained documentation, and runtime evidence. Use `baseline.record`
|
|
47
|
+
for the bounded snapshot and `baseline.converge` only after the owner approves the
|
|
48
|
+
captured baseline and any accepted known-red verification.
|
|
49
|
+
|
|
50
|
+
## Failure handling
|
|
51
|
+
|
|
52
|
+
- `ULTRA_DIR_EXISTS`: inspect and resume; do not retry with overwrite automatically.
|
|
53
|
+
- `BASELINE_EXISTS`: keep the ready baseline unless explicit re-adoption is required.
|
|
54
|
+
- `BASELINE_IN_PROGRESS`: resume the named baseline rather than creating another.
|
|
55
|
+
- `TEMPLATE_MISSING`: report a package-integrity failure and route to installer doctor.
|
|
56
|
+
- `TARGET_NOT_DIR`, `VALIDATION_ERROR`, or `IO_ERROR`: correct only the evidenced input;
|
|
57
|
+
preserve any backup and partial diagnostic.
|
|
58
|
+
|
|
59
|
+
## Output
|
|
60
|
+
|
|
61
|
+
Report target path, detected mode, baseline id/status/revision, state health, known-red
|
|
62
|
+
verification, blocking unknowns, and one next action. `.ultra/state.db` is authoritative;
|
|
63
|
+
JSON and Markdown projections do not create state.
|
|
64
|
+
|
|
65
|
+
Do not browse by default, invent missing behavior, rewrite application code, create
|
|
66
|
+
business tasks, stage files, or commit as part of initialization.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Brownfield adoption
|
|
2
|
+
|
|
3
|
+
Use this procedure only after `task.init_project` selects `brownfield`, or when an
|
|
4
|
+
existing baseline remains `adopting` or `blocked`.
|
|
5
|
+
|
|
6
|
+
## Establish the snapshot boundary
|
|
7
|
+
|
|
8
|
+
Bind the repository root, current Git HEAD when available, included paths, excluded
|
|
9
|
+
generated or vendored paths, project manifests, and the user-visible or public seams.
|
|
10
|
+
Use the revision returned by `baseline.record`; non-Git projects receive a deterministic
|
|
11
|
+
workspace revision from the recorded evidence.
|
|
12
|
+
|
|
13
|
+
## Read current behavior
|
|
14
|
+
|
|
15
|
+
Inspect only the evidence needed to explain the maintained system:
|
|
16
|
+
|
|
17
|
+
- entry points and consumers;
|
|
18
|
+
- persisted state and its writers;
|
|
19
|
+
- external interfaces, events, permissions, and failure paths;
|
|
20
|
+
- tests and their live seams;
|
|
21
|
+
- deployment, migration, and recovery paths when present;
|
|
22
|
+
- maintained documents and their relationship to source.
|
|
23
|
+
|
|
24
|
+
Classify every statement as observed, verified, decided, or unknown. Source and runtime
|
|
25
|
+
evidence outrank stale prose. External memory and code-graph providers may supply
|
|
26
|
+
references, but their content remains outside Ultra state.
|
|
27
|
+
|
|
28
|
+
## Capture the baseline
|
|
29
|
+
|
|
30
|
+
Update `.ultra/specs/product.md` with confirmed behavior, actors, entry points, failures,
|
|
31
|
+
and acceptance. Update `.ultra/specs/architecture.md` with actual boundaries, authority,
|
|
32
|
+
runtime paths, dependencies, permissions, and recovery. Use `discovery.md` only for
|
|
33
|
+
evidence or decisions that affect scope.
|
|
34
|
+
|
|
35
|
+
Do not redesign the project, normalize it to a preferred architecture, manufacture
|
|
36
|
+
personas or alternatives, or convert every source file into documentation.
|
|
37
|
+
|
|
38
|
+
Run the repository's existing verification commands. Record each result as `pass`,
|
|
39
|
+
`known_red`, or `not_run`. A known-red item needs evidence and a rationale; a missing
|
|
40
|
+
command is not a passing result. Mark an unknown blocking when it can change accepted
|
|
41
|
+
behavior, authority, security, data integrity, or the next implementation plan.
|
|
42
|
+
|
|
43
|
+
Call `baseline.record` with full replacement arrays for:
|
|
44
|
+
|
|
45
|
+
- scope and repository revision;
|
|
46
|
+
- product and architecture specification paths;
|
|
47
|
+
- bounded source, documentation, runtime, test, deployment, or external references;
|
|
48
|
+
- verification results;
|
|
49
|
+
- blocking and non-blocking unknowns;
|
|
50
|
+
- external provider metadata references, when supplied.
|
|
51
|
+
|
|
52
|
+
The server computes specification digests. Do not send prompt, transcript, memory, or
|
|
53
|
+
code-graph payloads.
|
|
54
|
+
|
|
55
|
+
## Converge
|
|
56
|
+
|
|
57
|
+
Present the observed behavior, known-red verification, blocking unknowns, and material
|
|
58
|
+
decisions to the project owner. After explicit approval, call `baseline.converge` with
|
|
59
|
+
the recorded revision, approver, approval note, and `accept_known_red` only when the
|
|
60
|
+
owner accepted those failures.
|
|
61
|
+
|
|
62
|
+
Resolve returned blockers through evidence or an owner decision, record the replacement
|
|
63
|
+
snapshot, and retry. Adoption is complete only when `baseline.get` and `system.doctor`
|
|
64
|
+
report the baseline ready and current. Route the first new outcome to `ultra-change`, or
|
|
65
|
+
route planning of already accepted work to `ultra-plan`.
|
|
@@ -1,109 +1,76 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-plan
|
|
3
|
-
description:
|
|
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
|
-
#
|
|
6
|
+
# Plan fresh-context execution
|
|
18
7
|
|
|
19
|
-
Produce a
|
|
20
|
-
`.ultra/state.db`
|
|
21
|
-
|
|
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
|
-
##
|
|
12
|
+
## Entry gate
|
|
24
13
|
|
|
25
|
-
Start with a state-backed MCP read.
|
|
26
|
-
|
|
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.
|
|
16
|
+
Call `baseline.get`. Initial product planning is blocked until the baseline is
|
|
17
|
+
`ready` and current; route its missing, adopting, blocked, or stale state to
|
|
18
|
+
`ultra-init`. Planning an already active bounded change may continue with the
|
|
19
|
+
baseline condition recorded as a warning. Convergence still requires approved
|
|
20
|
+
adoption, and archive atomically reconciles and verifies revision/spec drift.
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
ultra-tools migrate --from=4.4 --to=4.5 --source-dir <project-root>
|
|
30
|
-
```
|
|
22
|
+
Choose one input:
|
|
31
23
|
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
- validated baseline specifications;
|
|
25
|
+
- one active change packet;
|
|
26
|
+
- a raw PRD through the approval-gated mode below.
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
|
|
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.
|
|
42
|
-
|
|
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
|
+
Ask only for product, scope, cost, or risk decisions that cannot be derived from
|
|
29
|
+
current evidence. A material unresolved assumption blocks persistence.
|
|
45
30
|
|
|
46
31
|
## Planning rules
|
|
47
32
|
|
|
48
|
-
1. Trace acceptance through
|
|
49
|
-
user-observable
|
|
50
|
-
2. Prefer a walking skeleton
|
|
51
|
-
3.
|
|
52
|
-
|
|
53
|
-
4.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
the behavior
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
|
33
|
+
1. Trace acceptance through an entry point, domain behavior, side effects, and a
|
|
34
|
+
user-observable or public seam.
|
|
35
|
+
2. Prefer a walking skeleton or `tracer_bullet` before horizontal layers.
|
|
36
|
+
3. Give each task one outcome, bounded ownership, explicit dependencies, required
|
|
37
|
+
references, and one deterministic verification command.
|
|
38
|
+
4. Use the context budget as an attention signal. Prefer bounded excerpts, direct
|
|
39
|
+
reads, or a smaller slice, but keep necessary files when correctness requires them.
|
|
40
|
+
Budget overflow is a warning, never a reason to inflate a threshold or manufacture
|
|
41
|
+
a smaller but incomplete contract.
|
|
42
|
+
5. Add integration checkpoints at actual boundaries, not after arbitrary task counts.
|
|
43
|
+
6. Put validation, errors, recovery, documentation, and migrations in the task that
|
|
44
|
+
owns the behavior.
|
|
45
|
+
7. Reject scaffolding with no reachable consumer.
|
|
46
|
+
|
|
47
|
+
Every persisted task must include its slice kind, public seam, verification command,
|
|
48
|
+
acceptance evidence, ownership, dependencies, documentation impact, and linked change
|
|
49
|
+
id when applicable.
|
|
50
|
+
|
|
51
|
+
## Baseline or change mode
|
|
80
52
|
|
|
81
53
|
1. Read the smallest authoritative references that define acceptance.
|
|
82
|
-
2. Build
|
|
83
|
-
3. Present the outcome, order,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
54
|
+
2. Build the task DAG in memory and check dependency and ownership conflicts.
|
|
55
|
+
3. Present the proposed outcome, execution order, risk concentration, and first live
|
|
56
|
+
seam. Obtain approval if scope, cost, or delivery semantics change materially.
|
|
57
|
+
4. Persist approved tasks with `task.create`.
|
|
58
|
+
5. For change-linked tasks, compile `change.context` with the planning role and gate.
|
|
59
|
+
Resolve every readiness blocker before calling a task executable.
|
|
60
|
+
6. Call `task.dependency_topo`; cycles and missing dependencies block completion.
|
|
61
|
+
7. Call `plan.export`, then verify the persisted result with `plan.get`.
|
|
62
|
+
8. Call `change.breadcrumb` when a change is active and return one next action.
|
|
63
|
+
|
|
64
|
+
## PRD mode
|
|
91
65
|
|
|
92
66
|
1. Call `task.parse_prd` with `dry_run: true`.
|
|
93
|
-
2. Show the proposed
|
|
94
|
-
3. Require explicit approval
|
|
95
|
-
4. On approval, repeat
|
|
96
|
-
|
|
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.
|
|
67
|
+
2. Show the proposed slices, topology, conflict surface, and cost estimate.
|
|
68
|
+
3. Require explicit approval; rejection performs no state write.
|
|
69
|
+
4. On approval, repeat with `dry_run: false`, export the plan, and verify that the
|
|
70
|
+
dry-run and persisted task identities agree.
|
|
104
71
|
|
|
105
72
|
## Completion gate
|
|
106
73
|
|
|
107
|
-
Planning is complete only when the DAG is valid,
|
|
108
|
-
|
|
109
|
-
|
|
74
|
+
Planning is complete only when the DAG is valid, each task reaches a public seam, each
|
|
75
|
+
verification command is executable, every change-linked context is ready, and no
|
|
76
|
+
required documentation or decision remains unknown.
|