best-practices-audit

Audits Snowflake semantic view YAML files for best practices, inconsistencies, duplicates, and missing relationships.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Semantic views in Snowflake can accumulate naming violations, missing descriptions, conflicting definitions, redundant instructions, and missing relationships that cause query failures or wrong results. This Skill systematically audits a semantic view YAML file and reports every issue with severity levels and fix recommendations. ## Core Features & Use Cases - Best Practices Checks: Validates naming conventions, description completeness, metadata quality, and dimension/measure type safety across tables and columns. - Inconsistency Detection: Finds conflicting column data types, orphaned relationships, circular dependencies, and contradictory filters with CRITICAL/HIGH/MEDIUM/LOW severity ratings. - Duplicate & Relationship Analysis: Detects custom instructions that duplicate descriptions, synonyms, or metric logic, and flags suspiciously low relationship counts with primary key prerequisites. - Use Case: Before deploying a semantic model for Cortex Analyst, run this audit to catch a VARCHAR/NUMBER mismatch on customer_id that would break joins, and remove instructions that duplicate existing column descriptions. ## Quick Start Run a best practices audit on my semantic view YAML file and show all errors, warnings, inconsistencies, and duplicate instructions.

Frequently Asked Questions about best-practices-audit

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

FAQPage Schema
How do I audit a Snowflake semantic view for best practices?▼

Run the audit workflow which loads the semantic view YAML via semantic_view_get.py, then executes documentation, naming, metadata, and type safety checks. Results are grouped by severity: ERROR, WARNING, and INFO, with specific locations and fix recommendations.

How to detect duplicate custom instructions in a semantic model?▼

The duplicates check compares custom_instructions and module_custom_instructions text against descriptions, synonyms, sample values, metrics, and filters. Matches above 85% similarity are flagged, and the recommendation is to remove duplicated content from instructions since the model is the single source of truth.

What inconsistencies can break semantic view queries?▼

CRITICAL issues include conflicting column data types across tables, orphaned relationships referencing non-existent columns, and contradictory filter conditions. HIGH severity issues include circular dependencies and mixed dimension/measure classification.

When does the audit flag missing relationships?▼

Relationships are flagged only when the count falls below thresholds for the table count, such as zero relationships for 2-3 tables or two or fewer for 7+ tables. Candidates are reported with primary key status, since a PK must exist before relationships can be created.

Does the audit modify the semantic view file?▼

No, the audit only identifies and reports issues without modifying the model. Fixes are applied separately through OPTIMIZATION MODE, for example using infer_primary_keys.py to verify primary keys before adding relationships.