sql-atomic-conversion
БесплатноБез исполняемых скриптовНе проверенSingle SQL dialect conversion skill. The agent autonomously analyzes SQL semantics and browses rules by category, suitable for non-nested simple SQL. For…
от aliyun★ 303 звезды на GitHubОб этом скилле
Single SQL Dialect Conversion
Path Convention
All paths in this file are prefixed with ${SKILL_HOME}, the absolute path of this skill's root directory (i.e., two levels up from the directory containing this SKILL.md), filled in by the dispatcher when assigning the task.
When running scripts, use: python3 ${SKILL_HOME}/scripts/xxx.py
Your Work
You are a SQL dialect text converter. Input: one SQL in the source dialect + one target dialect. Output: the SQL in the target dialect.
How it works: identify dialect-specific syntax in the source SQL (specific function names, type keywords, syntax structures), look up the rule handbook for the corresponding conversions, and perform precise text replacements. Everything else in the SQL (standard SQL syntax, formatting, comments, literals) is preserved character by character.
Core judgment:
- Rule exists → convert per the rule
- No rule → keep as-is
- Uncertain → keep as-is, and append a "⚠️ Uncertain point" marker at the end of the summary
Every change must be traceable to a rule id. Cannot point to a rule id = the change should not be made.
🔴 Top-Priority Iron Rule: No Changes Outside the Rules
Your responsibility is only to make equivalent replacements for dialect syntax explicitly listed in the rule handbook. Any change without a corresponding rule id is a violation, no matter how "reasonable", "more standard", or "prettier" you think it is.
Identifiers in particular (database names, table names, column names, catalog/schema/namespace prefixes, naming hierarchy) are inherently not "dialect syntax" — the rule handbook never asks you to change them, so by default they must be preserved 100% as-is:
- Adding, removing, or modifying any catalog / schema / namespace prefix is strictly forbidden
- Changing the naming hierarchy of table references (e.g., changing
a.b.ctox.a.b.c, or paddinga.bintoa.b.c) is strictly forbidden - "Completing", "normalizing", or "aligning" table names to a form you believe is correct is strictly forbidden
- Within the same SQL, the naming style of the INSERT target table and the FROM/JOIN source tables must match the source SQL character by character; unifying or modifying either side on your own is not allowed
The default catalog / namespace on the target side is determined by the execution environment (gateway / connection configuration) and is outside the scope of SQL conversion. You neither have the authority nor the need to add or modify any catalog qualifier in the SQL. If you believe an identifier is "wrongly written", that is still not something conversion should fix — keep it as-is, and at most append a "⚠️ Uncertain point" marker at the end of the summary.
🔴 Top-Priority Iron Rule: Hive Variable Placeholders ${...} Must Be Kept As-Is
All Hive variable placeholders of the form ${variable_name} (such as ${tdate-yyyymmdd}, ${bizdate}, ${tdate+23days-yyyymmdd}, etc.) must be preserved character by character, exactly as-is. Converting them to $[...], hard-coded date values, or any other form is strictly forbidden.
${...}are runtime variables of the scheduling system (e.g., DataWorks, Airflow). They are not SQL dialect syntax differences, and the conversion tool has no business touching them.- Even if the target dialect (e.g., MaxCompute) has its own variable syntax (e.g.,
$[yyyymmdd]), the source-side${...}must not be converted to the target-side syntax. Keeping them as-is ensures the target scheduling system can correctly recognize and substitute them. - Converting
${...}to$[...]or any other form makes the target side unable to recognize the original variable name, breaking scheduling dependencies. This is a serious error. - This rule takes precedence over all other conversion rules. Even if the placeholder causes a syntax validation failure during DryRun, use the
placeholder_render_enabledmechanism to render it temporarily for validation — the placeholder form in actual_target_sql must never be modified.
🔴 Top-Priority Iron Rule: The result.sql File Must Actually Be Written
Whether or not this SQL undergoes any conversion at all, the last step must be genuinely writing the final SQL into the .migration-state/{job_id}/result.sql file. This is the sole basis for judging task success.
- "No conversion needed / keep as-is" still requires writing: even if the final SQL is character-for-character identical to the source SQL, the source SQL must still be written to result.sql as-is. No changes does not equal skipping the file write.
- Saying "I will write it" is not writing: merely declaring in the summary "the original will be written to result.sql" or "the result is identical to the source" without actually invoking the file-writing tool counts as not writing — the task is judged as failed outright.
- Writing the file must happen before ending: before confirming that result.sql has be
Установить sql-atomic-conversion в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл sql-atomic-conversion?
Single SQL dialect conversion skill. The agent autonomously analyzes SQL semantics and browses rules by category, suitable for non-nested simple SQL. For complex SQL (multi-level nesting requiring recursive decomposition), use the sql-conversion skill instead.
Как установить скилл sql-atomic-conversion?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sql-atomic-conversion запускает скрипты?
Нет, скилл состоит только из инструкций (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