agentleFS
Rune-kitRune-kit/rune/skills/cook/SKILL.md

cook

Skill96 starsChanged 7 months agoMITView on GitHub

Feature implementation orchestrator — runs the TDD cycle understand → plan → test → implement → quality → verify → commit. Use when the user wants working code built or changed across more than a line or two: a new feature, a bug fix with an unknown blast radius, a refactor. Not for questions, reviews or trivial one-line edits; for a change that is already fully specified, use fix.

  • Reads credentials

23 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use csv-translator, upgrade-app and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • pass-with-high-scoreSkill

    csv-translator

    Specialized skill for translating large CSV files. It follows a multi-step process of planning, counting lines, splitting large files into manageable chunks, translating chunks, merging, and finally importing translations into Android resource files. Use when the user needs to translate a CSV file, especially large ones.

    Also in 3 projects that use this

  • pass-with-high-scoreSkill

    upgrade-app

    Automates the process of upgrading the app version. Bumps versionCode and versionName in build.gradle.kts, updates the changelog, verifies the build, commits, pushes, and creates a GitHub release. Use when the user says "upgrade app", "release new version", or "bump version".

    Also in 3 projects that use this

  • OpenAnalystIncSkill

    markdown-novel-viewer

    Also in 3 projects that use this

  • apetrovSkill

    github-issue-manager

    Manage GitHub issues in the current repo via gh CLI. Use when asked to look up, inspect, design/plan, create, or implement a specific GitHub issue; or to update issue title/body/labels/state with explicit confirmation.

    Also in 3 projects that use this

  • mrgoonieSkill

    web-testing

    Web testing with Playwright, Vitest, k6. E2E/unit/integration/load/security/visual/a11y testing. Use for test automation, flakiness, Core Web Vitals, mobile gestures, cross-browser.

    Also in 3 projects that use this

  • mrgoonieSkill

    web-frameworks

    Build modern full-stack web applications with Next.js (App Router, Server Components, RSC, PPR, SSR, SSG, ISR), Turborepo (monorepo management, task pipelines, remote caching, parallel execution), and RemixIcon (3100+ SVG icons in outlined/filled styles). Use when creating React applications, implementing server-side rendering, setting up monorepos with multiple packages, optimizing build performance and caching strategies, adding icon libraries, managing shared dependencies, or working with TypeScript full-stack projects.

    Also in 3 projects that use this

  • +4 more from mrgoonie

The file

Show its rules and text

We split this skill into the rules it gives an agent

56 rules. 0 are common, 34 are distinctive, and 22 are very specific to this project.

  • 0

    Common

    Most of the 21 edited versions we read keep these.

  • 34

    Distinctive

    This author's own choices. Worth a look.

  • 22

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Before starting ANY implementation:

    line 25
  2. Distinctive:

    Not every task needs every phase:

    line 38
  3. Distinctive:

    Before selecting a workflow chain or phase set, compute the task's rigor level from risk signals.

    line 55
  4. Distinctive:

    If rigor upgrades mid-task (e.g., scout reveals cross-module impact not obvious from description), announce: "Rigor upgrade: [signal …

    line 82
  5. Distinctive:

    If any of these are detected mid-task, STOP and upgrade to Fast/Full mode.

    line 95
  6. Very specific:

    SUB-SKILL: Use rune:sentinel-env — verify the environment can run the project before planning.

    line 104
  7. Very specific:

    REQUIRED SUB-SKILLS: Use rune:scout. For non-trivial tasks, use rune:ba.

    line 112
  8. Distinctive:

    Create TodoWrite with all applicable phases for this task

    line 114
  9. Distinctive:

    Ask 2 questions before planning: (1) "What does success look like?" (2) "What should NOT change?"

    line 122
  10. Very specific:

    Python async detection: if Python project detected, Grep for async indicators (async def, await, aiosqlite, aiohttp, asyncio.run).

    line 128
  11. Distinctive:

    Explore-Before-Commit: If scout reveals multiple viable approaches (e.g., 2+ libraries, 2+ architectural patterns), do NOT commit to an …

    line 129
  12. Distinctive:

    Gate: If scout finds the feature already exists → STOP and inform user.

    line 135
  13. Very specific:

    Step 0.4 — Template Detection: If user passed --template <name>:

    line 149
  14. Very specific:

    Search installed pack templates for the name: Glob for extensions/*/templates/<name>.md and extensions/pro-*/templates/<name>.md

    line 150
  15. Very specific:

    If found: Read the template file → parse phases, signals, connections, acceptance criteria

    line 151
  16. Very specific:

    Write plan files to .rune/plan-<template-name>.md + .rune/plan-<template-name>-phaseN.md

    line 153
  17. Distinctive:

    If template not found: warn user and fall through to normal workflow

    line 155
  18. Very specific:

    Step 0.5 — Cross-Project Recall: Call neural-memory (Recall Mode) with 3-5 topics relevant to the current task.

    line 157
  19. Very specific:

    Use Glob to check for .rune/plan-*.md files

    line 159
  20. Distinctive:

    If a master plan exists matching the current task:

    line 160
  21. Very specific:

    Read the (reconciled) master plan → find first ⬚ Pending or 🔄 Active phase → load ONLY that phase file → announce "Resuming from Phase N" …

    line 165
  22. Distinctive:

    If no master plan exists → proceed to Phase 1 as normal

    line 166
  23. Very specific:

    Step 0.6 — Contract Load: Use Glob to check for .rune/contract.md.

    line 168
  24. Distinctive:

    If no contract exists → proceed normally (contract is optional)

    line 172
  25. Very specific:

    REQUIRED SUB-SKILL: Use rune:plan

    line 184
  26. Distinctive:

    Create implementation plan: exact files to create/modify, change order, dependencies, active decision constraints

    line 188
  27. Very specific:

    If multiple valid approaches exist → invoke rune:brainstorm for trade-off analysis

    line 189
  28. Very specific:

    If feature workspace was created, write approved plan to .rune/features/<name>/plan.md

    line 192
  29. Distinctive:

    NEVER load multiple phase files at once.

    line 215
  30. Distinctive:

    If the coder model needs info from other phases, it's in the Cross-Phase Context section of the current phase file.

    line 216
  31. Very specific:

    Write ONE test for the next behavior — vertical slicing required, see rune:test references/vertical-tdd.md.

    line 227
  32. Distinctive:

    Run the test to verify it FAILS — expected: RED because implementation doesn't exist yet

    line 229
  33. Very specific:

    Gate: Test MUST exist and MUST fail.

    line 232
  34. Distinctive:

    Goal: Write the minimum code to make tests pass.

    line 236
  35. Distinctive:

    Do NOT surrender. Do NOT tell user "no solution exists." Do NOT try a 4th variant of the same approach.

    line 245
  36. Distinctive:

    Do NOT try a 4th variant of the same approach.

    line 246
  37. Distinctive:

    MUST invoke brainstorm(mode="rescue") before giving up.

    line 247
  38. Very specific:

    Signal dispatch ordering: When fix emits code.changed, 4 listeners react (preflight, sentinel, test, review).

    line 256
  39. Distinctive:

    Stage 2: test (after Stage 1 passes — no point testing non-compliant code)

    line 258
  40. Very specific:

    No truncated code files (// ..., // rest of code, bare ellipsis) — agent MUST complete all output

    line 300
  41. Distinctive:

    Gate: If sentinel finds CRITICAL security issue → STOP, fix it, re-run.

    line 303
  42. Distinctive:

    Gate: If completion-gate finds UNCONFIRMED claim → STOP, re-verify.

    line 304
  43. Very specific:

    Before entering ANY Phase N+1, assert: Phase N completed in TodoWrite | gate condition met | no BLOCK from sub-skills | no unresolved …

    line 316
  44. Very specific:

    REQUIRED SUB-SKILL: Use rune:verification — run lint, type check, full test suite, build.

    line 322
  45. Very specific:

    RECOMMENDED SUB-SKILL: Use rune:git — stage specific files (git add <files>, NOT git add .), generate semantic commit message from diff.

    line 337
  46. Distinctive:

    NEVER treat a Cancel/Pause signal as a Steer or NewTask.

    line 348
  47. Distinctive:

    If ambiguous between Cancel and Steer → ask user: "Did you mean stop, or change approach?" </HARD-GATE>

    line 349
  48. Distinctive:

    MUST run scout before planning

    line 433
  49. Distinctive:

    MUST get user plan approval before writing code

    line 434
  50. Distinctive:

    MUST write failing tests before implementation (TDD) unless explicitly skipped

    line 435
  51. Distinctive:

    MUST NOT commit with failing tests

    line 436
  52. Distinctive:

    MUST NOT modify files outside approved plan scope without user confirmation

    line 437
  53. Distinctive:

    MUST run verification (lint + type-check + tests + build) before commit

    line 438
  54. Distinctive:

    MUST NOT say "all tests pass" without showing actual test output

    line 439
  55. Very specific:

    MUST NOT contradict .rune/decisions.md without explicit user override

    line 440
  56. Distinctive:

    All applicable phases complete + Self-Validation passed:

    line 478

“Common” is measured: kept by at least 6 in 10 of the 21 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

cook

Purpose

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.

<HARD-GATE> 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. </HARD-GATE>

Workflow Chains (Predefined)

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.

Phase Skip Rules

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.

Rigor Assessment (Progressive Scaling)

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 SignalWeightDetection
Files affected: 10Estimate from task description + scout
Files affected: 2-3+1
Files affected: 4++3
Cross-module impact (changes span 2+ directories)+2scout identifies touch points across boundaries
Security-sensitive code (auth, crypto, payments, secrets)+3Keyword match in file paths or task description
Public API change (exports, routes, schema)+2Task modifies interfaces consumed by external code
Database schema change+2Task mentions migration, schema, ALTER, column
New dependency added+1Task requires npm install or equivalent
Code will be imported by other modules+1New exports or modifications to shared utilities

Rigor level mapping:

ScoreLevelMaps ToPhases
0Nanonano chainDO → VERIFY → DONE
1-2Fastfast modePhase 1 → 4 → 6 → 7
3-5Standardbugfix / refactorPhase 1 → 2 → 4 → 5 → 6 → 7
6-8FullfeaturePhase 1 → 1.5 → 2 → 3 → 4 → 5 → 6 → 7 → 8
9+Criticalsecurity / full + adversaryAll phases + sentinel@opus + adversary

Rules:

  • Security signal (+3) automatically floors rigor at Standard — NEVER nano/fast for security code
  • User can override: "full pipeline" forces Full, "just do it" forces Nano
  • If rigor upgrades mid-task (e.g., scout reveals cross-module impact not obvious from description), announce: "Rigor upgrade: [signal detected] — upgrading from Fast to Standard."
  • Announce chosen level: "Rigor: Fast (score 2 — single file, no security)"

Nano Mode (Auto-Detect)

Full detail moved to references/modes.md (progressive disclosure). Read that file before executing this section.

<HARD-GATE> 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. </HARD-GATE>

Fast Mode (Auto-Detect)

Full detail moved to references/modes.md (progressive disclosure). Read that file before executing this section.

Phase 0.5: ENVIRONMENT CHECK (First Run Only)

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.

Phase 1: UNDERSTAND

Goal: Know what exists before changing anything.

REQUIRED SUB-SKILLS: Use rune:scout. For non-trivial tasks, use rune:ba.

  1. Create TodoWrite with all applicable phases for this task
  2. Mark Phase 1 as in_progress
  3. BA gate: Feature Request / Integration / Greenfield → invoke rune: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.
  4. Decision enforcement: 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.

Phase 1 Step 3.5 — Clarification Gate

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.

  1. Invoke scout to scan the codebase (Glob + Grep + Read on relevant files)
  2. Summarize: what exists, project conventions, files likely to change, active decision constraints
  3. Python async detection: if Python project detected, Grep for async indicators (async def, await, aiosqlite, aiohttp, asyncio.run). If ≥3 matches → flag as "async-first Python" — new code defaults to async def
  4. Explore-Before-Commit: If scout reveals multiple viable approaches (e.g., 2+ libraries, 2+ architectural patterns), do NOT commit to an approach yet. Instead:
    • List alternatives with 1-line trade-off each
    • Flag to Phase 2 (plan) for formal comparison
    • Separating "thinking" (Phase 1) from "committing" (Phase 2) prevents premature lock-in
  5. Mark Phase 1 as completed

Gate: If scout finds the feature already exists → STOP and inform user.

Phase 1.5: DOMAIN CONTEXT (L4 Pack Detection)

Full detail moved to references/domain-context.md (progressive disclosure). Read that file before executing this section.

Phase 1.7: WORKFLOW ORCHESTRATION (Multi-Skill Sequences)

Full detail moved to references/orchestration.md (progressive disclosure). Read that file before executing this section.

Phase 0: RESUME CHECK (Before Phase 1)

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>:

  1. Search installed pack templates for the name: Glob for extensions/*/templates/<name>.md and extensions/pro-*/templates/<name>.md
  2. If found: Read the template file → parse phases, signals, connections, acceptance criteria
  3. Generate a master plan from the template: each template phase becomes a plan phase
  4. Write plan files to .rune/plan-<template-name>.md + .rune/plan-<template-name>-phaseN.md
  5. Announce "Loading template: <name> (<pack>)" → skip Phase 1, 1.5, 1.7, 2 → proceed to Phase 4 with Phase 1 of the template
  6. If template not found: warn user and fall through to normal workflow

Step 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").

  1. Use Glob to check for .rune/plan-*.md files
  2. If a master plan exists matching the current task:
    • Step 0.55 — Spec-Backfill Gate (HARD-GATE): Before resuming, Glob .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:
      1. Invoke 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.
      2. Re-invoke 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).
      3. THEN resume. For Bug Fix / Refactor / trivial tasks, skip this gate — no spec is expected.
    • Read the (reconciled) master plan → find first ⬚ Pending or 🔄 Active phase → load ONLY that phase file → announce "Resuming from Phase N" → skip to Phase 4
  3. If no master plan exists → proceed to Phase 1 as normal

Step 0.6 — Contract Load: Use Glob to check for .rune/contract.md. If it exists:

  1. Read the contract file and parse each ## section as a named rule set
  2. Hold contract rules in context — they apply as hard gates throughout all phases
  3. Any code change that violates a contract rule → STOP and inform user before proceeding
  4. If no contract exists → proceed normally (contract is optional)
<HARD-GATE> Contract violations are NON-NEGOTIABLE. If `.rune/contract.md` exists and a planned or implemented change violates any rule, cook MUST stop and report the violation. The user must explicitly override ("ignore contract rule X") to proceed. </HARD-GATE>

This enables multi-session workflows: Opus plans once → each session picks up the next phase.

Phase 2: PLAN

Goal: Break the task into concrete implementation steps before writing code.

REQUIRED SUB-SKILL: Use rune:plan

  1. Mark Phase 2 as in_progress
  2. Feature workspace (opt-in) — for non-trivial features (3+ phases), suggest creating .rune/features/<feature-name>/ with spec.md, plan.md, decisions.md, status.md. Skip for simple bug fixes, fast mode.
  3. Create implementation plan: exact files to create/modify, change order, dependencies, active decision constraints
  4. If multiple valid approaches exist → invoke rune:brainstorm for trade-off analysis
  5. Frontend detection — if task touches .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.
  6. Present plan to user for approval
  7. If feature workspace was created, write approved plan to .rune/features/<name>/plan.md
  8. Mark Phase 2 as completed

Gate: User MUST approve the plan before proceeding. Do NOT skip this.

Phase 2.5: RFC GATE (Breaking Changes Only)

Full detail moved to references/plan-gates.md (progressive disclosure). Read that file before executing this section.

<HARD-GATE> Breaking change without RFC = BLOCKED. No exceptions. "It's just a small change" is the #1 excuse for production incidents from unreviewed breaking changes. </HARD-GATE>

Phase 2.5: ADVERSARY (Red-Team Challenge)

Full detail moved to references/plan-gates.md (progressive disclosure). Read that file before executing this section. Mesh links used there: rune:adversary.

Phase-Aware Execution (Master Plan + Phase Files)

Full detail moved to references/orchestration.md (progressive disclosure). Read that file before executing this section. Mesh links used there: rune:plan.

<HARD-GATE> 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. </HARD-GATE>

Phase 3: TEST (TDD Red)

Goal: Define expected behavior with failing tests BEFORE writing implementation.

REQUIRED SUB-SKILL: Use rune:test

  1. Mark Phase 3 as in_progress
  2. Eval definitions (Full/Critical rigor only): Before writing tests, define capability evals (pass@k) and regression evals (pass^k) in .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.
  3. Write ONE test for the next behavior — vertical slicing required, see rune:test references/vertical-tdd.md. Bulk-writing tests = horizontal violation, blocks Phase 4
  4. Python async pre-check (if async-first Python flagged in Phase 1): verify pytest-asyncio is installed and asyncio_mode = "auto" is in pyproject.toml — if missing, warn user before writing async tests
  5. Run the test to verify it FAILS — expected: RED because implementation doesn't exist yet
  6. Mark Phase 3 as completed (one cycle); Phase 4 implements that one cycle, then loop returns here for the next test

Gate: 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.

Phase 4: IMPLEMENT (TDD Green)

Goal: Write the minimum code to make tests pass.

REQUIRED SUB-SKILL: Use rune:fix

Reuse Ladder (climb before you write)

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.

<HARD-GATE> 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. </HARD-GATE>

Phase 5: QUALITY (Staged)

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: preflight + sentinel (parallel — independent checks)
  • Stage 2: test (after Stage 1 passes — no point testing non-compliant code)
  • Stage 3: review (after test passes — review verified code only)
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.

Remediation Cycle Counter

Full detail moved to references/quality-loop.md (progressive disclosure). Read that file before executing this section.

Upstream Inconsistency Protocol

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.

5a. Preflight (Spec Compliance + Logic) — STAGE 1

REQUIRED SUB-SKILL: Use rune:preflight

  • Spec compliance: compare approved plan vs actual diff
  • Logic review, error handling, completeness
  • Must pass before 5c (review) can start — no point reviewing code quality if it doesn't match the spec

5b. Security — STAGE 1

REQUIRED SUB-SKILL: Use rune:sentinel

  • Secret scan, OWASP check (no injection/XSS/CSRF), dependency audit

5c. Code Review — STAGE 2

REQUIRED SUB-SKILL: Use rune:review

  • Pattern compliance, code quality, performance bottlenecks
  • Reviewer reads code independently — does NOT rely on implementer's claims
  • Reviewer isolation (when invoked via 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.

5d. Completion Gate — STAGE 2

REQUIRED SUB-SKILL: Use rune:completion-gate

  • Validate agent claims match evidence trail (tests ran, files changed, build passed)
  • No truncated code files (// ..., // rest of code, bare ellipsis) — agent MUST complete all output
  • Any UNCONFIRMED claim → BLOCK

Gate: 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.

Per-Phase Rules (Project-Specific)

Full detail moved to references/quality-loop.md (progressive disclosure). Read that file before executing this section.

Checkpoint Protocol (Opt-In)

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.

Phase Transition Protocol (MANDATORY)

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).

Phase 6: VERIFY

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.

Phase 6.5: CONVERGE (Spec↔Code Gap Scan)

Full detail moved to references/converge-phase.md (progressive disclosure). Read that file before executing this section. Mesh links used there: rune:converge.

<HARD-GATE> 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. </HARD-GATE>

Phase 7: COMMIT

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."

Phase 8: BRIDGE

Full detail moved to references/bridge-phase.md (progressive disclosure). Read that file before executing this section. Mesh links used there: rune:session-bridge.

Autonomous Loop Patterns

Full detail moved to references/autonomous-patterns.md (progressive disclosure). Read that file before executing this section.

<HARD-GATE> 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?" </HARD-GATE><HARD-GATE> "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. </HARD-GATE>

Deviation Rules

Full detail moved to references/recovery.md (progressive disclosure). Read that file before executing this section.

Error Recovery

Full detail moved to references/recovery.md (progressive disclosure). Read that file before executing this section.

Analysis Paralysis Guard

Full detail moved to references/paralysis-guard.md (progressive disclosure). Read that file before executing this section.

<HARD-GATE> 5+ consecutive read-only tool calls (Read, Grep, Glob) without a single write action (Edit, Write, Bash) = STUCK.

You MUST either:

  1. Act — write code, run a command, create a file
  2. Report BLOCKED — state the specific missing piece: "Cannot proceed because [X]"

Stuck patterns (all banned):

  • Reading 10+ files to "fully understand" before acting
  • Grepping every variation of a string across the entire repo
  • Reading the same file twice in one investigation
  • "Let me check one more thing" — repeated after 5 reads

A wrong first attempt that produces feedback beats perfect understanding that never ships. </HARD-GATE>

Called By (inbound)

  • User: /rune cook direct invocation — primary entry point
  • team (L1): parallel workstream execution (meta-orchestration)

Calls (outbound)

PhaseSub-skillLayerPurpose
0 / 8neural-memoryextRecall context at start; capture learnings at end
0.5sentinel-envL3Environment pre-flight (first run only)
1scoutL2Scan codebase before planning
1onboardL2Initialize project context if no CLAUDE.md
1baL2Requirement elicitation for features
1logic-guardianL2Conditional: when .rune/logic-manifest.json exists — protect complex business logic before any edits
2planL2Create implementation plan
2brainstormL2Trade-off analysis / rescue mode
2designL2UI/design phase for frontend features — invoke with mode: "tweaks-default" (one opinionated default + accept natural-language tweaks, not a 5-option menu)
2.5adversaryL2Red-team challenge on approved plan
3testL2Write failing tests (RED phase)
4fixL2Implement code changes (GREEN phase)
4debugL2Unexpected errors (max 3 loops)
4dbL2Schema changes detected in diff
4worktreeL3Worktree isolation for parallel implementation
5apreflightL2Spec compliance + logic review
5bsentinelL2Security scan
5creviewL2Code quality review
5scope-guardL3Verify changed files match approved plan scope (flag out-of-scope files before commit)
5perfL2Performance regression check (optional)
5auditL2Project health audit when scope warrants
5review-intakeL2Structured 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)
5sastL3Static analysis security testing
5dcompletion-gateL3Validate agent claims against evidence trail
5constraint-checkL3Audit HARD-GATE compliance across workflow
6verificationL3Lint + types + tests + build
6hallucination-guardL3Verify imports and API calls are real
6.5convergeL3Spec↔code gap scan for features with requirements.md — dead buttons, missing backends, contradicted decisions
7journalL3Record architectural decisions
8session-bridgeL3Save context for future sessions
anycontext-packL3create structured handoff briefings before spawning subagents
anyskill-forgeL2When new skill creation detected during cook
1.5L4 extension packsL4Domain-specific patterns when stack matches

Data Flow

Full detail moved to references/contracts.md (progressive disclosure). Read that file before executing this section.

Constraints

  1. MUST run scout before planning
  2. MUST get user plan approval before writing code
  3. MUST write failing tests before implementation (TDD) unless explicitly skipped
  4. MUST NOT commit with failing tests
  5. MUST NOT modify files outside approved plan scope without user confirmation
  6. MUST run verification (lint + type-check + tests + build) before commit
  7. MUST NOT say "all tests pass" without showing actual test output
  8. MUST NOT contradict .rune/decisions.md without explicit user override

Mesh Gates

Full detail moved to references/contracts.md (progressive disclosure). Read that file before executing this section. Mesh links used there: rune:ba, rune:scout.

Structured Output Contract (Prompt-as-API Pattern)

Full detail moved to references/structured-output.md (progressive disclosure). Read that file before executing this section.

Output Format

Full detail moved to references/contracts.md (progressive disclosure). Read that file before executing this section.

Returns

Full detail moved to references/contracts.md (progressive disclosure). Read that file before executing this section.

Document Ownership

Full detail moved to references/contracts.md (progressive disclosure). Read that file before executing this section.

Anti-Patterns

Full detail moved to references/anti-patterns.md (progressive disclosure). Read that file before executing this section.

Sharp Edges

<MUST-READ path="references/sharp-edges.md" trigger="before declaring done — review all 18 failure modes"/>

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.

Self-Validation

Full detail moved to references/contracts.md (progressive disclosure). Read that file before executing this section.

Done When

All applicable phases complete + Self-Validation passed:

  • User approved plan | All tests PASS (output shown) | preflight+sentinel+review PASS | build green
  • Convergence: convergence.clean OR skip announced (no requirements.md) OR escalation documented — never silent
  • Cook Report emitted with commit hash | Session state saved to .rune/ via session-bridge

Cost Profile

~$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).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.