Command Palette

Search for a command to run...

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

proc-test-gen

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

Derive source-of-truth functional-equivalence assertions for ONE converted Informatica-to-Snowflake-Scripting mapping procedure (data-flow), independent of…

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

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

Proc Test Generator (scripting flavor)

Generate and run a functional-equivalence check for a single converted mapping procedure — an Informatica mapping converted to a standalone Snowflake Scripting stored procedure — from the original data-flow logic in the source mapping. The expected target-table contents are computed from the source mapping applied to the seeded input, NOT from the converted SQL under repair, so the assertions are an independent oracle. All generated artifacts are stored in <UNIT>/stabilization/tests/proc/<proc_name>/.

Scope. This is the data-flow counterpart to orchestration-test-gen: orchestration-test-gen tests control-flow elements of a task graph; proc-test-gen tests the output table of one mapping proc. It is the scripting-flavor analog of dbt-test-gen. In dbt mode a mapping becomes a model (tested by dbt-test-gen); in scripting mode a mapping becomes its own kind=etl stored procedure, tested here.

Autonomous mode: When spawned as a team agent, skip all interactive stopping points, make reasonable defaults, and document assumptions in the completion report. When done, send_message to main with your results, and respond to any shutdown_request with type: "shutdown_response", approve: true.

Where this sits in the fix loop

block-locate  ── the defective block + its source transform node (scripts/stabilization_tools.py block-locate, marker-scoped)
proc-fixer    ── [agentic] author the fixed block SQL from the source node (sibling sub-skill)
block-replace ── splice the fix back, marker-integrity checked (scripts/stabilization_tools.py block-replace)
deploy-and-call ─ deploy the one proc into the test schema + smoke-CALL it (scai code deploy-and-call)
proc-test-gen ── [THIS SKILL] derive the source-of-truth expected target contents + batched assertions
grade         ── run the assertions against the populated target; PASS/FAIL feeds the fixer loop

proc-test-gen owns the ARRANGE (input seed) and ASSERT (expected target) — the stable, source-derived parts. The ACT (deploy + CALL the proc) is performed via deploy-and-call; the proc body itself is the baseline snapshot the fixer iterates on.

AAA for a single mapping proc

  • Arrange:Setup — create the test schema + the source/input tables the mapping reads (schema inferred from the source mapping's Source/Source-Qualifier definitions), and the target table shape. Run once.
  • Arrange:Seed — TRUNCATE + INSERT synthetic input rows into the source tables. Run before every ACT/grade cycle to reset to a known state. The seed is the fixed input the expected output is computed from — it must not change once assertions are derived.
  • Act — deploy the (current) converted proc into the test schema and CALL it, so its output lands in <test_schema>.<TARGET>. Done with scai code deploy-and-call (see Tooling); on the baseline run the proc may fail to CREATE or error at CALL — that is expected and recorded.
  • Assert — a single batched query over only the target table that verifies its contents equal what the source mapping produces for the seeded input (see proc-assertion-patterns.md).

Input

  • session_status.json — with source_file_path, the pending mapping proc unit, and migration_object_path
  • The converted proc .sql file (a kind=etl unit's files.converted.path)
  • The source mapping definition (Informatica .xml) at source_file_path
  • The block FullName(s) under repair (from the block boundary markers / scan.json)

Prerequisites

  • Python 3.11+; the deterministic tool layer present (scripts/stabilization_tools.py — the block-locate / ewi-extract subcommands — and scripts/scan_unit.py)
  • The headless executor available: scai code deploy-and-call (deploy one proc + CALL, returns a ProcCallResult JSON) — see Tooling
  • An active Snowflake connection with a warehouse, and CREATE TABLE / CREATE PROCEDURE on a user-provided (test) database + schema

Output Location

<UNIT>/stabilization/tests/proc/<proc_name>/
  <proc_name>.assert.sql     # the batched target-only assertion query (source-derived)
  <proc_name>.seed.sql       # ARRANGE:SETUP + ARRANGE:SEED (input tables + synthetic rows)
  test_report.md             # baseline result, consumed by proc-fixer

The value of this skill is the seed (the fixed input) and the assert (expected target contents from source semantics). The proc body is the baseline; proc-fixer iterates it until the assert passes.

Tooling (headless, no IDE / no snowflake_sql_execute)

Unlike orchestration-test-gen (which runs SQL via the CoCo snowflake_sql_execute MCP tool), the scripting loop is headless:

Step Command
locate the block + its span/body `uv run --project {SKILL_DIR} python {SKILL_DIR}/scripts/stabilization_tools.py block-locat
Полный SKILL.md на GitHub

Установить proc-test-gen в Claude Code и Claude Desktop

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

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

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

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

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

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

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

proc-assertion-patterns.md

FAQ

Что делает скилл proc-test-gen?

Derive source-of-truth functional-equivalence assertions for ONE converted Informatica-to-Snowflake-Scripting mapping procedure (data-flow), independent of the converted SQL. Seeds input, deploys+CALLs the proc in an isolated test schema, and grades its target table against expected contents computed from the source mapping. Use when the stabilization skill invokes test generation for a scripting-flavor mapping proc.

Как установить скилл proc-test-gen?

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

Скилл proc-test-gen запускает скрипты?

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

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

Сравнить proc-test-gen с