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.
Files changed (61) hide show
  1. package/CHANGELOG.md +79 -1
  2. package/README.md +45 -26
  3. package/adapters/_shared/codex-assets.cjs +38 -0
  4. package/adapters/_shared/handbook.cjs +10 -1
  5. package/adapters/_shared/path-rewrite.cjs +3 -0
  6. package/adapters/_shared/runtime-assets.cjs +3 -1
  7. package/adapters/_shared/tests/handbook.test.cjs +9 -1
  8. package/adapters/_shared/tests/path-rewrite.test.cjs +3 -1
  9. package/adapters/_shared/tests/runtime-assets.test.cjs +5 -1
  10. package/adapters/kimi.js +642 -0
  11. package/adapters/opencode.js +46 -17
  12. package/adapters/tests/claude.test.cjs +4 -1
  13. package/adapters/tests/codex.test.cjs +4 -3
  14. package/adapters/tests/kimi-hook.test.cjs +122 -0
  15. package/adapters/tests/kimi.test.cjs +259 -0
  16. package/adapters/tests/opencode.test.cjs +46 -3
  17. package/bin/handbook.js +2 -2
  18. package/bin/install.js +9 -4
  19. package/bin/orchestrator.js +1 -1
  20. package/docs/AGENT-CONTEXT.md +39 -15
  21. package/docs/ARCHITECTURE.md +35 -9
  22. package/docs/PLAN.zh-CN.md +5 -4
  23. package/docs/ROADMAP.md +8 -7
  24. package/docs/RUNTIME-COMPAT-MATRIX.md +110 -64
  25. package/docs/USER-HANDBOOK-CONTRACT.md +13 -3
  26. package/hooks/README.md +6 -4
  27. package/hooks/active_task_context.py +14 -0
  28. package/hooks/adapters/kimi.py +162 -0
  29. package/hooks/context_spine.py +218 -0
  30. package/hooks/health_check.py +1 -1
  31. package/hooks/workflow_context.py +16 -123
  32. package/hooks/workflow_resume.py +21 -0
  33. package/mcp-server/lib/change-workflow.cjs +89 -11
  34. package/mcp-server/lib/change-workflow.test.cjs +202 -7
  35. package/mcp-server/lib/context-spine.cjs +331 -0
  36. package/mcp-server/lib/context-spine.test.cjs +73 -0
  37. package/mcp-server/lib/spec-learning.cjs +191 -0
  38. package/mcp-server/lib/spec-learning.test.cjs +62 -0
  39. package/mcp-server/lib/state-db.cjs +149 -4
  40. package/mcp-server/lib/state-db.test.cjs +61 -0
  41. package/mcp-server/server.cjs +31 -1
  42. package/mcp-server/tests/db-ops.test.cjs +3 -3
  43. package/mcp-server/tests/init-project.test.cjs +2 -2
  44. package/mcp-server/tests/server-contract.test.cjs +74 -0
  45. package/mcp-server/tests/state-db.test.cjs +20 -3
  46. package/package.json +4 -2
  47. package/skills/learn/SKILL.md +1 -0
  48. package/skills/ultra-change/SKILL.md +91 -118
  49. package/skills/ultra-deliver/SKILL.md +93 -221
  50. package/skills/ultra-dev/SKILL.md +81 -310
  51. package/skills/ultra-doctor/SKILL.md +1 -0
  52. package/skills/ultra-init/SKILL.md +1 -0
  53. package/skills/ultra-plan/SKILL.md +72 -292
  54. package/skills/ultra-review/SKILL.md +79 -407
  55. package/skills/ultra-status/SKILL.md +55 -168
  56. package/skills/ultra-test/SKILL.md +64 -183
  57. package/skills/ultra-think/SKILL.md +1 -0
  58. package/spec/cli-protocol.md +3 -0
  59. package/spec/mcp-tools.yaml +136 -7
  60. package/spec/schemas/skill-manifest.schema.json +2 -2
  61. package/spec/schemas/state-db.sql +35 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,83 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.10.0] — 2026-07-18
11
+
12
+ ### Added
13
+
14
+ - Added Context Manifest v2 and a DB-derived Context Spine across planning,
15
+ implementation, checking, review, convergence, and recovery. Context snapshots
16
+ now carry role, gate, readiness blockers, bounded references and digests,
17
+ fresh-context budgets, a public seam, an exact verification command, and one
18
+ deterministic next action.
19
+ - Added `change.breadcrumb`, `change.learning_propose`, and
20
+ `change.learning_resolve`, advancing the live MCP contract to 32 tools and
21
+ `.ultra/state.db` to schema 10.0 with 16 tables.
22
+ - Added approval-gated specification-learning candidates. Proposed or approved
23
+ discoveries block convergence until rejected or applied to a declared baseline
24
+ target, and `change.get` exposes their authoritative state.
25
+ - Added independent `spec_fidelity` and `engineering_standards` review evidence,
26
+ plus public-seam and exact red/green signal fields for convergence.
27
+
28
+ ### Changed
29
+
30
+ - Rebuilt the daily harness around one status router, one highest-value alignment
31
+ question, fresh-context tracer bullets, explicit expand contracts, independent
32
+ check/review contexts, and convergence before release.
33
+ - Reduced the seven core execution workflow prompts from 1,922 to 758 lines and
34
+ added a 220-line ceiling for every public Ultra skill so host prompts cannot
35
+ silently accumulate duplicated procedure. All twelve public workflows are now
36
+ explicitly user-invocable; four rule skills remain agent-only.
37
+ - Session-start, pre-edit, and recovery hooks now share one read-only
38
+ `context_spine.py` helper and inject only the compact DB breadcrumb. Intent,
39
+ transcript, memory-provider, and graph-provider payloads never enter hook context.
40
+ - OpenCode now consumes the DB-generated Context Manifest v2 projection, strips
41
+ provider/intent content, and fails context readiness when its compiled HEAD
42
+ differs from the current repository.
43
+ - Updated Claude Code, Codex, OpenCode, and Kimi Code native renderings, managed
44
+ handbook blocks, MCP mapping, architecture, and compatibility documentation.
45
+
46
+ ### Fixed
47
+
48
+ - Prevented plan-role task context from becoming ready without an execution
49
+ contract, public seam, and verification command.
50
+ - Prevented breadcrumbs from reusing a snapshot after task state or git HEAD
51
+ changed, and made an explicitly missing change id fail closed.
52
+ - Added auditable 9.1 → 10.0 migration history while preserving existing runtime
53
+ rows, references, projections, and foreign-key integrity.
54
+ - Corrected hook conformance to package `context_spine.py` as an imported helper
55
+ without registering it as a duplicate lifecycle hook.
56
+
57
+ ## [0.9.0] — 2026-07-17
58
+
59
+ ### Added
60
+
61
+ - Added Kimi Code 0.26+ as a fourth native plugin host with namespaced commands,
62
+ twenty allowlisted skills including its session bootstrap, lifecycle hooks,
63
+ bundled review-worker prompt templates, native plugin registration, and
64
+ read-only install diagnostics.
65
+ - Added packed-package and live MCP conformance coverage for the Kimi-managed
66
+ plugin layout while preserving unrelated registry entries and `config.toml`.
67
+
68
+ ### Changed
69
+
70
+ - Advanced `.ultra/state.db` to schema `9.1` so Kimi is a valid runtime for
71
+ events and sessions. Existing databases rebuild only the constrained tables
72
+ transactionally while preserving rows, foreign keys, telemetry, incidents,
73
+ and migration history.
74
+ - Extended CLI, handbook, orchestrator runtime selection, package metadata, and
75
+ runtime compatibility documentation to include Kimi without reintroducing
76
+ Ultra-owned memory, graph, browser, deployment, or framework capabilities.
77
+
78
+ ### Fixed
79
+
80
+ - Made the Kimi MCP launcher recover the active project from the inherited
81
+ working-directory contract even though Kimi starts plugin MCP processes from
82
+ the managed plugin root. It fails closed instead of creating `.ultra` inside
83
+ the installed plugin.
84
+ - Avoided Kimi's embedded Node native-module ABI mismatch by launching the
85
+ bundled MCP with the installer-compatible Node executable from `PATH`.
86
+
10
87
  ## [0.8.1] — 2026-07-17
11
88
 
12
89
  ### Fixed
@@ -332,7 +409,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
332
409
  skill manifest, CLI protocol + mapping table; 5 spec validators.
333
410
  - **Phase 0 — skeleton**: multi-runtime installer scaffolding.
334
411
 
335
- [Unreleased]: https://github.com/rocky2431/ultra-builder-pro-cli/compare/v0.8.1...HEAD
412
+ [Unreleased]: https://github.com/rocky2431/ultra-builder-pro-cli/compare/v0.9.0...HEAD
413
+ [0.9.0]: https://github.com/rocky2431/ultra-builder-pro-cli/compare/v0.8.1...v0.9.0
336
414
  [0.8.1]: https://github.com/rocky2431/ultra-builder-pro-cli/compare/v0.8.0...v0.8.1
337
415
  [0.8.0]: https://github.com/rocky2431/ultra-builder-pro-cli/compare/v0.7.0...v0.8.0
338
416
  [0.7.0]: https://github.com/rocky2431/ultra-builder-pro-cli/compare/v0.6.0...v0.7.0
package/README.md CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  Multi-runtime plugin suite + autonomous coding factory for the Ultra Builder Pro
4
4
  agent engineering system. It ships native plugins for **Claude Code · OpenCode ·
5
- Codex** and orchestrates PRD →
5
+ Codex · Kimi Code** and orchestrates PRD →
6
6
  dependency graph → parallel session execution → auto-merge with a single
7
7
  authoritative `.ultra/state.db`.
8
8
 
9
9
  <div align="center">
10
10
 
11
- [![Version](https://img.shields.io/badge/version-0.8.1-blue)](./CHANGELOG.md)
11
+ [![Version](https://img.shields.io/badge/version-0.10.0-blue)](./CHANGELOG.md)
12
12
  [![Tests](https://img.shields.io/badge/tests-passing-brightgreen)](#verification)
13
13
  [![License: MIT](https://img.shields.io/badge/license-MIT-green)](./LICENSE)
14
14
  [![Node](https://img.shields.io/badge/node-%E2%89%A522-informational)](./package.json)
@@ -21,8 +21,9 @@ authoritative `.ultra/state.db`.
21
21
 
22
22
  ## What it does
23
23
 
24
- - **Builds host-native plugins from one allowlist.** Claude Code, OpenCode, and
25
- Codex receive their own command/skill, agent, hook, and MCP representation.
24
+ - **Builds host-native plugins from one allowlist.** Claude Code, OpenCode,
25
+ Codex, and Kimi Code receive their own command/skill, agent, hook, and MCP
26
+ representation.
26
27
  Install and uninstall are symmetric on every supported host; `ubp --doctor`
27
28
  verifies the installed asset hashes and host entry points without mutation.
28
29
  - **Shares state across runtimes.** `.ultra/state.db` (SQLite + WAL) is the
@@ -35,8 +36,10 @@ authoritative `.ultra/state.db`.
35
36
  - **Runs real PRDs end-to-end.** `task.parse_prd` → `lib/topo.cjs` waves →
36
37
  `.ultra/execution-plan.json` → parallel worktree sessions → auto-merge back.
37
38
  - **Keeps daily work convergent.** `/ultra-change` creates a bounded delta and
38
- context manifest; `/ultra-deliver` requires docs/test/review evidence and
39
- baseline reconciliation before archive. `/ultra-doctor` reports incidents,
39
+ Context Manifest v2; the Context Spine assigns a role/gate, verifies required
40
+ references and fresh-context budget, exposes one DB-derived breadcrumb, and
41
+ routes a single next action. `/ultra-deliver` requires applied specification
42
+ learning plus docs/test/two-axis review evidence before archive. `/ultra-doctor` reports incidents,
40
43
  projection lag, orphan sessions, and backup-first mechanical recovery.
41
44
  Incident changes additionally require a five-section `diagnosis.md` covering
42
45
  reproduction, hypotheses, root cause, regression test, and recovery.
@@ -51,12 +54,14 @@ authoritative `.ultra/state.db`.
51
54
  npx ultra-builder-pro-cli --claude --local
52
55
  npx ultra-builder-pro-cli --opencode --local
53
56
  npx ultra-builder-pro-cli --codex --local
57
+ npx ultra-builder-pro-cli --kimi --local
54
58
 
55
59
  # Or blanket-install to every supported runtime you have
56
60
  npx ultra-builder-pro-cli --all --local
57
61
 
58
62
  # Global (into the runtime's ~/.config-style dir)
59
63
  npx ultra-builder-pro-cli --claude --global
64
+ npx ultra-builder-pro-cli --kimi --global
60
65
 
61
66
  # Uninstall (symmetric)
62
67
  npx ultra-builder-pro-cli --all --local --uninstall
@@ -70,7 +75,10 @@ After install, start a new host session/task and point it at the project.
70
75
  Claude Code and OpenCode expose native command forms. Codex exposes the same workflows as namespaced plugin
71
76
  skills such as `$ultra-builder-pro:ultra-init`, `$ultra-builder-pro:ultra-plan`,
72
77
  and `$ultra-builder-pro:ultra-dev`; `command-map.json` records the eleven legacy
73
- command mappings (`ultra-review` remains a directly invocable skill).
78
+ command mappings (`ultra-review` remains a directly invocable skill). Kimi Code
79
+ uses native namespaced commands such as `/ultra-builder-pro:ultra-init` and
80
+ `/ultra-builder-pro:ultra-plan`; run `/reload` or start a new Kimi session after
81
+ install or update.
74
82
  See [`docs/RUNTIME-COMPAT-MATRIX.md`](./docs/RUNTIME-COMPAT-MATRIX.md)
75
83
  for per-runtime capabilities.
76
84
 
@@ -85,26 +93,27 @@ for per-runtime capabilities.
85
93
  The layers share one `.ultra/state.db`, but the CLI is not a mirror of every MCP
86
94
  tool: continuous change mutations are MCP-only and fail closed. See
87
95
  [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md) for the full contract and
88
- [`spec/cli-protocol.md`](./spec/cli-protocol.md) for the 29 live contracts.
96
+ [`spec/cli-protocol.md`](./spec/cli-protocol.md) for the 32 live contracts.
89
97
  Review, impact discovery, skill resolution, and user interaction stay on each
90
98
  Host's native surfaces; the generated Codex capability map documents those
91
99
  replacements without advertising non-existent MCP tools.
92
100
 
93
101
  The package boundary is deliberate: twelve public Ultra workflow skills, four
94
- internal review-rule skills, and host-specific collaboration companions. Browser,
95
- deployment, skill-discovery, and framework guidance belong to their original plugins.
102
+ internal review-rule skills, host-specific collaboration companions, and the
103
+ minimal host bootstrap required by Kimi. Browser, deployment, skill-discovery,
104
+ and framework guidance belong to their original plugins.
96
105
 
97
106
  ## Runtime capability matrix
98
107
 
99
- | Feature | Claude Code | OpenCode | Codex CLI |
100
- |------------------------------|:-----------:|:--------:|:---------:|
101
- | Custom commands | ✅ | ✅ | ✅ |
102
- | Skill loader | ✅ | ✅ | ✅ (personal plugin) |
103
- | MCP server (stdio) | ✅ | ✅ | ✅ (plugin `.mcp.json`) |
104
- | Workflow hooks | ✅ (native plugin) | ✅ (native JS plugin) | ✅ (native plugin) |
105
- | Sub-agents | ✅ | ✅ | ✅ (9 native TOML agents) |
106
- | Session worktree isolation | ✅ (driven by `orchestrator/session-runner.cjs`) | ✅ | ✅ |
107
- | Parallel dispatch + auto-merge | ✅ (`ubp-orchestrator run`) | ✅ | ✅ |
108
+ | Feature | Claude Code | OpenCode | Codex CLI | Kimi Code 0.26+ |
109
+ |------------------------------|:-----------:|:--------:|:---------:|:---------------:|
110
+ | Custom commands | ✅ | ✅ | ✅ | ✅ (namespaced) |
111
+ | Skill loader | ✅ | ✅ | ✅ (personal plugin) | ✅ (native plugin) |
112
+ | MCP server (stdio) | ✅ | ✅ | ✅ (plugin `.mcp.json`) | ✅ (`mcpServers`) |
113
+ | Workflow hooks | ✅ (native plugin) | ✅ (native JS plugin) | ✅ (native plugin) | ✅ with documented compact limitation |
114
+ | Sub-agents | ✅ | ✅ | ✅ (9 native TOML agents) | ✅ via `Agent` / `AgentSwarm` prompt templates |
115
+ | Session worktree isolation | ✅ (driven by `orchestrator/session-runner.cjs`) | ✅ | ✅ | ✅ |
116
+ | Parallel dispatch + auto-merge | ✅ (`ubp-orchestrator run`) | ✅ | ✅ | ✅ |
108
117
 
109
118
  Full details in [`docs/RUNTIME-COMPAT-MATRIX.md`](./docs/RUNTIME-COMPAT-MATRIX.md)
110
119
  (10 sections, with per-runtime deviations called out).
@@ -130,15 +139,19 @@ ultra-tools system doctor
130
139
 
131
140
  Or let the skills drive it. In Codex, invoke
132
141
  `$ultra-builder-pro:ultra-plan` → `$ultra-builder-pro:ultra-dev` →
133
- `$ultra-builder-pro:ultra-status`; after the baseline is delivered, daily work
134
- starts with `$ultra-builder-pro:ultra-change`. Other runtimes retain their
135
- native command form.
142
+ `$ultra-builder-pro:ultra-test` → `$ultra-builder-pro:ultra-review` →
143
+ `$ultra-builder-pro:ultra-deliver`; after the baseline is delivered, daily work
144
+ starts with `$ultra-builder-pro:ultra-change`, while
145
+ `$ultra-builder-pro:ultra-status` reads the compact authoritative breadcrumb.
146
+ Kimi uses the corresponding
147
+ `/ultra-builder-pro:ultra-*` namespace. Other runtimes retain their native
148
+ command form.
136
149
 
137
150
  ## CLI surface
138
151
 
139
152
  | Binary | Purpose |
140
153
  |--------|---------|
141
- | `ultra-builder-pro-cli` / `ubp` | Installer — `--claude / --opencode / --codex / --all`, `--local / --global`, `--uninstall`; read-only install checks via `--doctor [--json]` |
154
+ | `ultra-builder-pro-cli` / `ubp` | Installer — `--claude / --opencode / --codex / --kimi / --all`, `--local / --global`, `--uninstall`; read-only install checks via `--doctor [--json]` |
142
155
  | `ubp-orchestrator` | Session dispatch daemon — `run`, `start`, `stop`, `status` |
143
156
  | `ultra-tools` | State-layer CLI — `task`, `session`, `status`, `db`, `migrate`; explicit `legacy-memory` archive/prune migration |
144
157
  | `ubp-handbook` | Preview/apply the managed Ultra contract in `CLAUDE.md` / `AGENTS.md`, with backup |
@@ -168,10 +181,16 @@ Individual suites: `test:state`, `test:orch`, `test:spec`, `test:rest`.
168
181
  and `node -e "require('./orchestrator/worktree-manager.cjs').releaseAll(process.cwd())"`
169
182
  cleans them up.
170
183
  - **Installed commands don't show up**: check the runtime's actual config
171
- dir (`ultra-builder-pro-cli --<runtime> --local` only writes to `./.claude`
172
- or `./.opencode` etc.; `--global` writes to the user-level dir). The
184
+ dir (`ultra-builder-pro-cli --<runtime> --local` writes to the host-specific
185
+ project dir such as `./.claude`, `./.opencode`, or `./.kimi-code`;
186
+ `--global` writes to the user-level dir). The
173
187
  install log prints the exact target path. Restart Claude Code/OpenCode or
174
- start a new Codex task after changing an installed plugin.
188
+ start a new Codex task after changing an installed plugin. In Kimi Code,
189
+ run `/reload` or start a new session.
190
+ - **Kimi MCP reports a native-module ABI error**: Kimi 0.26/0.27 embeds a different
191
+ Node ABI from the package installer. The generated plugin intentionally runs
192
+ the MCP with `env node`; keep a Node.js `>=22` executable on `PATH` when
193
+ starting Kimi.
175
194
  - **Installed hook/MCP path is missing or stale**: run
176
195
  `npx ultra-builder-pro-cli --<runtime> --local --doctor` first. It compares
177
196
  the recorded install provenance with current asset hashes and validates the
@@ -467,6 +467,16 @@ and does not require an interactive MCP or legacy CLI menu.
467
467
  }
468
468
 
469
469
  if (skillName === 'ultra-review') {
470
+ text = text.replace(
471
+ '# $ultra-builder-pro:ultra-review - Ultra Review System',
472
+ `# $ultra-builder-pro:ultra-review - Ultra Review System
473
+
474
+ ## Codex native worker contract
475
+
476
+ Use the installed native Codex custom agents as bounded review workers. Dispatch independent
477
+ workers concurrently, keep the current Codex task primary, and treat their JSON artifacts—not
478
+ their conversational transcripts—as review evidence.`,
479
+ );
470
480
  text = text.replaceAll('### Phase 3: Background Execution', '### Phase 3: Parallel Native Agent Execution');
471
481
  text = text.replaceAll('**Step 4b: Launch coordinator in background:**', '**Step 4b: Delegate coordination:**');
472
482
  text = text.replaceAll('in **background mode** (`native parallel execution`)', 'concurrently with native Codex subagent orchestration');
@@ -802,11 +812,39 @@ function buildMcpRuntime(repoRoot, pluginRoot, { runtime = 'codex' } = {}) {
802
812
  removeTree(cliBuildRoot);
803
813
  }
804
814
 
815
+ const runtimeBootstrap = runtime === 'kimi' ? `
816
+ const fs = require('node:fs');
817
+ const pluginRoot = path.resolve(__dirname, '..');
818
+
819
+ function usableProjectRoot(value) {
820
+ if (typeof value !== 'string' || !value.trim()) return null;
821
+ const candidate = path.resolve(value);
822
+ if (candidate === pluginRoot || candidate.startsWith(pluginRoot + path.sep)) return null;
823
+ try {
824
+ return fs.statSync(candidate).isDirectory() ? candidate : null;
825
+ } catch (_) {
826
+ return null;
827
+ }
828
+ }
829
+
830
+ if (!process.env.UBP_ROOT_DIR) {
831
+ const rootDir = usableProjectRoot(process.cwd()) || usableProjectRoot(process.env.PWD);
832
+ if (!rootDir) {
833
+ throw new Error('Kimi Ultra MCP could not resolve the active project root; start Kimi from the project directory');
834
+ }
835
+ process.env.UBP_ROOT_DIR = rootDir;
836
+ }
837
+ if (!process.env.UBP_DB_PATH) {
838
+ process.env.UBP_DB_PATH = path.join(process.env.UBP_ROOT_DIR, '.ultra', 'state.db');
839
+ }
840
+ ` : '';
841
+
805
842
  const launcher = `'use strict';
806
843
 
807
844
  const path = require('node:path');
808
845
 
809
846
  process.env.UBP_RUNTIME_ROOT = path.resolve(__dirname, '..');
847
+ ${runtimeBootstrap}
810
848
 
811
849
  const { main } = require('./index.cjs');
812
850
 
@@ -32,6 +32,13 @@ const HOSTS = Object.freeze({
32
32
  collaboration: '`/cc-collab` and `/codex-collab` are explicitly requested read-only advisors',
33
33
  coordination: 'OpenCode session coordination does not replace Ultra task state',
34
34
  }),
35
+ kimi: Object.freeze({
36
+ name: 'Kimi Code',
37
+ handbook: ['.kimi-code', 'AGENTS.md'],
38
+ invocation: '`/ultra-builder-pro:ultra-init`, `/ultra-builder-pro:ultra-research`, `/ultra-builder-pro:ultra-plan`, `/ultra-builder-pro:ultra-change`, `/ultra-builder-pro:ultra-dev`, `/ultra-builder-pro:ultra-test`, `/ultra-builder-pro:ultra-review`, and `/ultra-builder-pro:ultra-deliver`; diagnostics use `/ultra-builder-pro:ultra-status`, `/ultra-builder-pro:ultra-think`, and `/ultra-builder-pro:ultra-doctor`',
39
+ collaboration: '`/skill:cc-collab` and `/skill:codex-collab` are explicitly requested read-only advisors',
40
+ coordination: 'Kimi `TodoList` and `Agent` / `AgentSwarm` are host coordination; they do not replace Ultra task state',
41
+ }),
35
42
  });
36
43
 
37
44
  function host(runtime) {
@@ -53,11 +60,13 @@ function renderHandbook(runtime) {
53
60
  `- Collaboration boundary: ${value.collaboration}. The current host remains primary and owns final verification.`,
54
61
  `- Coordination boundary: ${value.coordination}.`,
55
62
  '- Authority: `.ultra/state.db` is the only durable Ultra authority for changes, tasks, sessions, events, incidents, projection state, telemetry, and review evidence. Generated JSON and Markdown are projections or workflow artifacts.',
63
+ '- Context Spine boundary: `change.context` compiles role/gate readiness, bounded references, fresh-context budget, public seam, verification command, and one next action. Hooks inject only the DB-derived `change.breadcrumb`; stale or blocked context must be recompiled.',
64
+ '- Specification learning boundary: stable implementation discoveries use approval-gated propose/approve-or-reject/apply transitions. Unresolved learning blocks convergence; review requires independent specification-fidelity and engineering-standards evidence.',
56
65
  '- Memory and graph boundary: Ultra Builder Pro does not capture prompts, transcripts, observations, summaries, cross-session memory, or code-graph content. Separately installed providers own that data; Ultra may store only their metadata references in a change context manifest.',
57
66
  '- Hook boundary: Ultra hooks observe workflow/change lifecycle only. Health/context may run when `.ultra/state.db` exists; projection protection is always authoritative, while edit/compact/stop/subagent enforcement remains active-workflow scoped. Generic command blocking and post-edit policy stay in user or repository governance.',
58
67
  '- Installation boundary: `ubp --doctor` is the read-only authority for installed asset provenance, content hashes, and host entry-point wiring; `system.doctor` remains scoped to project state and workflow recovery.',
59
68
  '- Agent boundary: the bundled review and debugging agents are bounded workers. They use the current checkout and parent-supplied context, do not own private persistent state, and never replace the primary agent.',
60
- '- Package boundary: only the twelve Ultra workflows, four internal review-rule skills, and host-specific collaboration companions belong to this plugin. General browser, deployment, discovery, and framework skills must be installed from their owners.',
69
+ '- Package boundary: only the twelve Ultra workflows, four internal review-rule skills, host-specific collaboration companions, and the minimal host bootstrap belong to this plugin. General browser, deployment, discovery, and framework skills must be installed from their owners.',
61
70
  END_MARKER,
62
71
  ].join('\n');
63
72
  }
@@ -14,6 +14,7 @@ const RUNTIME_SKILL_ROOT = {
14
14
  claude: '.claude/skills',
15
15
  opencode: '.config/opencode/skills',
16
16
  codex: '.agents/skills',
17
+ kimi: '.kimi-code/skills',
17
18
  };
18
19
 
19
20
  function parseSkillRef(ref) {
@@ -51,6 +52,7 @@ function runtimeRoot(runtime) {
51
52
  case 'claude': return '.claude';
52
53
  case 'opencode': return '.config/opencode';
53
54
  case 'codex': return '.agents';
55
+ case 'kimi': return '.kimi-code';
54
56
  default: throw new Error(`unknown runtime: ${runtime}`);
55
57
  }
56
58
  }
@@ -60,6 +62,7 @@ function localRoot(runtime) {
60
62
  case 'claude': return '.claude';
61
63
  case 'opencode': return '.opencode';
62
64
  case 'codex': return '.agents';
65
+ case 'kimi': return '.kimi-code';
63
66
  default: throw new Error(`unknown runtime: ${runtime}`);
64
67
  }
65
68
  }
@@ -29,12 +29,13 @@ const INTERNAL_AGENT_SKILLS = Object.freeze([
29
29
  'testing-rules',
30
30
  ]);
31
31
 
32
- const SUPPORTED_RUNTIMES = Object.freeze(['claude', 'opencode', 'codex']);
32
+ const SUPPORTED_RUNTIMES = Object.freeze(['claude', 'opencode', 'codex', 'kimi']);
33
33
 
34
34
  const COLLAB_SKILLS_BY_RUNTIME = Object.freeze({
35
35
  claude: Object.freeze(['codex-collab', 'ultra-verify']),
36
36
  codex: Object.freeze(['cc-collab', 'ultra-verify']),
37
37
  opencode: Object.freeze(['cc-collab', 'codex-collab', 'ultra-verify']),
38
+ kimi: Object.freeze(['cc-collab', 'codex-collab', 'ultra-verify']),
38
39
  });
39
40
 
40
41
  const RETIRED_SKILLS = Object.freeze([
@@ -49,6 +50,7 @@ const RETIRED_SKILLS = Object.freeze([
49
50
 
50
51
  const WORKFLOW_HOOK_FILES = Object.freeze([
51
52
  'active_task_context.py',
53
+ 'context_spine.py',
52
54
  'health_check.py',
53
55
  'pre_stop_check.py',
54
56
  'subagent_tracker.py',
@@ -19,16 +19,23 @@ test('renders one common contract with host-native invocation syntax', () => {
19
19
  const claude = renderHandbook('claude');
20
20
  const codex = renderHandbook('codex');
21
21
  const opencode = renderHandbook('opencode');
22
+ const kimi = renderHandbook('kimi');
22
23
 
23
24
  assert.match(claude, /\/ultra-plan/);
24
25
  assert.match(codex, /\$ultra-builder-pro:ultra-plan/);
25
26
  assert.match(opencode, /\/ultra-plan/);
26
- for (const rendered of [claude, codex, opencode]) {
27
+ assert.match(kimi, /\/ultra-builder-pro:ultra-plan/);
28
+ assert.match(kimi, /Kimi Code/);
29
+ assert.match(kimi, /AgentSwarm/);
30
+ for (const rendered of [claude, codex, opencode, kimi]) {
27
31
  assert.match(rendered, /\.ultra\/state\.db/);
28
32
  assert.match(rendered, /Separately installed providers/);
29
33
  assert.match(rendered, /ultra-change/);
30
34
  assert.match(rendered, /ultra-doctor/);
31
35
  assert.match(rendered, /metadata references/);
36
+ assert.match(rendered, /Context Spine boundary/);
37
+ assert.match(rendered, /change\.breadcrumb/);
38
+ assert.match(rendered, /Specification learning boundary/);
32
39
  assert.doesNotMatch(rendered, /\.ultra\/memory|memory\.retain|memory\.recall/);
33
40
  assert.match(rendered, new RegExp(BEGIN_MARKER.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
34
41
  assert.match(rendered, new RegExp(END_MARKER.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
@@ -86,4 +93,5 @@ test('default handbook paths are host-specific', () => {
86
93
  assert.equal(resolveHandbookFile('claude', { homeDir }), path.join(homeDir, '.claude', 'CLAUDE.md'));
87
94
  assert.equal(resolveHandbookFile('codex', { homeDir }), path.join(homeDir, '.codex', 'AGENTS.md'));
88
95
  assert.equal(resolveHandbookFile('opencode', { homeDir }), path.join(homeDir, '.config', 'opencode', 'AGENTS.md'));
96
+ assert.equal(resolveHandbookFile('kimi', { homeDir }), path.join(homeDir, '.kimi-code', 'AGENTS.md'));
89
97
  });
@@ -26,10 +26,12 @@ test('resolveSkillRef routes to runtime-specific root under homeDir', () => {
26
26
  const claude = resolveSkillRef('@skills/ultra-init/SKILL.md', { runtime: 'claude', homeDir: home });
27
27
  const opencode = resolveSkillRef('@skills/ultra-init/SKILL.md', { runtime: 'opencode', homeDir: home });
28
28
  const codex = resolveSkillRef('@skills/ultra-init/SKILL.md', { runtime: 'codex', homeDir: home });
29
+ const kimi = resolveSkillRef('@skills/ultra-init/SKILL.md', { runtime: 'kimi', homeDir: home });
29
30
 
30
31
  assert.equal(claude, path.join(home, '.claude/skills/ultra-init/SKILL.md'));
31
32
  assert.equal(opencode, path.join(home, '.config/opencode/skills/ultra-init/SKILL.md'));
32
33
  assert.equal(codex, path.join(home, '.agents/skills/ultra-init/SKILL.md'));
34
+ assert.equal(kimi, path.join(home, '.kimi-code/skills/ultra-init/SKILL.md'));
33
35
 
34
36
  assert.throws(
35
37
  () => resolveSkillRef('@skills/ultra-init/SKILL.md', { runtime: 'unknown', homeDir: home }),
@@ -45,7 +47,7 @@ test('rewriteWorkflowRefInText + resolveAssetTarget give predictable paths', ()
45
47
  assert.equal(out, `see ${path.join(home, '.claude/skills/ultra-init/SKILL.md')} for details`);
46
48
 
47
49
  // Cover every runtime × every scope so runtimeRoot/localRoot branches hit
48
- for (const rt of ['claude', 'opencode', 'codex']) {
50
+ for (const rt of ['claude', 'opencode', 'codex', 'kimi']) {
49
51
  const g = resolveAssetTarget('x', { runtime: rt, scope: 'global', homeDir: home, cwd });
50
52
  const l = resolveAssetTarget('x', { runtime: rt, scope: 'local', homeDir: home, cwd });
51
53
  assert.ok(g.startsWith(home));
@@ -62,7 +62,10 @@ test('runtime asset manifest exposes only Ultra-owned core and internal skills',
62
62
  assert.deepEqual(COLLAB_SKILLS_BY_RUNTIME.opencode, [
63
63
  'cc-collab', 'codex-collab', 'ultra-verify',
64
64
  ]);
65
- assert.deepEqual(SUPPORTED_RUNTIMES, ['claude', 'opencode', 'codex']);
65
+ assert.deepEqual(COLLAB_SKILLS_BY_RUNTIME.kimi, [
66
+ 'cc-collab', 'codex-collab', 'ultra-verify',
67
+ ]);
68
+ assert.deepEqual(SUPPORTED_RUNTIMES, ['claude', 'opencode', 'codex', 'kimi']);
66
69
 
67
70
  for (const runtime of SUPPORTED_RUNTIMES) {
68
71
  const names = skillsForRuntime(runtime);
@@ -80,6 +83,7 @@ test('code-review-expert and rule skills are internal, never implicitly exposed'
80
83
  test('workflow hook allowlist contains no memory, prompt capture, or generic policy hook', () => {
81
84
  assert.deepEqual(WORKFLOW_HOOK_FILES, [
82
85
  'active_task_context.py',
86
+ 'context_spine.py',
83
87
  'health_check.py',
84
88
  'pre_stop_check.py',
85
89
  'subagent_tracker.py',