Command Palette

Search for a command to run...

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

recipe-qa-rules

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

Full data QA flow for a recipe view — discovers pipeline topology, manages QA Requirements Documents (QRDs), runs hardcoded and QRD-defined quality checks…

teklinerот tekliner★ 17 звёзд на GitHub

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

Trigger phrases: "check recipe", "recipe QA", "test recipe", "recipe duplicates", "recipe discrepancy", "write qa for recipe", "create QRD", "update QRD", "recipe requirements", "проверь рецепт", or when the view name ends in _recipe.


Phase 1 — Recipe State Discovery

Step 1.1 — Retrieve recipe meta info

Call getRecipeTool with the recipe identifier to get the recipe's current meta state (name, status, owner, last run timestamps, etc.).

Step 1.2 — Check actual database state via system.tables

Query system.tables to discover which views exist for this recipe. A recipe may have any combination of:

Suffix Meaning
_staging Initial development view — recipe SQL with a date-range filter applied. Created when the recipe is first saved. Used for iterative development on a limited data sample.
_pre_prod Activation-ready view produced after a successful run that passes all backward-compatibility and complexity validations (column deletions, type changes, MAX_EXECUTION_TIME, MAX_MEMORY_USAGE). Replaced on each successful run.
(no suffix / prod) The current production view. Replaced when the user clicks Activate — the _pre_prod view is promoted in place.
SELECT name, engine, create_table_query
FROM system.tables
WHERE database = '<db>'
  AND name LIKE '%<recipe_base_name>%'

State interpretation matrix:

Found views Interpretation
_staging only Recipe is in active development, never activated
_staging + _pre_prod Recipe passed validation, awaiting activation
_staging + prod Recipe is live; _staging still present from dev
_staging + _pre_prod + prod Normal mid-activation state
prod only Recipe activated, staging cleaned up
Neither Unexpected — activation may have failed

If there is a state inconsistency that prevents clear QA (e.g., prod view exists but meta says staging, or _pre_prod is stale), stop and invoke notebook-editor-skill first to resolve the state before proceeding.


Phase 1.5 — QRD Lookup & Generation

Step 1.5.1 — Check for existing QRD

Search for an existing QA Requirements Document for this recipe:

listDocumentsTool(tag: "qrd, recipe:{notebook_id}")

If no results, try a fallback search:

listDocumentsTool(query: "QRD: {recipe_title}")

If multiple QRDs are found for the same recipe, use the most recently updated one. Warn the user about the duplicates so they can clean up.

Step 1.5.2a — No QRD exists (First Run Flow)

When no QRD is found, generate one from the recipe:

  1. Analyze the recipe — call getRecipeStepTool(notebookId, stepId) for each step listed in the getRecipeTool response. Extract:

    • Source tables (all FROM / JOIN references)
    • Column names and inferred types
    • Filters, GROUP BY, DISTINCT patterns
    • Calculated fields and business formulas (e.g., spend / clicks AS cpc)
    • JOIN conditions and JOIN types
    • Any deduplication logic (ROW_NUMBER, QUALIFY, DISTINCT)
  2. Fill the QRD template — use qrd_template.md as the skeleton. Populate each section:

    • Transformation Summary: one paragraph describing what the recipe does end-to-end
    • Input Contract: all source tables with their columns (from step SQL)
    • Output Contract: final view columns (from the last step or SHOW CREATE VIEW)
    • Data Quality Rules: infer from column types — e.g., spend >= 0 for monetary columns, NOT NULL for ID columns
    • Deduplication Rules: infer grain from GROUP BY or DISTINCT patterns
    • Business Logic Rules: infer from calculated fields — e.g., cpc = spend / clicks
    • Row Count Expectations: default to output rows > 0 for first run
    • Freshness Rules: default to max(date) within 48 hours of today()
    • Version History: v1.0 with current date and session ID
  3. Present the draft to the user — show the complete QRD with clear explanations of what was inferred vs assumed. Ask the user to review, edit, add, or remove rules.

  4. Wait for user approval. Do not proceed until the user explicitly approves the QRD.

  5. Save the QRD — after approval, call:

    createDocumentTool(
      title: "QRD: {recipe_title} ({view_name})",
      tags: "qrd, recipe:{notebook_id}, view:{view_name}",
      content: <approved QRD markdown>
    )
    
  6. Proceed to Phase 2.

Step 1.5.2b — QRD exists (Subsequent Run Flow)

When a QRD is found:

  1. Call getDocumentTool(id) to load the full QRD content.
  2. Parse the QRD by ## section headers into structured data for Phase 3.
  3. Proceed to Phase 2.

Phase 2 — Pipeline Topology

Step 2.1 — Fetch the target view DDL

Use SHOW CREATE VIEW on the view that represents the current intended state (prefer _pre_prod if activation is pending, otherwise prod):

SHOW CREATE VIEW <db>.<view_name>
Полный SKILL.md на GitHub

Установить recipe-qa-rules в Claude Code и Claude Desktop

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

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

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

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

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

Read
Write
Edit
Bash
Glob
Grep

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

duplicate_check.mdqrd_template.mdsource_discrepancy.md

FAQ

Что делает скилл recipe-qa-rules?

Full data QA flow for a recipe view — discovers pipeline topology, manages QA Requirements Documents (QRDs), runs hardcoded and QRD-defined quality checks, detects JOIN fan-outs, and resolves issues with user approval.

Как установить скилл recipe-qa-rules?

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

Скилл recipe-qa-rules запускает скрипты?

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

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

Сравнить recipe-qa-rules с