ultra-builder-pro-cli 0.8.1 → 0.10.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.
- package/CHANGELOG.md +79 -1
- package/README.md +45 -26
- package/adapters/_shared/codex-assets.cjs +38 -0
- package/adapters/_shared/handbook.cjs +10 -1
- package/adapters/_shared/path-rewrite.cjs +3 -0
- package/adapters/_shared/runtime-assets.cjs +3 -1
- package/adapters/_shared/tests/handbook.test.cjs +9 -1
- package/adapters/_shared/tests/path-rewrite.test.cjs +3 -1
- package/adapters/_shared/tests/runtime-assets.test.cjs +5 -1
- package/adapters/kimi.js +642 -0
- package/adapters/opencode.js +46 -17
- package/adapters/tests/claude.test.cjs +4 -1
- package/adapters/tests/codex.test.cjs +4 -3
- package/adapters/tests/kimi-hook.test.cjs +122 -0
- package/adapters/tests/kimi.test.cjs +259 -0
- package/adapters/tests/opencode.test.cjs +46 -3
- package/bin/handbook.js +2 -2
- package/bin/install.js +9 -4
- package/bin/orchestrator.js +1 -1
- package/docs/AGENT-CONTEXT.md +39 -15
- package/docs/ARCHITECTURE.md +35 -9
- package/docs/PLAN.zh-CN.md +5 -4
- package/docs/ROADMAP.md +8 -7
- package/docs/RUNTIME-COMPAT-MATRIX.md +110 -64
- package/docs/USER-HANDBOOK-CONTRACT.md +13 -3
- package/hooks/README.md +6 -4
- package/hooks/active_task_context.py +14 -0
- package/hooks/adapters/kimi.py +162 -0
- package/hooks/context_spine.py +218 -0
- package/hooks/health_check.py +1 -1
- package/hooks/workflow_context.py +16 -123
- package/hooks/workflow_resume.py +21 -0
- package/mcp-server/lib/change-workflow.cjs +89 -11
- package/mcp-server/lib/change-workflow.test.cjs +202 -7
- package/mcp-server/lib/context-spine.cjs +331 -0
- package/mcp-server/lib/context-spine.test.cjs +73 -0
- package/mcp-server/lib/spec-learning.cjs +191 -0
- package/mcp-server/lib/spec-learning.test.cjs +62 -0
- package/mcp-server/lib/state-db.cjs +149 -4
- package/mcp-server/lib/state-db.test.cjs +61 -0
- package/mcp-server/server.cjs +31 -1
- package/mcp-server/tests/db-ops.test.cjs +3 -3
- package/mcp-server/tests/init-project.test.cjs +2 -2
- package/mcp-server/tests/server-contract.test.cjs +74 -0
- package/mcp-server/tests/state-db.test.cjs +20 -3
- package/package.json +4 -2
- package/skills/learn/SKILL.md +1 -0
- package/skills/ultra-change/SKILL.md +91 -118
- package/skills/ultra-deliver/SKILL.md +93 -221
- package/skills/ultra-dev/SKILL.md +81 -310
- package/skills/ultra-doctor/SKILL.md +1 -0
- package/skills/ultra-init/SKILL.md +1 -0
- package/skills/ultra-plan/SKILL.md +72 -292
- package/skills/ultra-review/SKILL.md +79 -407
- package/skills/ultra-status/SKILL.md +55 -168
- package/skills/ultra-test/SKILL.md +64 -183
- package/skills/ultra-think/SKILL.md +1 -0
- package/spec/cli-protocol.md +3 -0
- package/spec/mcp-tools.yaml +136 -7
- package/spec/schemas/skill-manifest.schema.json +2 -2
- package/spec/schemas/state-db.sql +35 -2
|
@@ -1,190 +1,77 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-status
|
|
3
|
-
description: "
|
|
3
|
+
description: "Route the project from its authoritative Ultra breadcrumb, readiness gates, task state, and current verification evidence."
|
|
4
|
+
user-invocable: true
|
|
4
5
|
runtime: all
|
|
5
6
|
mcp_tools_required:
|
|
7
|
+
- change.breadcrumb
|
|
8
|
+
- change.list
|
|
6
9
|
- task.list
|
|
7
10
|
- task.get
|
|
8
11
|
- session.list
|
|
9
|
-
- session.subscribe_events
|
|
10
|
-
- change.list
|
|
11
12
|
- system.doctor
|
|
12
13
|
cli_fallback: "status --cost --json"
|
|
13
14
|
---
|
|
14
15
|
|
|
15
|
-
# ultra-status —
|
|
16
|
-
|
|
17
|
-
Single-call dashboard. Pulls task state from state.db (authoritative), layers
|
|
18
|
-
in `.ultra/test-report.json` + `.ultra/delivery-report.json` (file artifacts),
|
|
19
|
-
reports progress + risks + workflow routing.
|
|
20
|
-
It never treats a completed initial delivery as a terminal state: a healthy
|
|
21
|
-
baseline routes the next daily request through `/ultra-change`.
|
|
22
|
-
|
|
23
|
-
## Authority failure boundary
|
|
24
|
-
|
|
25
|
-
`task.list` and `task.get` are the only task-state inputs. If either is
|
|
26
|
-
unavailable or returns an authority error, surface it and stop. Never fall back to `.ultra/tasks/tasks.json`.
|
|
27
|
-
On `LEGACY_STATE_MIGRATION_REQUIRED`, instruct the
|
|
28
|
-
user to run `ultra-tools migrate --from=4.4 --to=4.5 --source-dir <project-root>`.
|
|
29
|
-
|
|
30
|
-
## Workflow
|
|
31
|
-
|
|
32
|
-
### Phase 0 — Environment validation
|
|
33
|
-
|
|
34
|
-
| Check | If missing |
|
|
35
|
-
|-------|-----------|
|
|
36
|
-
| state.db reachable through `task.list` | suggest `/ultra-init` only when `.ultra/` is absent; otherwise surface the MCP error |
|
|
37
|
-
| At least one task visible via `task.list` | suggest `/ultra-plan` |
|
|
38
|
-
| `task.list` returns valid rows | surface error |
|
|
39
|
-
|
|
40
|
-
### Phase 1 — Load data
|
|
41
|
-
|
|
42
|
-
```jsonc
|
|
43
|
-
// MCP: task.list (no filter — get all tasks)
|
|
44
|
-
{}
|
|
45
|
-
// → { tasks: [...], count: N }
|
|
46
|
-
|
|
47
|
-
// MCP: session.list (active sessions; Phase 4.5.4)
|
|
48
|
-
{ "status": "running" }
|
|
49
|
-
// → { sessions: [...], count: N }
|
|
50
|
-
|
|
51
|
-
// MCP: session.subscribe_events (recent events for the "last event" panel)
|
|
52
|
-
{ "since_id": 0, "limit": 20 }
|
|
53
|
-
// → { events: [...], next_since_id: M }
|
|
54
|
-
|
|
55
|
-
// MCP: change.list (continuous-change lane)
|
|
56
|
-
{ "limit": 20 }
|
|
57
|
-
|
|
58
|
-
// MCP: system.doctor (read-only runtime health)
|
|
59
|
-
{ "repair": false }
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Also read:
|
|
63
|
-
- `.ultra/test-report.json` — if present
|
|
64
|
-
- `.ultra/delivery-report.json` — if present
|
|
65
|
-
|
|
66
|
-
Extract:
|
|
67
|
-
- Task stats: by status (`pending`/`in_progress`/`completed`/`blocked`), by priority (P0-P3)
|
|
68
|
-
- Current `in_progress` task, next `pending` task (topological order)
|
|
69
|
-
- Active sessions: count, per-runtime breakdown, orphan warnings
|
|
70
|
-
- Most recent 20 events (by `events.id` DESC) — "last event" panel
|
|
71
|
-
- Test passed / failed / stale (compare `git_commit` to HEAD)
|
|
72
|
-
- Delivery readiness (tag + pushed)
|
|
73
|
-
- Active/blocked/ready change, linked task counts, docs impact, and context freshness
|
|
74
|
-
- Runtime health: open incidents, projection lag/failure, orphan sessions, missing change artifacts
|
|
75
|
-
|
|
76
|
-
### Phase 2 — Progress report
|
|
16
|
+
# ultra-status — One Router, One Next Action
|
|
77
17
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
- **Test**: pass/fail, `run_count`, `blocking_issues` if any
|
|
82
|
-
- **Delivery**: `version` + `pushed` + last tag
|
|
83
|
-
- **Change**: active id/kind/status, docs impact, task completion, context/provider freshness
|
|
84
|
-
- **Runtime**: healthy/degraded with failing doctor checks only
|
|
85
|
-
- **Risks**: auto-detected list (see Phase 3)
|
|
86
|
-
- **Next**: recommended next task (see Phase 4)
|
|
18
|
+
Use this workflow to answer “where are we?” and “what should happen next?” without
|
|
19
|
+
reconstructing project state from prose. `.ultra/state.db` is authoritative; reports
|
|
20
|
+
and Markdown are evidence or projections.
|
|
87
21
|
|
|
88
|
-
|
|
22
|
+
## Read order
|
|
89
23
|
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
- **Projection/incident failure**: read-only doctor is degraded → route to
|
|
99
|
-
`/ultra-doctor`; never infer recovery from a generated JSON file
|
|
100
|
-
- **Context stale**: active change manifest head or task set differs from current state
|
|
101
|
-
- **Docs drift**: change has `docs_impact.status=unknown` or declared required file is missing
|
|
24
|
+
1. Call `system.doctor { repair: false }`. If authority is unhealthy, route only to
|
|
25
|
+
`ultra-doctor` and include the blocking diagnostic.
|
|
26
|
+
2. Call `change.breadcrumb`. It returns the active change, task, role, gate,
|
|
27
|
+
readiness, blockers, stale status, and one deterministic next action.
|
|
28
|
+
3. Call `task.list` and `session.list` for counts and active execution detail.
|
|
29
|
+
4. Read `.ultra/test-report.json` and `.ultra/delivery-report.json` only when they
|
|
30
|
+
exist. Treat a report from a different HEAD as stale.
|
|
31
|
+
5. Read git branch, HEAD, and worktree status. Do not mutate anything.
|
|
102
32
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
| 🟢 | on track | continue |
|
|
106
|
-
| 🟡 | minor issues | review stalled |
|
|
107
|
-
| 🟠 | significant risks | address blockers |
|
|
108
|
-
| 🔴 | critical | stop and resolve |
|
|
33
|
+
Never fall back to `.ultra/tasks/tasks.json`, context Markdown frontmatter, or raw
|
|
34
|
+
SQLite when MCP task state is unavailable. Label that panel unavailable.
|
|
109
35
|
|
|
110
|
-
|
|
36
|
+
## Routing rules
|
|
111
37
|
|
|
112
|
-
|
|
113
|
-
1. Priority (P0 > P1 > P2 > P3)
|
|
114
|
-
2. Dependencies resolved (only `pending` with all deps `completed`)
|
|
115
|
-
3. Complexity sweet spot (prefer 3-5, avoid clustering 7+)
|
|
116
|
-
4. Context continuity (favor same component as recent completed task)
|
|
38
|
+
The breadcrumb owns the primary route. Do not print a menu of every Ultra command.
|
|
117
39
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
|
123
|
-
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
`/clear` then `/{command}`
|
|
146
|
-
---
|
|
147
|
-
**Also available**: `/{alt}` — {description}
|
|
148
|
-
---
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## Single-task mode (`$1` supplied)
|
|
152
|
-
|
|
153
|
-
When `task-id` provided:
|
|
154
|
-
```jsonc
|
|
155
|
-
// MCP: task.get
|
|
156
|
-
{ "id": "<id>" }
|
|
40
|
+
| State | Route |
|
|
41
|
+
|---|---|
|
|
42
|
+
| doctor unhealthy | `ultra-doctor` |
|
|
43
|
+
| no Ultra project | `ultra-init` |
|
|
44
|
+
| no baseline specs or tasks | `ultra-research` or `ultra-plan`, matching the missing artifact |
|
|
45
|
+
| readiness blocked or context stale | recompile through `ultra-change`, `ultra-plan`, or `ultra-dev` as named by the breadcrumb |
|
|
46
|
+
| implementation task ready | `ultra-dev <task-id>` |
|
|
47
|
+
| all scoped tasks complete, test report missing/stale | `ultra-test` |
|
|
48
|
+
| review or convergence incomplete | `ultra-review all` or `ultra-deliver`, matching the gate |
|
|
49
|
+
| ready change | `ultra-deliver` |
|
|
50
|
+
| archived change and clean HEAD | report complete; do not invent more work |
|
|
51
|
+
|
|
52
|
+
When there is no active change, derive a single baseline route from tasks and reports.
|
|
53
|
+
If several changes are active or blocked, report ambiguity and require an explicit
|
|
54
|
+
change id instead of guessing.
|
|
55
|
+
|
|
56
|
+
## Output
|
|
57
|
+
|
|
58
|
+
Keep the answer compact:
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
Ultra: <healthy|degraded> · <branch>@<head> · worktree <clean|dirty>
|
|
62
|
+
Position: change=<id|none> task=<id|none> role=<role> gate=<gate>
|
|
63
|
+
Readiness: <ready|blocked|stale> — <blockers or none>
|
|
64
|
+
Progress: <completed>/<total>; sessions=<active count>
|
|
65
|
+
Evidence: tests=<fresh|stale|missing>; delivery=<fresh|stale|missing>
|
|
66
|
+
Next: <exactly one action, including the task/change id when known>
|
|
157
67
|
```
|
|
158
|
-
Display: title, status, priority, complexity, deps, files_modified (if set),
|
|
159
|
-
session_id (if active), `context_file`, `trace_to`, stale flag, update history.
|
|
160
|
-
|
|
161
|
-
## MCP and CLI matrix
|
|
162
|
-
|
|
163
|
-
| Purpose | MCP tool | CLI fallback |
|
|
164
|
-
|---------|----------|--------------|
|
|
165
|
-
| List tasks | `task.list` | none; fail closed |
|
|
166
|
-
| Single task detail | `task.get` | none; fail closed |
|
|
167
|
-
| Change lane | `change.list` | none; fail closed |
|
|
168
|
-
| Runtime health | `system.doctor { repair:false }` | `ultra-tools system doctor` |
|
|
169
|
-
| Cost panel (Phase 6.3) | — | `ultra-tools status --cost --json --since 7d` |
|
|
170
68
|
|
|
171
|
-
|
|
69
|
+
Separate verified facts from unavailable panels. Do not hide a stale context or stale
|
|
70
|
+
test report behind an overall “healthy” label.
|
|
172
71
|
|
|
173
|
-
|
|
174
|
-
total_cost_usd}`. Render under the progress section when the user asks
|
|
175
|
-
"how much did we spend?" or `/ultra-status --cost` is invoked. `--since 7d`
|
|
176
|
-
is the conventional weekly window; override with ISO-8601 for custom ranges.
|
|
72
|
+
## Boundaries
|
|
177
73
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
-
|
|
181
|
-
|
|
182
|
-
- Does NOT require all artifacts (partial reports are tolerated)
|
|
183
|
-
|
|
184
|
-
## Integration
|
|
185
|
-
|
|
186
|
-
| | |
|
|
187
|
-
|---|---|
|
|
188
|
-
| **Input** | state.db via task/change/session/system reads, test/delivery reports, git HEAD |
|
|
189
|
-
| **Output** | console report (Chinese per project rule) |
|
|
190
|
-
| **When** | anytime — idempotent read-only |
|
|
74
|
+
- Read-only: this workflow does not repair, compile context, update tasks, or release.
|
|
75
|
+
- Cost data may use the declared CLI fallback, but task/change authority may not.
|
|
76
|
+
- External memory and code graph providers are optional metadata references; their
|
|
77
|
+
absence does not change Ultra authority.
|
|
@@ -1,213 +1,94 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-test
|
|
3
|
-
description: "
|
|
3
|
+
description: "Run the pre-delivery check gate from a fresh role context and record exact feedback-loop, wiring, recovery, and acceptance evidence."
|
|
4
|
+
user-invocable: true
|
|
4
5
|
runtime: all
|
|
5
6
|
mcp_tools_required:
|
|
6
7
|
- task.list
|
|
7
8
|
- change.list
|
|
9
|
+
- change.context
|
|
10
|
+
- change.breadcrumb
|
|
8
11
|
---
|
|
9
12
|
|
|
10
|
-
# ultra-test —
|
|
13
|
+
# ultra-test — Independent Check Context
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
pre-ship gate.
|
|
15
|
+
This is the project/change pre-delivery gate, not a replacement for the task-level TDD
|
|
16
|
+
loop. It produces `.ultra/test-report.json`; task and change authority remain in
|
|
17
|
+
`.ultra/state.db`.
|
|
16
18
|
|
|
17
|
-
##
|
|
19
|
+
## Entry gate
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
`
|
|
21
|
+
1. Call `task.list`; require at least one completed task in scope.
|
|
22
|
+
2. Call `change.list` and bind to exactly one relevant active/blocked/ready change, or
|
|
23
|
+
explicitly record `change_id: null` for an initial baseline.
|
|
24
|
+
3. For a change, compile `change.context` with `role=check`, `gate=verification`, only
|
|
25
|
+
the tests/specs/source seams needed to verify it, and the same execution contract.
|
|
26
|
+
4. Call `change.breadcrumb`; stop when context is stale or readiness is blocked.
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
Never fall back to `.ultra/tasks/tasks.json`. Do not reuse the implementer's full
|
|
29
|
+
conversation as test context.
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
- Repo has test files (Step 0 pre-check)
|
|
31
|
+
## Verification matrix
|
|
28
32
|
|
|
29
|
-
|
|
33
|
+
Build a matrix from acceptance claims to observable evidence:
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
| Check | Required evidence | Blocking condition |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| Feedback loop | exact command and observed green | command fails or no prior red for fix/incident |
|
|
38
|
+
| Public seam | reachable entry-to-consumer path | orphan/stub/unwired behavior |
|
|
39
|
+
| Regression | focused and adjacent suites | failure or meaningful skipped assertion |
|
|
40
|
+
| Build/static | typecheck/lint/build as applicable | non-zero result |
|
|
41
|
+
| Error/recovery | failure mode and recovery path | silent/swallowed/unrecoverable critical path |
|
|
42
|
+
| Security | input/auth/secrets/dependency checks in scope | high-severity issue |
|
|
43
|
+
| Docs/spec | delivered behavior matches declared delta | drift or unknown impact |
|
|
32
44
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
3. `change.list` → identify the active/blocked change, if any; filter linked
|
|
36
|
-
tasks locally by `change_id`
|
|
37
|
-
4. Find test files (suffix `.test.*`, `.spec.*`, `test_*.py`, `*_test.go`)
|
|
45
|
+
Use repository-native commands and real boundaries where practical. Test doubles are
|
|
46
|
+
acceptable only at costly or nondeterministic external boundaries and must be named.
|
|
38
47
|
|
|
39
|
-
|
|
48
|
+
## Quality checks
|
|
40
49
|
|
|
41
|
-
|
|
50
|
+
- Detect tautologies, empty tests, weakened assertions, and core-domain over-mocking.
|
|
51
|
+
- Find changed exports without meaningful test coverage.
|
|
52
|
+
- Trace changed source into non-test consumers; flag orphan modules and placeholder
|
|
53
|
+
handlers/components.
|
|
54
|
+
- Exercise key API/UI/CLI flows when the project exposes them.
|
|
55
|
+
- Inspect error handling, authorization, migrations, idempotency, and rollback in the
|
|
56
|
+
affected risk surface.
|
|
57
|
+
- Compare current HEAD and context digests with the implementation evidence.
|
|
42
58
|
|
|
43
|
-
|
|
59
|
+
Do not mechanically require every possible test category. Mark a check
|
|
60
|
+
`not_applicable` only with a concrete scope reason.
|
|
44
61
|
|
|
45
|
-
|
|
46
|
-
|---------|---------|----------|
|
|
47
|
-
| Tautology | `assert True`, `expect(true).toBe(true)` | CRITICAL |
|
|
48
|
-
| Empty test | function body is just `pass` / `{}` | CRITICAL |
|
|
49
|
-
| Core-logic mock | `jest.mock()` on domain/service/state files | CRITICAL |
|
|
62
|
+
## Report contract
|
|
50
63
|
|
|
51
|
-
|
|
64
|
+
Write `.ultra/test-report.json` atomically with at least:
|
|
52
65
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
### Step 2 — Coverage Gap Analysis
|
|
56
|
-
|
|
57
|
-
Find exported functions / classes with **zero** test references.
|
|
58
|
-
|
|
59
|
-
1. Enumerate exports in `src/` (or language equivalent)
|
|
60
|
-
2. For each symbol, grep test files for its name
|
|
61
|
-
3. Bucket:
|
|
62
|
-
- HIGH: core business logic untested
|
|
63
|
-
- MEDIUM: utility untested
|
|
64
|
-
- LOW: config/constant untested
|
|
65
|
-
|
|
66
|
-
**Output**: `.ultra/docs/test-coverage-gaps.md`
|
|
67
|
-
**Gate**: any HIGH → fail.
|
|
68
|
-
|
|
69
|
-
### Step 2.5 — Wiring Verification
|
|
70
|
-
|
|
71
|
-
Detect orphan code — files that exist and pass tests but are not reachable.
|
|
72
|
-
|
|
73
|
-
1. Enumerate exported symbols in source files
|
|
74
|
-
2. For each export, grep **non-test** source for imports
|
|
75
|
-
3. Report exports with 0 non-test imports as orphaned
|
|
76
|
-
|
|
77
|
-
Also check boundary wiring:
|
|
78
|
-
- Component → API (fetch/axios targets a real route)
|
|
79
|
-
- API → DB (handler imports a real client)
|
|
80
|
-
- Form → handler (onSubmit is not `() => {}`)
|
|
81
|
-
- State → render (state appears in JSX/template)
|
|
82
|
-
|
|
83
|
-
Stub detection (Level-2 substantive):
|
|
84
|
-
- Functions returning empty `[]` / `{}` without real work
|
|
85
|
-
- `console.log`-only bodies
|
|
86
|
-
- Handlers calling only `e.preventDefault()`
|
|
87
|
-
- Components returning only `<div>Placeholder</div>`
|
|
88
|
-
|
|
89
|
-
**Output**: append to `test-coverage-gaps.md` under `## Wiring Gaps`.
|
|
90
|
-
**Gate**: any HIGH orphan or stub → fail.
|
|
91
|
-
|
|
92
|
-
### Step 3 — E2E Testing (conditional)
|
|
93
|
-
|
|
94
|
-
**Trigger**: project has web UI or API endpoints.
|
|
95
|
-
|
|
96
|
-
1. Start dev server (detect `scripts.dev` / `scripts.start`)
|
|
97
|
-
2. Navigate key pages/endpoints
|
|
98
|
-
3. Verify elements render; check console errors
|
|
99
|
-
4. Exercise primary user flows
|
|
100
|
-
|
|
101
|
-
**Method per runtime**:
|
|
102
|
-
- Claude: `mcp__claude-in-chrome__*` or Playwright via Bash
|
|
103
|
-
- Others: Playwright via `npx playwright` (CLI portable)
|
|
104
|
-
|
|
105
|
-
**Gate**: critical pages fail / major errors → fail.
|
|
106
|
-
|
|
107
|
-
### Step 4 — Performance (conditional, frontend only)
|
|
108
|
-
|
|
109
|
-
Lighthouse on dev server. Core Web Vitals gates:
|
|
110
|
-
- LCP < 2.5s
|
|
111
|
-
- INP < 200ms
|
|
112
|
-
- CLS < 0.1
|
|
113
|
-
|
|
114
|
-
**Gate**: any metric above threshold → fail.
|
|
115
|
-
|
|
116
|
-
### Step 5 — Security Audit
|
|
117
|
-
|
|
118
|
-
Dependency vulnerability scan via project's native tool:
|
|
119
|
-
- `npm audit --json` / `pnpm audit --json` / `yarn audit --json`
|
|
120
|
-
- `cargo audit --json`
|
|
121
|
-
- `pip-audit --format=json`
|
|
122
|
-
- `govulncheck ./...`
|
|
123
|
-
|
|
124
|
-
**Severity**:
|
|
125
|
-
- Critical/High → fail
|
|
126
|
-
- Medium → warn
|
|
127
|
-
- Low → info
|
|
128
|
-
|
|
129
|
-
### Step 6 — Auto-Fix Loop
|
|
130
|
-
|
|
131
|
-
If any gate failed, loop (max 5 attempts):
|
|
132
|
-
|
|
133
|
-
1. Read `blocking_issues`
|
|
134
|
-
2. Fix what is fixable without user input:
|
|
135
|
-
- Coverage Gap → write missing tests
|
|
136
|
-
- Anti-Pattern → rewrite fake tests
|
|
137
|
-
- E2E error → fix the code
|
|
138
|
-
- Performance → code-level optimizations (lazy, splitting, memoization)
|
|
139
|
-
3. External blockers (upstream CVE, breaking dep bump) → break, report, ask user
|
|
140
|
-
4. If all gates pass → exit loop
|
|
141
|
-
|
|
142
|
-
If max reached → surface remaining issues; `passed=false`.
|
|
143
|
-
|
|
144
|
-
### Step 7 — Persist `.ultra/test-report.json`
|
|
145
|
-
|
|
146
|
-
```jsonc
|
|
66
|
+
```json
|
|
147
67
|
{
|
|
148
|
-
"
|
|
149
|
-
"
|
|
150
|
-
"
|
|
68
|
+
"schema_version": "2.0",
|
|
69
|
+
"change_id": "<id-or-null>",
|
|
70
|
+
"git_commit": "<full-head>",
|
|
71
|
+
"context_manifest_hash": "<hash-or-null>",
|
|
151
72
|
"passed": true,
|
|
152
|
-
"
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
"
|
|
158
|
-
"coverage_gaps": { "passed": true, "high": 0, "medium": 3, "low": 5 },
|
|
159
|
-
"wiring": { "passed": true, "orphans": 0, "stubs": 0 },
|
|
160
|
-
"e2e": { "passed": true, "skipped": false },
|
|
161
|
-
"performance": { "passed": true, "lcp": 1.8, "inp": 150, "cls": 0.05 },
|
|
162
|
-
"security": { "passed": true, "critical": 0, "high": 0, "medium": 2 }
|
|
73
|
+
"feedback_loop": {
|
|
74
|
+
"command": "<exact command>",
|
|
75
|
+
"expected_red": "<failure contract or not-applicable reason>",
|
|
76
|
+
"observed_red": true,
|
|
77
|
+
"observed_green": true,
|
|
78
|
+
"deterministic": true
|
|
163
79
|
},
|
|
164
|
-
"
|
|
80
|
+
"public_seams": ["<verified seam>"],
|
|
81
|
+
"checks": [],
|
|
82
|
+
"blocking_issues": [],
|
|
83
|
+
"commands": []
|
|
165
84
|
}
|
|
166
85
|
```
|
|
167
86
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
- `blocking_issues` lists human-readable strings for any fail
|
|
172
|
-
- `commands` records exact executable evidence; prose such as “tests look good”
|
|
173
|
-
is not convergence evidence
|
|
174
|
-
- when a continuous change is active, `change_id` must match it; never reuse a
|
|
175
|
-
report from another change
|
|
176
|
-
|
|
177
|
-
### Step 8 — Report
|
|
178
|
-
|
|
179
|
-
Print a compact summary (emoji-free, ≤20 lines). Suggest `/ultra-deliver` only
|
|
180
|
-
when `passed=true`.
|
|
181
|
-
|
|
182
|
-
## Quality Gates — summary
|
|
183
|
-
|
|
184
|
-
| Gate | Requirement |
|
|
185
|
-
|------|-------------|
|
|
186
|
-
| Anti-Pattern | 0 critical |
|
|
187
|
-
| Coverage Gaps | 0 HIGH |
|
|
188
|
-
| Wiring | 0 HIGH orphan, 0 HIGH stub |
|
|
189
|
-
| E2E | all flows pass (if applicable) |
|
|
190
|
-
| Performance | all Core Web Vitals (if frontend) |
|
|
191
|
-
| Security | 0 critical/high |
|
|
192
|
-
|
|
193
|
-
## MCP failure matrix
|
|
194
|
-
|
|
195
|
-
| Purpose | MCP tool | CLI fallback |
|
|
196
|
-
|---------|----------|--------------|
|
|
197
|
-
| Confirm ≥1 completed task | `task.list { status: "completed" }` | none; fail closed |
|
|
198
|
-
| Identify active change | `change.list` | none; omit only for initial baseline delivery |
|
|
199
|
-
| Confirm risky auto-fix | none | current Host's native user-interaction surface |
|
|
200
|
-
|
|
201
|
-
## What this skill DOES NOT do
|
|
202
|
-
|
|
203
|
-
- Does NOT run unit tests (that is `/ultra-dev`)
|
|
204
|
-
- Does NOT mutate state.db (auditing is read-only against state)
|
|
205
|
-
- Does NOT release or tag (that is `/ultra-deliver`)
|
|
87
|
+
Set `passed=true` only when every required check passes, the report HEAD is current,
|
|
88
|
+
and at least one public seam is verified. Preserve exact commands, exit results, and
|
|
89
|
+
concise failure excerpts; do not paste full logs.
|
|
206
90
|
|
|
207
|
-
##
|
|
91
|
+
## Exit
|
|
208
92
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
| **Input** | Source + test files, state.db (read-only) |
|
|
212
|
-
| **Output** | `.ultra/test-report.json` with exact commands/change id, `.ultra/docs/test-coverage-gaps.md` |
|
|
213
|
-
| **Next** | `/ultra-deliver` (only when `passed=true`) |
|
|
93
|
+
Call `change.breadcrumb` and route one next action: fix a named blocker, run
|
|
94
|
+
`/ultra-review all`, or run `/ultra-deliver`. A stale report never routes to delivery.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-think
|
|
3
3
|
description: "Deep analysis with adversarial reasoning — Evidence-First + Multi-Perspective + Steel-Man + Pre-Mortem + Sensitivity. Produces a recommendation with confidence bounds."
|
|
4
|
+
user-invocable: true
|
|
4
5
|
runtime: all
|
|
5
6
|
cli_fallback: "direct user interaction"
|
|
6
7
|
---
|
package/spec/cli-protocol.md
CHANGED
|
@@ -105,6 +105,9 @@ as a fallback unless `ultra-tools <family> --help` lists it.
|
|
|
105
105
|
| `change.get` | `change get` | 9 | any |
|
|
106
106
|
| `change.list` | `change list` | 9 | any |
|
|
107
107
|
| `change.context` | `change context` | 9 | mcp |
|
|
108
|
+
| `change.breadcrumb` | `change breadcrumb` | 10 | any |
|
|
109
|
+
| `change.learning_propose` | `change learning-propose` | 10 | mcp |
|
|
110
|
+
| `change.learning_resolve` | `change learning-resolve` | 10 | mcp |
|
|
108
111
|
| `change.converge` | `change converge` | 9 | mcp |
|
|
109
112
|
| `change.archive` | `change archive` | 9 | mcp |
|
|
110
113
|
| `system.doctor` | `system doctor` | 9 | mcp |
|