Skip to content
Development
Skill

/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

From plugin
spec-kitty
1.5k53 skills1 command
Install
$ npx -y skills add Priivacy-ai/spec-kitty --skill spec-kitty-runtime-next --agent claude-code

How 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.md
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.md

Decision 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
Ships withspec-kitty

Spec-Driven Development for serious software developers. Spec Coding with with Claude, Cursor, Gemini, Codex. Kanban dashboard, git worktrees, auto-merge and more.

Get the whole plugin

Other skills on spec-kitty.