logic-guardian

logic-guardian is a skill for Claude Code from Rune-kit/rune. It costs 60 tokens per session (3,091 once invoked), scanned A, original, MIT.

A protection tool for complex business logic, such as payment processing, trading rules, state machines, and game-engine rules. It records important logic, checks files before edits, and validates the resulting changes.

In plain words
What is it for?
Use it when editing or refactoring logic-heavy modules, especially in payment, trading, state-machine, or other systems where individual lines carry important behavior.
Why use it?
An AI coding assistant can accidentally delete or overwrite a small but essential piece of logic, causing silent data corruption or regressions. These checks make such changes easier to detect.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the rune plugin — 66 skills, 1 command, 66 agents, 6 hooks shipped together

Good fit Use it when editing or refactoring logic-heavy modules, especially in payment, trading, state-machine, or other systems where individual lines carry important behavior.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rune-kit/rune/logic-guardian
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Rune-kit/rune --skill logic-guardian
Clone the repo
git clone --depth 1 https://github.com/Rune-kit/rune

Made for: Claude Code.

Or install rune, the plugin that ships this one along with the rest of its 66 skills, 1 command, 66 agents, 6 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for logic-guardian

README.md
[![agentmods](https://agentmods.dev/badge/skills/rune-kit/rune/logic-guardian/github.svg)](https://agentmods.dev/skills/rune-kit/rune/logic-guardian)
Your own site
<a href="https://agentmods.dev/skills/rune-kit/rune/logic-guardian"><img src="https://agentmods.dev/badge/skills/rune-kit/rune/logic-guardian/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for logic-guardian

Your own site · 80×15
<a href="https://agentmods.dev/skills/rune-kit/rune/logic-guardian"><img src="https://agentmods.dev/badge/skills/rune-kit/rune/logic-guardian.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,091 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00060 $0.03091
Opus 5.5 $0.00024 $0.01236
Sonnet 5.5 $0.00012 $0.00618
Haiku 4.5 $0.00006 $0.00309

Measured 8d ago against content hash f93021da68bd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

logic-guardian scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/logic-guardian/SKILL.md · 270 lines

How it starts

The opening of the file, as written. The whole thing — 270 lines — stays where its author put it; the contents beside it link to each section on GitHub.

logic-guardian

Purpose

Complex projects (trading bots, payment systems, game engines, state machines) contain interconnected logic that AI agents routinely destroy by accident. The pattern is always the same: new session starts, agent doesn't know existing logic, rewrites or deletes working code, project regresses. logic-guardian breaks this cycle by maintaining a machine-readable logic manifest, enforcing a pre-edit gate on logic files, and validating that edits don't silently remove existing logic. It is the "institutional memory" for business logic.

Triggers

  • /rune logic-guardian — manual invocation (scan project, generate/update manifest)
  • Auto-trigger: when cook or fix targets a file listed in .rune/logic-manifest.json
  • Auto-trigger: when surgeon plans refactoring on logic-heavy modules
  • Auto-trigger: when .rune/logic-manifest.json exists in project root

Calls (outbound connections)

  • scout (L2): scan project to discover logic files and extract function signatures
  • verification (L3): run tests after logic edits to confirm no regression
  • hallucination-guard (L3): verify that referenced functions/imports actually exist after edit
  • journal (L3): record logic changes as ADRs for cross-session persistence
  • session-bridge (L3): save manifest state so next session loads it immediately

Called By (inbound connections)

  • cook (L1): Phase 1.5 — when complex logic project detected, load manifest before planning
  • fix (L2): pre-edit gate — before modifying any file in the manifest
  • surgeon (L2): pre-refactor — before restructuring logic modules
  • team (L1): validate logic integrity across parallel workstreams
  • review (L2): check if reviewed diff removes or modifies manifested logic

Workflow

Phase 0 — Load Manifest + Invariants

  1. Use Read on .rune/logic-manifest.json
  2. If file exists:
    • Parse manifest, display summary: "Loaded logic manifest: N components, M functions, K parameters"
    • Proceed to step 4 (load invariants)
  3. If manifest does NOT exist:
    • Announce: "No logic manifest found. Scanning project to generate one."
    • Proceed to Phase 3 (Generate)
  4. Obtain invariants (seeded by onboard — see onboard Step 5.4):
    • Preferred: consume the invariants.loaded signal emitted by session-bridge at session start (contains pre-parsed rules[] + stats). No second file read needed.
    • Fallback: if no signal was emitted this session, Read .rune/INVARIANTS.md directly and invoke skills/session-bridge/scripts/load-invariants.js to parse.
    • Entries come from ## Danger Zones, ## Critical Invariants, ## State Machine Rules, ## Cross-File Consistency, and ## Auto-detected (new). Archived rules are automatically excluded by the loader.
    • Each entry follows the WHAT / WHERE / WHY contract from invariants-template.md.
    • Treat INVARIANTS.md as the primary source of cross-file rules — the JSON manifest covers component-level signatures; INVARIANTS.md covers rules that span files (shared constants, state transitions, mirrored schemas).
    • If the file is absent, log WARN: "INVARIANTS.md not found — run rune onboard to seed baseline rules." Do not block.
    • Cache parsed rules keyed by glob so Phase 2 can match the edit target in O(rules × globs) time.

Read the full file on GitHub · 270 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 270 lines · 60 tokens per session scan A f93021da68bd

Subscribe to this mod's changes

logic-guardian is a skill published in the GitHub repository Rune-kit/rune (96 stars, last pushed yesterday), licensed MIT. It adds 60 tokens to every session and 3,091 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-22.

Related

logic-guardian compared with skills from other repositories

logic-guardian next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
logic-guardianRune-kit/runeSkill96yesterdayMITA60Claude Code
criticism-self-criticismHughYau/qiushi-skillSkill4.0k2d agoMITA197Claude Code
fix-pr-review-looprichkuo/rk-skillsSkill50todayMITA90Claude Code
validate-issuerichkuo/rk-skillsSkill50todayMITA55Claude Code
fable-validate-looprichkuo/rk-skillsSkill50todayMITA102Claude Code
refactorsmallnest/goal-workflowSkill3032mo agoMITA71Claude Code
walkthroughsmallnest/goal-workflowSkill3032mo agoMITA131Claude Code