Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

sql-dynamic-pattern-analyzer

БесплатноБез исполняемых скриптовНе проверен

Analyzes Dynamic SQL occurrences from SnowConvert issues, classifies patterns, scores complexity, and records migration considerations. Use for SQL Server…

sfc-gh-dflippoот sfc-gh-dflippo★ 35 звёзд на GitHub

Об этом скилле

Analyzing SQL Dynamic Patterns

Analyzes Dynamic SQL occurrences flagged by SnowConvert (issue code SSC-EWI-0030), classifies them against a dialect-specific pattern catalog, scores complexity, and records migration considerations. All operations go through the scai assessment sql-dynamic command — there are no Python helpers, no CSV/JSON scripts, no bash loops.

Sub-Agent Mode

When invoked from a parent skill (e.g., assessment/SKILL.md) as a sub-agent, the parent provides a context block with the fields below. The review_mode field controls whether the per-occurrence review loop runs.

Field Required Notes
project_dir yes absolute path to the SCAI project root
output_dir yes typically <project_dir>/assessment/json
review_mode yes generate-only, auto-review-all, or skip

On entry: call the configure MCP tool with project_dir from the context block. Snowflake credentials are not required — scai assessment sql-dynamic reads only local CSVs and source files.

Branching by review_mode:

  • generate-only — run only scai assessment sql-dynamic generate (Workflow Step 1) and return. The output JSON will contain PENDING occurrences; that is expected.
  • auto-review-all — generate, then loop show-code-unit → analyze → update --status REVIEWED for every PENDING occurrence (Workflow Steps 2–6). Run stats at the end and confirm zero PENDING. The single-record / unique-analysis rule from Critical Rules (NO BATCH UPDATES) still applies — each occurrence gets its own analysis.
  • skip — return immediately with "status": "skipped". The parent should not have dispatched in this case; this branch is defensive.

On completion, return JSON only:

{
  "sub_skill": "analyzing-sql-dynamic-patterns",
  "status": "ok",
  "output_json": "<abs path to sql_dynamic_analysis.json>",
  "summary": "<one-line: total occurrences, REVIEWED count, PENDING count>",
  "error": null
}

On skip: "status": "skipped", "output_json": null. On failure: "status": "error", "error": "<message>".

Critical Rules

ONLY USE scai assessment sql-dynamic: All generate / show / update / stats operations are subcommands of scai assessment sql-dynamic. Do not write custom scripts, parsers, or batch wrappers.

NO BATCH UPDATES: Each update invocation processes ONE record with ONE unique analysis.

  • Do not "walk IDs" sequentially as a batch just because they are adjacent.
  • Do not use shell loops (e.g. for id in ...; do scai assessment sql-dynamic update ...; done) to apply the same update across many records.
  • Do not copy/paste identical notes across multiple IDs; each occurrence must have its own specific rationale, even within the same code unit.

CODE-UNIT-BASED WORKFLOW: Use show-file (or show-code-unit) to view all occurrences within a procedure/function. Analyze each code unit separately by reading its source code.

  • The generated analysis JSON stores the full procedure source text inside each code unit under the procedure field, alongside fileName, procedureName, codeUnitStartLine, and linesOfCode. Treat the JSON as the "source bundle" for analysis.

QUALITY OVER SPEED: This work is often fast, but do not "rush" by batching, reusing notes, or skipping code review. Aim for consistent, defensible analyses per occurrence.

Source Platform Detection

CRITICAL FIRST STEP: Before classifying patterns, determine the source platform.

Detection methods:

  1. Check TopLevelCodeUnits.*.csv — SourceLanguage column (e.g. Transact for SQL Server, RedShift for Redshift, Oracle for Oracle, Teradata for Teradata).
  2. Examine code syntax in the procedure source (visible in the analysis JSON):
    • SQL Server indicators: sp_executesql, EXEC(@sql), QUOTENAME(), sys.* catalog views.
    • Redshift indicators: EXECUTE ... USING, QUOTE_IDENT(), QUOTE_LITERAL(), pg_catalog.*, plpgsql functions.
    • Oracle indicators: EXECUTE IMMEDIATE, DBMS_SQL.*, DBMS_ASSERT.*, ALL_*/USER_*/DBA_* catalog views, PRAGMA AUTONOMOUS_TRANSACTION, :varname named bind variables, @dblink references.
    • Teradata indicators: REPLACE PROCEDURE ... BEGIN ... END, EXECUTE IMMEDIATE <sql> USING ... with positional ? placeholders, DBC.TablesV / DBC.ColumnsV / DBC.DatabasesV / DBC.IndicesV catalog views, REPLACE MACRO / EXEC macro_name(...), VOLATILE TABLE, MULTISET / SET table semantics, SET QUERY_BAND, BTEQ &variable substitution and BT / ET transaction control.
  3. Review source file extensions and DDL: .sql, .prc, .fnc.

Pattern catalog selection:

  • SQL Server → Snowflake: reference/PATTERNS_TRANSACT.md
  • Redshift → Snowflake: reference/PATTERNS_REDSHIFT.md
  • Oracle → Snowflake: reference/PATTERNS_ORACLE.md
  • Teradata → Snowflake: `reference/PATTERNS_
Полный SKILL.md на GitHub

Установить sql-dynamic-pattern-analyzer в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

reference/PATTERNS_ORACLE.mdreference/PATTERNS_REDSHIFT.mdreference/PATTERNS_TERADATA.mdreference/PATTERNS_TRANSACT.md

FAQ

Что делает скилл sql-dynamic-pattern-analyzer?

Analyzes Dynamic SQL occurrences from SnowConvert issues, classifies patterns, scores complexity, and records migration considerations. Use for SQL Server, Redshift, Oracle, or Teradata to Snowflake migrations. Driven entirely by `scai assessment sql-dynamic`; no custom scripts.

Как установить скилл sql-dynamic-pattern-analyzer?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл sql-dynamic-pattern-analyzer запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить sql-dynamic-pattern-analyzer с