/spec-kitty-runtime-next
Drive the canonical spec-kitty next --mission <handle> control loop for mission advancement. Load agent profiles at init, apply action-scoped doctrine context at each step boundary, and pull specific tactics/directives on demand. Triggers: "run the next step", "what should
$ npx -y skills add Priivacy-ai/spec-kitty --skill spec-kitty-runtime-next --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/spec-kitty-runtime-next
Context preview
The summary Claude sees to decide when to auto-load this skill.
Drive the canonical spec-kitty next --mission <handle> control loop for mission advancement. Load agent profiles at init, apply action-scoped doctrine context at each step boundary, and pull specific tactics/directives on demand. Triggers: "run the next step", "what should
SKILL.md
spec-kitty-runtime-next.SKILL.mdname: spec-kitty-runtime-next
description: >-
Drive the canonical spec-kitty next --mission <handle> control loop for mission
advancement. Load agent profiles at init, apply action-scoped doctrine
context at each step boundary, and pull specific tactics/directives on demand.
Triggers: "run the next step", "what should runtime do next", "advance the
mission", "what is the next task", "continue the workflow", "what step comes
next".
Does NOT handle: setup or repair requests, purely editorial glossary or
doctrine maintenance, or direct code review.
spec-kitty-runtime-next
This skill teaches agents how to advance a Spec Kitty mission through the canonical runtime control loop, including doctrine-aware context loading at each step boundary.
When to Use This Skill
Use this skill when the user wants to:
- Advance a mission to its next step
- Understand what the runtime will do next
- Unblock a stalled mission
- Interpret runtime outcomes (step, blocked, decision_required, terminal)
---
How the Runtime-Next System Works
The `spec-kitty next` command is the single entry point for agent-driven mission execution. Each call returns a deterministic decision about what action the agent should take next.
Decision Algorithm
The runtime evaluates state in this order:
1. **Mission state machine** — Current phase and available transitions (from `mission-runtime.yaml` DAG) 2. **WP iteration check** — For `implement` and `review` steps, the CLI bridge manages WP-level iteration WITHOUT advancing the runtime. The runtime only advances when ALL WPs reach terminal/handoff lanes. 3. **Guard conditions** — Required artifacts, prerequisites, dependency graph 4. **Priority ordering** — Reviews before implementations, higher-priority WPs first, dependency-free WPs before dependent ones
WP Iteration Logic (Critical)
The CLI bridge (not the runtime) manages WP-level iteration:
- If current step is `implement` or `review`
- AND there are WPs in `planned` or `in_progress` lanes
- THEN return a WP-level decision **without advancing the runtime step**
- The runtime step only advances when ALL WPs are in terminal/handoff lanes
(`done`, `approved`, or `for_review`)
This means multiple calls to `spec-kitty next` during implementation will return different WP IDs but the same `step_id` (e.g., "implement") until all WPs are done.
Mission Runtime YAML Schema
Missions define steps as a DAG (directed acyclic graph) with dependencies:
mission:
key: software-dev
name: Software Dev Kitty
version: "2.1.0"
steps:
- id: discovery
title: Discovery & Research
depends_on: []
prompt_template: research.md
- id: specify
depends_on: [discovery]
prompt_template: specify.md
- id: plan
depends_on: [specify]
prompt_template: plan.md
- id: tasks
depends_on: [plan]
- id: implement
depends_on: [tasks]
prompt_template: implement.md
- id: review
depends_on: [implement]
prompt_template: review.md
- id: accept
depends_on: [review]
prompt_template: accept.mdDecision Kinds
Every call to `spec-kitty next` returns exactly one decision kind:
| Kind | Meaning | Agent Action | |---|---|---| | `step` | Normal action available | Read `prompt_file` and execute | | `query` | Read-only current-state preview | Inspect state; do not execute a prompt or mark a result | | `decision_required` | Runtime needs input | Answer with `--answer` and `--decision-id` | | `blocked` | Guards failing, cannot proceed | Read `reason` + `guard_failures`, resolve blockers | | `terminal` | Mission complete | Run `/spec-kitty.accept`; if it passes, merge, then: mission review → author or verify retrospective (`retrospect create`) → surface findings (`summary` aggregates; `synthesize` reviews proposals) |
Decision Output Fields
{
"kind": "step",
"agent": "claude",
"mission_slug": "042-test-mission",
"mission": "software-dev",
"mission_state": "implementing",
"action": "implement",
"wp_id": "WP02",
"workspace_path": ".worktrees/042-test-mission-lane-b",
"prompt_file": "/tmp/spec-kitty-next-claude-042-test-mission-implement-WP02.md",
"reason": null,
"guard_failures": [],
"progress": {
"total_wps": 5,
"done_wps": 1,
"approved_wps": 0,
"in_progress_wps": 1,
"planned_wps": 3,
"for_review_wps": 0
},
"run_id": "abc123",
"step_id": "implement",
"decision_id": null,
"question": null,
"options": null
}6 Guard Primitives
Guards block step transitions by returning failure descriptions:
| Guard | Syntax | Checks | |---|---|---| | `artifact_exists` | `artifact_exists("spec.md")` | File exists relative to mission dir | | `gate_passed` | `gate_passed("review_gate")` | Gate event in mission-events.jsonl | | `all_wp_status` | `all_wp_status("approved_or_done")` | All WPs in a specific lane or named accepted-ready set | | `any_wp_status` | `any_wp_status("for_review")` | At least one WP in lane | | `input_provided` | `input_provided("architecture")` | Input exists in runtime model | | `event_count` | `event_count("review", 1)` | Minimum event count threshold |
Guards never raise exceptions — they return `false` on missing context.
Prompt File Generation
The runtime generates a temp file at: `/tmp/spec-kitty-next-{agent}-{mission_slug}-{action}[-{wp_id}].md`
**Template actions** (specify, plan, tasks): Mission context header + governance context + action-specific template content.
**WP actions** (implement, review): Full isolation-aware prompt containing: 1. WP header with workspace path 2. Governance context (paradigms, directives, tools) 3. **WP Isolation Rules** — DO only modify this WP's status, DO NOT change other WPs or react to their status changes 4. Working directory and review commands 5. WP file content (from `tasks/WP##.md`) 6. Completion instructions
**Decision prompts**: Question text, options, and the `--answer` command
Read more
name: spec-kitty-runtime-next description: >- Drive the canonical spec-kitty next --mission <handle> control loop for mission advancement. Load agent profiles at init, apply action-scoped doctrine context at each step boundary, and pull specific tactics/directives on demand. Triggers: "run the next step", "what should runtime do next", "advance the mission", "what is the next task", "continue the workflow", "what step comes next". Does NOT handle: setup or repair requests, purely editorial glossary or doctrine maintenance, or direct code review.
spec-kitty-runtime-next
This skill teaches agents how to advance a Spec Kitty mission through the canonical runtime control loop, including doctrine-aware context loading at each step boundary.
When to Use This Skill
Use this skill when the user wants to:
- Advance a mission to its next step
- Understand what the runtime will do next
- Unblock a stalled mission
- Interpret runtime outcomes (step, blocked, decision_required, terminal)
---
How the Runtime-Next System Works
The `spec-kitty next` command is the single entry point for agent-driven mission execution. Each call returns a deterministic decision about what action the agent should take next.
Decision Algorithm
The runtime evaluates state in this order:
1. **Mission state machine** — Current phase and available transitions (from `mission-runtime.yaml` DAG) 2. **WP iteration check** — For `implement` and `review` steps, the CLI bridge manages WP-level iteration WITHOUT advancing the runtime. The runtime only advances when ALL WPs reach terminal/handoff lanes. 3. **Guard conditions** — Required artifacts, prerequisites, dependency graph 4. **Priority ordering** — Reviews before implementations, higher-priority WPs first, dependency-free WPs before dependent ones
WP Iteration Logic (Critical)
The CLI bridge (not the runtime) manages WP-level iteration:
- If current step is `implement` or `review`
- AND there are WPs in `planned` or `in_progress` lanes
- THEN return a WP-level decision **without advancing the runtime step**
- The runtime step only advances when ALL WPs are in terminal/handoff lanes
(`done`, `approved`, or `for_review`)
This means multiple calls to `spec-kitty next` during implementation will return different WP IDs but the same `step_id` (e.g., "implement") until all WPs are done.
Mission Runtime YAML Schema
Missions define steps as a DAG (directed acyclic graph) with dependencies:
mission:
key: software-dev
name: Software Dev Kitty
version: "2.1.0"
steps:
- id: discovery
title: Discovery & Research
depends_on: []
prompt_template: research.md
- id: specify
depends_on: [discovery]
prompt_template: specify.md
- id: plan
depends_on: [specify]
prompt_template: plan.md
- id: tasks
depends_on: [plan]
- id: implement
depends_on: [tasks]
prompt_template: implement.md
- id: review
depends_on: [implement]
prompt_template: review.md
- id: accept
depends_on: [review]
prompt_template: accept.mdDecision Kinds
Every call to `spec-kitty next` returns exactly one decision kind:
| Kind | Meaning | Agent Action | |---|---|---| | `step` | Normal action available | Read `prompt_file` and execute | | `query` | Read-only current-state preview | Inspect state; do not execute a prompt or mark a result | | `decision_required` | Runtime needs input | Answer with `--answer` and `--decision-id` | | `blocked` | Guards failing, cannot proceed | Read `reason` + `guard_failures`, resolve blockers | | `terminal` | Mission complete | Run `/spec-kitty.accept`; if it passes, merge, then: mission review → author or verify retrospective (`retrospect create`) → surface findings (`summary` aggregates; `synthesize` reviews proposals) |
Decision Output Fields
{
"kind": "step",
"agent": "claude",
"mission_slug": "042-test-mission",
"mission": "software-dev",
"mission_state": "implementing",
"action": "implement",
"wp_id": "WP02",
"workspace_path": ".worktrees/042-test-mission-lane-b",
"prompt_file": "/tmp/spec-kitty-next-claude-042-test-mission-implement-WP02.md",
"reason": null,
"guard_failures": [],
"progress": {
"total_wps": 5,
"done_wps": 1,
"approved_wps": 0,
"in_progress_wps": 1,
"planned_wps": 3,
"for_review_wps": 0
},
"run_id": "abc123",
"step_id": "implement",
"decision_id": null,
"question": null,
"options": null
}6 Guard Primitives
Guards block step transitions by returning failure descriptions:
| Guard | Syntax | Checks | |---|---|---| | `artifact_exists` | `artifact_exists("spec.md")` | File exists relative to mission dir | | `gate_passed` | `gate_passed("review_gate")` | Gate event in mission-events.jsonl | | `all_wp_status` | `all_wp_status("approved_or_done")` | All WPs in a specific lane or named accepted-ready set | | `any_wp_status` | `any_wp_status("for_review")` | At least one WP in lane | | `input_provided` | `input_provided("architecture")` | Input exists in runtime model | | `event_count` | `event_count("review", 1)` | Minimum event count threshold |
Guards never raise exceptions — they return `false` on missing context.
Prompt File Generation
The runtime generates a temp file at: `/tmp/spec-kitty-next-{agent}-{mission_slug}-{action}[-{wp_id}].md`
**Template actions** (specify, plan, tasks): Mission context header + governance context + action-specific template content.
**WP actions** (implement, review): Full isolation-aware prompt containing: 1. WP header with workspace path 2. Governance context (paradigms, directives, tools) 3. **WP Isolation Rules** — DO only modify this WP's status, DO NOT change other WPs or react to their status changes 4. Working directory and review commands 5. WP file content (from `tasks/WP##.md`) 6. Completion instructions
**Decision prompts**: Question text, options, and the `--answer` command
Spec-Driven Development for serious software developers. Spec Coding with with Claude, Cursor, Gemini, Codex. Kanban dashboard, git worktrees, auto-merge and more.
Other skills on spec-kitty.
- /ad-hoc-profile-load
Legacy alias for resolver-backed profile loading. Use the canonical spk-doctrine-profile-load skill for identity, boundaries, and governance. Triggers: "act as the architect", "load the reviewer profile", "switch to researcher", "use the planner role", "adopt a profile".
Open skill - /adversarial-squad
Deploy a bounded, profile-loaded adversarial review squad at an SDD point-cut (post-spec, post-plan, post-tasks, pre-merge, or an ad-hoc decision) so independent doctrine lenses converge on findings one reviewer would miss. Triggers: "deploy a squad", "adversarial squad",
Open skill - /spec-kitty-bulk-edit-classification
Recognize when a mission is a bulk edit and drive the occurrence-classification guardrail on the user's behalf. Triggers: user says any variant of "rename X to Y", "change the terminology", "migrate all occurrences", "replace across the codebase", "the X feature is now the Y
Open skill - /spec-kitty-charter-doctrine
Run charter interview, generation, context, and sync workflows for project governance in Spec Kitty 3.x. Access doctrine artifacts programmatically via DoctrineService. Resolve agent profiles. Load action-scoped governance context iteratively, not all at once. Triggers:
Open skill - /spec-kitty-git-workflow
Understand how Spec Kitty manages git: what git operations Python handles automatically, what agents must do manually, worktree lifecycle, auto-commit behavior, merge execution, and the safe-commit pattern. Triggers: "how does spec-kitty use git", "worktree management",
Open skill - /spec-kitty-glossary-context
Curate and apply canonical terminology across Spec Kitty missions. Triggers: "update the glossary", "use canonical terms", "check terminology", "add a term", "fix term drift", "glossary conflicts", "resolve ambiguity", "review terminology consistency". Does NOT handle: runtime
Open skill

