Command Palette

Search for a command to run...

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

synthetic-seeder

БесплатноЗапускает вложенные скриптыНе проверен

Generate two-sided synthetic data tests (source + Snowflake) for migrated stored procedures and functions. Derives test scenarios from source SQL branch…

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

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

Synthetic Seeder Skill

Generate two-sided synthetic data tests for migrated stored procedures and functions. Tests are derived from source SQL analysis — the source is the oracle, not the converted code. Each test is a step-based YAML artifact directly consumable by scai test capture and scai test validate.

YAML schema reference. See ../../references/step-based-yaml.md for the step types (SQL Query / Output Parameter / Table Read / Cursor Read), the validate: true | false | [list] semantics, and the modifies_data / affected_tables inference rules. This file describes what to generate for each procedure; the cheat sheet is the source of truth for the shape of each step. For special cases (multi-RS, OUT params, cursor reads, before/after capture) see ../../migrate-object/EDIT_TEST_YAML.md.

Autonomous mode: When spawned as a subagent, skip interactive stopping points, apply reasonable defaults, document assumptions in the completion report, and send a send_message to main when done.


Scope and Boundaries

This skill does:

  • Analyze source SQL to identify branches, NULL paths, boundary values
  • Generate two-sided INSERT / CALL / SELECT steps in both source and Snowflake dialects
  • Execute the Snowflake side to validate the test SQL (not the object)
  • Write YAML artifacts with test_cases: [[]] for test-runner compatibility
  • Enrich YAMLs with modifies_data and affected_tables for clone isolation
  • Fix test SQL if Snowflake execution fails (up to 3 retries)

This skill does NOT:

  • Repair the migrated object — delegate failures caused by object bugs to migrate-object
  • Run uv run migrate or run_migration_tests — test execution is handled by scai test capture + scai test validate
  • Generate tests for TABLEs or VIEWs (procedures and functions only)
  • Generate tests for BTEQ scripts. Units with kind: "script" (BTEQ) author a validation.steps[].script block per ../seed-script/SKILL.md from user-provided bindings + import fixtures — they are not synthesized here. Do not invent test_cases: for them.

Available MCP Tools

Tool Purpose
configure() Retrieve project_dir, source_dialect, snowflake_database
query_registry Look up code unit metadata and transitive dependencies for isolation enrichment
snowflake_sql_execute Execute SQL on Snowflake for validation

Output Format

Each test is a YAML file following the ValidationMetadata schema:

validation:
  test_cases:
  - []
  steps:
  # Setup steps — validate: false
  - source_query: <source-dialect INSERT or DDL>
    target_query: <Snowflake INSERT or DDL>
    validate: false
  # Call steps — validate: true (default, key omitted)
  - source_query: <EXEC / source CALL>
    target_query: <Snowflake CALL>
  # Assertion steps — validate: true (default, key omitted)
  - source_query: <SELECT from modified table, source dialect>
    target_query: <SELECT from modified table, Snowflake>

IMPORTANT: Every YAML must include test_cases: [[]] (a list containing one empty list). This is required by test-runner discovery. Step-based tests embed all data inline in the steps, so the test case list contains a single empty-parameter entry.

File layout: The object's test directory is whatever files.artifacts.path returns from the registry (Phase 0.4) with /test/ appended — read it, do not construct it. It may use a placeholder database segment (e.g. database_unspecified) and lowercased names for some dialects; that is correct and must be preserved. files.artifacts.path is PROJECT-RELATIVE, so prefix it with <project_dir>/ for all filesystem writes/reads (capture resolves it as project_root / files.artifacts.path / test).

<project_dir>/<files.artifacts.path>/test/
  <sanitized_object_name>.0.yml   ← one data arrangement
  <sanitized_object_name>.1.yml   ← another data arrangement

<sanitized_object_name> (for the FILE name only) replaces non-alphanumeric characters (except . and -) with _.

YAML granularity rule:

  • One YAML per data arrangement — scenarios that require distinct INSERT data get their own file
  • Multiple calls/selects in one YAML — scenarios exercisable against the same data state are additional steps within the same file

Qualities of a Good Test

Before generating, internalize these rules:

  1. Deterministic — no CURRENT_TIMESTAMP, NOW(), GETDATE(), RANDOM() or similar. Use fixed constant dates and values only.
  2. Non-trivially non-empty — each CALL or SELECT step must produce at least 3 distinct, non-empty output rows. Tests producing empty or single-row output rarely catch behavioral differences.
  3. Covers all modified tables — include SELECT assertions for every table the procedure writes to, not just the return
Полный SKILL.md на GitHub

Установить synthetic-seeder в Claude Code и Claude Desktop

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

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

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

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

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

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

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

enrich_yamls.pyplatforms/oracle.mdplatforms/teradata.md

FAQ

Что делает скилл synthetic-seeder?

Generate two-sided synthetic data tests (source + Snowflake) for migrated stored procedures and functions. Derives test scenarios from source SQL branch analysis, writes step-based validation YAML artifacts, and enriches them with isolation metadata. Use when generating or refreshing test cases for a migrated object. Delegates object repair to migrate-object. Triggers: generate tests, create tests, write test YAML, test generation, synthetic tests.

Как установить скилл synthetic-seeder?

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

Скилл synthetic-seeder запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

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

Сравнить synthetic-seeder с