@kontextmind/kxm 0.6.0 → 0.7.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 (117) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.kxm/agents/coordinator.yaml +9 -0
  3. package/.kxm/agents/critic-arch.yaml +13 -0
  4. package/.kxm/agents/critic-cli.yaml +13 -0
  5. package/.kxm/agents/implementer.yaml +13 -0
  6. package/.kxm/gates.yaml +8 -0
  7. package/.kxm/producers.yaml +22 -0
  8. package/.kxm/project.yaml +15 -0
  9. package/.kxm/roles/writer.yaml +5 -0
  10. package/.kxm/workflows/default.yaml +47 -0
  11. package/CHANGELOG.md +39 -7
  12. package/README.md +1 -0
  13. package/docs/README.md +2 -0
  14. package/docs/agent-skills.md +118 -0
  15. package/docs/architecture.md +1 -1
  16. package/docs/assignment-runner.md +21 -8
  17. package/docs/configuration.md +2 -2
  18. package/docs/kxm-handbook.md +3 -3
  19. package/docs/operator-pi-packages.md +63 -0
  20. package/docs/skills/repo-work-delivery.md +102 -0
  21. package/docs/test-matrix.md +4 -3
  22. package/docs/troubleshooting.md +19 -0
  23. package/docs/vnext/validation.md +9 -0
  24. package/docs/webhook-workflows.md +2 -2
  25. package/examples/README.md +1 -1
  26. package/package.json +16 -17
  27. package/plugins/kxm/.claude-plugin/plugin.json +1 -1
  28. package/plugins/kxm/README.md +1 -1
  29. package/plugins/kxm/dist/cli.js +6875 -3672
  30. package/plugins/kxm/dist/core.js +214 -34
  31. package/plugins/kxm/dist/extension.js +7721 -85
  32. package/plugins/kxm/dist/mcp-server.js +75 -21
  33. package/plugins/kxm/dist/runtime.js +5403 -1014
  34. package/plugins/kxm/dist/server.js +3008 -2268
  35. package/plugins/kxm/dist/vnext-runtime-supervisor.js +5751 -631
  36. package/plugins/kxm/package.json +1 -1
  37. package/plugins/kxm/skills/SUITE.md +5 -0
  38. package/plugins/kxm/skills/hints.json +73 -0
  39. package/plugins/kxm/skills/kxm/SKILL.md +30 -83
  40. package/plugins/kxm/skills/kxm-context-memory/SKILL.md +69 -0
  41. package/plugins/kxm/skills/kxm-definitions/SKILL.md +65 -0
  42. package/plugins/kxm/skills/kxm-harness-auth/SKILL.md +34 -0
  43. package/plugins/kxm/skills/kxm-harvest/SKILL.md +48 -0
  44. package/plugins/kxm/skills/kxm-hub-ops/SKILL.md +34 -0
  45. package/plugins/kxm/skills/kxm-insights/SKILL.md +48 -0
  46. package/plugins/kxm/skills/kxm-mind/SKILL.md +59 -0
  47. package/plugins/kxm/skills/kxm-peer/SKILL.md +110 -0
  48. package/plugins/kxm/skills/kxm-project-setup/SKILL.md +35 -0
  49. package/plugins/kxm/skills/kxm-projects/SKILL.md +43 -0
  50. package/plugins/kxm/skills/kxm-protocol/SKILL.md +66 -0
  51. package/plugins/kxm/skills/kxm-query/SKILL.md +45 -0
  52. package/plugins/kxm/skills/kxm-routing-improve/SKILL.md +30 -0
  53. package/plugins/kxm/skills/kxm-runs/SKILL.md +29 -0
  54. package/plugins/kxm/skills/kxm-setup/SKILL.md +55 -0
  55. package/plugins/kxm/skills/kxm-skill-lifecycle/SKILL.md +31 -0
  56. package/plugins/kxm/skills/kxm-tasks/SKILL.md +33 -0
  57. package/plugins/kxm/skills/kxm-triage/SKILL.md +47 -0
  58. package/plugins/kxm/skills/kxm-work/SKILL.md +44 -0
  59. package/plugins/kxm/skills/kxm-workflow/SKILL.md +45 -0
  60. package/plugins/kxm/src/autocomplete.ts +9 -3
  61. package/plugins/kxm/src/cli.ts +1077 -11
  62. package/plugins/kxm/src/commands.ts +150 -8
  63. package/plugins/kxm/src/config.ts +7 -4
  64. package/plugins/kxm/src/context-packet.ts +172 -0
  65. package/plugins/kxm/src/extension.ts +36 -1
  66. package/plugins/kxm/src/external-effects.ts +356 -7
  67. package/plugins/kxm/src/hub.ts +2 -4
  68. package/plugins/kxm/src/improve.ts +72 -0
  69. package/plugins/kxm/src/mcp-server.ts +1 -1
  70. package/plugins/kxm/src/model-inventory.ts +127 -0
  71. package/plugins/kxm/src/policy-draft.d.mts +55 -0
  72. package/plugins/kxm/src/policy-draft.mjs +565 -0
  73. package/plugins/kxm/src/price-calc.ts +17 -18
  74. package/plugins/kxm/src/prices.ts +32 -16
  75. package/plugins/kxm/src/producers.ts +71 -0
  76. package/plugins/kxm/src/restricted-yaml.d.mts +31 -0
  77. package/plugins/kxm/src/restricted-yaml.mjs +145 -0
  78. package/plugins/kxm/src/role.ts +375 -0
  79. package/plugins/kxm/src/routing.ts +99 -1
  80. package/plugins/kxm/src/session-work.ts +9 -2
  81. package/plugins/kxm/src/studio-layout.ts +660 -17
  82. package/plugins/kxm/src/suggest.ts +7 -13
  83. package/plugins/kxm/src/telemetry.ts +82 -0
  84. package/plugins/kxm/src/tui.ts +140 -0
  85. package/plugins/kxm/src/vnext-config.ts +15 -110
  86. package/plugins/kxm/src/vnext-engine.ts +198 -62
  87. package/plugins/kxm/src/vnext-harness.ts +263 -81
  88. package/plugins/kxm/src/vnext-oneshot-evidence.ts +85 -0
  89. package/plugins/kxm/src/vnext-oneshot-process.ts +149 -0
  90. package/plugins/kxm/src/vnext-oneshot-producer.ts +170 -233
  91. package/plugins/kxm/src/vnext-runtime-store.ts +35 -1
  92. package/plugins/kxm/src/vnext-runtime-supervisor.ts +120 -5
  93. package/plugins/kxm/src/vnext-runtime.ts +14 -0
  94. package/plugins/kxm/src/workflow-manager.ts +392 -0
  95. package/plugins/kxm/src/workflow-tui.ts +255 -0
  96. package/schemas/policy-draft/README.md +17 -0
  97. package/schemas/policy-draft/model.v2.schema.json +140 -0
  98. package/schemas/policy-draft/role.v2.schema.json +91 -0
  99. package/schemas/vnext/role.schema.json +76 -0
  100. package/schemas/vnext/run-event.schema.json +1 -0
  101. package/scripts/assignment-run.d.mts +1 -1
  102. package/scripts/assignment-run.mjs +44 -35
  103. package/scripts/check-generated.mjs +33 -9
  104. package/scripts/emit-codex-artifacts.mjs +255 -11
  105. package/scripts/harness-run.d.mts +12 -4
  106. package/scripts/harness-run.mjs +65 -17
  107. package/scripts/kxm-hub.mjs +6 -0
  108. package/scripts/native-critic.d.mts +5 -0
  109. package/scripts/native-critic.mjs +60 -0
  110. package/.kxm/config/README.md +0 -5
  111. package/.kxm/config/agents.json +0 -43
  112. package/.kxm/config/env.example +0 -56
  113. package/.kxm/config/update.example.yaml +0 -9
  114. package/.kxm/config/workflows/fix.json +0 -160
  115. package/.kxm/config/workflows/jira-development.json +0 -116
  116. package/.kxm/config/workflows/provenance-quorum.json +0 -150
  117. package/.kxm/config/workflows/v04-dogfood.json +0 -72
@@ -11,7 +11,7 @@
11
11
  "name": "kxm",
12
12
  "source": "./plugins/kxm",
13
13
  "description": "Durable workflows, peer agents, and kxm tui",
14
- "version": "0.6.0",
14
+ "version": "0.7.0",
15
15
  "category": "development",
16
16
  "tags": ["kxm", "multi-agent", "workflows", "mcp"]
17
17
  }
@@ -0,0 +1,9 @@
1
+ schema: kxm.agent.v1
2
+ purpose: Coordinate the pinned workflow and emit schema-validated commands.
3
+ tools:
4
+ preset: coordinator
5
+ defaultRepositoryAccess: read
6
+ repositories:
7
+ control: read
8
+ network: provider-only
9
+ resultSchema: kxm.assignment-result.v1
@@ -0,0 +1,13 @@
1
+ schema: kxm.agent.v1
2
+ purpose: Architecture critic for the approved workflow change.
3
+ harness: claude
4
+ model:
5
+ provider: anthropic
6
+ model: fable
7
+ tools:
8
+ preset: read-only
9
+ defaultRepositoryAccess: read
10
+ repositories:
11
+ control: read
12
+ network: provider-only
13
+ resultSchema: kxm.assignment-result.v1
@@ -0,0 +1,13 @@
1
+ schema: kxm.agent.v1
2
+ purpose: CLI and verification critic for the approved workflow change.
3
+ harness: codex
4
+ model:
5
+ provider: openai
6
+ model: gpt-5.6-sol
7
+ tools:
8
+ preset: read-only
9
+ defaultRepositoryAccess: read
10
+ repositories:
11
+ control: read
12
+ network: provider-only
13
+ resultSchema: kxm.assignment-result.v1
@@ -0,0 +1,13 @@
1
+ schema: kxm.agent.v1
2
+ purpose: Implement the approved change within the declared repository scope.
3
+ harness: grok
4
+ model:
5
+ provider: xai
6
+ model: grok-4.6
7
+ tools:
8
+ preset: workspace-writer
9
+ defaultRepositoryAccess: none
10
+ repositories:
11
+ control: write
12
+ network: provider-only
13
+ resultSchema: kxm.assignment-result.v1
@@ -0,0 +1,8 @@
1
+ schema: kxm.gate-registry.v1
2
+ gates:
3
+ test:
4
+ kind: command
5
+ argv:
6
+ - npm
7
+ - test
8
+ timeoutMs: 3600000
@@ -0,0 +1,22 @@
1
+ schema: kxm.producers.v1
2
+ updatedAt: 2026-09-10T17:30:00.000Z
3
+ promoted:
4
+ - anthropic/fable
5
+ - openai/gpt-5.6-sol
6
+ - xai/grok-4.6
7
+ - openrouter/qwen/qwen3-coder-plus
8
+ demoted: []
9
+ enabled:
10
+ - anthropic/fable
11
+ - openai/gpt-5.6-sol
12
+ - xai/grok-4.6
13
+ - openrouter/qwen/qwen3-coder-plus
14
+ disabled: []
15
+ roles:
16
+ implementer:
17
+ - xai/grok-4.6
18
+ - openrouter/qwen/qwen3-coder-plus
19
+ critic-arch:
20
+ - anthropic/fable
21
+ critic-cli:
22
+ - openai/gpt-5.6-sol
@@ -0,0 +1,15 @@
1
+ schema: kxm.project.v1
2
+ id: prj_kxm_project
3
+ name: KXM
4
+ defaultWorkflow: default
5
+ defaultExecutor: local
6
+ defaultHarness: pi
7
+ repositories:
8
+ - id: control
9
+ role: control
10
+ required: true
11
+ pathHint: .
12
+ workspace:
13
+ dirtySnapshot:
14
+ untracked: ask
15
+ dirtySubmodules: fail
@@ -0,0 +1,5 @@
1
+ schema: kxm.role.v1
2
+ id: writer
3
+ roster:
4
+ - model: openrouter/qwen/qwen3-coder-plus
5
+ enabled: true
@@ -0,0 +1,47 @@
1
+ schema: kxm.workflow.v1
2
+ description: Canonical 4-stage KXM delivery workflow
3
+ coordinator: coordinator
4
+ limits:
5
+ maxTransitions: 8
6
+ steps:
7
+ - id: implement
8
+ kind: agent
9
+ agent: implementer
10
+ maxAttempts: 3
11
+ on:
12
+ passed: review-arch
13
+ failed:
14
+ target: $terminal
15
+ terminalStatus: failed
16
+ - id: review-arch
17
+ kind: agent
18
+ agent: critic-arch
19
+ maxAttempts: 2
20
+ on:
21
+ passed: review-cli
22
+ failed:
23
+ target: implement
24
+ maxTransitions: 2
25
+ - id: review-cli
26
+ kind: agent
27
+ agent: critic-cli
28
+ maxAttempts: 2
29
+ on:
30
+ passed: verify
31
+ failed:
32
+ target: implement
33
+ maxTransitions: 2
34
+ - id: verify
35
+ kind: gate
36
+ gate: test
37
+ expect: pass
38
+ repositories:
39
+ control: write
40
+ maxAttempts: 2
41
+ on:
42
+ passed:
43
+ target: $terminal
44
+ terminalStatus: completed
45
+ failed:
46
+ target: implement
47
+ maxTransitions: 2
package/CHANGELOG.md CHANGED
@@ -4,15 +4,36 @@ All notable user-facing changes are documented here. The project follows [Semant
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.7.0 - 2026-09-11
8
+
7
9
  ### Added
8
10
 
9
- - **Public npm release automation unlatched (E7):** Unlatched `publish-npm` job
10
- in `.github/workflows/release.yml` with `environment: npm-publish`. Added
11
- `scripts/kxm-publish-npm.mjs` to enforce fail-closed verification: requires the
12
- GitHub release for the tag to be published (`draft: false`), validates the
13
- release asset presence and SHA-256 digest against the release manifest, and
14
- executes `npm publish --access public`. Added `publishConfig.access: "public"`
15
- in root `package.json` and unit test suite `test/core/kxm-publish-npm.test.ts`.
11
+ - **vNext Architecture Engine and Multi-Phase Isolation (Phases 0–4):**
12
+ - **Dead Route Brake (Phase 0):** Fails closed and asserts 404 on obsolete `/dispatch`
13
+ endpoint in supervisor API to eliminate legacy unmonitored dispatch routes.
14
+ - **Objective Propagation (Phase 1):** Propagates accepted run objectives into the producer
15
+ context packet with cryptographic SHA-256 hash validation against execution drift.
16
+ - **Dynamic Permission Ceilings (Phase 2):** Dynamically derives sandbox permissions from step
17
+ repository access declarations (`birthMember`), failing closed immediately on unauthorized
18
+ live write access outside declared repository scopes.
19
+ - **Pinned Route Admission & Roster Verification (Phase 3):** Strictly validates producer model
20
+ resolution (`step.model -> agent.model -> refuse`), enforcing model admission policies and role
21
+ roster alignment before birth.
22
+ - **Asynchronous Scheduler & Graceful Lifecycle (Phase 4):** Asynchronous `/drive` execution via
23
+ `VnextRunScheduler` returning `202 Accepted` with `/v1/runs/:id` poll endpoints, duplicate run
24
+ rejection (`409 Conflict`), and supervisor graceful shutdown that awaits active drives.
25
+ - **Oneshot Harness Isolation, Pricing Safety & Async Probes:**
26
+ - Standardized one-shot harness execution across Anthropic Claude, OpenAI Codex, Kimi, and Google AGY
27
+ with unmetered subscription vs metered cost separation, process stdin piping, and timeout protection.
28
+ - **Universal KontextMind Knowledge-Plane Skill Suite:**
29
+ - Portable, harness-agnostic skill suite under `.agents/skills/` including repository delivery skills,
30
+ context memory recall, and lifecycle governance.
31
+ - **Pi Workflow Progress TUI & Studio Dashboard:**
32
+ - Interactive Pi extension workflow progress terminal user interface with live status bars and web studio layout.
33
+ - **Public npm Release Automation Unlatched (E7):**
34
+ - Unlatched `publish-npm` job in `.github/workflows/release.yml` with `environment: npm-publish`.
35
+ - Added `scripts/kxm-publish-npm.mjs` verifying published GitHub release assets, digests, and
36
+ publishing to npm registry.
16
37
 
17
38
  ## 0.6.0 - 2026-09-08
18
39
 
@@ -109,6 +130,17 @@ All notable user-facing changes are documented here. The project follows [Semant
109
130
 
110
131
  ### Fixed
111
132
 
133
+ - **Windows Claude Code / npm shim detection (issue #168):** `kxm harness list`
134
+ treated Claude Code as `not_detected` when the CLI was only an npm
135
+ `claude.cmd` shim (no `claude.exe` on `PATH`). The probe now tries `.exe`,
136
+ then the allowlisted inner package `claude.exe` next to `claude.cmd`, then
137
+ `.cmd` on win32. Allowlisted `name.cmd` probes still use `shell: true` and
138
+ record `windows_shim` when that is what answered. Auth still requires
139
+ parseable `claude auth status`. Headless assignment (`just assign` /
140
+ `harness-run`) scans every PATH directory for `name.exe` before any `.cmd`
141
+ (so a user-bin `codex.cmd` cannot hide `codex.exe`), then unwraps the inner
142
+ npm `claude.exe` and Pi's `node.exe` plus `cli.js`, without running
143
+ unverified `.cmd` launchers through a shell.
112
144
  - Concurrent Runtime registry and event-store initialization now checks and
113
145
  creates the schema under one write transaction, preventing duplicate-table
114
146
  failures when a supervisor and status reader first open the same database.
package/README.md CHANGED
@@ -214,6 +214,7 @@ The hub routes messages; it does not merge contexts, choose tasks, or bypass too
214
214
  | Complete a Pi-to-Pi or Pi-to-Claude setup | [Getting started](docs/getting-started.md) |
215
215
  | Configure the hub or an agent | [Configuration reference](docs/configuration.md) |
216
216
  | Understand components and message flow | [Architecture](docs/architecture.md) |
217
+ | Learn about agent skills | [Agent Skills](docs/agent-skills.md) |
217
218
  | Run the hub responsibly | [Operations guide](docs/operations.md) |
218
219
  | Fix connection or delivery problems | [Troubleshooting](docs/troubleshooting.md) |
219
220
  | See which behaviors and examples are verified | [Test matrix](docs/test-matrix.md) |
package/docs/README.md CHANGED
@@ -8,6 +8,7 @@ This documentation is organized by task. Start with the guide that matches what
8
8
  | [Getting started](getting-started.md) | Pi and Claude Code users | Complete the first successful multi-agent exchange |
9
9
  | [Configuration](configuration.md) | Users and operators | Understand every supported setting and default |
10
10
  | [Architecture](architecture.md) | Maintainers and integrators | Learn the component boundaries and message lifecycle |
11
+ | [Agent Skills](agent-skills.md) | Users and integrators | Comprehensive skill suite covering all KXM commands with progressive disclosure |
11
12
  | [Operations](operations.md) | Hub operators | Run, monitor, secure, and recover the service |
12
13
  | [Troubleshooting](troubleshooting.md) | Everyone | Diagnose common installation and delivery failures |
13
14
  | [Test matrix](test-matrix.md) | Users and maintainers | Map features and use cases to automated evidence |
@@ -17,6 +18,7 @@ This documentation is organized by task. Start with the guide that matches what
17
18
  | [Workflow guide](workflow-guide.md) | Workflow designers and operators | Area -> Workflow -> Stage -> Role taxonomy with documentation slugs, dated research candidates, and selection policy |
18
19
  | [Agent Envelopes & Quality Gates](agent-communication-envelopes-and-gates.md) | Multi-agent workflow engineers | Production communication envelopes, quality gates, and work loops |
19
20
  | [Assignment runner](assignment-runner.md) | Maintainers and developers | Native developer assignments, deterministic witness verification, and multi-vendor dual-critic acceptance |
21
+ | [This host's Pi packages](operator-pi-packages.md) | Maintainers on this development host | Snapshot of operator `pi list` packages and file extensions; not a KXM install requirement |
20
22
  | [vNext contract package](vnext/README.md) | Maintainers and reviewers | Review the accepted local-first target architecture and implementation contracts |
21
23
 
22
24
  Project-level policies live at the repository root:
@@ -0,0 +1,118 @@
1
+ # KXM Agent Skills
2
+
3
+ This document describes the bundled KXM Agent Skills suite: focused skills
4
+ that cover current KXM top-level command groups. The suite documents the
5
+ existing CLI. It does **not** land unified YAML role/project/workflow
6
+ authority, admit new writers, or replace trusted `.kxm/roster.json` policy.
7
+
8
+ ## Feature-to-Skill Matrix
9
+
10
+ | Feature Area | Skill | Commands Covered | Purpose |
11
+ |---|---|---|---|
12
+ | Core Routing | `kxm` | — | Select the right suite skill; state universal safety rules and portable CLI convention |
13
+ | Project Setup | `kxm-project-setup` | `init`, `migrate`, `trust`, `config`, `completion` | Initialize, migrate, review permission changes, configure, and add shell completion |
14
+ | Harness & Auth | `kxm-harness-auth` | `harness`, `auth`, `update`, `runtime`, `agent` | Inspect authenticated harness capability and operate supported runtimes/workers |
15
+ | Hub Operations | `kxm-hub-ops` | `hub`, `backup`, `restore` | Run and protect the local hub and its durable SQLite state |
16
+ | Session Management | `kxm-session` | `session`, `dash`, `studio` | Resume/inspect operator work and use UI capabilities each harness supports |
17
+ | Peer Communication | `kxm-peer` | `peer` | Discover, send, poll/await, cancel, fan out, inbox, and reply safely |
18
+ | Workflow Management | `kxm-workflow` | `workflow`, `gate` | Operate webhook workflows, waits/signals, evidence checkpoints, provenance |
19
+ | Definitions | `kxm-definitions` | `role` | Manage role YAML through configuration commands; role edits do not grant trusted writer admission |
20
+ | Run Management | `kxm-runs` | `run`, `runs` | Create and inspect local vNext runs while preserving execution boundaries |
21
+ | Context & Memory | `kxm-context-memory` | `context`, `memory` | Query role-aware context and manage Git-authored memory proposals |
22
+ | Skill Lifecycle | `kxm-skill-lifecycle` | `skills` | Govern candidate/evaluate/promote/reject/verify lifecycle |
23
+ | Routing & Improve | `kxm-routing-improve` | `routing`, `improve` | Inspect real route quality/cost and propose reviewed improvements |
24
+ | Tasks & Goals | `kxm-tasks` | `suggest`, `goal`, `task` | Recommend workflows and manage goals/tasks with SCM/tracker boundaries |
25
+
26
+ ## Installation and Discovery
27
+
28
+ ### For Pi Users
29
+
30
+ Pi automatically discovers skills in the `pi.skills` section of `package.json`. The KXM skills are included in the standard distribution:
31
+
32
+ ```json
33
+ {
34
+ "pi.skills": [
35
+ "./plugins/kxm/skills"
36
+ ]
37
+ }
38
+ ```
39
+
40
+ ### For Claude Users
41
+
42
+ Claude plugins package the authored skills from `plugins/kxm/skills/` during the build process.
43
+
44
+ ### For Other Harnesses
45
+
46
+ Skills in `.agents/skills/` follow the standard agent skill format. Discovery
47
+ outside Pi and Claude remains harness-specific; do not assume every consumer
48
+ loads this mirror.
49
+
50
+ ## Progressive Disclosure Usage
51
+
52
+ 1. Start with the core `kxm` skill to choose a specialized skill.
53
+ 2. Use the named skill for that command group.
54
+ 3. Teach only verbs and options that exist in `kxm <group> --help`.
55
+
56
+ ### Example Usage Patterns
57
+
58
+ ```bash
59
+ kxm peer list --json
60
+ kxm peer send --target alice --content "Please review" --json
61
+ kxm workflow list --json
62
+ kxm workflow checkpoint run_123 stage_a passed "Completed stage A" --json
63
+ ```
64
+
65
+ ## Verified vs Unverified Harness Limits
66
+
67
+ ### Verified Harnesses
68
+
69
+ - **Pi**: Discovers `plugins/kxm/skills`
70
+ - **Claude**: Plugin packaging of the authored skills
71
+ - **Codex**: Consumes the generated `.agents/skills` mirror and AGENTS command block
72
+
73
+ ### Unverified Harnesses
74
+
75
+ The following harnesses have discovery claims that remain explicitly unverified:
76
+
77
+ - **Kimi**: `.agents/skills` consumer capability unverified
78
+ - **Copilot**: Integration capability unverified
79
+ - **OpenCode**: Compatibility unverified
80
+ - **Other `.agents/skills` consumers**: Capabilities unverified
81
+
82
+ ## Distinguishing Operational vs Governed Skills
83
+
84
+ ### Bundled Operational Skills
85
+
86
+ The skills in this suite (`kxm-*`) are bundled and operational by default. They map 1:1 with KXM's top-level command groups and are maintained as part of the core KXM distribution.
87
+
88
+ ### Governed Candidates
89
+
90
+ Separately, `kxm skills` manages community or experimental candidates through
91
+ create/evaluate/promote/reject/verify. Those governed skills are distinct from
92
+ this bundled suite. Telemetry cannot auto-promote a skill.
93
+
94
+ ## Development and Maintenance
95
+
96
+ ### Authoring Location
97
+
98
+ Skills are authored in `plugins/kxm/skills/` as the primary source of truth.
99
+
100
+ ### Generated Mirror
101
+
102
+ `scripts/emit-codex-artifacts.mjs` copies owned skills byte-for-byte to
103
+ `.agents/skills/` and leaves unrelated skills in that tree untouched. The
104
+ suite manifest `plugins/kxm/skill-suite.json` is required; missing, symlink,
105
+ or malformed manifests fail closed.
106
+
107
+ ### Build Process
108
+
109
+ 1. Validate `plugins/kxm/skill-suite.json`
110
+ 2. Replace owned generated skill directories
111
+ 3. Preserve foreign skills in `.agents/skills/`
112
+ 4. `scripts/check-generated.mjs` requires every owned mirror path
113
+
114
+ ### Testing
115
+
116
+ - `test/core/skill-suite.test.ts` validates command coverage and mirrors
117
+ - `test/core/commands-policy.test.ts` checks taught verbs against `cli.ts`
118
+ - `test/core/generated-artifacts.test.ts` checks manifest-backed generated paths
@@ -163,7 +163,7 @@ Workflow session isolation is a context-routing and accidental-cross-run safety
163
163
 
164
164
  | Path | Responsibility |
165
165
  |---|---|
166
- | `.kxm/config/` | Tracked workspace workflow and harness configuration |
166
+ | `.kxm/` | Tracked workspace workflow and harness configuration |
167
167
  | `.kxm/logs/` | Ignored hub, worker, and Pi process logs |
168
168
  | `.kxm/assets/` | Intentional workflow inputs and outputs |
169
169
  | `.kxm/state/` | Ignored SQLite and restart-recovery state |
@@ -35,6 +35,17 @@ and models are admitted with strict permission and vendor boundaries:
35
35
  a requested harness/model is not in the admitted role lineup, or if permissions
36
36
  exceed the admitted ceiling (e.g. attempting to give edit permissions to a
37
37
  read-only reviewer).
38
+ - **Trusted roster policy:** Dispatch (`assign` / `run`) and accept load
39
+ `.kxm/roster.json` through the trusted control Git loader
40
+ (`loadTrustedRosterPolicy`). Loader errors, missing/empty policy, and
41
+ malformed policy fail closed with `route_invalid`. There is no raw working-tree
42
+ JSON fallback and no null-policy acceptance. Tests may inject an explicit
43
+ policy object; that seam is not a CLI or environment bypass. The witness
44
+ verifies the bound candidate against the fixed gate (`npm run verify`) and
45
+ does not itself call the policy loader today. Unified YAML
46
+ role/project/workflow authority is still open and is not this runner's live
47
+ source. Passive `schemas/policy-draft` / `validatePolicyDraft` scaffolding is
48
+ not operator settings and is not admission.
38
49
  - **Deterministic witness beats extra models:** Implementers run `npm run verify`.
39
50
  Root re-runs the fixed witness. Reviewers verify candidate trees; they do not
40
51
  replace tests.
@@ -145,14 +156,16 @@ node scripts/assignment-run.mjs accept \
145
156
 
146
157
  `accept` validates all acceptance invariants:
147
158
 
148
- 1. The commit exists and its tree matches the witness index tree.
149
- 2. The writer record matches the latest passed witness.
150
- 3. Both required critic roles (`review-arch` and `review-cli`) are present.
151
- 4. Both critics judged the exact accepted tree and issued `PASS`.
152
- 5. No unresolved `BLOCK` review exists for the tree in the task directory (unless
159
+ 1. Trusted roster policy is loaded and valid **before** acceptance artifacts are
160
+ written. Failure to obtain required policy refuses acceptance.
161
+ 2. The commit exists and its tree matches the witness index tree.
162
+ 3. The writer record matches the latest passed witness.
163
+ 4. Both required critic roles (`review-arch` and `review-cli`) are present.
164
+ 5. Both critics judged the exact accepted tree and issued `PASS`.
165
+ 6. No unresolved `BLOCK` review exists for the tree in the task directory (unless
153
166
  superseded by an unbroken `rework_of` lineage).
154
- 6. The writer and all critics satisfy pairwise vendor independence.
155
- 7. Writes `accepted.json` (`kxm.task-accepted.v1`) into the task directory.
167
+ 7. The writer and all critics satisfy pairwise vendor independence.
168
+ 8. Writes `accepted.json` (`kxm.task-accepted.v1`) into the task directory.
156
169
 
157
170
  ---
158
171
 
@@ -206,7 +219,7 @@ The runner fails closed with bounded error codes defined in `RUNNER_CODES`:
206
219
 
207
220
  | Code | Trigger condition | Remedy |
208
221
  |---|---|---|
209
- | `route_invalid` | Harness/model not admitted in lineup for the requested role, or permission exceeds route ceiling. | Check `.kxm/roster.json` lineup and permissions for the role. |
222
+ | `route_invalid` | Harness/model not admitted in lineup for the requested role, permission exceeds route ceiling, or trusted roster policy cannot be loaded/validated. | Use a trusted clean control checkout; do not dispatch from a dirty implementation branch. Check `.kxm/roster.json` lineup and permissions for the role. |
210
223
  | `critic_invalid` | Missing required critic role, duplicate roles, wrong model, or vendor collision between writer and critics. | Ensure independent critics (Fable + Sol) from distinct providers. |
211
224
  | `critic_block` | An unresolved `BLOCK` verdict exists for the target tree. | Rework the changes, address findings, and pass review with a `rework_of` link. |
212
225
  | `commit_tree_mismatch` | Git commit tree does not equal the witnessed tree. | Commit the exact candidate tree verified by the witness before running accept. |
@@ -269,7 +269,7 @@ Global flags: `--json`, `--dry-run`, `--workspace`. Project-root `kxm init` disc
269
269
 
270
270
  Configure either `KXM_WEBHOOK_WORKFLOWS` or `KXM_WEBHOOK_WORKFLOWS_FILE`, never both. A definition selects a provider source, project, coordinator, event and payload filters, prompt template, and ordered stages. Use `secretEnv` to resolve the workflow-start HMAC secret from another environment variable. Use the optional `signalSecretEnv` for a separate callback secret; otherwise external signals use the workflow-start secret. Do not store either secret in JSON.
271
271
 
272
- See [Webhook workflows](webhook-workflows.md) for the base schema and the complete Jira configuration under `.kxm/config/workflows`. See [Peer provenance and quorum gates](provenance-gates.md) for `evidencePolicies`, `workflowContext`, `evidenceRefs`, and explicit degradation.
272
+ See [Webhook workflows](webhook-workflows.md) for the base schema and the complete Jira configuration under `.kxm/workflows`. See [Peer provenance and quorum gates](provenance-gates.md) for `evidencePolicies`, `workflowContext`, `evidenceRefs`, and explicit degradation.
273
273
 
274
274
  ## Delivery modes
275
275
 
@@ -279,7 +279,7 @@ See [Webhook workflows](webhook-workflows.md) for the base schema and the comple
279
279
  | `steer` | An active blocker requires a course change | Deliver at the next decision boundary |
280
280
  | `nextTurn` | Information should wait for a later turn | Queue context without immediate work |
281
281
 
282
- `followUp` is the safe default. Use [`.kxm/config/env.example`](../.kxm/config/env.example) as a reference, but load values through your shell, supervisor, container platform, or secret manager. Never commit real tokens.
282
+ `followUp` is the safe default. Use [`.kxm/env.example`](../ .kxm/env.example) as a reference, but load values through your shell, supervisor, container platform, or secret manager. Never commit real tokens.
283
283
 
284
284
  ## Nous providers (opt-in)
285
285
 
@@ -695,7 +695,7 @@ Claude MCP also exposes:
695
695
  Set exactly one of:
696
696
 
697
697
  ```text
698
- KXM_WEBHOOK_WORKFLOWS_FILE=.kxm/config/workflows/product.json
698
+ KXM_WEBHOOK_WORKFLOWS_FILE=.kxm/workflows/default.yaml
699
699
  ```
700
700
 
701
701
  or:
@@ -712,7 +712,7 @@ required evidence, attempt limits, and optional peer policies.
712
712
  Validate before restart:
713
713
 
714
714
  ```powershell
715
- kxm gate validate --file .kxm/config/workflows/product.json
715
+ kxm gate validate --file .kxm/workflows/default.yaml
716
716
  ```
717
717
 
718
718
  Secrets belong in environment variables named by `secretEnv` and
@@ -921,7 +921,7 @@ with content hashes. See `docs/skills.md` for the full lifecycle.
921
921
 
922
922
  ### Reference /fix workflow
923
923
 
924
- `.kxm/config/workflows/fix.json` implements the reference bug-fix flow:
924
+ `.kxm/workflows/default.yaml` implements the reference bug-fix flow:
925
925
  read-only exploration, a tests-only reproduction draft, independent two-critic
926
926
  `repro-review` that captures the immutable oracle (a sibling API is invalid),
927
927
  plan review by independent critics, a human approval gate, bounded rework
@@ -0,0 +1,63 @@
1
+ # This host's Pi packages
2
+
3
+ Snapshot of the operator Pi user packages and file extensions on this KXM
4
+ development host (2026-09-10). It is **not** a KXM install requirement and is
5
+ **not** copied by `kxm init`. `pi list` is authoritative; this page is a
6
+ checked-in copy for agents working in this repository.
7
+
8
+ ## User packages (`pi list`)
9
+
10
+ | Source | Version | What it loads |
11
+ |---|---|---|
12
+ | `npm:pi-antigravity` | 0.7.2 | Antigravity / Cloud Code Assist provider (`./src/index.ts`) |
13
+ | `git:git@github.com:kontextmind/kxm.git@main` | 0.6.0 (`10a1b77` at snapshot) | KXM Pi extension and Agent Skills |
14
+ | `npm:@xynogen/pix-core` | 0.5.38 | pix UI/tool aggregator (`src/extension.ts`); activates bundled pix members, not separate `pi list` sources |
15
+ | `npm:@tian.zuo/pi-antigravity` | 0.10.3 | Antigravity via `agy` stream-json (`./index.ts`) |
16
+ | `npm:@latentminds/pi-quotas` | 0.5.0 | Quota and usage status commands |
17
+ | `npm:pi-provider-kimi-code` | 0.6.12 | Kimi Code provider (`./index.ts`) |
18
+
19
+ Install roots on this host:
20
+
21
+ - npm: `%USERPROFILE%\.pi\agent\npm\node_modules\`
22
+ - git KXM: `%USERPROFILE%\.pi\agent\git\github.com\kontextmind\kxm`
23
+
24
+ Project-local Pi extension (gitignored `.pi/`): `.pi/extensions/rtk.ts` from
25
+ `rtk init --agent pi`. User-level `~/.pi/agent/extensions/rtk.ts` is also
26
+ installed.
27
+
28
+ ## File extensions
29
+
30
+ Loaded from `%USERPROFILE%\.pi\agent\extensions\` (not shown by `pi list`):
31
+
32
+ | File | Role |
33
+ |---|---|
34
+ | `rtk.ts` | RTK bash rewrite via `rtk rewrite`; needs `rtk` 0.23 or newer on `PATH` |
35
+ | `quotas.json` | Config for `@latentminds/pi-quotas`, not an extension factory |
36
+
37
+ `rtk` 0.48.0 is installed as winget `rtk-ai.rtk`. New shells pick up the User
38
+ `PATH` entry. `pix-core` also activates `pix-optimizer`, which can rewrite
39
+ commands for RTK independently of `rtk.ts`.
40
+
41
+ ## Notes
42
+
43
+ - `pi-antigravity` and `@tian.zuo/pi-antigravity` are different Pi providers.
44
+ They do not replace the native `agy` harness used by the assignment runner.
45
+ - For KXM development loads, prefer the working tree:
46
+ `pi --no-extensions -e ./plugins/kxm/src/extension.ts`. Add every required
47
+ provider extension with another `-e`; otherwise Pi discovery is disabled.
48
+ See [Troubleshooting](troubleshooting.md#pi-shows-huboff).
49
+ - Refresh this page when `pi list` or
50
+ `%USERPROFILE%\.pi\agent\extensions\` changes.
51
+
52
+ ## Project-scoped RTK (this checkout)
53
+
54
+ `rtk init` in this repository (2026-09-10). Not copied by `kxm init`.
55
+
56
+ | Path | Role |
57
+ |---|---|
58
+ | `RTK.md` | Slim RTK instructions for Codex and `@RTK.md` includes |
59
+ | `AGENTS.md` | `@RTK.md` reference (Codex / Kimi) |
60
+ | `CLAUDE.md` | `@RTK.md` reference (Claude Code) |
61
+ | `.rtk/filters.toml` | Project filter template |
62
+ | `.agents/rules/antigravity-rtk-rules.md` | Antigravity rules |
63
+ | `.pi/extensions/rtk.ts` | Project Pi rewrite extension (gitignored) |
@@ -0,0 +1,102 @@
1
+ # Repository Work Delivery Skill
2
+
3
+ ## Purpose
4
+
5
+ `repo-work-delivery` is a reusable skill for converting an engineering request into an evidence-based, executable delivery prompt. It is designed for repository work that may need discovery, official documentation research, phased delivery, validation, pull requests, CI/review follow-through, policy-gated merge, and safe cleanup.
6
+
7
+ The canonical skill is located at:
8
+
9
+ ```text
10
+ .agents/skills/repo-work-delivery/SKILL.md
11
+ ```
12
+
13
+ ## What it does
14
+
15
+ The skill requires the executor to:
16
+
17
+ - Inspect repository instructions, architecture, workflow guidance, CI, package manifests, and existing patterns.
18
+ - Identify material ambiguity and ask focused questions only when repository evidence cannot safely resolve it.
19
+ - Select the workflow recommended by the repository’s workflow guide.
20
+ - Assign explicit delivery roles, even when one agent performs several roles.
21
+ - Use a one-shot workflow only for genuinely small, low-risk, self-contained changes.
22
+ - Research fresh official documentation for every materially affected package, framework, SDK, platform, or API.
23
+ - Create and maintain a living Markdown plan for multi-phase work.
24
+ - Deliver buildable and testable phases with coherent commits and incremental pushes.
25
+ - Run targeted and broader validation, record commands and outcomes, and inspect the final diff for security issues.
26
+ - Create a pull request, monitor checks/reviews, apply only bounded low-risk fixes, and stop for user direction when scope or risk materially changes.
27
+ - Auto-merge only where explicit authorization and repository policy allow it.
28
+ - Clean up the workspace only after merge is verified and no local work can be lost.
29
+
30
+ ## Workflow selection
31
+
32
+ The skill first reads the repository workflow guide. For KXM, that includes:
33
+
34
+ ```text
35
+ .agents/skills/kxm-workflow/SKILL.md
36
+ ```
37
+
38
+ It chooses the least complex safe workflow prescribed by that guidance.
39
+
40
+ ### One-shot work
41
+
42
+ One-shot is suitable only when all of the following are true:
43
+
44
+ - Scope is narrow and unambiguous.
45
+ - The change is self-contained and can be validated as a single coherent unit.
46
+ - No migration, public contract, authorization/security, irreversible side effect, or production-rollout complexity is involved.
47
+ - No cross-service coordination is needed.
48
+ - Repository policy does not require a phased plan.
49
+
50
+ One-shot work still performs discovery, documentation research, focused validation, commit, push, and required PR work.
51
+
52
+ ### Phased work
53
+
54
+ All other work uses a living plan. Each phase has an objective, owner role, dependencies, expected files, acceptance criteria, test commands, rollback notes when appropriate, commit boundary, and push requirement.
55
+
56
+ ## Required role coverage
57
+
58
+ The generated prompt assigns relevant roles from this set:
59
+
60
+ | Role | Primary responsibility |
61
+ |---|---|
62
+ | Delivery lead | Scope, decisions, workflow, plan, and final reporting |
63
+ | Repository analyst | Architecture, instructions, existing patterns, affected paths |
64
+ | Documentation researcher | Fresh official package/API/framework evidence |
65
+ | Implementer | Minimal compatible code and configuration changes |
66
+ | Test engineer | Focused, regression, integration, and acceptance validation |
67
+ | Security reviewer | Secrets, dependencies, input handling, auth, and data-risk review |
68
+ | Release/CI owner | Required checks, CI monitoring, and safe remediation |
69
+ | Reviewer/merge steward | PR, review resolution, policy gates, merge, and cleanup |
70
+
71
+ ## Gap questions
72
+
73
+ The skill asks the user only when unanswered details would materially affect behavior, scope, data/migration choices, permissions, external integrations, rollout, acceptance criteria, or merge authority. It does not ask for facts that can be established from the repository or official docs.
74
+
75
+ ## Documentation standard
76
+
77
+ For material dependencies, research uses official maintainer or other authoritative primary documentation for the repository’s actual version. The plan or PR records the source, version/date where available, retrieval date, and decision supported.
78
+
79
+ ## Merge and cleanup safety
80
+
81
+ Auto-merge happens only after explicit authorization or policy authorization, passing required checks, required approvals, resolved comments, clean security status, and compliance with branch protection.
82
+
83
+ After verified merge, cleanup is guarded by checks for a clean workspace and fully merged branch. It updates the default branch, removes only safe merged local branches/worktrees, prunes stale references, and never discards uncommitted or user-owned artifacts.
84
+
85
+ ## Expected generated prompt sections
86
+
87
+ A prompt produced with this skill includes:
88
+
89
+ 1. Desired outcome and acceptance criteria
90
+ 2. Gap-resolution gate
91
+ 3. Repository discovery
92
+ 4. Workflow selection and rationale
93
+ 5. Assigned roles
94
+ 6. Fresh official documentation research
95
+ 7. Scope, non-goals, assumptions, and constraints
96
+ 8. Design and integration expectations
97
+ 9. One-shot or phase plan
98
+ 10. Tests and validation
99
+ 11. Commit/push discipline
100
+ 12. PR, CI/review monitoring, bounded remediation, and merge gate
101
+ 13. Verified post-merge cleanup
102
+ 14. Completion report