Skip to content

Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.

feat(streamlit-snowflake): Add skill for Streamlit in Snowflake + Marketplace

Jez3081e0679010
diff --git a/planning/research-logs/streamlit-snowflake-IMPLEMENTATION_PHASES.md b/planning/research-logs/streamlit-snowflake-IMPLEMENTATION_PHASES.md
new file mode 100644
index 00000000..0e382f9f
--- /dev/null
+++ b/planning/research-logs/streamlit-snowflake-IMPLEMENTATION_PHASES.md
@@ -0,0 +1,244 @@
+# Implementation Phases: streamlit-snowflake Skill
+
+**Project**: Claude Code Skill for Streamlit in Snowflake
+**Type**: Skill Creation
+**Estimated Total**: 2-3 hours (~5-10 min human time)
+**Created**: 2024-12-24
+
+---
+
+## Phase 1: Skill Foundation (30 min)
+
+**Type**: Setup
+**Objective**: Create skill directory structure with SKILL.md and README.md
+
+### Tasks
+
+1. Create skill directory: `skills/streamlit-snowflake/`
+2. Create SKILL.md with:
+ - YAML frontmatter (name, description)
+ - Overview section
+ - Quick start guide
+ - When to use / when not to use
+ - Known limitations (no custom components, package restrictions)
+ - Error prevention table
+3. Create README.md with:
+ - Auto-trigger keywords (streamlit snowflake, SiS, native app marketplace)
+ - Brief description
+ - Link to SKILL.md
+
+### Verification
+- [ ] SKILL.md has valid YAML frontmatter
+- [ ] Description is 250-350 characters
+- [ ] README.md has trigger keywords
+- [ ] Skill structure matches repo standards
+
+### Key Files
+- `skills/streamlit-snowflake/SKILL.md`
+- `skills/streamlit-snowflake/README.md`
+
+---
+
+## Phase 2: Core Templates (1 hour)
+
+**Type**: Templates
+**Objective**: Create production-ready project scaffold templates
+
+### Tasks
+
+1. Create `templates/snowflake.yml`:
+ - Definition version 2
+ - Placeholder for warehouse, stage, identifier
+ - External access integrations section
+ - Secrets section
+ - Artifacts list
+ - Grants section
+
+2. Create `templates/environment.yml`:
+ - Required `channels: - snowflake`
+ - Explicit `streamlit=1.35.0`
+ - Common packages: pandas, plotly, altair
+ - snowflake-snowpark-python
+
+3. Create `templates/streamlit_app.py`:
+ - Snowpark session via `st.connection("snowflake")`
+ - `@st.cache_data` pattern for queries
+ - Basic layout structure
+ - Error handling pattern
+
+4. Create `templates/pages/data_explorer.py`:
+ - Multi-page example
+ - DataFrame display
+ - Chart example
+
+5. Create `templates/common/utils.py`:
+ - Reusable query helpers
+ - Session getter
+
+6. Create `templates/.gitignore`:
+ - .snowflake/
+ - __pycache__/
+ - .env
+ - *.pyc
+
+### Verification
+- [ ] snowflake.yml is valid YAML
+- [ ] environment.yml has required channels field
+- [ ] streamlit_app.py runs locally (syntax check)
+- [ ] No hardcoded credentials in any template
+
+### Key Files
+- `skills/streamlit-snowflake/templates/`
+
+---
+
+## Phase 3: Native App Templates (30 min)
+
+**Type**: Templates
+**Objective**: Add Marketplace publishing templates
+
+### Tasks
+
+1. Create `templates-native-app/manifest.yml`:
+ - Version format
+ - Artifacts section
+ - Streamlit configuration
+ - Privileges required
+
+2. Create `templates-native-app/setup.sql`:
+ - CREATE APPLICATION ROLE
+ - CREATE SCHEMA IF NOT EXISTS
+ - CREATE STREAMLIT statement
+ - GRANT statements
+
+3. Create `templates-native-app/README.md`:
+ - Provider profile setup steps
+ - Listing creation workflow
+ - Stripe setup (for paid listings)
+ - Approval process overview
+
+### Verification
+- [ ] manifest.yml follows Snowflake Native App spec
+- [ ] setup.sql has valid SQL syntax
+- [ ] README covers complete publishing workflow
+
+### Key Files
+- `skills/streamlit-snowflake/templates-native-app/`
+
+---
+
+## Phase 4: References & Scripts (30 min)
+
+**Type**: Documentation
+**Objective**: Add supporting reference docs and helper scripts
+
+### Tasks
+
+1. Create `references/available-packages.md`:
+ - How to query available packages (SQL)
+ - Link to Snowpark Python Packages Explorer
+ - Common packages list with versions
+
+2. Create `references/authentication.md`:
+ - Key-pair authentication pattern
+ - OAuth client credentials pattern
+ - Password deprecation timeline (Oct 2026)
+ - Workload Identity Federation mention
+
+3. Create `references/ci-cd.md`:
+ - GitHub Actions workflow template
+ - Secrets configuration
+ - Deploy command patterns
+
+4. Create `scripts/check-packages.sql`:
+ - Query to list available packages
+ - Filter by name pattern
+
+### Verification
+- [ ] All reference docs have working links
+- [ ] SQL script is valid
+- [ ] Authentication patterns are current (2025)
+
+### Key Files
+- `skills/streamlit-snowflake/references/`
+- `skills/streamlit-snowflake/scripts/`
+
+---
+
+## Phase 5: Install & Test (30 min)
+
+**Type**: Verification
+**Objective**: Install skill and validate it works
+
+### Tasks
+
+1. Run install script:
+ ```bash
+ ./scripts/install-skill.sh streamlit-snowflake
+ ```
+
+2. Verify symlink created:
+ ```bash
+ ls -la ~/.claude/skills/streamlit-snowflake
+ ```
+
+3. Test skill discovery:
+ - Ask Claude Code: "Help me set up a Streamlit app in Snowflake"
+ - Verify skill is proposed/discovered
+
+4. Generate marketplace manifest:
+ ```bash
+ ./scripts/generate-plugin-manifests.sh streamlit-snowflake
+ ```
+
+5. Run metadata check:
+ ```bash
+ ./scripts/check-metadata.sh streamlit-snowflake
+ ```
+
+6. Commit skill to repo:
+ ```bash
+ git add skills/streamlit-snowflake/
+ git commit -m "Add streamlit-snowflake skill for native Snowflake apps"
+ ```
+
+### Verification
+- [ ] Symlink exists and points correctly
+- [ ] Skill discovered by Claude Code
+- [ ] Marketplace manifest generated
+- [ ] Metadata check passes
+- [ ] Committed to git
+
+### Key Files
+- `~/.claude/skills/streamlit-snowflake` (symlink)
+- `skills/streamlit-snowflake/.claude-plugin/plugin.json`
+
+---
+
+## Success Criteria (All Phases)
+
+- [ ] Skill structure matches repo standards (SKILL.md, README.md, templates/)
+- [ ] YAML frontmatter valid with 250-350 char description
+- [ ] Templates are production-ready (no hardcoded values)
+- [ ] Error prevention documented (5+ common errors)
+- [ ] References include current auth patterns (2025)
+- [ ] Skill installs and is discoverable
+- [ ] Token savings estimated ≥50%
+
+---
+
+## Estimated Token Savings
+
+| Scenario | Without Skill | With Skill | Savings |
+|----------|---------------|------------|---------|
+| Project setup | ~8k tokens | ~3k tokens | ~62% |
+| Marketplace publishing | ~6k tokens | ~2k tokens | ~67% |
+| Auth troubleshooting | ~4k tokens | ~1k tokens | ~75% |
+| **Average** | **~6k tokens** | **~2k tokens** | **~67%** |
+
+---
+
+## Dependencies
+
+- None (skill creation only requires text files)
+- Testing requires Snowflake account (optional, can validate syntax only)
diff --git a/planning/research-logs/streamlit-snowflake-skill-brief.md b/planning/research-logs/streamlit-snowflake-skill-brief.md
new file mode 100644
index 00000000..b36ee754
--- /dev/null
+++ b/planning/research-logs/streamlit-snowflake-skill-brief.md
@@ -0,0 +1,189 @@
+# Project Brief: streamlit-snowflake Skill
+
+**Created**: 2024-12-24
+**Status**: Ready for Planning
+
+---
+
+## Vision
+
+A Claude Code skill that accelerates building and publishing Streamlit apps natively in Snowflake, covering the complete workflow from project scaffold to Marketplace listing.
+
+## Problem/Opportunity
+
+Building Streamlit apps in Snowflake has several friction points:
+- Complex `snowflake.yml` configuration with many options
+- Package limitations (only Snowflake Anaconda Channel)
+- Default Streamlit version is outdated (1.22.0 vs current 1.35)
+- Marketplace publishing requires multiple steps (provider profile, listings, Native App packaging)
+- Authentication patterns are evolving (password deprecation by Oct 2026)
+- No existing Claude Code skills for this ecosystem
+
+## Target Audience
+
+- **Primary**: Developers building data apps on Snowflake
+- **Secondary**: Data teams publishing data products to Marketplace
+- **Context**: Building skills for personal use + potentially contributing to claude-skills repo
+
+## Core Functionality (MVP)
+
+### 1. Project Scaffolding
+- `snowflake.yml` template with production-ready defaults
+- `environment.yml` with common data viz packages + explicit Streamlit version
+- `streamlit_app.py` with Snowpark session pattern and caching
+- Multi-page structure (`pages/` directory)
+- `.gitignore` for Snowflake projects
+
+### 2. Connection Patterns
+- `st.connection("snowflake")` usage examples
+- Snowpark session management
+- `@st.cache_data` patterns for expensive queries
+- Secure credential handling (no hardcoding)
+
+### 3. Deployment Workflow
+- `snow streamlit deploy --replace` command patterns
+- GitHub Actions CI/CD template
+- Local development with Snowflake CLI
+
+### 4. Marketplace Publishing (Native App)
+- Provider profile setup guidance
+- Listing creation workflow
+- Native App file structure for Streamlit apps
+- Permission SDK for consumer interactions
+- `manifest.yml` and `setup.sql` templates
+
+## Out of Scope for MVP (Future Skills)
+
+- **Snowpark skill** (DataFrame API, UDFs, Stored Procedures) - separate skill
+- **Snowflake MCP server** setup - already exists (Snowflake-Labs/mcp)
+- **External Streamlit hosting** (Community Cloud) - different workflow
+- **Cortex AI integration** (search, analyst) - separate concern
+
+## Tech Stack (Validated)
+
+| Component | Choice | Rationale |
+|-----------|--------|-----------|
+| CLI | Snowflake CLI (`snow`) | Official tool, required for deployment |
+| Config | `snowflake.yml` v2 | Definition version 2 is current |
+| Packages | Snowflake Anaconda Channel | Only supported option for native apps |
+| Streamlit | 1.35.0 (explicit) | Latest supported, avoids 1.22.0 default |
+| Python | 3.11 | Best compatibility with Snowpark |
+
+## Research Findings
+
+### Key Documentation Sources
+- [Create and deploy Streamlit apps using Snowflake CLI](https://docs.snowflake.com/en/developer-guide/streamlit/create-streamlit-snowflake-cli)
+- [Initializing a Streamlit app](https://docs.snowflake.com/en/developer-guide/snowflake-cli/streamlit-apps/manage-apps/initialize-app)
+- [About Streamlit in Snowflake](https://docs.snowflake.com/en/developer-guide/streamlit/about-streamlit)
+- [Adding Streamlit to Native Apps](https://docs.snowflake.com/en/developer-guide/native-apps/adding-streamlit)
+- [Marketplace Publishing Guidelines](https://docs.snowflake.com/en/developer-guide/native-apps/publish-guidelines)
+
+### Official Templates & Examples
+- [snowpark-python-template](https://github.com/Snowflake-Labs/snowpark-python-template) - CI/CD ready
+- [native-apps-templates](https://github.com/snowflakedb/native-apps-templates) - CLI compatible
+- [snowflake-demo-streamlit](https://github.com/Snowflake-Labs/snowflake-demo-streamlit) - Comprehensive demos
+
+### Package Discovery Tool
+- [Snowpark Python Packages Explorer](https://snowpark-python-packages.streamlit.app/) - Check available packages
+- SQL: `select * from information_schema.packages where language = 'python';`
+
+### Known Limitations
+1. **No custom Streamlit components** - native platform limitation
+2. **Only Snowflake Anaconda Channel packages** - no conda-forge
+3. **No Azure Private Link / GCP Private Service Connect** for app access
+4. **page_title and page_icon not supported** in st.set_page_config
+
+### Errors to Prevent
+
+| Error | Cause | Prevention |
+|-------|-------|------------|
+| Package not found | Using external Anaconda channel | Always use `channels: - snowflake` |
+| Old Streamlit features | Default 1.22.0 version | Explicitly set `streamlit=1.35.0` |
+| Deployment fails | Using deprecated ROOT_LOCATION | Use `FROM source_location` (CLI 3.14.0+) |
+| Auth failures 2026+ | Password-only authentication | Document key-pair/OAuth patterns |
+| File too large | >250MB files | Document size limits |
+
+## Scope Validation
+
+**Why Build This?**
+- No existing skill covers this workflow
+- Significant setup time for each new project
+- Multiple error-prone configuration steps
+- Marketplace publishing is multi-step and undocumented in skill form
+
+**Why Single Skill (Not Split)?**
+- Streamlit + Marketplace are often used together
+- Provider profile setup is one-time, not repeated
+- Native App packaging is tightly coupled to Streamlit structure
+- Keeps context together for coherent workflow
+
+**What Could Go Wrong?**
+1. **Snowflake CLI changes** - Mitigation: Pin to CLI 3.14+ patterns, document version
+2. **Package availability changes** - Mitigation: Link to package explorer, document how to check
+3. **Auth deprecation timeline** - Mitigation: Document modern auth patterns, warn about 2026 deadline
+
+## Estimated Effort
+
+- **Skill creation**: ~2-3 hours (templates, documentation, error prevention)
+- **With Claude Code**: ~5-10 minutes human interaction time
+- **Breakdown**:
+ - SKILL.md structure: 30 min
+ - Templates (4-5 files): 1 hour
+ - Error prevention docs: 30 min
+ - Testing/validation: 30 min
+
+## Success Criteria
+
+- [ ] `snow init` replacement with better defaults works
+- [ ] Deployed app runs in Snowflake without errors
+- [ ] Marketplace listing can be created following guidance
+- [ ] No hardcoded credentials in templates
+- [ ] Token savings ≥50% vs manual setup
+
+## Skill Structure (Proposed)
+
+```
+skills/streamlit-snowflake/
+├── SKILL.md # Main skill documentation
+├── README.md # Auto-trigger keywords
+├── templates/
+│ ├── snowflake.yml # Project definition
+│ ├── environment.yml # Package dependencies
+│ ├── streamlit_app.py # Entry point with patterns
+│ ├── pages/
+│ │ └── example_page.py # Multi-page example
+│ ├── common/
+│ │ └── utils.py # Shared utilities
+│ └── .gitignore # Snowflake-specific ignores
+├── templates-native-app/ # Marketplace publishing
+│ ├── manifest.yml # Native App manifest
+│ ├── setup.sql # Installation script
+│ └── README.md # Publishing workflow
+├── references/
+│ ├── available-packages.md # How to check Anaconda channel
+│ ├── authentication.md # Key-pair, OAuth patterns
+│ └── ci-cd.md # GitHub Actions template
+└── scripts/
+ └── check-packages.sql # Query available packages
+```
+
+## Next Steps
+
+**If proceeding**:
+1. Run `/plan-project` to generate IMPLEMENTATION_PHASES.md
+2. Create skill directory structure
+3. Write templates based on official docs
+4. Test with a real Snowflake project
+5. Add to skills repo
+
+---
+
+## Research References
+
+- [Snowflake CLI Streamlit Commands](https://docs.snowflake.com/en/developer-guide/snowflake-cli/command-reference/streamlit-commands/overview)
+- [Streamlit in Snowflake Documentation](https://docs.snowflake.com/en/developer-guide/streamlit/about-streamlit)
+- [Snowflake Marketplace About](https://other-docs.snowflake.com/en/collaboration/collaboration-marketplace-about)
+- [Native Apps Adding Streamlit](https://docs.snowflake.com/en/developer-guide/native-apps/adding-streamlit)
+- [Snowpark Python Packages Explorer](https://snowpark-python-packages.streamlit.app/)
+- [GitLab's Streamlit Framework in Snowflake](https://about.gitlab.com/blog/how-we-built-a-structured-streamlit-application-framework-in-snowflake/)
+- [Snowflake MCP Server](https://github.com/Snowflake-Labs/mcp)
diff --git a/skills/streamlit-snowflake/.claude-plugin/plugin.json b/skills/streamlit-snowflake/.claude-plugin/plugin.json
new file mode 100644
index 00000000..0c531a76
--- /dev/null
+++ b/skills/streamlit-snowflake/.claude-plugin/plugin.json
@@ -0,0 +1,12 @@
+{
+ "name": "streamlit-snowflake",
+ "description": "Build and deploy Streamlit apps natively in Snowflake with production-ready templates. Covers project scaffolding (snowflake.yml, environment.yml), Snowpark session patterns, multi-page structure, and Marketplace publishing as Native Apps. Use when building data apps on Snowflake, deploying Streamlit in Snowflake (SiS), or publishing to Snowflake Marketplace. Prevents package channel errors, outdated Streamlit versions, and authentication issues.",
+ "version": "1.0.0",
+ "author": {
+ "name": "Jeremy Dawes",
+ "email": "[email protected]"
+ },
+ "license": "MIT",
+ "repository": "https://github.com/jezweb/claude-skills",
+ "keywords": []
+}
diff --git a/skills/streamlit-snowflake/README.md b/skills/streamlit-snowflake/README.md
new file mode 100644
index 00000000..fb4ddad6
--- /dev/null
+++ b/skills/streamlit-snowflake/README.md
@@ -0,0 +1,79 @@
+# streamlit-snowflake
+
+Build and deploy Streamlit apps natively in Snowflake with production-ready templates.
+
+## Auto-Trigger Keywords
+
+This skill should be suggested when the user mentions:
+
+- streamlit snowflake
+- streamlit in snowflake
+- SiS (Streamlit in Snowflake)
+- snow streamlit deploy
+- snowflake native app streamlit
+- snowflake marketplace app
+- environment.yml snowflake
+- snowflake anaconda channel
+- snowpark streamlit
+- streamlit data app snowflake
+
+## What This Skill Provides
+
+- **Project scaffold**: `snowflake.yml`, `environment.yml`, `streamlit_app.py`
+- **Snowpark patterns**: Session connection, caching, DataFrame handling
+- **Multi-page structure**: Ready-to-use pages/ directory
+- **Marketplace publishing**: Native App templates for Marketplace listings
+- **CI/CD**: GitHub Actions deployment workflow
+- **Error prevention**: Package channel, version, and auth issue fixes
+
+## Quick Usage
+
+```
+User: "Help me set up a Streamlit app in Snowflake"
+Claude: [Proposes using streamlit-snowflake skill]
+```
+
+## Contents
+
+```
+streamlit-snowflake/
+├── SKILL.md # Full documentation
+├── README.md # This file
+├── templates/ # Project templates
+│ ├── snowflake.yml
+│ ├── environment.yml
+│ ├── streamlit_app.py
+│ ├── pages/
+│ └── common/
+├── templates-native-app/ # Marketplace publishing
+│ ├── manifest.yml
+│ ├── setup.sql
+│ └── README.md
+├── references/ # Supporting docs
+│ ├── available-packages.md
+│ ├── authentication.md
+│ └── ci-cd.md
+└── scripts/
+ └── check-packages.sql
+```
+
+## Key Errors Prevented
+
+| Error | This Skill Prevents |
+|-------|---------------------|
+| PackageNotFoundError | Uses correct `channels: - snowflake` |
+| Old Streamlit features missing | Explicit `streamlit=1.35.0` version |
+| Deployment syntax errors | CLI 3.14.0+ patterns |
+| Auth failures (2026) | Documents modern auth methods |
+
+## Requirements
+
+- Snowflake account with Streamlit enabled
+- Snowflake CLI 3.14.0+ (`snow` command)
+- Python 3.11 (recommended)
+
+## Links
+
+- [Streamlit in Snowflake Docs](https://docs.snowflake.com/en/developer-guide/streamlit/about-streamlit)
+- [Snowflake CLI](https://docs.snowflake.com/en/developer-guide/snowflake-cli/index)
+- [Package Explorer](https://snowpark-python-packages.streamlit.app/)
diff --git a/skills/streamlit-snowflake/SKILL.md b/skills/streamlit-snowflake/SKILL.md
new file mode 100644
index 00000000..8b4d8df7
--- /dev/null
+++ b/skills/streamlit-snowflake/SKILL.md
@@ -0,0 +1,268 @@
+---
+name: streamlit-snowflake
+description: |
+ Build and deploy Streamlit apps natively in Snowflake with production-ready templates. Covers project scaffolding (snowflake.yml, environment.yml), Snowpark session patterns, multi-page structure, and Marketplace publishing as Native Apps.
+
+ Use when building data apps on Snowflake, deploying Streamlit in Snowflake (SiS), or publishing to Snowflake Marketplace. Prevents package channel errors, outdated Streamlit versions, and authentication issues.
+license: MIT
+metadata:
+ version: "1.0.0"
+ last_verified: "2025-12-24"
+ snowflake_cli: ">=3.14.0"
+ streamlit: "1.35.0"
+ python: "3.11"
+ keywords:
+ - streamlit snowflake
+ - streamlit in snowflake
+ - SiS
+ - snowflake native app
+ - snowflake marketplace
+ - snowpark streamlit
+ - snow streamlit deploy
+ - environment.yml snowflake
+ - snowflake anaconda channel
+---
+
+# Streamlit in Snowflake Skill
+
+Build and deploy Streamlit apps natively within Snowflake, including Marketplace publishing as Native Apps.
+
+## Quick Start
+
+### 1. Initialize Project
+
+Copy the templates to your project:
+
+```bash
+# Create project directory
+mkdir my-streamlit-app && cd my-streamlit-app
+
+# Copy templates (Claude will provide these)
+```
+
+### 2. Configure snowflake.yml
+
+Update placeholders in `snowflake.yml`:
+
+```yaml
+definition_version: 2
+entities:
+ my_app:
+ type: streamlit
+ identifier: my_streamlit_app # ← Your app name
+ stage: my_app_stage # ← Your stage name
+ query_warehouse: my_warehouse # ← Your warehouse
+ main_file: streamlit_app.py
+ pages_dir: pages/
+ artifacts:
+ - common/
+ - environment.yml
+```
+
+### 3. Deploy
+
+```bash
+# Deploy to Snowflake
+snow streamlit deploy --replace
+
+# Open in browser
+snow streamlit deploy --replace --open
+```
+
+## When to Use This Skill
+
+**Use when:**
+- Building data apps that run natively in Snowflake
+- Need Snowpark integration for data access
+- Publishing apps to Snowflake Marketplace
+- Setting up CI/CD for Streamlit in Snowflake
+
+**Don't use when:**
+- Hosting Streamlit externally (use Streamlit Community Cloud)
+- Building general Snowpark pipelines (use a Snowpark-specific skill)
+- Need custom Streamlit components (not supported in SiS)
+
+## Project Structure
+
+```
+my-streamlit-app/
+├── snowflake.yml # Project definition (required)
+├── environment.yml # Package dependencies (required)
+├── streamlit_app.py # Main entry point
+├── pages/ # Multi-page apps
+│ └── data_explorer.py
+├── common/ # Shared utilities
+│ └── utils.py
+└── .gitignore
+```
+
+## Key Patterns
+
+### Snowpark Session Connection
+
+```python
+import streamlit as st
+
+# Get Snowpark session (native SiS connection)
+conn = st.connection("snowflake")
+session = conn.session()
+
+# Query data
+df = session.sql("SELECT * FROM my_table LIMIT 100").to_pandas()
+st.dataframe(df)
+```
+
+### Caching Expensive Queries
+
+```python
[email protected]_data(ttl=600) # Cache for 10 minutes
+def load_data(query: str):
+ conn = st.connection("snowflake")
+ return conn.session().sql(query).to_pandas()
+
+# Use cached function
+df = load_data("SELECT * FROM large_table")
+```
+
+### Environment Configuration
+
+**environment.yml** (required format):
+
+```yaml
+name: sf_env
+channels:
+ - snowflake # REQUIRED - only supported channel
+dependencies:
+ - streamlit=1.35.0 # Explicit version (default is old 1.22.0)
+ - pandas
+ - plotly
+ - altair=4.0 # Version 4.0 supported in SiS
+ - snowflake-snowpark-python
+```
+
+## Error Prevention
+
+| Error | Cause | Prevention |
+|-------|-------|------------|
+| `PackageNotFoundError` | Using conda-forge or external channel | Always use `channels: - snowflake` only |
+| Missing Streamlit features | Default version 1.22.0 | Explicitly set `streamlit=1.35.0` |
+| `ROOT_LOCATION deprecated` | Old CLI syntax | Use Snowflake CLI 3.14.0+ with `FROM source_location` |
+| Auth failures (2026+) | Password-only authentication | Use key-pair or OAuth (see references/authentication.md) |
+| File upload fails | File >250MB | Keep files under 250MB limit |
+| `page_title not supported` | SiS limitation | Don't use `st.set_page_config(page_title=...)` |
+| Custom component error | SiS limitation | Custom Streamlit components not supported |
+
+## Deployment Commands
+
+### Basic Deployment
+
+```bash
+# Deploy and replace existing
+snow streamlit deploy --replace
+
+# Deploy and open in browser
+snow streamlit deploy --replace --open
+
+# Deploy specific entity (if multiple in snowflake.yml)
+snow streamlit deploy my_app --replace
+```
+
+### CI/CD Deployment
+
+See `references/ci-cd.md` for GitHub Actions workflow template.
+
+## Marketplace Publishing (Native App)
+
+To publish your Streamlit app to Snowflake Marketplace:
+
+1. **Convert to Native App** - Use `templates-native-app/` templates
+2. **Create Provider Profile** - Required for Marketplace listings
+3. **Submit for Approval** - Snowflake reviews before publishing
+
+See `templates-native-app/README.md` for complete workflow.
+
+### Native App Structure
+
+```
+my-native-app/
+├── manifest.yml # Native App manifest
+├── setup.sql # Installation script
+├── streamlit/
+│ ├── environment.yml
+│ ├── streamlit_app.py
+│ └── pages/
+└── README.md
+```
+
+## Package Availability
+
+Only packages from the **Snowflake Anaconda Channel** are available:
+
+```sql
+-- Query available packages
+SELECT * FROM information_schema.packages
+WHERE language = 'python'
+ORDER BY package_name;
+
+-- Search for specific package
+SELECT * FROM information_schema.packages
+WHERE language = 'python'
+AND package_name ILIKE '%plotly%';
+```
+
+**Common available packages:**
+- pandas, numpy, scipy
+- plotly, altair (4.0), matplotlib
+- scikit-learn, xgboost
+- snowflake-snowpark-python
+- streamlit (1.22.0 default, 1.35.0 with explicit version)
+
+**Not available:**
+- Packages from conda-forge
+- Custom/private packages
+- Packages requiring native compilation
+
+See: [Snowpark Python Packages Explorer](https://snowpark-python-packages.streamlit.app/)
+
+## Known Limitations
+
+1. **No custom Streamlit components** - Only built-in components work
+2. **Package restrictions** - Only Snowflake Anaconda Channel
+3. **No Azure Private Link / GCP Private Service Connect** for app access
+4. **page_title and page_icon** not supported in `st.set_page_config()`
+5. **File size limit** - 250MB per file
+6. **Session timeout** - Apps may timeout after inactivity
+
+## Authentication (Important - 2026 Deadline)
+
+Password-only authentication is being deprecated:
+
+| Milestone | Date | Requirement |
+|-----------|------|-------------|
+| Milestone 1 | Sept 2025 - Jan 2026 | MFA required for Snowsight users |
+| Milestone 2 | May - July 2026 | All new users must use MFA |
+| Milestone 3 | Aug - Oct 2026 | All users must use MFA or key-pair/OAuth |
+
+**Recommended authentication methods:**
+- Key-pair authentication (for service accounts)
+- OAuth client credentials (for M2M)
+- Workload Identity Federation (for cloud-native apps)
+
+See `references/authentication.md` for implementation patterns.
+
+## Resources
+
+### Official Documentation
+- [Streamlit in Snowflake](https://docs.snowflake.com/en/developer-guide/streamlit/about-streamlit)
+- [Snowflake CLI Streamlit Commands](https://docs.snowflake.com/en/developer-guide/snowflake-cli/command-reference/streamlit-commands/overview)
+- [Native Apps with Streamlit](https://docs.snowflake.com/en/developer-guide/native-apps/adding-streamlit)
+- [Marketplace Publishing](https://docs.snowflake.com/en/developer-guide/native-apps/publish-guidelines)
+
+### Examples
+- [snowflake-demo-streamlit](https://github.com/Snowflake-Labs/snowflake-demo-streamlit)
+- [native-apps-templates](https://github.com/snowflakedb/native-apps-templates)
+- [GitLab's Streamlit Framework](https://about.gitlab.com/blog/how-we-built-a-structured-streamlit-application-framework-in-snowflake/)
+
+### Tools
+- [Snowpark Python Packages Explorer](https://snowpark-python-packages.streamlit.app/)
+- [Snowflake MCP Server](https://github.com/Snowflake-Labs/mcp) (for Claude integration)
diff --git a/skills/streamlit-snowflake/references/authentication.md b/skills/streamlit-snowflake/references/authentication.md
new file mode 100644
index 00000000..e6d471dd
--- /dev/null
+++ b/skills/streamlit-snowflake/references/authentication.md
@@ -0,0 +1,238 @@
+# Snowflake Authentication Patterns
+
+Password-only authentication is being deprecated. This guide covers modern authentication methods.
+
+## Deprecation Timeline
+
+| Milestone | Date | Requirement |
+|-----------|------|-------------|
+| Milestone 1 | Sept 2025 - Jan 2026 | MFA required for Snowsight users with password auth |
+| Milestone 2 | May - July 2026 | All new users must use MFA |
+| Milestone 3 | Aug - Oct 2026 | All users must use MFA or alternative auth |
+
+**Recommendation:** Migrate to key-pair or OAuth before Oct 2026.
+
+## Authentication Methods
+
+### 1. Key-Pair Authentication (Recommended for Service Accounts)
+
+Best for: CI/CD pipelines, automated deployments, service accounts
+
+#### Generate Key Pair
+
+```bash
+# Generate private key (with passphrase)
+openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8
+
+# Generate public key
+openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub
+
+# For unencrypted private key (not recommended for production)
+openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt
+```
+
+#### Assign Public Key to User
+
+```sql
+ALTER USER my_service_user SET RSA_PUBLIC_KEY='MIIBIjANBgkq...';
+```
+
+#### Use in Python
+
+```python
+from cryptography.hazmat.primitives import serialization
+from cryptography.hazmat.backends import default_backend
+import snowflake.connector
+
+# Load private key
+with open("rsa_key.p8", "rb") as key_file:
+ private_key = serialization.load_pem_private_key(
+ key_file.read(),
+ password="your_passphrase".encode(), # Remove if unencrypted
+ backend=default_backend()
+ )
+
+# Connect
+conn = snowflake.connector.connect(
+ account="your_account",
+ user="my_service_user",
+ private_key=private_key,
+ warehouse="my_warehouse",
+ database="my_database",
+ schema="my_schema"
+)
+```
+
+#### Use in Snowflake CLI
+
+```bash
+# In connections.toml (~/.snowflake/connections.toml)
+[my_connection]
+account = "your_account"
+user = "my_service_user"
+authenticator = "SNOWFLAKE_JWT"
+private_key_path = "/path/to/rsa_key.p8"
+private_key_passphrase = "your_passphrase" # Or use env var
+```
+
+### 2. OAuth Client Credentials (Recommended for M2M)
+
+Best for: Machine-to-machine communication, API integrations
+
+#### Create Security Integration
+
+```sql
+-- Create OAuth integration
+CREATE OR REPLACE SECURITY INTEGRATION oauth_integration
+ TYPE = OAUTH
+ ENABLED = TRUE
+ OAUTH_CLIENT = CUSTOM
+ OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'
+ OAUTH_REDIRECT_URI = 'https://localhost'
+ OAUTH_ISSUE_REFRESH_TOKENS = TRUE
+ OAUTH_REFRESH_TOKEN_VALIDITY = 86400;
+
+-- Get client ID and secret
+SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS('OAUTH_INTEGRATION');
+```
+
+#### Use in Python
+
+```python
+import snowflake.connector
+
+conn = snowflake.connector.connect(
+ account="your_account",
+ authenticator="oauth",
+ token="your_access_token",
+ warehouse="my_warehouse"
+)
+```
+
+### 3. Workload Identity Federation (Cloud-Native)
+
+Best for: Apps running on AWS/Azure/GCP with native identity
+
+#### AWS IAM Integration
+
+```sql
+-- Create security integration for AWS
+CREATE OR REPLACE SECURITY INTEGRATION aws_integration
+ TYPE = API_AUTHENTICATION
+ AUTH_TYPE = AWS_IAM_ROLE
+ ENABLED = TRUE
+ AWS_ROLE_ARN = 'arn:aws:iam::123456789:role/SnowflakeRole';
+```
+
+```python
+import snowflake.connector
+
+conn = snowflake.connector.connect(
+ account="your_account",
+ authenticator="WORKLOAD_IDENTITY",
+ # AWS credentials auto-discovered from environment
+)
+```
+
+#### Azure Managed Identity
+
+```sql
+CREATE OR REPLACE SECURITY INTEGRATION azure_integration
+ TYPE = API_AUTHENTICATION
+ AUTH_TYPE = AZURE_AD
+ ENABLED = TRUE
+ AZURE_AD_APPLICATION_ID = 'your-app-id'
+ AZURE_TENANT_ID = 'your-tenant-id';
+```
+
+### 4. Personal Access Tokens (PAT)
+
+Best for: Developer access, testing (new in 2025)
+
+```sql
+-- Create PAT for a user
+ALTER USER my_user SET NETWORK_POLICY = 'my_policy';
+-- PATs are managed via Snowsight UI
+```
+
+## Snowflake CLI Authentication
+
+### connections.toml
+
+Location: `~/.snowflake/connections.toml`
+
+```toml
+# Password auth (deprecated, use for development only)
+[dev]
+account = "your_account"
+user = "your_user"
+password = "your_password" # Better: use env var
+warehouse = "my_warehouse"
+
+# Key-pair auth (recommended)
+[prod]
+account = "your_account"
+user = "service_user"
+authenticator = "SNOWFLAKE_JWT"
+private_key_path = "/secure/path/rsa_key.p8"
+private_key_passphrase_env_var = "SNOWFLAKE_PRIVATE_KEY_PASSPHRASE"
+warehouse = "my_warehouse"
+
+# SSO/Browser auth (for interactive use)
+[sso]
+account = "your_account"
+user = "your_user"
+authenticator = "externalbrowser"
+warehouse = "my_warehouse"
+```
+
+### Environment Variables
+
+```bash
+# Avoid storing secrets in files
+export SNOWFLAKE_PRIVATE_KEY_PASSPHRASE="your_passphrase"
+export SNOWFLAKE_PASSWORD="your_password" # For dev only
+```
+
+## CI/CD Authentication
+
+### GitHub Actions
+
+```yaml
+- name: Deploy Streamlit
+ env:
+ SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
+ SNOWFLAKE_USER: ${{ secrets.SNOWFLAKE_USER }}
+ SNOWFLAKE_PRIVATE_KEY: ${{ secrets.SNOWFLAKE_PRIVATE_KEY }}
+ run: |
+ # Write private key to file
+ echo "$SNOWFLAKE_PRIVATE_KEY" > /tmp/rsa_key.p8
+ chmod 600 /tmp/rsa_key.p8
+
+ # Configure connection
+ snow connection add \
+ --connection-name deploy \
+ --account $SNOWFLAKE_ACCOUNT \
+ --user $SNOWFLAKE_USER \
+ --authenticator SNOWFLAKE_JWT \
+ --private-key-path /tmp/rsa_key.p8
+
+ # Deploy
+ snow streamlit deploy --connection deploy --replace
+```
+
+## Security Best Practices
+
+1. **Never commit credentials** to version control
+2. **Use secrets management** (GitHub Secrets, AWS Secrets Manager, etc.)
+3. **Rotate keys regularly** (90 days recommended)
+4. **Use separate accounts** for dev/staging/prod
+5. **Apply network policies** to restrict access
+6. **Monitor authentication** via ACCESS_HISTORY view
+
+## Resources
+
+- [Key-Pair Authentication](https://docs.snowflake.com/en/user-guide/key-pair-auth)
+- [OAuth Overview](https://docs.snowflake.com/en/user-guide/oauth)
+- [Workload Identity](https://docs.snowflake.com/en/user-guide/admin-security-fed-auth-overview)
+- [Authentication Deprecation](https://community.snowflake.com/s/article/Authentication-Changes-2025)
diff --git a/skills/streamlit-snowflake/references/available-packages.md b/skills/streamlit-snowflake/references/available-packages.md
new file mode 100644
index 00000000..1fb7de1c
--- /dev/null
+++ b/skills/streamlit-snowflake/references/available-packages.md
@@ -0,0 +1,123 @@
+# Available Packages for Streamlit in Snowflake
+
+Streamlit in Snowflake only supports packages from the **Snowflake Anaconda Channel**. External channels (conda-forge, pip) are not supported.
+
+## Checking Available Packages
+
+### SQL Query
+
+```sql
+-- List all available Python packages
+SELECT
+ package_name,
+ version,
+ language
+FROM information_schema.packages
+WHERE language = 'python'
+ORDER BY package_name;
+
+-- Search for specific package
+SELECT *
+FROM information_schema.packages
+WHERE language = 'python'
+AND package_name ILIKE '%plotly%';
+
+-- Get latest version of a package
+SELECT
+ package_name,
+ MAX(version) as latest_version
+FROM information_schema.packages
+WHERE language = 'python'
+AND package_name = 'streamlit'
+GROUP BY package_name;
+```
+
+### Using REPODATA Function
+
+```sql
+-- Get full package metadata
+SELECT *
+FROM TABLE(SNOWFLAKE.SNOWPARK.GET_ANACONDA_PACKAGES_REPODATA('linux-64'))
+WHERE name ILIKE '%pandas%';
+```
+
+### Web Tool
+
+Use the community package explorer:
+**[Snowpark Python Packages Explorer](https://snowpark-python-packages.streamlit.app/)**
+
+## Common Available Packages
+
+### Data Processing
+- `pandas` - DataFrames and data manipulation
+- `numpy` - Numerical computing
+- `scipy` - Scientific computing
+- `polars` - Fast DataFrame library
+
+### Visualization
+- `streamlit` (1.22.0 default, 1.35.0 available)
+- `plotly` - Interactive charts
+- `altair` (4.0) - Declarative visualization
+- `matplotlib` - Static plots
+- `seaborn` - Statistical visualization
+
+### Machine Learning
+- `scikit-learn` - ML algorithms
+- `xgboost` - Gradient boosting
+- `lightgbm` - Gradient boosting
+- `statsmodels` - Statistical models
+
+### Snowflake
+- `snowflake-snowpark-python` - Snowpark API
+- `snowflake-connector-python` - Direct connector
+
+### Utilities
+- `pillow` - Image processing
+- `requests` - HTTP library (limited use in SiS)
+- `pyyaml` - YAML parsing
+- `python-dateutil` - Date utilities
+
+## Package Limitations
+
+### Not Available
+- Packages from conda-forge
+- Packages requiring native compilation not in channel
+- Custom/private packages
+- Packages with system dependencies
+
+### Version Constraints
+- Some packages have specific version requirements
+- Check compatibility with Snowpark version
+- Streamlit versions: 1.22.0 (default), up to 1.35.0
+
+## Adding Packages to environment.yml
+
+```yaml
+name: sf_env
+channels:
+ - snowflake # REQUIRED - only channel
+
+dependencies:
+ - streamlit=1.35.0 # Always pin version
+ - pandas
+ - plotly
+ - scikit-learn
+ # Check availability before adding more
+```
+
+## Troubleshooting
+
+### "PackageNotFoundError"
+- Package not in Snowflake channel
+- Check spelling and case
+- Use SQL query to verify availability
+
+### Version Conflicts
+- Some packages have interdependencies
+- Try removing version pins
+- Check Snowpark compatibility
+
+### Package Not Loading
+- Restart app after environment.yml changes
+- Check for syntax errors in YAML
+- Verify `channels: - snowflake` is present
diff --git a/skills/streamlit-snowflake/references/ci-cd.md b/skills/streamlit-snowflake/references/ci-cd.md
new file mode 100644
index 00000000..a8d0430e
--- /dev/null
+++ b/skills/streamlit-snowflake/references/ci-cd.md
@@ -0,0 +1,299 @@
+# CI/CD for Streamlit in Snowflake
+
+Automate deployment of Streamlit apps using GitHub Actions and Snowflake CLI.
+
+## GitHub Actions Workflow
+
+### Basic Deployment
+
+`.github/workflows/deploy-streamlit.yml`:
+
+```yaml
+name: Deploy Streamlit to Snowflake
+
+on:
+ push:
+ branches: [main]
+ paths:
+ - 'streamlit_app.py'
+ - 'pages/**'
+ - 'common/**'
+ - 'environment.yml'
+ - 'snowflake.yml'
+
+ workflow_dispatch: # Manual trigger
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.11'
+
+ - name: Install Snowflake CLI
+ run: pip install snowflake-cli-labs
+
+ - name: Configure Snowflake connection
+ env:
+ SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
+ SNOWFLAKE_USER: ${{ secrets.SNOWFLAKE_USER }}
+ SNOWFLAKE_PRIVATE_KEY: ${{ secrets.SNOWFLAKE_PRIVATE_KEY }}
+ SNOWFLAKE_WAREHOUSE: ${{ secrets.SNOWFLAKE_WAREHOUSE }}
+ SNOWFLAKE_DATABASE: ${{ secrets.SNOWFLAKE_DATABASE }}
+ SNOWFLAKE_SCHEMA: ${{ secrets.SNOWFLAKE_SCHEMA }}
+ run: |
+ # Write private key
+ echo "$SNOWFLAKE_PRIVATE_KEY" > /tmp/rsa_key.p8
+ chmod 600 /tmp/rsa_key.p8
+
+ # Create config directory
+ mkdir -p ~/.snowflake
+
+ # Write connections.toml
+ cat > ~/.snowflake/connections.toml << EOF
+ [deploy]
+ account = "$SNOWFLAKE_ACCOUNT"
+ user = "$SNOWFLAKE_USER"
+ authenticator = "SNOWFLAKE_JWT"
+ private_key_path = "/tmp/rsa_key.p8"
+ warehouse = "$SNOWFLAKE_WAREHOUSE"
+ database = "$SNOWFLAKE_DATABASE"
+ schema = "$SNOWFLAKE_SCHEMA"
+ EOF
+
+ - name: Deploy Streamlit app
+ run: |
+ snow streamlit deploy --connection deploy --replace
+
+ - name: Get app URL
+ run: |
+ snow streamlit describe --connection deploy | grep -i url
+
+ - name: Cleanup
+ if: always()
+ run: rm -f /tmp/rsa_key.p8
+```
+
+### With Environment-Specific Deployments
+
+```yaml
+name: Deploy Streamlit
+
+on:
+ push:
+ branches:
+ - main # Deploy to prod
+ - staging # Deploy to staging
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set environment
+ id: env
+ run: |
+ if [ "${{ github.ref }}" == "refs/heads/main" ]; then
+ echo "ENV=prod" >> $GITHUB_OUTPUT
+ echo "STREAMLIT_NAME=my_app" >> $GITHUB_OUTPUT
+ else
+ echo "ENV=staging" >> $GITHUB_OUTPUT
+ echo "STREAMLIT_NAME=my_app_staging" >> $GITHUB_OUTPUT
+ fi
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.11'
+
+ - name: Install CLI
+ run: pip install snowflake-cli-labs
+
+ - name: Configure connection
+ env:
+ # Use environment-specific secrets
+ SNOWFLAKE_ACCOUNT: ${{ secrets[format('SNOWFLAKE_ACCOUNT_{0}', steps.env.outputs.ENV)] }}
+ SNOWFLAKE_USER: ${{ secrets[format('SNOWFLAKE_USER_{0}', steps.env.outputs.ENV)] }}
+ SNOWFLAKE_PRIVATE_KEY: ${{ secrets[format('SNOWFLAKE_PRIVATE_KEY_{0}', steps.env.outputs.ENV)] }}
+ run: |
+ echo "$SNOWFLAKE_PRIVATE_KEY" > /tmp/rsa_key.p8
+ chmod 600 /tmp/rsa_key.p8
+
+ mkdir -p ~/.snowflake
+ cat > ~/.snowflake/connections.toml << EOF
+ [deploy]
+ account = "$SNOWFLAKE_ACCOUNT"
+ user = "$SNOWFLAKE_USER"
+ authenticator = "SNOWFLAKE_JWT"
+ private_key_path = "/tmp/rsa_key.p8"
+ EOF
+
+ - name: Deploy
+ run: |
+ snow streamlit deploy ${{ steps.env.outputs.STREAMLIT_NAME }} \
+ --connection deploy \
+ --replace
+
+ - name: Cleanup
+ if: always()
+ run: rm -f /tmp/rsa_key.p8
+```
+
+## Required GitHub Secrets
+
+| Secret | Description | Example |
+|--------|-------------|---------|
+| `SNOWFLAKE_ACCOUNT` | Account identifier | `xy12345.us-east-1` |
+| `SNOWFLAKE_USER` | Service account username | `deploy_user` |
+| `SNOWFLAKE_PRIVATE_KEY` | Private key (PEM format) | Full key content |
+| `SNOWFLAKE_WAREHOUSE` | Warehouse name | `COMPUTE_WH` |
+| `SNOWFLAKE_DATABASE` | Database name | `MY_DB` |
+| `SNOWFLAKE_SCHEMA` | Schema name | `PUBLIC` |
+
+### Setting Private Key Secret
+
+```bash
+# Copy entire private key including headers
+cat rsa_key.p8 | pbcopy # macOS
+cat rsa_key.p8 | xclip # Linux
+
+# Paste into GitHub secret (Settings > Secrets > New)
+```
+
+## Alternative: Using Snowflake CLI Configuration
+
+### Pre-configured CLI
+
+If using self-hosted runners with pre-configured Snowflake CLI:
+
+```yaml
+- name: Deploy
+ run: snow streamlit deploy --connection prod --replace
+```
+
+### Using config.toml
+
+```yaml
+- name: Configure
+ run: |
+ mkdir -p ~/.snowflake
+ cat > ~/.snowflake/config.toml << EOF
+ default_connection_name = "deploy"
+ EOF
+```
+
+## Native App CI/CD
+
+For Marketplace Native Apps:
+
+```yaml
+name: Deploy Native App
+
+on:
+ push:
+ branches: [main]
+ paths:
+ - 'manifest.yml'
+ - 'setup.sql'
+ - 'streamlit/**'
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Setup
+ # ... same as above ...
+
+ - name: Upload to Stage
+ run: |
+ snow stage put manifest.yml @my_package.versions.v1/ --overwrite
+ snow stage put setup.sql @my_package.versions.v1/ --overwrite
+ snow stage put streamlit/ @my_package.versions.v1/streamlit/ --overwrite --recursive
+
+ - name: Update Version
+ run: |
+ snow sql -q "ALTER APPLICATION PACKAGE my_package
+ ADD VERSION v${{ github.run_number }}
+ USING '@my_package.versions.v1'"
+```
+
+## Best Practices
+
+### 1. Use Dedicated Service Account
+
+```sql
+-- Create deploy user
+CREATE USER deploy_user
+ DEFAULT_ROLE = deploy_role
+ DEFAULT_WAREHOUSE = deploy_wh;
+
+-- Grant minimal permissions
+GRANT ROLE deploy_role TO USER deploy_user;
+GRANT CREATE STREAMLIT ON SCHEMA my_schema TO ROLE deploy_role;
+```
+
+### 2. Validate Before Deploy
+
+```yaml
+- name: Validate snowflake.yml
+ run: |
+ python -c "import yaml; yaml.safe_load(open('snowflake.yml'))"
+
+- name: Validate environment.yml
+ run: |
+ python -c "import yaml; yaml.safe_load(open('environment.yml'))"
+```
+
+### 3. Add Deployment Notifications
+
+```yaml
+- name: Notify Slack
+ if: success()
+ uses: slackapi/slack-github-action@v1
+ with:
+ payload: |
+ {
+ "text": "Streamlit app deployed successfully!"
+ }
+ env:
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
+```
+
+### 4. Run Tests First
+
+```yaml
+- name: Test Streamlit app
+ run: |
+ pip install streamlit pytest
+ # Syntax check
+ python -m py_compile streamlit_app.py
+ python -m py_compile pages/*.py
+ # Unit tests if any
+ pytest tests/ -v || true
+```
+
+## Troubleshooting
+
+### Authentication Fails
+- Verify private key format (PKCS#8)
+- Check key passphrase if encrypted
+- Confirm user has correct permissions
+
+### Deploy Timeout
+- Increase GitHub Actions timeout: `timeout-minutes: 30`
+- Check warehouse availability
+
+### Stage Upload Fails
+- Verify stage exists
+- Check write permissions on stage
diff --git a/skills/streamlit-snowflake/scripts/check-packages.sql b/skills/streamlit-snowflake/scripts/check-packages.sql
new file mode 100644
index 00000000..f82e53f1
--- /dev/null
+++ b/skills/streamlit-snowflake/scripts/check-packages.sql
@@ -0,0 +1,102 @@
+-- =============================================================================
+-- Snowflake Anaconda Channel Package Queries
+-- Run these in Snowsight or via Snowflake CLI
+-- =============================================================================
+
+-- -----------------------------------------------------------------------------
+-- List all available Python packages
+-- -----------------------------------------------------------------------------
+SELECT
+ package_name,
+ version,
+ language
+FROM information_schema.packages
+WHERE language = 'python'
+ORDER BY package_name, version DESC;
+
+
+-- -----------------------------------------------------------------------------
+-- Search for specific package (case-insensitive)
+-- -----------------------------------------------------------------------------
+-- Replace 'plotly' with your package name
+SELECT *
+FROM information_schema.packages
+WHERE language = 'python'
+AND package_name ILIKE '%plotly%'
+ORDER BY version DESC;
+
+
+-- -----------------------------------------------------------------------------
+-- Get latest version of a package
+-- -----------------------------------------------------------------------------
+SELECT
+ package_name,
+ MAX(version) as latest_version
+FROM information_schema.packages
+WHERE language = 'python'
+AND package_name = 'streamlit' -- Replace with package name
+GROUP BY package_name;
+
+
+-- -----------------------------------------------------------------------------
+-- Check if specific version is available
+-- -----------------------------------------------------------------------------
+SELECT *
+FROM information_schema.packages
+WHERE language = 'python'
+AND package_name = 'streamlit'
+AND version = '1.35.0';
+
+
+-- -----------------------------------------------------------------------------
+-- List commonly used packages with versions
+-- -----------------------------------------------------------------------------
+SELECT
+ package_name,
+ MAX(version) as latest_version
+FROM information_schema.packages
+WHERE language = 'python'
+AND package_name IN (
+ 'streamlit',
+ 'pandas',
+ 'numpy',
+ 'plotly',
+ 'altair',
+ 'matplotlib',
+ 'scikit-learn',
+ 'xgboost',
+ 'snowflake-snowpark-python',
+ 'pillow',
+ 'scipy'
+)
+GROUP BY package_name
+ORDER BY package_name;
+
+
+-- -----------------------------------------------------------------------------
+-- Get package metadata using REPODATA function
+-- (More detailed info including dependencies)
+-- -----------------------------------------------------------------------------
+SELECT *
+FROM TABLE(SNOWFLAKE.SNOWPARK.GET_ANACONDA_PACKAGES_REPODATA('linux-64'))
+WHERE name = 'streamlit'
+LIMIT 10;
+
+
+-- -----------------------------------------------------------------------------
+-- Count available packages by category
+-- (Approximate based on naming patterns)
+-- -----------------------------------------------------------------------------
+SELECT
+ CASE
+ WHEN package_name ILIKE '%ml%' OR package_name ILIKE '%sklearn%' THEN 'Machine Learning'
+ WHEN package_name ILIKE '%plot%' OR package_name ILIKE '%chart%' OR package_name ILIKE '%viz%' THEN 'Visualization'
+ WHEN package_name ILIKE '%sql%' OR package_name ILIKE '%db%' THEN 'Database'
+ WHEN package_name ILIKE '%test%' OR package_name ILIKE '%pytest%' THEN 'Testing'
+ ELSE 'Other'
+ END as category,
+ COUNT(DISTINCT package_name) as package_count
+FROM information_schema.packages
+WHERE language = 'python'
+GROUP BY category
+ORDER BY package_count DESC;
diff --git a/skills/streamlit-snowflake/templates-native-app/README.md b/skills/streamlit-snowflake/templates-native-app/README.md
new file mode 100644
index 00000000..1bdf266d
--- /dev/null
+++ b/skills/streamlit-snowflake/templates-native-app/README.md
@@ -0,0 +1,214 @@
+# Publishing Streamlit Apps to Snowflake Marketplace
+
+This guide covers converting your Streamlit app to a Native App and publishing to the Snowflake Marketplace.
+
+## Overview
+
+**Workflow:**
+1. Convert Streamlit app to Native App structure
+2. Create Application Package
+3. Test locally with trial installation
+4. Create Provider Profile (one-time)
+5. Create Marketplace Listing
+6. Submit for approval
+
+## Native App Directory Structure
+
+```
+my-native-app/
+├── manifest.yml # App manifest (required)
+├── setup.sql # Installation script (required)
+├── README.md # App documentation
+├── streamlit/ # Streamlit app files
+│ ├── environment.yml
+│ ├── streamlit_app.py
+│ ├── pages/
+│ └── common/
+└── scripts/ # Optional helper scripts
+ └── deploy.sql
+```
+
+## Step 1: Create Application Package
+
+```sql
+-- Create the application package
+CREATE APPLICATION PACKAGE IF NOT EXISTS my_app_package;
+
+-- Create a versioned stage for app files
+CREATE SCHEMA IF NOT EXISTS my_app_package.versions;
+CREATE STAGE IF NOT EXISTS my_app_package.versions.v1
+ DIRECTORY = (ENABLE = TRUE);
+
+-- Upload files to stage (via Snowflake CLI or Snowsight)
+-- PUT file://manifest.yml @my_app_package.versions.v1/;
+-- PUT file://setup.sql @my_app_package.versions.v1/;
+-- PUT file://streamlit/* @my_app_package.versions.v1/streamlit/;
+```
+
+### Using Snowflake CLI
+
+```bash
+# Upload all files
+snow stage put manifest.yml @my_app_package.versions.v1/ --overwrite
+snow stage put setup.sql @my_app_package.versions.v1/ --overwrite
+snow stage put streamlit/ @my_app_package.versions.v1/streamlit/ --overwrite --recursive
+```
+
+## Step 2: Add Version to Package
+
+```sql
+-- Add version to the application package
+ALTER APPLICATION PACKAGE my_app_package
+ ADD VERSION v1_0
+ USING '@my_app_package.versions.v1';
+
+-- Set as release directive (for distribution)
+ALTER APPLICATION PACKAGE my_app_package
+ SET DEFAULT RELEASE DIRECTIVE
+ VERSION = v1_0
+ PATCH = 0;
+```
+
+## Step 3: Test Installation
+
+```sql
+-- Create test installation in your account
+CREATE APPLICATION my_app_test
+ FROM APPLICATION PACKAGE my_app_package
+ USING VERSION v1_0;
+
+-- Verify Streamlit app works
+-- Navigate to Apps > my_app_test in Snowsight
+
+-- Drop test when done
+DROP APPLICATION my_app_test;
+```
+
+## Step 4: Create Provider Profile (One-Time)
+
+1. Go to **Snowsight** > **Data Products** > **Provider Studio**
+2. Click **Profiles** > **+ Profile**
+3. Fill in:
+ - Company name
+ - Contact information
+ - Logo (recommended: 200x200px PNG)
+ - Description
+4. Click **Submit for Approval**
+
+**Note:** Provider profile approval can take 1-3 business days.
+
+## Step 5: Set Distribution to External
+
+```sql
+-- Enable external distribution
+ALTER APPLICATION PACKAGE my_app_package
+ SET DISTRIBUTION = EXTERNAL;
+```
+
+**Note:** This triggers Snowflake's security scan (NAAPS). Allow 24-48 hours for scan completion.
+
+## Step 6: Create Marketplace Listing
+
+1. Go to **Provider Studio** > **Listings** > **+ Create Listing**
+2. Select **Snowflake Marketplace**
+3. Configure listing:
+
+### Basic Info
+- **Title**: Your app name (shown in Marketplace)
+- **Subtitle**: Brief tagline
+- **Description**: Full description (Markdown supported)
+
+### Attachments
+- **Icon**: 200x200px PNG (required)
+- **Screenshots**: Up to 5 images showing app functionality
+
+### Data Product
+- Select your Application Package
+
+### Pricing (for paid apps)
+- **Free**: No charge
+- **Paid**: Configure Stripe, set pricing
+
+### Categories & Regions
+- Select relevant categories
+- Choose deployment regions
+
+4. Click **Publish** to submit for review
+
+## Step 7: Approval Process
+
+Snowflake reviews all Marketplace listings:
+
+1. **Automated Security Scan** - NAAPS checks for vulnerabilities
+2. **Manual Review** - Snowflake team reviews functionality
+3. **Approval/Feedback** - Usually 3-5 business days
+
+**Common rejection reasons:**
+- Missing documentation
+- Security vulnerabilities
+- Non-functional features
+- Inappropriate content
+
+## Updating Your App
+
+### Create New Version
+
+```sql
+-- Upload updated files to new stage
+CREATE STAGE IF NOT EXISTS my_app_package.versions.v2;
+-- ... upload files ...
+
+-- Add new version
+ALTER APPLICATION PACKAGE my_app_package
+ ADD VERSION v2_0
+ USING '@my_app_package.versions.v2';
+
+-- Update release directive
+ALTER APPLICATION PACKAGE my_app_package
+ SET DEFAULT RELEASE DIRECTIVE
+ VERSION = v2_0
+ PATCH = 0;
+```
+
+Existing consumers will see update notification in Snowsight.
+
+## Paid Listings (Stripe Setup)
+
+For paid apps:
+
+1. Create Stripe account at [stripe.com](https://stripe.com)
+2. In Provider Studio, go to **Monetization Settings**
+3. Connect your Stripe account
+4. Configure pricing:
+ - Per-seat pricing
+ - Flat monthly fee
+ - Usage-based pricing
+
+## Best Practices
+
+### Documentation
+- Include clear README in your app
+- Document required privileges
+- Provide example use cases
+
+### Testing
+- Test in multiple regions
+- Verify with different roles
+- Check mobile/tablet rendering
+
+### Security
+- Request minimum necessary privileges
+- Never hardcode credentials
+- Use Snowflake secrets for sensitive data
+
+### User Experience
+- Add loading spinners for long operations
+- Handle errors gracefully
+- Provide helpful error messages
+
+## Resources
+
+- [Native Apps Developer Guide](https://docs.snowflake.com/en/developer-guide/native-apps/native-apps-about)
+- [Marketplace Publishing Guidelines](https://docs.snowflake.com/en/developer-guide/native-apps/publish-guidelines)
+- [Provider Studio Documentation](https://other-docs.snowflake.com/en/collaboration/provider-listings-gs)
+- [Monetization Guide](https://other-docs.snowflake.com/en/collaboration/provider-monetization)
diff --git a/skills/streamlit-snowflake/templates-native-app/manifest.yml b/skills/streamlit-snowflake/templates-native-app/manifest.yml
new file mode 100644
index 00000000..a363abf3
--- /dev/null
+++ b/skills/streamlit-snowflake/templates-native-app/manifest.yml
@@ -0,0 +1,56 @@
+# Snowflake Native App Manifest
+# Documentation: https://docs.snowflake.com/en/developer-guide/native-apps/creating-manifest
+
+manifest_version: 1
+
+version:
+ name: "1.0.0"
+ label: "Version 1.0.0"
+
+# Application artifacts
+artifacts:
+ readme: README.md
+ setup_script: setup.sql
+
+ # Default Streamlit app (appears as "Application" tab)
+ default_streamlit: streamlit/streamlit_app.py
+
+ # Extension code (optional)
+ # extension_code: true
+
+# Streamlit configuration
+# Optional: Configure default Streamlit environment
+configuration:
+ log_level: INFO
+
+# Required privileges for the app
+privileges:
+ - CREATE SCHEMA:
+ description: "Create schema for app data"
+ - CREATE TABLE:
+ description: "Create tables for app functionality"
+ # Add more privileges as needed:
+ # - EXECUTE TASK:
+ # description: "Run scheduled tasks"
+ # - CREATE WAREHOUSE:
+ # description: "Create compute resources"
+
+# References - objects the consumer provides access to
+references:
+ # Example: Reference to consumer's data table
+ # - consumer_data_table:
+ # label: "Data Table"
+ # description: "Table containing data to analyze"
+ # privileges:
+ # - SELECT
+ # object_type: TABLE
+ # multi_valued: false
+ # register_callback: config.register_data_table
+
+# Lifecycle callbacks (optional)
+# lifecycle_callbacks:
+# version_initializer: setup.initialize_version
+
+# Telemetry (optional - for usage analytics)
+# telemetry:
+# shared_telemetry: true
diff --git a/skills/streamlit-snowflake/templates-native-app/setup.sql b/skills/streamlit-snowflake/templates-native-app/setup.sql
new file mode 100644
index 00000000..2d1251f2
--- /dev/null
+++ b/skills/streamlit-snowflake/templates-native-app/setup.sql
@@ -0,0 +1,98 @@
+-- Snowflake Native App Setup Script
+-- This runs when the app is installed in a consumer account
+-- Documentation: https://docs.snowflake.com/en/developer-guide/native-apps/creating-setup-script
+
+-- =============================================================================
+-- APPLICATION ROLES
+-- =============================================================================
+
+-- Admin role for app management
+CREATE APPLICATION ROLE IF NOT EXISTS app_admin;
+
+-- User role for regular usage
+CREATE APPLICATION ROLE IF NOT EXISTS app_user;
+
+
+-- =============================================================================
+-- SCHEMAS
+-- =============================================================================
+
+-- Schema for app configuration and data
+CREATE SCHEMA IF NOT EXISTS core;
+GRANT USAGE ON SCHEMA core TO APPLICATION ROLE app_admin;
+GRANT USAGE ON SCHEMA core TO APPLICATION ROLE app_user;
+
+-- Schema for Streamlit app
+CREATE SCHEMA IF NOT EXISTS streamlit;
+GRANT USAGE ON SCHEMA streamlit TO APPLICATION ROLE app_admin;
+GRANT USAGE ON SCHEMA streamlit TO APPLICATION ROLE app_user;
+
+
+-- =============================================================================
+-- STREAMLIT APP
+-- =============================================================================
+
+-- Create the Streamlit application
+CREATE OR REPLACE STREAMLIT streamlit.main_app
+ FROM '/streamlit'
+ MAIN_FILE = 'streamlit_app.py';
+
+-- Grant access to Streamlit app
+GRANT USAGE ON STREAMLIT streamlit.main_app TO APPLICATION ROLE app_admin;
+GRANT USAGE ON STREAMLIT streamlit.main_app TO APPLICATION ROLE app_user;
+
+
+-- =============================================================================
+-- STORED PROCEDURES (Optional)
+-- =============================================================================
+
+-- Example: Configuration procedure
+-- CREATE OR REPLACE PROCEDURE core.configure_app(config VARIANT)
+-- RETURNS STRING
+-- LANGUAGE PYTHON
+-- RUNTIME_VERSION = '3.11'
+-- PACKAGES = ('snowflake-snowpark-python')
+-- HANDLER = 'config.configure'
+-- AS $$
+-- # Python handler code here
+-- $$;
+
+-- GRANT USAGE ON PROCEDURE core.configure_app(VARIANT) TO APPLICATION ROLE app_admin;
+
+
+-- =============================================================================
+-- TABLES (Optional)
+-- =============================================================================
+
+-- Example: App configuration table
+-- CREATE TABLE IF NOT EXISTS core.app_config (
+-- key STRING PRIMARY KEY,
+-- value VARIANT,
+-- updated_at TIMESTAMP_NTZ DEFAULT CURRENT_TIMESTAMP()
+-- );
+
+-- GRANT SELECT, INSERT, UPDATE ON TABLE core.app_config TO APPLICATION ROLE app_admin;
+-- GRANT SELECT ON TABLE core.app_config TO APPLICATION ROLE app_user;
+
+
+-- =============================================================================
+-- VERSION CALLBACK (Optional)
+-- =============================================================================
+
+-- Called when app version changes
+-- CREATE OR REPLACE PROCEDURE core.version_init()
+-- RETURNS STRING
+-- LANGUAGE SQL
+-- AS
+-- BEGIN
+-- -- Migration logic here
+-- RETURN 'Version initialized';
+-- END;
+
+
+-- =============================================================================
+-- GRANT ROLES TO OWNER
+-- =============================================================================
+
+-- The app owner gets admin role by default
+GRANT APPLICATION ROLE app_admin TO APPLICATION;
diff --git a/skills/streamlit-snowflake/templates/.gitignore b/skills/streamlit-snowflake/templates/.gitignore
new file mode 100644
index 00000000..64ac53c6
--- /dev/null
+++ b/skills/streamlit-snowflake/templates/.gitignore
@@ -0,0 +1,48 @@
+# Snowflake CLI
+.snowflake/
+
+# Python
+__pycache__/
+*.py[cod]
+*$py.class
+*.so
+.Python
+*.egg-info/
+.eggs/
+*.egg
+.venv/
+venv/
+ENV/
+env/
+
+# Environment files (may contain secrets)
+.env
+.env.local
+.env.*.local
+
+# IDE
+.idea/
+.vscode/
+*.swp
+*.swo
+*~
+
+# OS
+.DS_Store
+Thumbs.db
+
+# Streamlit
+.streamlit/secrets.toml
+
+# Logs
+*.log
+logs/
+
+# Testing
+.pytest_cache/
+.coverage
+htmlcov/
+
+# Build artifacts
+dist/
+build/
diff --git a/skills/streamlit-snowflake/templates/common/utils.py b/skills/streamlit-snowflake/templates/common/utils.py
new file mode 100644
index 00000000..2779b387
--- /dev/null
+++ b/skills/streamlit-snowflake/templates/common/utils.py
@@ -0,0 +1,189 @@
+"""
+Shared Utilities for Streamlit in Snowflake Apps
+
+Common patterns for:
+- Session management
+- Query execution
+- Data transformation
+- Error handling
+"""
+
+import streamlit as st
+import pandas as pd
+from typing import Optional, Any
+from functools import wraps
+
+
+# -----------------------------------------------------------------------------
+# Session Management
+# -----------------------------------------------------------------------------
+
+def get_snowpark_session():
+ """
+ Get cached Snowpark session.
+
+ Usage:
+ from common.utils import get_snowpark_session
+ session = get_snowpark_session()
+ df = session.sql("SELECT 1").to_pandas()
+ """
+ conn = st.connection("snowflake")
+ return conn.session()
+
+
+def get_current_context() -> dict:
+ """
+ Get current Snowflake context (user, role, warehouse, etc.)
+
+ Returns:
+ dict with keys: user, role, warehouse, database, schema
+ """
+ session = get_snowpark_session()
+ result = session.sql("""
+ SELECT
+ CURRENT_USER() as user,
+ CURRENT_ROLE() as role,
+ CURRENT_WAREHOUSE() as warehouse,
+ CURRENT_DATABASE() as database,
+ CURRENT_SCHEMA() as schema
+ """).to_pandas()
+
+ if result.empty:
+ return {}
+
+ row = result.iloc[0]
+ return {
+ "user": row["USER"],
+ "role": row["ROLE"],
+ "warehouse": row["WAREHOUSE"],
+ "database": row["DATABASE"],
+ "schema": row["SCHEMA"],
+ }
+
+
+# -----------------------------------------------------------------------------
+# Query Execution
+# -----------------------------------------------------------------------------
+
+def run_query(
+ query: str,
+ ttl: int = 300,
+ show_spinner: bool = True,
+) -> pd.DataFrame:
+ """
+ Execute a SQL query with optional caching.
+
+ Args:
+ query: SQL query string
+ ttl: Cache time-to-live in seconds (default 5 min)
+ show_spinner: Show loading spinner
+
+ Returns:
+ pandas DataFrame with results
+
+ Usage:
+ df = run_query("SELECT * FROM my_table LIMIT 100")
+ """
+ @st.cache_data(ttl=ttl)
+ def _execute(q: str) -> pd.DataFrame:
+ session = get_snowpark_session()
+ return session.sql(q).to_pandas()
+
+ if show_spinner:
+ with st.spinner("Executing query..."):
+ return _execute(query)
+ else:
+ return _execute(query)
+
+
+def run_query_safe(
+ query: str,
+ ttl: int = 300,
+ default: Optional[pd.DataFrame] = None,
+) -> pd.DataFrame:
+ """
+ Execute query with error handling.
+
+ Returns empty DataFrame (or default) on error instead of raising.
+
+ Usage:
+ df = run_query_safe("SELECT * FROM maybe_missing_table")
+ if df.empty:
+ st.warning("No data found")
+ """
+ try:
+ return run_query(query, ttl=ttl, show_spinner=False)
+ except Exception as e:
+ st.error(f"Query failed: {e}")
+ return default if default is not None else pd.DataFrame()
+
+
+# -----------------------------------------------------------------------------
+# Data Helpers
+# -----------------------------------------------------------------------------
+
+def format_bytes(bytes_val: int) -> str:
+ """Format bytes to human readable string."""
+ if bytes_val is None:
+ return "N/A"
+
+ for unit in ["B", "KB", "MB", "GB", "TB"]:
+ if bytes_val < 1024:
+ return f"{bytes_val:.2f} {unit}"
+ bytes_val /= 1024
+ return f"{bytes_val:.2f} PB"
+
+
+def format_number(num: Any) -> str:
+ """Format number with thousand separators."""
+ if num is None:
+ return "N/A"
+ try:
+ return f"{int(num):,}"
+ except (ValueError, TypeError):
+ return str(num)
+
+
+# -----------------------------------------------------------------------------
+# UI Helpers
+# -----------------------------------------------------------------------------
+
+def show_dataframe_with_download(
+ df: pd.DataFrame,
+ filename: str = "data.csv",
+ key: Optional[str] = None,
+) -> None:
+ """
+ Display DataFrame with download button.
+
+ Usage:
+ show_dataframe_with_download(df, "my_export.csv")
+ """
+ st.dataframe(df, use_container_width=True)
+
+ if not df.empty:
+ csv = df.to_csv(index=False)
+ st.download_button(
+ label="Download CSV",
+ data=csv,
+ file_name=filename,
+ mime="text/csv",
+ key=key,
+ )
+
+
+def show_connection_info() -> None:
+ """Display current Snowflake connection info in an expander."""
+ with st.expander("Connection Info"):
+ ctx = get_current_context()
+ if ctx:
+ col1, col2 = st.columns(2)
+ with col1:
+ st.write(f"**User:** {ctx.get('user', 'N/A')}")
+ st.write(f"**Role:** {ctx.get('role', 'N/A')}")
+ with col2:
+ st.write(f"**Warehouse:** {ctx.get('warehouse', 'N/A')}")
+ st.write(f"**Database:** {ctx.get('database', 'N/A')}.{ctx.get('schema', 'N/A')}")
+ else:
+ st.warning("Could not retrieve connection info")
diff --git a/skills/streamlit-snowflake/templates/environment.yml b/skills/streamlit-snowflake/templates/environment.yml
new file mode 100644
index 00000000..0f1d13fe
--- /dev/null
+++ b/skills/streamlit-snowflake/templates/environment.yml
@@ -0,0 +1,39 @@
+# Snowflake Streamlit Environment Configuration
+# Documentation: https://docs.snowflake.com/en/developer-guide/streamlit/create-streamlit-sql
+
+# IMPORTANT: Both 'name' and 'channels' are REQUIRED
+# Only the 'snowflake' channel is supported - external channels will fail
+
+name: sf_env
+
+channels:
+ - snowflake # REQUIRED - only supported channel (no conda-forge)
+
+dependencies:
+ # Streamlit - ALWAYS set explicit version
+ # Default is 1.22.0 which lacks many features
+ - streamlit=1.35.0
+
+ # Snowpark for data access
+ - snowflake-snowpark-python
+
+ # Data processing
+ - pandas
+ - numpy
+
+ # Visualization (choose based on needs)
+ - plotly # Interactive charts
+ - altair=4.0 # Declarative viz (version 4.0 supported)
+ # - matplotlib # Static charts
+
+ # Optional: ML packages (uncomment as needed)
+ # - scikit-learn
+ # - xgboost
+
+ # Optional: Additional utilities
+ # - scipy
+ # - pillow
+
+# Note: Check package availability before adding:
+# SQL: SELECT * FROM information_schema.packages WHERE language = 'python';
+# Web: https://snowpark-python-packages.streamlit.app/
diff --git a/skills/streamlit-snowflake/templates/pages/data_explorer.py b/skills/streamlit-snowflake/templates/pages/data_explorer.py
new file mode 100644
index 00000000..8e52c09b
--- /dev/null
+++ b/skills/streamlit-snowflake/templates/pages/data_explorer.py
@@ -0,0 +1,149 @@
+"""
+Data Explorer Page
+
+Multi-page Streamlit app example.
+This page demonstrates:
+- Table/schema browsing
+- Interactive data filtering
+- Visualization with Plotly
+"""
+
+import streamlit as st
+import pandas as pd
+
+# Try to import plotly (optional dependency)
+try:
+ import plotly.express as px
+ HAS_PLOTLY = True
+except ImportError:
+ HAS_PLOTLY = False
+
+st.set_page_config(layout="wide")
+st.title("Data Explorer")
+
+
+# -----------------------------------------------------------------------------
+# Connection (reuse pattern from main app)
+# -----------------------------------------------------------------------------
+
+def get_session():
+ conn = st.connection("snowflake")
+ return conn.session()
+
+
[email protected]_data(ttl=600)
+def get_tables(database: str, schema: str) -> pd.DataFrame:
+ """Get list of tables in a schema."""
+ session = get_session()
+ query = f"""
+ SELECT table_name, row_count, bytes
+ FROM {database}.information_schema.tables
+ WHERE table_schema = '{schema}'
+ AND table_type = 'BASE TABLE'
+ ORDER BY table_name
+ """
+ try:
+ return session.sql(query).to_pandas()
+ except Exception as e:
+ st.error(f"Failed to list tables: {e}")
+ return pd.DataFrame()
+
+
[email protected]_data(ttl=300)
+def preview_table(database: str, schema: str, table: str, limit: int = 100) -> pd.DataFrame:
+ """Preview rows from a table."""
+ session = get_session()
+ query = f'SELECT * FROM {database}.{schema}.{table} LIMIT {limit}'
+ try:
+ return session.sql(query).to_pandas()
+ except Exception as e:
+ st.error(f"Failed to preview table: {e}")
+ return pd.DataFrame()
+
+
+# -----------------------------------------------------------------------------
+# Sidebar Controls
+# -----------------------------------------------------------------------------
+
+with st.sidebar:
+ st.header("Explorer Settings")
+
+ # Database/Schema selection
+ database = st.text_input("Database", value="MY_DATABASE")
+ schema = st.text_input("Schema", value="PUBLIC")
+
+ # Row limit
+ row_limit = st.slider("Preview Rows", 10, 500, 100)
+
+ if st.button("Refresh"):
+ st.cache_data.clear()
+ st.rerun()
+
+
+# -----------------------------------------------------------------------------
+# Main Content
+# -----------------------------------------------------------------------------
+
+# Get tables
+st.subheader(f"Tables in {database}.{schema}")
+tables_df = get_tables(database, schema)
+
+if tables_df.empty:
+ st.warning("No tables found or unable to access schema.")
+ st.stop()
+
+# Table selector
+table_names = tables_df["TABLE_NAME"].tolist()
+selected_table = st.selectbox("Select Table", table_names)
+
+if selected_table:
+ st.divider()
+
+ # Show table info
+ table_info = tables_df[tables_df["TABLE_NAME"] == selected_table].iloc[0]
+ col1, col2 = st.columns(2)
+ with col1:
+ st.metric("Row Count", f"{table_info.get('ROW_COUNT', 'N/A'):,}")
+ with col2:
+ bytes_val = table_info.get("BYTES", 0) or 0
+ st.metric("Size", f"{bytes_val / 1024 / 1024:.2f} MB")
+
+ # Preview data
+ st.subheader(f"Preview: {selected_table}")
+ preview_df = preview_table(database, schema, selected_table, row_limit)
+
+ if not preview_df.empty:
+ # Data tabs
+ tab1, tab2 = st.tabs(["Table View", "Chart View"])
+
+ with tab1:
+ st.dataframe(preview_df, use_container_width=True)
+
+ # Column stats
+ with st.expander("Column Statistics"):
+ st.write(preview_df.describe())
+
+ with tab2:
+ if HAS_PLOTLY:
+ # Simple chart builder
+ numeric_cols = preview_df.select_dtypes(include=["number"]).columns.tolist()
+ all_cols = preview_df.columns.tolist()
+
+ if numeric_cols:
+ chart_type = st.selectbox("Chart Type", ["Bar", "Line", "Scatter"])
+ x_col = st.selectbox("X Axis", all_cols)
+ y_col = st.selectbox("Y Axis", numeric_cols)
+
+ if chart_type == "Bar":
+ fig = px.bar(preview_df, x=x_col, y=y_col)
+ elif chart_type == "Line":
+ fig = px.line(preview_df, x=x_col, y=y_col)
+ else:
+ fig = px.scatter(preview_df, x=x_col, y=y_col)
+
+ st.plotly_chart(fig, use_container_width=True)
+ else:
+ st.info("No numeric columns for charting.")
+ else:
+ st.info("Add 'plotly' to environment.yml for charts.")
diff --git a/skills/streamlit-snowflake/templates/snowflake.yml b/skills/streamlit-snowflake/templates/snowflake.yml
new file mode 100644
index 00000000..d90201cf
--- /dev/null
+++ b/skills/streamlit-snowflake/templates/snowflake.yml
@@ -0,0 +1,51 @@
+# Snowflake Project Definition
+# Documentation: https://docs.snowflake.com/en/developer-guide/snowflake-cli/streamlit-apps/manage-apps/initialize-app
+
+definition_version: 2
+
+entities:
+ # Streamlit Application
+ streamlit_app:
+ type: streamlit
+
+ # App identifier in Snowflake (replace with your app name)
+ identifier: my_streamlit_app
+
+ # Stage for storing app files (will be created if doesn't exist)
+ stage: my_app_stage
+
+ # Warehouse for running the app (required)
+ query_warehouse: my_warehouse
+
+ # Entry point file
+ main_file: streamlit_app.py
+
+ # Multi-page apps directory
+ pages_dir: pages/
+
+ # Files to deploy with the app
+ artifacts:
+ - common/
+ - environment.yml
+
+ # Optional: External access for API calls
+ # external_access_integrations:
+ # - my_external_access
+
+ # Optional: Secrets from Snowflake
+ # secrets:
+ # api_key: "my_database.my_schema.my_secret"
+
+ # Optional: Import files from stages
+ # imports:
+ # - "@my_stage/shared_lib.py"
+
+ # Optional: Grant access to roles
+ # grants:
+ # - privilege: USAGE
+ # role: my_app_role
+
+# Environment defaults (optional)
+# env:
+# default_database: MY_DATABASE
+# default_schema: MY_SCHEMA
diff --git a/skills/streamlit-snowflake/templates/streamlit_app.py b/skills/streamlit-snowflake/templates/streamlit_app.py
new file mode 100644
index 00000000..aece3213
--- /dev/null
+++ b/skills/streamlit-snowflake/templates/streamlit_app.py
@@ -0,0 +1,173 @@
+"""
+Streamlit in Snowflake - Main Application
+
+This template demonstrates:
+- Snowpark session connection via st.connection()
+- Cached data loading for performance
+- Basic layout patterns
+- Error handling
+
+Deploy: snow streamlit deploy --replace
+"""
+
+import streamlit as st
+import pandas as pd
+
+# Page configuration
+# Note: page_title and page_icon are NOT supported in Streamlit in Snowflake
+st.set_page_config(
+ layout="wide",
+ initial_sidebar_state="expanded",
+)
+
+# Application title
+st.title("My Streamlit App")
+st.markdown("Built with Streamlit in Snowflake")
+
+
+# -----------------------------------------------------------------------------
+# Database Connection
+# -----------------------------------------------------------------------------
+
+def get_snowpark_session():
+ """
+ Get Snowpark session using native Streamlit connection.
+ Cached to avoid reconnection on every rerun.
+ """
+ conn = st.connection("snowflake")
+ return conn.session()
+
+
+# -----------------------------------------------------------------------------
+# Data Loading (Cached)
+# -----------------------------------------------------------------------------
+
[email protected]_data(ttl=600) # Cache for 10 minutes
+def load_sample_data() -> pd.DataFrame:
+ """
+ Load sample data from Snowflake.
+ Uses caching to avoid repeated queries on interaction.
+ """
+ session = get_snowpark_session()
+
+ # Example query - replace with your table/query
+ query = """
+ SELECT
+ CURRENT_TIMESTAMP() as query_time,
+ CURRENT_USER() as current_user,
+ CURRENT_ROLE() as current_role,
+ CURRENT_WAREHOUSE() as warehouse,
+ CURRENT_DATABASE() as database,
+ CURRENT_SCHEMA() as schema
+ """
+
+ try:
+ df = session.sql(query).to_pandas()
+ return df
+ except Exception as e:
+ st.error(f"Query failed: {e}")
+ return pd.DataFrame()
+
+
[email protected]_data(ttl=300)
+def run_custom_query(query: str) -> pd.DataFrame:
+ """
+ Run a custom SQL query with caching.
+ TTL of 5 minutes to balance freshness and performance.
+ """
+ session = get_snowpark_session()
+ try:
+ return session.sql(query).to_pandas()
+ except Exception as e:
+ st.error(f"Query error: {e}")
+ return pd.DataFrame()
+
+
+# -----------------------------------------------------------------------------
+# Sidebar
+# -----------------------------------------------------------------------------
+
+with st.sidebar:
+ st.header("Settings")
+
+ # Example: Refresh button that clears cache
+ if st.button("Refresh Data"):
+ st.cache_data.clear()
+ st.rerun()
+
+ st.divider()
+
+ # Example: Show connection info
+ with st.expander("Connection Info"):
+ df = load_sample_data()
+ if not df.empty:
+ st.write(f"**User:** {df['CURRENT_USER'].iloc[0]}")
+ st.write(f"**Role:** {df['CURRENT_ROLE'].iloc[0]}")
+ st.write(f"**Warehouse:** {df['WAREHOUSE'].iloc[0]}")
+
+
+# -----------------------------------------------------------------------------
+# Main Content
+# -----------------------------------------------------------------------------
+
+# Tabs for different views
+tab1, tab2 = st.tabs(["Dashboard", "Query"])
+
+with tab1:
+ st.header("Dashboard")
+
+ # Example metrics row
+ col1, col2, col3 = st.columns(3)
+
+ with col1:
+ st.metric("Metric 1", "123", "+5%")
+
+ with col2:
+ st.metric("Metric 2", "456", "-2%")
+
+ with col3:
+ st.metric("Metric 3", "789", "+10%")
+
+ # Example data display
+ st.subheader("Sample Data")
+ df = load_sample_data()
+ if not df.empty:
+ st.dataframe(df, use_container_width=True)
+ else:
+ st.info("No data available. Check your connection settings.")
+
+with tab2:
+ st.header("Run Custom Query")
+
+ # SQL query input
+ query = st.text_area(
+ "Enter SQL Query",
+ value="SELECT CURRENT_TIMESTAMP() as now",
+ height=100,
+ )
+
+ if st.button("Run Query"):
+ with st.spinner("Executing query..."):
+ result = run_custom_query(query)
+
+ if not result.empty:
+ st.success(f"Returned {len(result)} rows")
+ st.dataframe(result, use_container_width=True)
+
+ # Download option
+ csv = result.to_csv(index=False)
+ st.download_button(
+ "Download CSV",
+ csv,
+ "query_results.csv",
+ "text/csv",
+ )
+
+
+# -----------------------------------------------------------------------------
+# Footer
+# -----------------------------------------------------------------------------
+
+st.divider()
+st.caption("Powered by Streamlit in Snowflake")