Command Palette

Search for a command to run...

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

validate-sas-conversion

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

Preview. Validate a completed SAS to Snowflake conversion by comparing expected SAS output against actual converted SQL output using synthetic test data…

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

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

Validate SAS to Snowflake Conversion

Dual-execution comparison framework: LLM traces SAS logic to produce expected baselines, then executes converted SQL on Snowflake and compares.

Execution Model

Component Engine Snowflake?
Synthetic data generation LLM + SQL Yes (temp tables)
SAS logic trace (expected baseline) LLM No
Converted SQL execution Snowflake Yes
Output comparison SQL MINUS/EXCEPT Yes
Artifact persistence CSV + SQL files to disk No

Snowflake is used for execution with explicit credit confirmation per Snowflake Interaction Policy.

When to Load

[convert-sas-to-snowflake] Step 8: After user opts to validate conversion, or when user explicitly requests validation of existing converted code.

Arguments

  • $CONVERTED_CODE - Path to converted .sql file or SQL code to validate
  • $ORIGINAL_SAS - Path to original SAS code (REQUIRED for baseline generation)

Rules

  1. Never modify the converted code - Create test wrapper/harness separately
  2. Original SAS code is REQUIRED - Cannot generate baseline without it
  3. Schema inference - Derive from SQL CREATE statements, SELECT columns, or original SAS
  4. Persist all test artifacts - Save synthetic data, expected baselines, actual results, and validation reports to disk subfolders (see Artifact Persistence below)
  5. Load reference files - Read references/synthetic-data-rules.md and references/comparison-rules.md before generating data or comparing
  6. Snowflake execution - All SQL execution runs on Snowflake with explicit credit confirmation per Snowflake Interaction Policy.

Artifact Persistence

All test artifacts MUST be persisted to disk in the conversion output directory. This enables reproducibility, audit trails, and inclusion in the conversion report.

Directory Structure

Create the following subfolder structure relative to the conversion output directory (same directory as the generated .sql files):

<output_dir>/
├── extract.sql                          # converted code
├── transform.sql                        # converted code
├── tests/
│   ├── extract/
│   │   ├── synthetic_data/
│   │   │   ├── customers.csv            # pandas DataFrame exported as CSV
│   │   │   ├── customers.sql            # SQL reference (CREATE + INSERT, not executed)
│   │   │   ├── orders.csv               # pandas DataFrame exported as CSV
│   │   │   ├── orders.sql               # SQL reference (CREATE + INSERT, not executed)
│   │   │   └── _manifest.md             # table names, row counts, key coverage summary
│   │   ├── expected/
│   │   │   ├── expected_output.csv      # expected baseline from SAS logic trace
│   │   │   └── expected_output.sql      # SQL reference (not executed)
│   │   ├── actual/
│   │   │   ├── actual_output.csv        # Snowflake execution result
│   │   │   └── actual_summary.csv       # one file per actual output table
│   │   └── validation_report.md         # per-script validation report (Phase 5 output)
│   ├── transform/
│   │   ├── synthetic_data/
│   │   │   └── ...
│   │   ├── expected/
│   │   │   └── ...
│   │   ├── actual/
│   │   │   └── ...
│   │   └── validation_report.md
│   └── _test_summary.md                 # cross-file test summary
├── conversion_report.md                 # final conversion report
└── conversion_report.docx               # DOCX copy of conversion report

Persistence Rules

Artifact Format When to Write Contents
Synthetic data .csv + .sql Phase 2.4 (after generating DataFrames) CSV for local testing; SQL for reference/future Snowflake use
Manifest _manifest.md Phase 2.4 Table list, row counts, key coverage, edge case checklist
Expected baseline .csv + .sql Phase 3A.3 (after LLM trace) CSV for comparison; SQL for reference
Actual results .csv Phase 3B.2 (after Snowflake execution) CSV export of Snowflake result
Validation report .md Phase 5 (after comparison) Full diff report for this script
Test summary _test_summary.md After all scripts validated Cross-file pass/fail summary

Writing Synthetic Data Files

For each input table, write BOTH a .csv (for local testing) and a .sql (for reference):

import pandas as pd

customers_df = pd.DataFrame({
    'ID': [1, 2, 2, 3, 4, 5],
    'NAME': ['Alice', 'Bob', 'Bob Jr', 'Carol', 'Dave', None],
    'REGION': ['EAST', 'WEST', 'WEST', 'EAST', 'SOUTH', None]
})

customers_df.to_csv('tests/<script>/synthetic_data/customers.csv', index=False)

Also write a .sql reference file (NOT executed against Snowflake):

-- Synthetic data for: customers
-- Generated for: extract.sas validation
-- Rows: 6
-- Key coverage: JOIN keys (3 matching, 1 left-only, 1 right-only, 1 duplicate)
-- NOTE: This SQL is for REFERENCE ONLY. Testing runs on Snowflake.

CREATE OR RE
Полный SKILL.md на GitHub

Установить validate-sas-conversion в Claude Code и Claude Desktop

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

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

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

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

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

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

FAQ

Что делает скилл validate-sas-conversion?

Preview. Validate a completed SAS to Snowflake conversion by comparing expected SAS output against actual converted SQL output using synthetic test data. Performs dual-execution comparison: LLM traces original SAS logic to produce baseline, then runs converted SQL on Snowflake and compares outputs cell-by-cell. Triggers: validate conversion, verify sas migration, test conversion, compare sas output.

Как установить скилл validate-sas-conversion?

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

Скилл validate-sas-conversion запускает скрипты?

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

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

Сравнить validate-sas-conversion с