/prometheus-skill-pack:kbd-process-orchestratorfrom prometheus-skill-pack
The Universal Knowledge-Based Development (KBD) process orchestrator. Drives the full iterative PMPO lifecycle for ANY project — Assess → Analyze → Plan → Execute (backend dispatch) → Reflect — at every granularity level: global phases, OpenSpec changes, and artifact-level QA. Implements the process defined in TJ-KBD-UNIVERSAL-001. Coordinates execution across multiple AI tools (Claude Code, Codex, OpenCode, Kimi, and compatible adapters) using the append-only KBD runtime as the shared control plane.
Ships in prometheus-skill-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Always think in terms of user goals and value—not in tests or assumptions.
Before selecting or planning a unit of work, state the user's intended outcome and why it matters. Anchor intended behavior in exact representative examples and observed evidence; distinguish confirmed requirements from assumptions. Before proposing a solution, query, or test, record plain-language, verifiable business rules in the existing accepted specification or behavior contract: condition, expected outcome, supporting evidence, exceptions, and unresolved assumptions. Do not invent a separate workflow or treat assumptions as rules. Trace scoped end-of-phase BDD scenarios to those rules. Test outcomes verify user value; they do not define it. Preserve established build, release, phase-end BDD/VLBV processes and approval gates unchanged.
Invoking skills on any harness. Skill names in this pack (
kbd-plan,kbd-apply,value-scenario-verify, …) are written without a command prefix. Invoke one with your harness's syntax —/kbd-planin Claude Code and OpenCode,$kbd-planin Codex,/skill:kbd-planin Kimi Code — or ask for it by name. The harness-neutral control surface is theprometheus kbdCLI. Each harness's syntax is recorded in its profile (shared/harnesses/capabilities.json).
The universal process orchestrator for any software project. Implements the Knowledge-Based Development lifecycle defined in TJ-KBD-UNIVERSAL-001 using PMPO orchestration at three nested levels: phase, change, and artifact.
This skill is project-agnostic. It derives project identity from context (AGENTS.md, CLAUDE.md, README.md, package.json, Cargo.toml, pyproject.toml, or explicit prompt arguments). Do not hard-code project names into this skill.
Every KBD skill emits signals at the start and end of its work. The orchestrator coordinates but does not double-emit — individual skills own their own signals.
Cross-phase signal rule: When orchestrating a full phase cycle (Assess → Plan → Execute → Reflect), emit phase-level signals at the orchestrator level:
Starting phase <N> of <total>: <phase-name>
When the phase cycle is complete:
Completed phase <N> of <total>: <phase-name>
Read change totals from the active phase’s completion.implementation and phase totals from the canonical phase list — never use change totals as phase totals or guess. Emit to plain response text — no tool call needed. Individual skills (kbd-assess, kbd-plan, etc.) emit their own skill-level signals independently.
At session startup and before starting or entering a phase, resolve the installed
kbd-process-orchestrator skill directory as KBD_ORCHESTRATOR_ROOT and run:
node "$KBD_ORCHESTRATOR_ROOT/shared/openspec/cli.mjs" refresh --project "<project-root>" --timeout-ms 120000
This resolves the latest stable official OpenSpec CLI and refreshes the project's
generated OpenSpec skills/commands while preserving authored specs, changes and
custom configuration. Read the receipt: failed or pending refresh is unresolved,
not current-version proof. A cached offline version is explicitly unverified for
latest freshness. Resolve reported conflicts before dependent phase mutations.
OpenSpec is the primary spec engine for new projects (kbd-init initializes
it); existing native KBD projects keep working, and the helper skips projects
without an existing OpenSpec root.
Use the same preflight in harnesses without startup hooks and before raw
prometheus kbd phase commands that bypass the lifecycle scripts. Invoke
OpenSpec through the managed runner, including commands copied from generated
skills, rather than an independently versioned global executable:
node "$KBD_ORCHESTRATOR_ROOT/shared/openspec/cli.mjs" run --project "<project-root>" -- <openspec arguments>
The runner preserves CLI stdout for JSON consumers. Planning model assignments still never launches workers or changes inference providers. A dry-run or read-only request does not authorize this mutating refresh; report its pending preflight and defer it until a writable invocation.
On every invocation, before acting, KBD MUST:
Identify the project name — read, in priority order:
kbd-plan my-project).kbd-orchestrator/project.json if it existsAGENTS.md header or CLAUDE.md headerREADME.md first headingpackage.json → name, Cargo.toml → [package] name, pyproject.toml → nameIdentify project-specific constraints — read AGENTS.md and the
project's canonical spec files (OpenSpec openspec/specs/*.md, or
equivalent spec directory defined in .kbd-orchestrator/project.json).
Derive the technology stack — identify from lock files / config files to tailor the Build Health and Test Coverage assessment dimensions.
Assess → Analyze → Plan → Execute (backend selection + dispatch) → Reflect KBD owns canonical phase state and delegates execution to OpenSpec, a native planner backend, or a designated AI tool.
the managed runner's new change (change created in plan) → kbd-apply (drives the spec
backend task-by-task in execute) → verify → archive.
kbd-apply wraps the OpenSpec CLI one task at a time so KBD hooks fire and
progress.json/the waypoint stay in sync. Never invoke the bare openspec-apply-change skill (formerly /opsx:apply) — it
runs outside KBD. Delegates QA to artifact-refiner when available.
artifact-refiner Specify → Plan → Execute → Reflect → Persist
KBD uses the append-only event journal in
.kbd-orchestrator/runtime/events.jsonl as its universal coordination
contract. Harnesses mutate it through the CLI, REST, or MCP contract while one
exclusive journal lock serializes each complete command transaction.
Compatibility JSON is generated from replay and is never an independent
authority.
| File | Written by | Read by | Purpose |
|---|---|---|---|
.kbd-orchestrator/runtime/events.jsonl | kbd-runtime | All adapters | Canonical append-only journal |
.kbd-orchestrator/current-waypoint.json | projection writer | All tools | Derived resume view |
.kbd-orchestrator/current-waypoint.md | projection writer | All tools | Human-readable waypoint summary |
.kbd-orchestrator/phases/<phase>/assessment.md | kbd-assess | kbd-analyze/kbd-plan | Gap analysis output |
.kbd-orchestrator/phases/<phase>/analysis.md | kbd-analyze | kbd-spec/kbd-plan | Engineering-landscape research |
.kbd-orchestrator/phases/<phase>/library-candidates.json | kbd-analyze | kbd-spec/kbd-plan | Build-vs-adopt candidate set |
.kbd-orchestrator/phases/<phase>/handoffs/*.handoff.json | each stage | next stage gate | Stage precondition + summary |
.kbd-orchestrator/phases/<phase>/harness-handoffs/<harness>-<UTC>.{md,json} | kbd-handoff | receiving harness | Cross-harness handoff packet (advisory, no lease) |
.kbd-orchestrator/position.json | projection writer | kbd-status/renderer | Revision-bound derived position tree |
.kbd-orchestrator/phases/<phase>/plan.md | kbd-plan | kbd-execute | Ordered change list |
.kbd-orchestrator/phases/<phase>/execution.md | kbd-execute | All tools | Backend dispatch contract |
.kbd-orchestrator/phases/<phase>/progress.json | projection writer | kbd-status | Derived implementation/evidence/certification/publication ledger |
.kbd-orchestrator/phases/<phase>/reflection.md | kbd-reflect | Next phase | Phase retrospective |
.kbd-orchestrator/project.json | kbd-init; phase helpers for activePhase/bootstrap | All tools | Project identity + config |
All workflow mutations MUST use prometheus kbd typed commands (or equivalent
MCP/REST commands). progress.json is read-only when generatedBy is
kbd-runtime; sourceRevision identifies the exact canonical revision.
Legacy shadow-mode writers are migration inputs only and must stop at cutover.
The following is a compatibility ledger example, not an initialization template or the full canonical runtime schema:
{
"schemaVersion": "2",
"phase": "<phase-name>",
"last_updated": "<ISO 8601 timestamp>",
"last_updated_by": "<tool-name: antigravity|roo|cursor|codex|cline|opencode|windsurf|human>",
"implementation_total": 0,
"implementation_completed": 0,
"changes_total": 0,
"changes_completed": 0,
"completion": {
"primaryCounter": "implementation",
"implementation": { "completed": 0, "total": 0, "status": "PENDING" },
"evidence": { "status": "NOT_TRACKED", "summary": null, "blockers": [] },
"certification": { "status": "NOT_TRACKED", "summary": null, "blockers": [] },
"publication": { "status": "NOT_TRACKED", "summary": null, "blockers": [] }
},
"changes": [
{
"id": "<change-id>",
"status": "PENDING|IN_PROGRESS|DONE|BLOCKED|SKIPPED",
"implementation_status": "PENDING|IN_PROGRESS|COMPLETE|BLOCKED|SKIPPED",
"evidence_status": "NOT_TRACKED|NOT_REQUIRED|PENDING|IN_PROGRESS|COMPLETE|BLOCKED",
"certification_status": "NOT_TRACKED|NOT_REQUIRED|PENDING|IN_PROGRESS|COMPLETE|BLOCKED",
"publication_status": "NOT_TRACKED|NOT_REQUIRED|PENDING|IN_PROGRESS|COMPLETE|BLOCKED",
"tasks_total": 0,
"tasks_done": 0,
"last_task_completed": "<task description or null>",
"next_task_pending": "<task description or null>",
"started_by": "<tool-name>",
"completed_by": "<tool-name or null>",
"blockers": []
}
]
}
The active phase’s counter is completion.implementation. Run-wide totals
are explicitly separate in runCompletion; they do not certify the phase. Legacy
changes_completed and changes_total remain compatibility aliases of that
counter only. They MUST NOT count evidence, certification, authorization,
elapsed-time, external-adopter, or publication gates.
Completion invariant: once a change's code and integration contract is
implemented, run prometheus kbd change transition ... --status complete;
the projection then shows implementation_status: COMPLETE even when evidence
or publication remains pending. Unchecked OpenSpec tasks marked
EVIDENCE, TIME_BOUND, AUTHORIZATION, or EXTERNAL never reopen
implementation. Never edit counters in the projection.
Detailed registry, knowledge stack, integration layer, integration timing diagram, and the typical phase progression are in
references/architecture.md. Read on first use; not loaded on every invocation.
.kbd-orchestrator/current-waypoint.json as the
preferred resume contract before inferring the next actionAGENTS.md, spec filesprometheus kbd status --json; use
progress.json only as a revision-matched human-readable projectionprompts/assess.md) — inspect repo, reconcile with spec, surface gapsprompts/plan.md) — produce ordered list of changes for this phaseprompts/execute.md) — select backend, write execution.md, dispatchprompts/reflect.md) — run evolver report, capture lessons, seed next phaseAfter each phase: checkpoint + dispatch workflow triggers.
OpenSpec is optional. KBD adapts:
openspec/ directory exists)new change <id> (OpenSpec 2.0; the /opsx:* commands were removed) to create structured changes with proposal → design → tasksopenspec/changes/<id>/tasks.mdkbd-apply begin-task / end-task; driver verify
and archive feed the reflection phase after the required review gates.kbd-orchestrator/changes/<id>/spec.md, tasks.json, and verification.md; tasks.md is a
generated human view (legacy change.md is supported as migration input)kbd-apply, which keeps backend task state
and canonical KBD transitions synchronizedThe full pack supports optional OpenSpec and native backends (and Spec Kit through its adapter). A project’s explicit backend pin and policy take precedence: do not silently switch a pinned project when its tooling fails.
KBD maintains a resumable return point for the current phase.
.kbd-orchestrator/current-waypoint.md.kbd-orchestrator/current-waypoint.jsonphase, activePhase, activePhaseId, path,
backend, lastCompletedChange, nextPendingChange, nextChange, and
nextTask. Writers emit camelCase; snake_case names are migration aliases.exactNextCommand stores operator intent, not an authoritative work selector.
Confirm the next action against canonical status and pending tasks.Consult the waypoint first, then verify canonical status and revision before
resuming. Never update it manually. The current projection shape is documented
in references/schemas/current-waypoint.schema.json and its template.
The waypoint supports a parent → child relationship between phases via three optional fields. They are additive: every existing reader keeps working when the fields are absent, and tools that don't recognise them must silently ignore them.
parentPhase: string | null — name of the enclosing phase when this row
represents a child. Default null (top-level phase).childPhases: string[] — ordered list of child-phase names owned by this
row's phase. Default []. The order is the canonical iteration order used by
kbd-next-child.childPointer: string | null — name of the currently-active child within
childPhases, or null when no child is active. Default null.Cross-field invariants (writer-enforced):
childPointer, when non-null, MUST be a member of childPhases.childPhases MUST NOT contain duplicates.Writers (kbd-new-child, kbd-next-child) reject inconsistent waypoints;
readers (kbd-status) render best-effort and warn on violations.
Arbitrary-depth nesting (v3 path[]). The waypoint also carries path: string[] — the canonical position chain for any nesting depth, synthesized
additively from the v2 fields when absent. Lifecycle: kbd-new-child →
kbd-next-child (select) → kbd-child-exit --enter (descend) →
kbd-child-exit (close + roll up + pop). Full depth model, node-dir
resolution, and the critical selected-vs-entered invariant (when
kbd-new-child nests vs. siblings — read before invoking lifecycle helpers):
references/nested-phases.md.
Template versioning. references/schemas/current-waypoint.template.json
is a documented compatibility projection shape, not a manual initialization
recipe. The runtime emits schemaVersion and revision metadata; use supported
migration readers for older shapes rather than inventing fields or copying
legacy templates over canonical projections.
Scope-guard note. The scope guard and child-scope hook ship in
warnmode; the flip toaskis held until a reload session confirms they fire correctly in live operation.
Worktree integration. project.json's worktreeRoot (default
${HOME}/.claude/worktrees) is consumed by kbd-status to render the active
checkout and warn when outside the configured root. See skills/kbd-status/SKILL.md.
KBD ships an extensible hook surface fired around every lifecycle boundary:
each skill fires <kind>:<edge> events (kind ∈ phase/child/change/plan/
execute/reflect/task/assess/spec/analyze, edge ∈ before/after), and any project can
plug in augment or override entries via .kbd-orchestrator/hooks-config.json.
The built-in report-progress reporter writes starting/ending <kind> <name>
to stderr — telemetry, NOT the user-facing guarantee (that is the plain-text
Progress Signals every skill emits).
Full reference — event taxonomy, legacy aliases, discovery order, per-fire
KBD_HOOK_* context, the wiring stanza, hook log schema, and debugging — lives
in references/hooks.md.
When an AI tool (Roo, Cursor, Cline, Codex, etc.) is dispatched to execute a KBD
change, it MUST follow the start/during/completion/blocker protocol — use
kbd-apply task boundaries and typed change/completion/blocker commands. The
runtime generates progress and waypoint views. Review and commit only the
intended artifacts under project policy; never mutate generated views directly.
Full steps in references/cross-tool-protocol.md.
Unlike the previous version, KBD does not hard-code Rust/DocuMind constraints. Project constraints are defined in:
AGENTS.md — "Never Do" and code style rules.kbd-orchestrator/constraints.md — project-specific blocking/warning rulesThe executing tool MUST read these files and apply constraints when verifying work.
file_system — Read/write spec files, phase reports, progress ledgersequential_thinking — Multi-step phase planning and gap analysisweb_search / tavily — External research during Analyze phasecode_interpreter — Run build/test commands during QAsurreal-memory — Cross-session persistence, multi-tool coordination, Graph-RAG queriesmemory — Generic cross-session persistence for phase stateDefault-on when reachable. When the configured or canonical local
surreal-memory service passes GET /health, KBD mirrors every hook fire through
the canonical entity REST API; it cleanly no-ops when the service is
unreachable. Lessons flow separately: reflect:after and the
assess|analyze|plan:after stage write-backs store attributed lessons, and
kbd-memory-recall writes a lesson-bearing prior-context.md at every stage
start (surreal-memory, then pk, then the learning log). Built-in hooks:
kbd-memory-log (*:*), auto-memory-recall* (<stage>:before),
kbd-stage-writeback-* and memory-reflection-writeback. Detection contract, what the
integration provides, and the entity schema are in
references/memory-integration.md.
/kbd-init # Auto-discover project and generate .kbd-orchestrator/project.json
/kbd-new-phase <name> # Start the first phase
/kbd-assess # Run the first assessment
IMPORTANT — project.json is GENERATED, not shipped.
kbd-initdiscovers full project configuration. Phase creation/advancement helpers maintainactivePhase, preserve unrelated keys, and remove the legacyactive_phasealias. They may bootstrap minimal missing identity/phase metadata; that does not replacekbd-initfor full configuration. It lives in the project repository, not in this skill directory. The skill ships the generation template atreferences/schemas/project.template.jsonand the writer contract atreferences/schemas/project.schema.json. Never commit project-specific values into the skill files.
kbd-init [--force] [--dry-run] — Initialize or re-initialize project contextkbd-assess [phase-name] — Assess current codebase against active phase goalskbd-plan [phase-name] — Create prioritized change list for current phasekbd-execute [phase-name] — Select execution backend and dispatch phasekbd-apply <change> — Drive the spec backend (OpenSpec/Spec Kit/native-kbd) one task at a time, firing per-task hooks + position signals (implemented in skills/kbd-apply/). Replaces the bare openspec-apply-change skill (formerly /opsx:apply).kbd-reflect [phase-name] — Generate phase reflection report + seed next phasekbd-status — Show current phase, change inventory, and waypoint-guided next actionkbd-pause — Checkpoint and suspend the active runkbd-resume — Resume a paused run at a validated plan revisionkbd-cancel — Gracefully terminate the active runkbd-audit — Inspect causal history, ownership, and driftkbd-handoff --to <harness> — Write a lease-free handoff packet so another harness can continue the active phasekbd-new-phase <name> [goals...] — Start a new named phase with goals (implemented in skills/kbd-new-phase/)kbd-new-child <name> [goals...] — Spawn a child phase inside the active top-level phase (implemented in skills/kbd-new-child/)kbd-next-child [<name>] — Advance childPointer (implicit) or jump to a named child (implemented in skills/kbd-next-child/)kbd-child-exit [--enter] — Exit the active child (handoff-out + roll up + pop path) or, with --enter, descend into the selected child so new children nest under it (implemented in skills/kbd-child-exit/)kbd-memory-recall [<phase>] [<stage>] — Populate prior-context.md with recalled lessons, pk knowledge, the previous reflection and knowledge gaps (implemented in skills/kbd-memory-recall/)kbd-inject-agent-rules [--target …] [--refresh] [--dry-run] — Inject Karpathy + Boris Cherny rule sets into CLAUDE.md / AGENTS.md (implemented in skills/kbd-inject-agent-rules/)kbd-full-phase <name> — Run full Assess → Plan → Execute → Reflect cycleSee references/domain/kbd.md (KBD philosophy), references/cross-tool-handoff.md (multi-tool coordination), and prompts/ (detailed phase execution protocols).
When kbd-reflect runs and .kbd-orchestrator/phases/<phase>/evolver-bridge.json
exists, the reflect phase must propagate KBD results back to the evolver's
outer state so /evolve-status shows accurate per-item completion.
Read bridge — load item_to_change_map and execution_results from
evolver-bridge.json.
Compute per-item status — for each evolver item in item_to_change_map:
completed → item status = completedfailed → item status = failedpending/in_progress → item status = in_progressexecution_results yet → item status = pendingWrite status to evolver state — update
.evolver/evolutions/<evolution_name>/state.json by merging
kbd_results under current_iteration:
{
"kbd_results": {
"phase": "<phase-name>",
"reflected_at": "ISO8601",
"items": {
"evolver-item-1": "completed",
"evolver-item-2": "in_progress"
}
}
}
Signal outer loop readiness — if ALL evolver items are completed:
set current_iteration.status to ready_for_reflect in evolver state,
which allows /evolve-reflect to proceed without waiting for another
executor run.
No bridge → no-op — when evolver-bridge.json is absent, kbd-reflect
runs as normal with no evolver state writes.
See .kbd-orchestrator/changes/change-slli-007-evolver-bridge-integration/bridge-schema.md
for the full schema narrative and field definitions.
hooks/hooks.json (opens in a new tab)prompts/assess.md (opens in a new tab)prompts/execute.md (opens in a new tab)prompts/plan.md (opens in a new tab)prompts/reflect.md (opens in a new tab)references/TJ-KBD-UNIVERSAL-001.html (opens in a new tab)references/architecture.md (opens in a new tab)references/boundaries.md (opens in a new tab)references/constraints.md (opens in a new tab)references/cross-tool-handoff.md (opens in a new tab)references/cross-tool-protocol.md (opens in a new tab)references/domain/kbd.md (opens in a new tab)references/execute-memory.md (opens in a new tab)references/hooks.md (opens in a new tab)references/integrations/adversarial-review.md (opens in a new tab)references/integrations/artifact-refiner.md (opens in a new tab)references/integrations/bdd-testing.md (opens in a new tab)references/integrations/iterative-evolver.md (opens in a new tab)references/integrations/pmpo-skill-creator.md (opens in a new tab)references/integrations/sycophancy-correction.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub prometheus-ags/prometheus-skill-system --plugin prometheus-skill-pack218 skills in this plugin
/actor-modelTokio-native actor model pattern for Prometheus AGS projects. Implements actors as tokio tasks communicating via mpsc channels with a typed message enum, enabling safe concurrent state management without shared locks. Used in UAR session management, pk-librarian event broadcasting, and parking-lot scheduler design. Use when a component needs to own state exclusively while serving concurrent callers.
/adversarial-reviewIsolated, cross-model adversarial review of KBD artifacts and change diffs. Dispatches a fresh-context LLM judge over an OpenAI-compatible REST gateway (openai-proxy or `liter-llm api`) with an explicit mandate to find problems — the model that produced an artifact or change is never the model that reviews it. Runs as a pipeline stage inside kbd-assess/analyze/plan (artifact mode) and kbd-execute's single phase-boundary QA step (diff mode, once over the whole phase diff). Findings are severity-bucketed (CRITICAL/WARNING/SUGGESTION) and the judge's own report is screened by sycophancy-correction before it is surfaced.
/agent-team-creatorCreate, revise, package, and deploy agent-team definitions with staged questions and native exports for UAR, Codex, Claude Code, Copilot, Kimi Code, MiniMax CLI, OpenCode and DeepSeek. Use for team definition and catalog lifecycle; use agent-team-manage for active runtime task state.Other plugins' skills for the same job
2 plugins in one repository ship this exact skill · first indexed Nov 27, 2026