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★ 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.sqlfile or SQL code to validate$ORIGINAL_SAS- Path to original SAS code (REQUIRED for baseline generation)
Rules
- Never modify the converted code - Create test wrapper/harness separately
- Original SAS code is REQUIRED - Cannot generate baseline without it
- Schema inference - Derive from SQL CREATE statements, SELECT columns, or original SAS
- Persist all test artifacts - Save synthetic data, expected baselines, actual results, and validation reports to disk subfolders (see Artifact Persistence below)
- Load reference files - Read
references/synthetic-data-rules.mdandreferences/comparison-rules.mdbefore generating data or comparing - 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
Установить 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), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic