semantic-view-audit

Audit Snowflake semantic views via VQR testing, best practices checks, and custom criteria.

Updated Jun 9, 2025
One-click install
npx skills add https://github.com/RajaPoseidon/snippets_repo --skill semantic-view-audit-rajaposeidon
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: semantic-view-audit
Source: https://github.com/RajaPoseidon/snippets_repo/tree/main/snowflake/skills/audit
Command: npx skills add https://github.com/RajaPoseidon/snippets_repo --skill semantic-view-audit-rajaposeidon

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Semantic views in Snowflake can contain naming violations, missing descriptions, conflicting definitions, duplicate instructions, and untested verified queries that silently degrade Cortex Analyst accuracy. This Skill provides a structured audit workflow that detects these issues before they cause wrong query results. ## Core Features & Use Cases - VQR Testing: Runs verified query questions against the semantic view without VQR hints, comparing generated SQL results against ground truth to measure model completeness. - Best Practices Verification: Checks naming conventions, documentation, metadata completeness, inconsistencies (conflicting data types, orphaned relationships), duplicate instructions, and missing relationships with severity-ranked reports. - Custom Criteria Evaluation: Lets users define validation rules in natural language (e.g., "all revenue metrics must contain 'revenue' in the name") and reports compliance rates per criterion. - SVA VQR Compile Check: Validates stored or candidate verified query SQL through Snowflake's validate_verified_queries EXPLAIN path. - Use Case: After building a semantic view for sales analytics, run the best practices audit to find that customer_id has conflicting data types across tables and that two custom instructions duplicate existing column descriptions, then route to optimization mode to fix them. ## Quick Start Ask the assistant to enter audit mode and run a best practices audit on your semantic view YAML file.

Frequently Asked Questions about semantic-view-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test verified queries in a Snowflake semantic view?▼

Use the VQR Testing audit, which extracts verified queries from the semantic model YAML, regenerates SQL through Cortex Analyst without VQR hints, and compares execution results against ground truth SQL using eval_sql_pair.py. Queries whose results differ are reported as failures.

How to check a semantic view for best practices violations?▼

Run the Best Practices audit, which verifies table and column descriptions, naming conventions, data type definitions, and dimension versus measure classification. It also detects inconsistencies, duplicate instructions, and missing relationships, reporting findings with severity levels.

What is the difference between VQR testing and SVA VQR compile check?▼

VQR testing evaluates natural-language-to-SQL behavior by running questions through Cortex Analyst without hints and comparing result sets. The SVA compile check only validates that stored or candidate SQL compiles against the model via Snowflake's validate_verified_queries EXPLAIN path.

Can I define custom validation rules for a semantic view?▼

Yes, the Custom Criteria audit accepts natural language rules such as requiring all date columns to use DATE or TIMESTAMP types. It parses each rule, scans the relevant model components, and reports compliance percentages with specific violations.

Why does the audit require a setup step before running?▼

The audit depends on initialization from the setup skill, which creates the workspace directory and loads the semantic view tools. Without it, the semantic_view_get.py commands and the no-VQR model variant used in testing are unavailable.