rule-engine

rule-engine is a skill for Claude Code from sfc-gh-dflippo/snowflake-dbt-demo. It costs 65 tokens per session (849 once invoked), scanned A, original, Apache-2.0.

A store of reusable rules for known code-conversion fixes, with tools to search, apply, extract, share, and manage those rules in Snowflake.

In plain words
What is it for?
It finds rules matching SQL, applies approved fixes, and records or propagates rules for later migrations.
Why use it?
It reduces repeated investigation when the same source-to-Snowflake issue appears in multiple files. Automatic pattern fixes can be applied directly, while AI-guided fixes require approval.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Part of the snowflake-migration plugin — 72 skills, 7 agents shipped together

Good fit It finds rules matching SQL, applies approved fixes, and records or propagates rules for later migrations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sfc-gh-dflippo/snowflake-dbt-demo/rule-engine
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 sfc-gh-dflippo/snowflake-dbt-demo --skill rule-engine
Clone the repo
git clone --depth 1 https://github.com/sfc-gh-dflippo/snowflake-dbt-demo

Made for: Claude Code.

Or install snowflake-migration, the plugin that ships this one along with the rest of its 72 skills, 7 agents.

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 rule-engine

README.md
[![agentmods](https://agentmods.dev/badge/skills/sfc-gh-dflippo/snowflake-dbt-demo/rule-engine/github.svg)](https://agentmods.dev/skills/sfc-gh-dflippo/snowflake-dbt-demo/rule-engine)
Your own site
<a href="https://agentmods.dev/skills/sfc-gh-dflippo/snowflake-dbt-demo/rule-engine"><img src="https://agentmods.dev/badge/skills/sfc-gh-dflippo/snowflake-dbt-demo/rule-engine/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 rule-engine

Your own site · 80×15
<a href="https://agentmods.dev/skills/sfc-gh-dflippo/snowflake-dbt-demo/rule-engine"><img src="https://agentmods.dev/badge/skills/sfc-gh-dflippo/snowflake-dbt-demo/rule-engine.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 849 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.00065 $0.00849
Opus 5 $0.00032 $0.00425
Sonnet 5 $0.00013 $0.00170
Haiku 4.5 $0.00006 $0.00085

Measured 2d ago against content hash 5b136c39fcdc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

rule-engine 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 2d 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.

.claude/skills/snowflake-migration/skills/migration/migrate-objects/rule-engine/SKILL.md · 84 lines

How it starts

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

Rule Engine

On Entry

Tell the user:

Rule Engine — I'll search for known migration fix patterns that apply to your code, and can apply them automatically (regex) or with your approval (AI-guided).

Prerequisites

  • Snowflake connection active with direct SQL ability
  • Session configured with a Snowflake connection and database. The configure MCP tool sets up the RULE_ENGINE schema automatically on first call.

Setup (automatic)

You do not run a separate setup step. On the first configure call that supplies both snowflake_connection and snowflake_database, the MCP server creates and seeds everything needed:

  • RULE_ENGINE schema
  • RULES, RULE_EVENTS, CODE_UNITS_SQL tables
  • Built-in seed rules (SQL Server → Snowflake patterns)
  • RULE_SEARCH and CODE_SEARCH Cortex Search services

The setup handler is idempotent: calling configure again reruns pending migrations and re-seeds missing rules without disturbing existing data.

Commands

Search

Find applicable rules for a SQL file. Sends the file content to Snowflake for regex pattern matching (REGEXP_LIKE) and Cortex semantic search.

→ Load search/SKILL.md

Apply

Apply matched rules to local SQL files. Supports single-file and batch application. Runs regex replacements mechanically, presents AI-mode fixes for review.

→ Load apply/SKILL.md

Extract Rules

Analyze code changes to extract reusable migration rules. Works on interactive fixes (before/after comparison) or git history (retroactive analysis of committed changes).

→ Load extract/SKILL.md

Propagate

Given a rule, find all code units in the project it applies to. Uses reverse search (regex + Cortex semantic) to identify candidates, then hands off to Apply for batch application.

→ Load propagate/SKILL.md

Status

Check what rules exist and recent fix history:

SELECT id, name, replacement_mode, priority, rule_sentiment, rule_applications, successes, created_from
FROM RULE_ENGINE.RULES
ORDER BY priority;

Read the full file on GitHub · 84 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. 2d ago First seen · 84 lines · 0 tokens per session scan A 5b136c39fcdc

Subscribe to this mod's changes

rule-engine is a skill published in the GitHub repository sfc-gh-dflippo/snowflake-dbt-demo (33 stars, last pushed 3d ago), licensed Apache-2.0. It adds 65 tokens to every session and 849 once invoked, about $0.0003 per session on Opus 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-09-10.

Related

Other skills, from other repositories

reproduce-bug

Reproduce a reported bug in googleapis/mcp-toolbox and decide whether it is real, delivering an evidence-backed verdict: confirmed, already fixed, misconfiguration, client-side, works as intended, not reproducible, or blocked. Use whenever a maintainer asks you to reproduce, verify, confirm, or investigate a bug…

googleapis/mcp-toolbox · 130 tokens

fix-failing-tests

Diagnose a failing test in the googleapis/mcp-toolbox repo and land a fix by reasoning from the actual error: read the failure, reproduce it, shrink it until the cause is forced into the open, then fix the cause. Use this whenever a test or CI job is red, a build breaks after a change, many packages fail at once, or a…

googleapis/mcp-toolbox · 87 tokens

triage-issues

Triage GitHub issues in the googleapis/mcp-toolbox repo: propose the correct labels (type / priority / product / status), check for duplicates, verify a bug has enough info to act on, and draft a triage comment. Use whenever a maintainer asks you to triage, label, categorize, prioritize, or "look at" an issue (or a…

googleapis/mcp-toolbox · 164 tokens

postgresql-indexing

PostgreSQL indexing best practices for Prowler: index design, partial indexes, partitioned table indexing, EXPLAIN ANALYZE validation, concurrent operations, monitoring, and maintenance. Trigger: When creating or modifying PostgreSQL indexes, analyzing query performance with EXPLAIN, debugging slow queries, reviewing…

prowler-cloud/prowler · 108 tokens

graphjin-eval

Create, extend, run, baseline, and diagnose GraphJin agent evaluations through the graphjin eval CLI.

dosco/graphjin · 27 tokens

axiom-audit-grdb-performance

Use when the user mentions GRDB performance review, slow GRDB queries, app-group database setup audit, a ValueObservation that stopped updating, or pre-release GRDB scan.

CharlesWiltgen/Axiom · 43 tokens