rule-engine-apply
БесплатноБез исполняемых скриптовНе проверенApply matched migration rules to a single SQL file. Runs regex replacements mechanically, presents AI-mode fixes for review. Triggers: apply rule, apply rules.
от sfc-gh-dflippo★ 35 звёзд на GitHubОб этом скилле
Rule Apply
Apply matched rules to a single converted SQL file. For batch application (multiple files from propagation), see BATCH.md.
Inputs
rules— matched rules array fromsearch_rules(sorted by priority)file_path— path to the local SQL file to modifyobject_name— name of the object being migrated
Step 1: Sort by Priority
Process rules in priority order (ascending). Lower priority = runs first. This ensures simple regex fixes happen before structural AI rewrites.
Step 2: Apply Regex-Mode Rules
For each rule where replacement_mode = 'regex':
- Read the current file content
- Apply the regex substitution: find all matches of
replacement_findand replace withreplacement_replace - Write the updated content back to the file
- Report what changed:
Applied Replace ISNULL with COALESCE: 3 replacements made
If replacement_find does not match anything in the file (even though match_pattern did), skip silently — the pattern may have already been fixed.
Step 3: Apply AI-Mode Rules
For each rule where replacement_mode = 'ai':
- Read the current file content
- Read the rule's
ai_contextandexamples - Use your judgment to identify and fix all instances of the pattern described
- Present the diff to the user for approval before writing:
EXEC to CALL — proposed changes:
- EXEC schema.ProcName @p1, @p2 + CALL schema.ProcName(:p1, :p2)Apply this fix?
- If approved, write the updated file
- If rejected, skip this rule
Step 4: Track
After each successful application, record it using the record_rule_application tool with rule_id set to the applied rule's ID and outcome set to "applied". Optionally include code_unit_name and file_path.
Output
Report back:
- Number of regex rules applied and total replacements made
- Number of AI rules applied (approved) and skipped (rejected)
- Whether the file was modified
Rules
- Always update the local file — do not deploy SQL directly without writing changes to the file first
- Regex rules do not need user approval — they are mechanical and deterministic
- AI rules always need user approval — present the diff before writing
- Re-read the file between rules — earlier fixes may affect later rule matches
- Track effectiveness — after testing confirms the fix works, call
record_rule_applicationwithoutcome = "success"
Установить rule-engine-apply в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл rule-engine-apply?
Apply matched migration rules to a single SQL file. Runs regex replacements mechanically, presents AI-mode fixes for review. Triggers: apply rule, apply rules.
Как установить скилл rule-engine-apply?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rule-engine-apply запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic