/rune:cookfrom rune
Orchestrates feature implementation through a phased TDD workflow: understand, plan, test, implement, quality, verify, commit. Handles new features, bug fixes with unknown blast radius, and refactors.
Ships in rune. 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.
The primary orchestrator for feature implementation. Coordinates the entire L2 mesh in a phased TDD workflow. Handles 70% of all user requests — any task that modifies source code routes through cook.
Before starting ANY implementation: 1. You MUST understand the codebase first (Phase 1) 2. You MUST have a plan before writing code (Phase 2) 3. You MUST write failing tests before implementation (Phase 3) — unless explicitly skipped This applies to EVERY feature regardless of perceived simplicity.Full detail moved to
references/modes.md(progressive disclosure). Read that file before executing this section. Mesh links used there:rune:deploy,rune:fix,rune:graft,rune:incident,rune:journal,rune:neural-memory,rune:sentinel,rune:verification,rune:watchdog.
Not every task needs every phase:
Nano task: DO → VERIFY → DONE (no phases, auto-detected)
Simple bug fix: Phase 1 → 4 → 6 → 7
Small refactor: Phase 1 → 4 → 5 → 6 → 7
New feature: Phase 1 → 1.5 → 2 → 3 → 4 → 5 → 6 → 6.5 → 7 → 8 (6.5: conditional — requires requirements.md)
Complex feature: All phases (incl. 6.5) + brainstorm in Phase 2
Security-sensitive: All phases + sentinel escalated to opus
Fast mode: Phase 1 → 4 → 6 → 7 (auto-detected, see below)
Multi-session: Phase 0 (resume) → 3 → 4 → 5 → 6 → 7 (one plan phase per session)
Determine complexity BEFORE starting using the Rigor Assessment below. Create TodoWrite with applicable phases.
Before selecting a workflow chain or phase set, compute the task's rigor level from risk signals. This prevents over-engineering trivial changes while ensuring full ceremony for critical ones.
| Risk Signal | Weight | Detection |
|---|---|---|
| Files affected: 1 | 0 | Estimate from task description + scout |
| Files affected: 2-3 | +1 | |
| Files affected: 4+ | +3 | |
| Cross-module impact (changes span 2+ directories) | +2 | scout identifies touch points across boundaries |
| Security-sensitive code (auth, crypto, payments, secrets) | +3 | Keyword match in file paths or task description |
| Public API change (exports, routes, schema) | +2 | Task modifies interfaces consumed by external code |
| Database schema change | +2 | Task mentions migration, schema, ALTER, column |
| New dependency added | +1 | Task requires npm install or equivalent |
| Code will be imported by other modules | +1 | New exports or modifications to shared utilities |
Rigor level mapping:
| Score | Level | Maps To | Phases |
|---|---|---|---|
| 0 | Nano | nano chain | DO → VERIFY → DONE |
| 1-2 | Fast | fast mode | Phase 1 → 4 → 6 → 7 |
| 3-5 | Standard | bugfix / refactor | Phase 1 → 2 → 4 → 5 → 6 → 7 |
| 6-8 | Full | feature | Phase 1 → 1.5 → 2 → 3 → 4 → 5 → 6 → 7 → 8 |
| 9+ | Critical | security / full + adversary | All phases + sentinel@opus + adversary |
Rules:
Nano mode MUST NOT be used for: - Any code that will be imported/called by other code - Security-relevant files (auth, crypto, payments, .env, secrets) - Database schema changes - Public API changes If any of these are detected mid-task, STOP and upgrade to Fast/Full mode.Full detail moved to
references/modes.md(progressive disclosure). Read that file before executing this section.
Full detail moved to
references/modes.md(progressive disclosure). Read that file before executing this section.
SUB-SKILL: Use rune:sentinel-env — verify the environment can run the project before planning.
Auto-trigger: no .rune/ dir (first run) OR build just failed with env-looking errors AND NOT fast mode. Skip silently on subsequent runs. Force with /rune env-check.
Goal: Know what exists before changing anything.
REQUIRED SUB-SKILLS: Use rune:scout. For non-trivial tasks, use rune:ba.
in_progressrune:ba. Task > 50 words or business terms (users, revenue, workflow) → invoke rune:ba. Bug Fix / simple Refactor → skip. BA produces .rune/features/<name>/requirements.md for Phase 2. Synthesis-mode auto-trigger: if user pasted a spec > 200 words, conversation has > 1000 words on this feature, .rune/features/<name>/requirements.md already exists (continuation), or user said "synthesize"/"just write the spec" → BA Step 1.4 activates Synthesis Mode (extract + cite sources + confirm), skipping the 5-question elicitation. Cook does NOT need to choose mode — BA detects automatically.Glob for .rune/decisions.md; if exists, Read + extract constraints for Phase 2. Plan MUST NOT contradict active decisions without explicit user override.
4b. Contract enforcement: If .rune/contract.md was loaded in Phase 0.6, list applicable contract sections for this task (e.g., contract.security for auth work, contract.data for database changes). These rules constrain Phase 2 planning and Phase 4 implementation.Ask 2 questions before planning: (1) "What does success look like?" (2) "What should NOT change?"
Skip if: bug fix with clear repro steps | user said "just do it" | fast mode + <10 LOC | hotfix chain active. Complexity revealed → escalate to rune:ba.
Grep for async indicators (async def, await, aiosqlite, aiohttp, asyncio.run). If ≥3 matches → flag as "async-first Python" — new code defaults to async defcompletedGate: If scout finds the feature already exists → STOP and inform user.
Full detail moved to
references/domain-context.md(progressive disclosure). Read that file before executing this section.
Full detail moved to
references/orchestration.md(progressive disclosure). Read that file before executing this section.
Goal: Detect if a master plan already exists for this task, or if a --template was specified. If so, skip Phase 1-2 and resume/load the workflow.
Step 0.4 — Template Detection: If user passed --template <name>:
Glob for extensions/*/templates/<name>.md and extensions/pro-*/templates/<name>.mdRead the template file → parse phases, signals, connections, acceptance criteria.rune/plan-<template-name>.md + .rune/plan-<template-name>-phaseN.mdStep 0.5 — Cross-Project Recall: Call neural-memory (Recall Mode) with 3-5 topics relevant to the current task. Always prefix queries with the project name (e.g., "ProjectName auth pattern" not "auth pattern").
Glob to check for .rune/plan-*.md filesGlob .rune/features/*/requirements.md. If NO requirements doc exists AND the task is a Feature / Integration / Greenfield (same classification as the Phase 1 BA-gate — NOT a bug fix, refactor, or trivial change), the plan was produced without a spec (e.g., a brainstorm → plan bypass that skipped ba). Do NOT resume blindly:
rune:ba to backfill requirements (5-question elicitation, or Synthesis Mode if the plan + conversation already carry enough context) → produces .rune/features/<name>/requirements.md.rune:plan to reconcile the existing plan against the new spec — if the plan contradicts a locked Decision or misses a requirement, revise the affected phase files and get user re-approval (Re-Planning protocol).⬚ Pending or 🔄 Active phase → load ONLY that phase file → announce "Resuming from Phase N" → skip to Phase 4Step 0.6 — Contract Load: Use Glob to check for .rune/contract.md. If it exists:
Read the contract file and parse each ## section as a named rule setThis enables multi-session workflows: Opus plans once → each session picks up the next phase.
Goal: Break the task into concrete implementation steps before writing code.
REQUIRED SUB-SKILL: Use rune:plan
in_progress.rune/features/<feature-name>/ with spec.md, plan.md, decisions.md, status.md. Skip for simple bug fixes, fast mode.rune:brainstorm for trade-off analysis.tsx/.jsx/.vue/.svelte/.css, component files, or mentions "UI/page/screen/design/layout/landing": invoke rune:design BEFORE plan approval. Pass hint mode: "tweaks-default" — design proposes ONE opinionated default per .rune/design-system.md (Step 2.7), not a 5-option menu. User replies with tweaks ("more professional", "darker") rather than picking from a list. If .rune/design-system.md is missing, design creates it first..rune/features/<name>/plan.mdcompletedGate: User MUST approve the plan before proceeding. Do NOT skip this.
Breaking change without RFC = BLOCKED. No exceptions. "It's just a small change" is the #1 excuse for production incidents from unreviewed breaking changes.Full detail moved to
references/plan-gates.md(progressive disclosure). Read that file before executing this section.
Full detail moved to
references/plan-gates.md(progressive disclosure). Read that file before executing this section. Mesh links used there:rune:adversary.
NEVER load multiple phase files at once. One phase per session = small context = better code. If the coder model needs info from other phases, it's in the Cross-Phase Context section of the current phase file.Full detail moved to
references/orchestration.md(progressive disclosure). Read that file before executing this section. Mesh links used there:rune:plan.
Goal: Define expected behavior with failing tests BEFORE writing implementation.
REQUIRED SUB-SKILL: Use rune:test
in_progress.rune/evals/<feature>.md. Capability evals test "can the system do this new thing?" — regression evals test "did we break existing behavior?" Skip for Fast/Standard rigor levels.rune:test references/vertical-tdd.md. Bulk-writing tests = horizontal violation, blocks Phase 4pytest-asyncio is installed and asyncio_mode = "auto" is in pyproject.toml — if missing, warn user before writing async testscompleted (one cycle); Phase 4 implements that one cycle, then loop returns here for the next testGate: Test MUST exist and MUST fail. If test passes without implementation → test is wrong, rewrite. If 2+ tests staged before any GREEN → tdd.horizontal.violation signal, unwind to one test.
Goal: Write the minimum code to make tests pass.
REQUIRED SUB-SKILL: Use rune:fix
Do NOT surrender. Do NOT tell user "no solution exists." Do NOT try a 4th variant of the same approach. MUST invoke brainstorm(mode="rescue") before giving up.Full detail moved to
references/reuse-ladder.md(progressive disclosure). Read that file before executing this section. Mesh links used there:rune:brainstorm,rune:debug,rune:plan.
Goal: Catch issues before they reach production.
Quality checks run in two stages — spec compliance gates code review. Reviewing code quality before verifying it matches the spec wastes effort on code that may need rewriting.
Signal dispatch ordering: When fix emits code.changed, 4 listeners react (preflight, sentinel, test, review). Cook coordinates dispatch order — do NOT let all 4 fire simultaneously:
STAGE 1 (parallel):
Launch 5a (preflight) + 5b (sentinel) simultaneously.
Wait for BOTH to complete.
If 5a returns BLOCK → fix spec gaps, re-run 5a. Code review CANNOT start on non-compliant code.
If 5b returns BLOCK → fix security issue, re-run 5b.
STAGE 2 (after Stage 1 passes):
Launch 5c (review) + 5d (completion-gate) simultaneously.
If any returns BLOCK → fix findings, re-run the blocking check only.
Full detail moved to
references/quality-loop.md(progressive disclosure). Read that file before executing this section.
Full detail moved to
references/quality-loop.md(progressive disclosure). Read that file before executing this section. Mesh links used there:rune:ba,rune:plan.
REQUIRED SUB-SKILL: Use rune:preflight
REQUIRED SUB-SKILL: Use rune:sentinel
REQUIRED SUB-SKILL: Use rune:review
team): The review agent MUST be a separate context window from the implementing agent. Author reasoning contaminates review — the reviewer should never have seen the implementation's reasoning chain. Sonnet implements, a fresh Sonnet reviews.REQUIRED SUB-SKILL: Use rune:completion-gate
// ..., // rest of code, bare ellipsis) — agent MUST complete all outputGate: If sentinel finds CRITICAL security issue → STOP, fix it, re-run. Non-negotiable. Gate: If completion-gate finds UNCONFIRMED claim → STOP, re-verify. Non-negotiable.
Full detail moved to
references/quality-loop.md(progressive disclosure). Read that file before executing this section.
Invoke rune:session-bridge after Phase 2, 4, and 5 to save intermediate state. OPT-IN — activate only if task spans 3+ phases, context-watch is ORANGE, or user explicitly requests checkpoints. Before spawning subagents, invoke rune:context-pack to create structured handoff briefings.
Before entering ANY Phase N+1, assert: Phase N completed in TodoWrite | gate condition met | no BLOCK from sub-skills | no unresolved CRITICAL findings. If any fails → STOP, log "BLOCKED at Phase N→N+1: [assertion]", fix, re-check.
Key transitions: 1→2: scout done | 2→3: plan approved | 3→4: failing tests exist | 4→5: all tests pass | 5→6: no CRITICAL findings | 6→6.5: lint+types+build green | 6.5→7: convergence.clean or documented escalation (features with requirements.md; others pass through).
REQUIRED SUB-SKILL: Use rune:verification — run lint, type check, full test suite, build. Then rune:hallucination-guard to verify imports and API signatures. ALL checks MUST pass before commit.
Quickstart execution: if .rune/features/<name>/quickstart.md exists (plan Step 3.7 boundary artifact), execute its validation blocks — run each command, compare against its Expect line. Any mismatch = verification FAIL (treat like a failing test). If the environment cannot run a block (no browser, no DB), SKIP it with the reason named in the Cook Report — a skipped quickstart is visible debt, never silent.
A P1 story with a CRITICAL convergence gap (missing/contradicts) MUST NOT be committed as "done." Either remediate within the round cap, or escalate with the gap documented — never claim completion over a known dead path.Full detail moved to
references/converge-phase.md(progressive disclosure). Read that file before executing this section. Mesh links used there:rune:converge.
RECOMMENDED SUB-SKILL: Use rune:git — stage specific files (git add <files>, NOT git add .), generate semantic commit message from diff. If working from master plan: update phase status 🔄 → ✅, announce next phase or "All phases complete."
Full detail moved to
references/bridge-phase.md(progressive disclosure). Read that file before executing this section. Mesh links used there:rune:session-bridge.
NEVER treat a Cancel/Pause signal as a Steer or NewTask. User safety signals take absolute priority. If ambiguous between Cancel and Steer → ask user: "Did you mean stop, or change approach?" "Bad work is worse than no work." Cook MUST produce this report rather than attempting a 4th variant of a failing approach. Escalating is not failure — shipping broken code is.Full detail moved to
references/autonomous-patterns.md(progressive disclosure). Read that file before executing this section.
Full detail moved to
references/recovery.md(progressive disclosure). Read that file before executing this section.
Full detail moved to
references/recovery.md(progressive disclosure). Read that file before executing this section.
5+ consecutive read-only tool calls (Read, Grep, Glob) without a single write action (Edit, Write, Bash) = STUCK.Full detail moved to
references/paralysis-guard.md(progressive disclosure). Read that file before executing this section.
You MUST either:
Stuck patterns (all banned):
A wrong first attempt that produces feedback beats perfect understanding that never ships.
/rune cook direct invocation — primary entry pointteam (L1): parallel workstream execution (meta-orchestration)| Phase | Sub-skill | Layer | Purpose |
|---|---|---|---|
| 0 / 8 | neural-memory | ext | Recall context at start; capture learnings at end |
| 0.5 | sentinel-env | L3 | Environment pre-flight (first run only) |
| 1 | scout | L2 | Scan codebase before planning |
| 1 | onboard | L2 | Initialize project context if no CLAUDE.md |
| 1 | ba | L2 | Requirement elicitation for features |
| 1 | logic-guardian | L2 | Conditional: when .rune/logic-manifest.json exists — protect complex business logic before any edits |
| 2 | plan | L2 | Create implementation plan |
| 2 | brainstorm | L2 | Trade-off analysis / rescue mode |
| 2 | design | L2 | UI/design phase for frontend features — invoke with mode: "tweaks-default" (one opinionated default + accept natural-language tweaks, not a 5-option menu) |
| 2.5 | adversary | L2 | Red-team challenge on approved plan |
| 3 | test | L2 | Write failing tests (RED phase) |
| 4 | fix | L2 | Implement code changes (GREEN phase) |
| 4 | debug | L2 | Unexpected errors (max 3 loops) |
| 4 | db | L2 | Schema changes detected in diff |
| 4 | worktree | L3 | Worktree isolation for parallel implementation |
| 5a | preflight | L2 | Spec compliance + logic review |
| 5b | sentinel | L2 | Security scan |
| 5c | review | L2 | Code quality review |
| 5 | scope-guard | L3 | Verify changed files match approved plan scope (flag out-of-scope files before commit) |
| 5 | perf | L2 | Performance regression check (optional) |
| 5 | audit | L2 | Project health audit when scope warrants |
| 5 | review-intake | L2 | Structured review intake for complex PRs OR Issue Triage Mode for issue tracker items (state machine: needs-triage / needs-info / ready-for-agent / ready-for-human / wontfix). When external feedback source is an issue (not PR comment), review-intake auto-detects and runs Issue Triage Mode — emits triage.classified + agent.brief.ready (for AFK pickup) |
| 5 | sast | L3 | Static analysis security testing |
| 5d | completion-gate | L3 | Validate agent claims against evidence trail |
| 5 | constraint-check | L3 | Audit HARD-GATE compliance across workflow |
| 6 | verification | L3 | Lint + types + tests + build |
| 6 | hallucination-guard | L3 | Verify imports and API calls are real |
| 6.5 | converge | L3 | Spec↔code gap scan for features with requirements.md — dead buttons, missing backends, contradicted decisions |
| 7 | journal | L3 | Record architectural decisions |
| 8 | session-bridge | L3 | Save context for future sessions |
| any | context-pack | L3 | create structured handoff briefings before spawning subagents |
| any | skill-forge | L2 | When new skill creation detected during cook |
| 1.5 | L4 extension packs | L4 | Domain-specific patterns when stack matches |
Full detail moved to
references/contracts.md(progressive disclosure). Read that file before executing this section.
.rune/decisions.md without explicit user overrideFull detail moved to
references/contracts.md(progressive disclosure). Read that file before executing this section. Mesh links used there:rune:ba,rune:scout.
Full detail moved to
references/structured-output.md(progressive disclosure). Read that file before executing this section.
Full detail moved to
references/contracts.md(progressive disclosure). Read that file before executing this section.
Full detail moved to
references/contracts.md(progressive disclosure). Read that file before executing this section.
Full detail moved to
references/contracts.md(progressive disclosure). Read that file before executing this section.
Full detail moved to
references/anti-patterns.md(progressive disclosure). Read that file before executing this section.
CRITICAL failures (always check): skipping scout | writing code without plan approval | "done" without evidence trail | surrendering without Approach Pivot Gate | breaking change without RFC | treating Cancel/Pause as scope change.
Full detail moved to
references/contracts.md(progressive disclosure). Read that file before executing this section.
All applicable phases complete + Self-Validation passed:
convergence.clean OR skip announced (no requirements.md) OR escalation documented — never silent~$0.05-0.15 per feature. Haiku for scanning (Phase 1), sonnet for coding (Phase 3-4), opus for complex planning (Phase 2 when needed).
references/anti-patterns.md (opens in a new tab)references/autonomous-patterns.md (opens in a new tab)references/bridge-phase.md (opens in a new tab)references/contracts.md (opens in a new tab)references/converge-phase.md (opens in a new tab)references/deviation-rules.md (opens in a new tab)references/domain-context.md (opens in a new tab)references/error-recovery.md (opens in a new tab)references/exit-conditions.md (opens in a new tab)references/loop-detection.md (opens in a new tab)references/mid-run-signals.md (opens in a new tab)references/modes.md (opens in a new tab)references/orchestration.md (opens in a new tab)references/output-format.md (opens in a new tab)references/pack-detection.md (opens in a new tab)references/paralysis-guard.md (opens in a new tab)references/pause-resume-template.md (opens in a new tab)references/plan-gates.md (opens in a new tab)references/quality-loop.md (opens in a new tab)references/recovery.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
general-purpose), waits for its result67 skills in this plugin
/adversaryPre-implementation red-team analysis. Use when a plan is high-risk, critical path, or expensive to reverse. Challenges plans before code is written — finds edge cases, security holes, scalability bottlenecks, error propagation risks, and integration conflicts. Catches flaws at plan time (10x cheaper than post-implementation)./asset-creatorCreates code-based visual assets — SVG icons, OG image HTML templates, social banners, and icon sets. Use when generating visuals as code (vector/HTML), NOT raster images — for raster generation see @rune-pro/media. Outputs files with usage instructions./auditComprehensive project audit — security, dependencies, code quality, architecture, performance, infra, docs, and mesh analytics. Use when needing a full 8-dimension health-score snapshot before a major release, M&A diligence, or quarterly review. Delegates to specialist skills (sentinel, dependency-doctor, perf, autopsy, etc.).npx claudepluginhub rune-kit/rune --plugin runeOther plugins' skills for the same job