rune-kit/rune/preflight
Claude Code and agent skill by rune-kit/rune
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Pre-commit quality gate that catches 'almost right' code. Use when about to commit — auto-fires before commit to validate logic correctness, error handling, regressions, and completeness. Goes beyond linting.
Install
npx vskill@latest install rune-kit/rune/preflightSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as rune-kit/rune/preflight.
preflight
Purpose
<HARD-GATE> Preflight verdict of BLOCK stops the pipeline. The calling skill (cook, deploy, launch) MUST halt until all BLOCK findings are resolved and preflight re-runs clean. </HARD-GATE>
Pre-commit quality gate that catches "almost right" code — the kind that compiles and passes linting but has logic errors, missing error handling, or incomplete implementations. Goes beyond static analysis to check data flow, edge cases, async correctness, and regression impact. The last defense before code enters the repository.
Triggers
- Called automatically by
cookbefore commit phase - Called by
fixafter applying fixes (verify fix quality) /rune preflight— manual quality check- Auto-trigger: when staged changes exceed 100 LOC
Calls (outbound)
scout(L2): find code affected by changes (dependency tracing)sentinel(L2): security sub-check on changed fileshallucination-guard(L3): verify imports and API references existtest(L2): run test suite as pre-commit check
Called By (inbound)
cook(L1): before commit phase — mandatory gate
Check Categories
Executable Steps
Stage A — Spec Compliance (Plan vs Diff)
Before checking code quality, verify the code matches what was planned.
Use Bash to get the diff: git diff --cached (staged) or git diff HEAD (all changes). Use Read to load the approved plan from the calling skill (cook passes plan context).
Check each plan phase against the diff:
| Plan says... | Diff shows... | Verdict | |
|---|---|---|---|
| "Add function X to file Y" | Function X exists in file Y | PASS | |
| "Add function X to file Y" | Function X missing | BLOCK — incomplete implementation | |
| "Modify function Z" | Function Z untouched | BLOCK — planned change not applied | |
| Nothing about file W | File W modified | WARN — out-of-scope change (scope creep) |
Output: List of plan-vs-diff mismatches. Any missing planned change = BLOCK. Any unplanned change = WARN.
If no plan is available (manual preflight invocation), skip Stage A and proceed to Step 1.
Step 1 — Logic Review
Use Read to load each changed file. For every modified function or method:
- Trace the data flow from input to output. Identify where a
null,undefined, empty array, or 0 value would cause a runtime error or wrong result. - Check async/await: every
asyncfunction that calls an async operation mustawaitit. Identify missingawaitthat would cause race conditions or unhandled promise rejections. - Check boundary conditions: off-by-one in loops, array index out of bounds, division by zero.
- Check type coercions: implicit
==comparisons that could produce wrong results, string-to-number conversions without validation.
Common patterns to flag:
Flag each issue with: file path, a verbatim evidence snippet copied from the file, category (null-deref | missing-await | off-by-one | type-coerce), and a one-line description. Record the snippet, not a line number — Step 6's Anchor Pass resolves the line with Grep.
Step 2 — Error Handling
For every changed file, verify:
- Every
asyncfunction has atry/catchblock OR the caller explicitly handles the rejected promise. - No bare
catch(e) {}orexcept: pass— every catch must log or rethrow with context. - Every
fetch/ HTTP client call checks the response status before consuming the body. - Error messages are user-friendly: no raw stack traces, no internal variable names exposed to the client.
- API route handlers return appropriate HTTP status codes (4xx for client errors, 5xx for server errors).
Common patterns to flag:
Flag each violation with: file path, a verbatim evidence snippet, category (bare-catch | missing-status-check | raw-error-exposure), and description. Same rule as Step 1 — the snippet is what you produce; the line number comes from Step 6's Anchor Pass.
Step 3 — Regression Check
Use rune:scout to identify all files that import or depend on the changed files/functions. For each dependent file:
- Check if the changed function signature is still compatible (parameter count, types, return type).
- Check if the dependent file has tests that cover the interaction with the changed code.
- Flag untested impact zones: dependents with zero test coverage of the affected code path.
Flag each regression risk with: dependent file path, what changed, whether tests exist, severity (breaking | degraded | untested).
Step 4 — Completeness Check
Verify that new code ships complete:
- New API endpoint → has input validation schema (Zod, Pydantic, Joi, etc.)
- New React/Svelte component → has loading state AND error state
- New feature → has at least one test file
- New configuration option → has documentation (inline comment or docs file)
- New database query → has corresponding migration file if schema changed
- Cross-layer pairing: new interactive component (button/form/action) → its handler chain reaches a REAL endpoint/service that exists in the codebase — OR the plan explicitly scopes it UI-only with a mock (stated, not assumed). Unexcused missing pair = BLOCK, not WARN: a dead interactive element is incomplete work presented as complete. (Mirror check: new endpoint this diff → ≥1 consumer or a NAMED future task consuming it)
Framework-specific completeness (apply only if detected):
- React component with async data → must have
loadingstate ANDerrorstate - Next.js Server Action → must have
try/catchand return typed result - FastAPI endpoint → must have Pydantic request/response models
- Django ViewSet → must have explicit
permission_classes - Express route → must have input validation middleware before handler
If any completeness item is missing, flag as WARN with: what is missing, which file needs it.
Step 4.2 — Coherence Check
Verify that new code is consistent with existing project patterns — not just correct, but coherent with the codebase it lives in.
| Check | What To Look For | Severity | |
|---|---|---|---|
| Naming conventions | New functions/variables follow project's existing naming style (camelCase, snake_case, etc.) | WARN | |
| File organization | New files placed in correct directory per project structure (e.g., utils/ not lib/, components/ not ui/) | WARN | |
| Import patterns | Uses project's established import style (absolute vs relative, barrel exports vs direct) | WARN | |
| Error handling style | Matches project's existing pattern (Result type, try/catch, error codes) | WARN | |
| State management | Uses same state approach as rest of project (Zustand, context, stores) | BLOCK if different paradigm | |
| API patterns | Follows existing response format, middleware chain, auth pattern | BLOCK if diverges | |
| Design system usage | Uses existing design tokens/components, not inline overrides | WARN |
Detection: Read 2-3 existing files in the same directory as the change. Compare patterns. Flag divergences.
Skip if: Project has no established patterns (greenfield, <5 files), or CLAUDE.md/conventions.md explicitly says "no conventions yet."
Step 4.3 — Eval Verification
If .rune/evals/ directory exists with eval definition files, verify eval results as part of the quality gate.
| Check | Action | Severity | |
|---|---|---|---|
| Capability eval defined but not run | Feature has .rune/evals/<feature>.md with CAP-* entries but no results | WARN: "Capability evals defined but not executed" | |
| Regression eval failing | Any REG-* eval with status=fail | BLOCK: "Regression detected — existing behavior broken" | |
| Capability eval below threshold | CAP-* eval pass@k below defined threshold | WARN: "Capability eval below threshold (X% vs Y% required)" | |
| No eval file for new feature | New feature added (detected by new test files + new source files) but no .rune/evals/ entry | INFO: "Consider defining capability evals for new feature" |
Skip if: No .rune/evals/ directory exists (project hasn't adopted eval-driven development).
Step 4.5 — Domain Quality Hooks
Apply domain-specific quality checks based on detected file types in the diff. These extend the generic completeness checks in Step 4 with deeper domain validation.
<HARD-GATE> Domain hooks are additive — they add checks, never remove generic ones from Steps 1-4. If a domain hook flags BLOCK, the overall preflight verdict is BLOCK regardless of other steps. </HARD-GATE>
Hook Selection (auto-detect from diff)
| Detected Pattern | Domain Hook | Key Checks | |
|---|---|---|---|
migrations/*.sql, *.migration.* | Database | Rollback script present, no bare DROP/DELETE, migration tested | |
openapi.*, *.graphql, *.proto | API Contract | Breaking changes flagged, version bumped, deprecated fields documented | |
docs/policies/*, PRIVACY*, TERMS* | Legal/Compliance | No placeholder text, review date current, practice matches policy | |
**/billing*, **/payment*, **/invoice* | Financial | Decimal precision correct, currency locale-aware, no hardcoded rates | |
*.tsx, *.jsx, *.svelte, *.vue, *.html (with script/template content), components/* | UI/Frontend | Design token compliance, animation a11y, touch targets, visual hierarchy | |
skills/*/SKILL.md, extensions/*/PACK.md | Rune Skill | Frontmatter valid, all required sections present, word count within layer budget | |
*.test.*, *.spec.*, __tests__/*, tests/char/**, tests/holdout/** | Test Quality | Enforced by hook-dispatch: test-integrity (rune verify --integrity) plus junk-match (rune verify --junk: no tautological asserts, empty snapshots, mock-echo, catch-all regex). Project lints from rune verify --reflect also run here. See test-integrity-gate and verify-cli. |
Domain Hook Execution
For each detected domain, run its checks on the relevant files in the diff:
- Identify which domain hooks apply based on changed file patterns
- Load domain-specific check rules (inline above, or from pack reference files if a pack is installed)
- Scan each relevant file for domain violations
- Classify findings: BLOCK (data loss risk, breaking contract) or WARN (best practice, incomplete)
- Append to preflight report under
### Domain Qualitysection
UI/Frontend Domain Checks
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/preflight/SKILL.md
Popularity
- Repository stars
- 77
- Repository forks
- 21
- Repository npm downloads, 30 days
- 548
- 7-day trend score
- 34
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 4 Jul 2026, 4 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/rune-kit/rune/preflight)