New to Claude Skills? Learn how to install them →

github on GitHub

Snowflake Semantic Views

OfficialFree

Manage and validate Snowflake semantic views effortlessly.

Get this skill

Free · Opens the source repo

What Snowflake Semantic Views does

The Snowflake Semantic Views skill streamlines the creation, alteration, and validation of semantic views within Snowflake using the Snowflake CLI. This skill is particularly useful for developers and data engineers who need to build or troubleshoot semantic layer definitions efficiently. By following a structured workflow, users can ensure that their semantic views are correctly defined and validated against Snowflake's requirements.

To get started, users must first verify their Snowflake CLI installation and set up a connection. Once the environment is ready, the skill guides users through each step of the semantic view creation process. This includes confirming database parameters, drafting the necessary Data Definition Language (DDL) syntax, and populating synonyms and comments for clarity. The skill emphasizes the importance of validation, ensuring that the DDL is executed against Snowflake before finalizing any changes.

The workflow includes several best practices, such as using temporary names for validation to avoid conflicts with existing views and ensuring that all synonyms and comments are approved by users. The skill also provides templates for executing commands in the Snowflake CLI, making it easier for users to validate their work. By adhering to these guidelines, users can maintain a high level of accuracy and completeness in their semantic view definitions.

This skill is ideal for data professionals who frequently work with Snowflake and need a reliable method for managing semantic views. It reduces the risk of errors during development and ensures that all necessary documentation is in place, ultimately leading to better data governance and usability.

When to use it

Use this skill when you need to create or troubleshoot semantic views in Snowflake, ensuring compliance with best practices.

When not to use it

This skill may not be suitable for users unfamiliar with Snowflake CLI or those who do not require semantic views for their data models.

What you can build with it

Creating a New Semantic View

Use the skill to draft and validate a new semantic view based on your data model requirements.

Troubleshooting Existing Views

Leverage the skill to identify issues with existing semantic views and correct them through validation.

Documenting Semantic Views

Utilize the skill to ensure all synonyms and comments are properly documented for clarity and governance.

How to install Snowflake Semantic Views

View source

1. Install with the skills CLI

npx skills add github/awesome-copilot/snowflake-semanticview --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by github

Snowflake Semantic Views

One-Time Setup

Workflow For Each Semantic View Request

  1. Confirm the target database, schema, role, warehouse, and final semantic view name.
  2. Confirm the model follows a star schema (facts with conformed dimensions).
  3. Draft the semantic view DDL using the official syntax:
  4. Populate synonyms and comments for each dimension, fact, and metric:
    • Read Snowflake table/view/column comments first (preferred source):
    • If comments or synonyms are missing, ask whether you can create them, whether the user wants to provide text, or whether you should draft suggestions for approval.
  5. Use SELECT statements with DISTINCT and LIMIT (maximum 1000 rows) to discover relationships between fact and dimension tables, identify column data types, and create more meaningful comments and synonyms for columns.
  6. Create a temporary validation name (for example, append __tmp_validate) while keeping the same database and schema.
  7. Always validate by sending the DDL to Snowflake via Snowflake CLI before finalizing:
    • Use snow sql to execute the statement with the configured connection.
    • If flags differ by version, check snow sql --help and use the connection option shown there.
  8. If validation fails, iterate on the DDL and re-run the validation step until it succeeds.
  9. Apply the final DDL (create or alter) using the real semantic view name.
  10. Run a sample query against the final semantic view to confirm it works as expected. It has a different SQL syntax as can be seen here: https://docs.snowflake.com/en/user-guide/views-semantic/querying#querying-a-semantic-view Example:
SELECT * FROM SEMANTIC_VIEW(
    my_semview_name
    DIMENSIONS customer.customer_market_segment
    METRICS orders.order_average_value
)
ORDER BY customer_market_segment;
  1. Clean up any temporary semantic view created during validation.

Synonyms And Comments (Required)

  • Use the semantic view syntax for synonyms and comments:
WITH SYNONYMS [ = ] ( 'synonym' [ , ... ] )
COMMENT = 'comment_about_dim_fact_or_metric'
  • Treat synonyms as informational only; do not use them to reference dimensions, facts, or metrics elsewhere.
  • Use Snowflake comments as the preferred and first source for synonyms and comments:
  • If Snowflake comments are missing, ask whether you can create them, whether the user wants to provide text, or whether you should draft suggestions for approval.
  • Do not invent synonyms or comments without user approval.

Validation Pattern (Required)

  • Never skip validation. Always execute the DDL against Snowflake with Snowflake CLI before presenting it as final.
  • Prefer a temporary name for validation to avoid clobbering the real view.

Example CLI Validation (Template)

# Replace placeholders with real values.
snow sql -q "<CREATE OR ALTER SEMANTIC VIEW ...>" --connection <connection_name>

If the CLI uses a different connection flag in your version, run:

snow sql --help

Notes

  • Treat installation and connection setup as one-time steps, but confirm they are done before the first validation.
  • Keep the final semantic view definition identical to the validated temporary definition except for the name.
  • Do not omit synonyms or comments; consider them required for completeness even if optional in syntax.

Frequently asked questions about Snowflake Semantic Views

Similar skills