snowflake
Skill17 starsChanged 56 days agoMITView on GitHub
Snowflake playbook. Workflows for RBAC rollout, warehouse sizing and cost control, secure data sharing, Streams/Tasks/Snowpipe pipelines, permissions audit, and Time Travel / Fail-safe recovery. Use when designing, operating, or auditing Snowflake.
- Deletes or force-pushes
3 other projects use a version of this.
Adopted by
Most recently taken up by
- G1Joshi/Agent-Skillstheir own version, first seen Oct 13, 2026
- aemcoder/skillstheir own version, first seen May 22, 2026
- herbert051281/mission-controltheir own version, first seen Mar 25, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- G1Joshi/Agent-Skills★ 15same name
- aemcoder/skills★ 4same name
- herbert051281/mission-control★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository53 other files it gives its agents.
- agents-sdkSkill
- agent-workflowSkill
- api-designSkill
- aws-iamSkill
- bash-shell-scriptingSkill
- cicd-github-actionsSkill
- cloudflare-email-serviceSkill
- cloudflareSkill
- cloudflare-waf-authorSkill
- cloudflare-workers-authorSkill
- cloud-platformsSkill
- codebase-security-auditSkill
- containers-orchestrationSkill
- core-engineeringSkill
- database-postgresqlSkill
- databricksSkill
- data-engineeringSkill
- distributed-transactionsSkill
- documentation-standardsSkill
- domain-driven-designSkill
- durable-objectsSkill
- frontend-engineeringSkill
- git-workflowSkill
- go-rust-systemsSkill
- iam-security-advisorSkill
- independent-verificationSkill
- infrastructure-iacSkill
- kubernetes-containersSkill
- kubernetes-operator-developmentSkill
- mcp-developmentSkill
- memory-architectureSkill
- multi-perspective-reviewSkill
- networking-transportSkill
- observabilitySkill
- oktaSkill
- pdf-exportSkill
- python-developmentSkill
- reactflow-architecture-diagramsSkill
- sandbox-sdkSkill
- scripting-automationSkill
- security-testingSkill
- service-resilienceSkill
- single-file-dashboardSkill
- skills-compositionSkill
- skills-continuous-improvementSkill
- system-designSkill
- typescript-javascriptSkill
- web-perfSkill
- web-research-kb-refreshSkill
- workers-best-practicesSkill
- workload-identitySkill
- wranglerSkill
- zero-trustSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 7 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use when the user is:
- Distinctive: line 28
Roles hold privileges; users hold roles: Never grant directly to users.
- Distinctive: line 73
Keep Snowflake cheap without starving workloads.
- Very specific: line 87
Never AUTO_SUSPEND = 0 in prod
- Distinctive: line 96
Use Query Acceleration Service for BI workloads with unpredictable heavy queries
- Distinctive: line 168
Document retention / SLA for the share.
- Very specific: line 232
Don't DROP DATABASE in prod from a human session.
- Distinctive: line 246
No resource monitors on shared warehouses
- Distinctive: line 247
No storage / credit dashboard
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Snowflake - Playbook
Companion rule: 482-snowflake.mdc. This skill turns those patterns into end-to-end workflows.
When to invoke
Use when the user is:
- Designing a new Snowflake account, database, or warehouse
- Rolling out or auditing RBAC (roles, grants, object ownership)
- Tuning cost (warehouse sizing, auto-suspend, query optimization, storage)
- Building pipelines with Snowpipe, Streams, Tasks, or Dynamic Tables
- Setting up secure data sharing (Reader Accounts, Snowflake Marketplace, Private Listings)
- Recovering from a bad change (Time Travel, Fail-safe)
- Governing sensitive data (masking, row access policies, tagging)
Golden Rules
- Roles hold privileges; users hold roles. Never grant directly to users.
- Use
USE ROLEat the top of every script. Implicit roles cause access-denied mysteries. - Warehouses suspend aggressively (60s auto-suspend for interactive; higher for streaming).
- Right-size warehouses; scale with multi-cluster, not with XL.
- Time Travel is real; Fail-safe is last-resort. Set retention deliberately per schema.
- Every production role chain has an owner and an audit trail.
Workflow 1 - RBAC Rollout
Design a production-grade role hierarchy and migrate away from ACCOUNTADMIN-as-default.
Steps
- Map your access model to Snowflake's RBAC:
- System roles:
ORGADMIN,ACCOUNTADMIN,SECURITYADMIN,USERADMIN,SYSADMIN,PUBLIC - Custom roles: business- and data-oriented
- System roles:
- Use the standard hierarchy:
- Functional roles (granted to users): e.g.,
ANALYST_SALES,ENGINEER_DATA,ADMIN_FINOPS - Access roles (hold privileges on objects): e.g.,
DB_SALES_READ,DB_SALES_WRITE,WH_LOAD_USE - Functional roles inherit from access roles, not from each other
- Functional roles (granted to users): e.g.,
- Ownership:
- Custom databases / schemas / warehouses are OWNED by a custom role (e.g.,
DB_SALES_OWNER), never byACCOUNTADMIN SYSADMINsits above functional roles; custom-role-owned objects grant managed access through their owner role
- Custom databases / schemas / warehouses are OWNED by a custom role (e.g.,
- USE MANAGED ACCESS schemas for any schema where multiple teams grant access - centralize grant control.
- Separation of duties:
USERADMINmanages users + role grants;SECURITYADMINmanages privilege grants on objects; they do NOT overlap- Application service users are locked to a specific role via
DEFAULT_ROLEand cannot switch
- Audit:
- Snapshot
GRANTSto a governance schema nightly (SNOWFLAKE.ACCOUNT_USAGE.GRANTS_TO_ROLES) - Alert on new grants to
ACCOUNTADMIN/SECURITYADMIN
- Snapshot
- Terraform / dbt:
- Manage roles and grants via
snowflake-terraform-provider(Snowflake Labs) or Permifrost (dbt Labs) - PR-reviewed changes; drift detection
- Manage roles and grants via
- Migrate existing access incrementally; lock down
ACCOUNTADMIN-for-daily-use.
Deliverable: Role hierarchy diagram, Terraform modules, audit job, migration runbook.
See references/rbac-patterns.md.
Workflow 2 - Warehouse Sizing and Cost Control
Keep Snowflake cheap without starving workloads.
Steps
- Classify workloads:
- Interactive (BI, ad-hoc) - small/medium WH, multi-cluster auto-scale, short auto-suspend
- Batch ETL - medium/large WH, single cluster, on-demand
- Streaming (Snowpipe, Tasks) - small WH, tasks share warehouses
- ML / heavy - large/xlarge WH, purpose-specific
- Start small, scale on evidence. Double warehouse size only if >50% of query time is spillage or queueing.
- Multi-cluster warehouses for concurrency, not for speed. A bigger warehouse makes one query faster; multi-cluster lets more concurrent queries run at the same speed.
- Auto-suspend:
- Interactive: 60s
- Batch / streaming: 60-600s depending on duty cycle
- Never
AUTO_SUSPEND = 0in prod
- Resource monitors per warehouse (or per warehouse group):
- Daily, weekly, monthly credit quotas
- Actions: notify at 75%, suspend at 100%
- Owner and escalation path in the notification message
- Query tuning:
EXPLAINandQUERY_HISTORYthe slow queries- Prune with clustering keys only when necessary (micro-partition pruning is automatic - test before adding)
- Materialize results (tables / materialized views) for repeated heavy scans
- Use Query Acceleration Service for BI workloads with unpredictable heavy queries
- Storage:
- Time Travel retention appropriate to schema (0 for staging scratch, 1d for most, 7-90d for critical)
- Transient / temporary tables for scratch
- Track storage cost by database with ACCOUNT_USAGE.STORAGE_DAILY_HISTORY
- Reports:
- Weekly top-N queries by credit cost
- Weekly top-N tables by storage growth
- Month-over-month trend
Deliverable: Warehouse catalog, resource monitors, dashboard, slow-query hit list.
Workflow 3 - Pipeline via Snowpipe / Streams / Tasks / Dynamic Tables
When to use which
| Use | Why |
| Snowpipe | Continuous ingestion from S3/GCS/ADLS into raw tables |
| Streams | CDC (change-tracking) on tables; power incremental pipelines |
| Tasks | Scheduled or conditional SQL; often reads from streams |
| Dynamic Tables | Declarative, managed materialization (prefer over manual Stream+Task where it fits) |
| Snowflake Connector for Kafka | Direct Kafka ingestion when latency < Snowpipe is needed |
Design pattern
Cloud storage --Snowpipe--> raw.tableRaw (VARIANT)
|
| Stream cdc_raw
v
staging.tableStaged <--Task-- INSERT/MERGE from raw via stream consumption
|
| Stream cdc_staging
v
warehouse.fact_table <--Task-- MERGE into dimensional modelOr with Dynamic Tables:
raw.tableRaw --> dt_staging (target lag 5 min) --> dt_fact (target lag 15 min)Guardrails
- Idempotent MERGE (use stable business keys)
- DLQ table for malformed rows
- Monitoring: unprocessed stream rows, task failure count, ingestion latency
- Alert thresholds and runbook for each pipeline
Workflow 4 - Secure Data Sharing
Share data without moving it.
Options
- Listings (Snowflake Marketplace): public or private catalog-based sharing
- Private Listings: curated access with request workflow
- Direct Shares: account-to-account inside the same cloud region; cross-region uses Replication
- Reader Accounts: consumer gets a Snowflake account you pay for (to share with non-Snowflake customers)
Design checklist
- Secure views / secure UDFs for shared objects (prevent data peek via
EXPLAIN) - Explicit column selection; no
SELECT *on shared views - Row access policies for tenant-level filtering where applicable
- Masking policies for any PII in shared objects
- Document retention / SLA for the share; versioning strategy for schema changes
- Consumer-side usage reported back via
SHARE_USAGE(governance)
Workflow 5 - Permissions Audit
Quarterly or after any org change.
Steps
- Dump grants from
SNOWFLAKE.ACCOUNT_USAGE.GRANTS_TO_USERS,GRANTS_TO_ROLES,GRANTS_ON_OBJECTS. - Flag:
- Direct grants to users (should be zero)
ACCOUNTADMIN/SECURITYADMINgranted to non-service identities beyond a small list- Privileges granted to
PUBLIC - Objects owned by
ACCOUNTADMIN(drift; should be owned by custom role)
- Check users:
- Disabled / stale users still holding roles
- Service users without scoped roles
- Check network policies:
- Service users restricted to known CIDRs / PrivateLink
- Admin roles require MFA
- Masking / row-access policies:
- Cover all PII columns?
- Applied via tags where feasible
- File findings with owner, severity, fix.
Workflow 6 - Recovery via Time Travel and Fail-safe
Time Travel = queryable historical data (0-90 days, per-object DATA_RETENTION_TIME_IN_DAYS).
Fail-safe = Snowflake-only recovery, 7 days, for permanent tables only, not self-serve.
Recovery playbook
- Quantify the blast radius: which objects, what time, which rows?
Query the past with
AT(OFFSET => ...),AT(TIMESTAMP => ...),BEFORE(STATEMENT => ...):SELECT * FROM my_table AT(OFFSET => -3600); -- 1 hour ago SELECT * FROM my_table BEFORE(STATEMENT => '<query_id>');Clone to isolate:
CREATE TABLE my_table_recovered CLONE my_table AT(OFFSET => -3600);- Restore selectively (SQL MERGE from clone).
Undrop recently-dropped objects:
UNDROP TABLE my_table;- If Time Travel is expired, engage Snowflake support for Fail-safe recovery. Not self-serve; not a plan.
Prevention
- Set
DATA_RETENTION_TIME_IN_DAYSper schema (>= 7 for prod, >= 30 for critical) TRANSIENTtables where durability matters less than cost- Don't
DROP DATABASEin prod from a human session; use roles that cannot
Anti-patterns
- Users with
ACCOUNTADMINfor daily work - Grants direct to users
AUTO_SUSPENDdisabled or very long on interactive warehouses- Clustering keys added "for performance" without an
EXPLAINshowing benefit SELECT *across wide VARIANT tables in production queries- Secrets in SQL scripts or task definitions (use External Functions + vault)
- Tasks using
ACCOUNTADMINasOWNER - Shares exposing base tables instead of secure views
- No resource monitors on shared warehouses
- No storage / credit dashboard
References
- references/rbac-patterns.md - Role hierarchy, ownership, managed access, service accounts
Related
- Rule:
482-snowflake.mdc - Rule:
480-data-engineering.mdc(cross-platform data contracts, DQ, governance) - Rule:
475-sql.mdc(safe SQL patterns) - Rule:
316-zero-trust.mdc(data tier controls) - Skill:
data-engineering(pipeline concepts) - Skill:
database-postgresql(for comparison)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

