Cortex Skills
  • Skills Directory
  • Categories
  • Docs
Add SkillBrowse Skills
  1. Home
  2. Skills Directory
  3. Embeddings
  4. developing-with-streamlit
IntermediateEmbeddings

developing-with-streamlit

[REQUIRED] Use for ALL Streamlit tasks: creating, editing, debugging, beautifying, styling, theming, optimizing, or deploying Streamlit applications.
Jump to Installation

Compatible with

Cortex

About this skill

Developing with Streamlit

This is a routing skill that directs you to specialized sub-skills for Streamlit development.

When to Use

Invoke this skill when the user's request involves:

  • Creating a new Streamlit app
  • Editing or modifying an existing Streamlit app
  • Debugging Streamlit issues (errors, session state bugs, performance problems)
  • Beautifying or improving the visual design of a Streamlit app
  • Optimizing Streamlit performance (caching, fragments, reruns)
  • Deploying Streamlit apps (locally or to Snowflake)
  • Styling widgets (button colors, backgrounds, CSS customization)
  • Any question about Streamlit widgets, layouts, or components

Trigger phrases: "streamlit", "st.", "dashboard", "app.py", "beautify app", "make it look better", "style", "CSS", "color", "background", "theme", "button", "slow rerun", "session state", "performance", "faster", "cache", "deploy"

Workflow

Step 1: Locate the Streamlit source code
    ↓
Step 2: Identify task type and load appropriate sub-skill(s)
    ↓
Step 3: Apply guidance from sub-skill to edit code
    ↓
Step 4: Check if app is running and offer to run it

Step 1: Locate the Streamlit Source Code (if needed)

Goal: Identify the app file(s) to edit. Skip this step if already clear from context.

When to skip:

  • User mentioned a specific file path (e.g., "edit src/app.py")
  • User has file(s) already in conversation context
  • Working directory has an obvious single entry point (app.py, streamlit_app.py)

When to search:

  • User says "my streamlit app" without specifying which file
  • Multiple Python files exist and it's unclear which is the entry point

If searching is needed:

  1. Quick scan for Streamlit files:

    find . -name "*.py" -type f | xargs grep -l "import streamlit\|from streamlit" 2>/dev/null | head -10
    
  2. Apply entry point heuristics (in priority order):

    • streamlit_app.py at root → this is the entry point (canonical name)
    • app.py at root → likely entry point
    • File using st.navigation → entry point for multi-page apps
    • Single .py file at root with streamlit import → entry point
    • Files in pages/ or app_pages/ subdirectory → NOT entry points (these are sub-pages)
  3. If entry point is obvious → use it, no confirmation needed

    Example: Found streamlit_app.py and pages/metrics.py → use streamlit_app.py

  4. Only ask if genuinely ambiguous (e.g., multiple root-level candidates, none named streamlit_app.py):

    Found multiple potential entry points:
    - dashboard.py
    - main.py
    
    Which is your main app?
    

Output: Path to the main Streamlit source file(s)

Step 2: Identify Task Type and Route to Sub-Skill

Goal: Determine what the user needs and load the appropriate guidance.

Use this routing table to select sub-skill(s). Always read the sub-skill file before making changes:

User NeedSub-skill to Read
Performance issues, slow apps, cachingread references/performance.md
Building a dashboard with KPIs/metricsread references/dashboards.md
Improving visual design, icons, polishread references/design.md
Choosing widgets (selectbox vs radio vs pills)read references/selection-widgets.md
Styling widgets (button colors, backgrounds, CSS)read references/theme.md
Layouts (columns, tabs, sidebar, containers)read references/layouts.md
Displaying data (dataframes, charts)read references/data-display.md
Multi-page app architectureread references/multipage-apps.md
Session state and callbacksread references/session-state.md
Markdown, colored text, badgesread references/markdown.md
Custom themes and colorsread references/theme.md
Chat interfaces and AI assistantsread references/chat-ui.md
Connecting to Snowflakeread references/snowflake-connection.md
Deploying to Snowflake (SiS)read references/snowflake-deployment.md
Building or packaging a custom component, triggering events back to Python from JS/HTML, custom HTML/JS with event handling (CCv2), OR any UI element that doesn't exist as a native Streamlit widget (e.g., drag-and-drop, custom interactive visualization, canvas drawing)read references/custom-components-v2.md — IMPORTANT: st.components.v1 is deprecated. Never use v1 for new components; always use st.components.v2.component().
Third-party componentsread references/third-party-components.md
Code organizationread references/code-organization.md
Environment setupread references/environment-setup.md
CLI commandsread references/cli.md

Fallback — "this widget doesn't exist in Streamlit":

If the user asks for a UI element or interaction that has never been part of Streamlit's API and cannot be built with any combination of native widgets (e.g., drag-and-drop, canvas drawing, custom interactive visualizations), route to the CCv2 sub-skill (references/custom-components-v2.md). Do not route to CCv2 for features that exist in newer Streamlit versions (e.g., st.connection, st.segmented_control) — suggest upgrading instead.

Common combinations:

For beautifying/improving an app, read in order:

  1. references/design.md
  2. references/layouts.md
  3. references/selection-widgets.md

For building a dashboard, read:

  1. references/dashboards.md
  2. references/data-display.md

IMPORTANT - Use templates:

When creating a new dashboard app, prefer starting from a template in assets/templates/apps/:

  • If a template closely matches the request, copy it and adapt:
    • dashboard-metrics / dashboard-metrics-snowflake — KPI cards with time-series charts
    • dashboard-companies — company/entity comparison
    • dashboard-compute / dashboard-compute-snowflake — resource/credit monitoring
    • dashboard-feature-usage — feature adoption tracking
    • dashboard-seattle-weather — public dataset exploration (local only)
    • dashboard-stock-peers / dashboard-stock-peers-snowflake — financial peer analysis
  • If no template is a close match, start from scratch but borrow relevant patterns from the templates (e.g., caching with @st.cache_data, filter_by_time_range(), st.set_page_config(), chart utilities, layout structure)
  • See assets/templates/apps/README.md for template descriptions

When editing an existing app, use templates as reference for best practices:

  • Check assets/templates/apps/ for caching patterns, layout structure, and Snowflake integration
  • Apply consistent patterns from templates to improve the existing code

When applying a custom theme, use a template from assets/templates/themes/:

  • Copy a theme directory (snowflake, dracula, nord, stripe, solarized-light, spotify, github, minimal)
  • Themes include bundled fonts for Snowflake deployment compatibility
  • See assets/templates/themes/README.md for theme previews

For performance optimization, read:

  1. references/performance.md

Step 3: Apply Guidance to Edit Code

Goal: Make changes to the Streamlit app following sub-skill best practices.

Actions:

  1. Apply the patterns and recommendations from the loaded sub-skill(s)
  2. Make edits to the source file(s) identified in Step 1
  3. Preserve existing functionality while adding improvements

Step 4: Check Running Apps and Offer to Run

Goal: Help the user see their changes by checking if their app is running.

Actions:

  1. Check for running Streamlit apps on ports 850*:

    lsof -nP -iTCP -sTCP:LISTEN 2>/dev/null | grep -i python | awk '{print $2, $9}' | grep ':85' || echo "No Streamlit apps detected on ports 850*"
    
  2. Present findings to user:

    If app is running:

    Found Streamlit app running:
    - PID: [pid] at http://localhost:[port]
    
    Your changes should be visible after a page refresh (Streamlit hot-reloads on file save).
    

    If no app is running:

    No Streamlit app detected on ports 850*.
    
    Would you like me to run the app? I can start it with:
      streamlit run [app_file.py]
    
  3. If user wants to run the app, start it:

    streamlit run [path/to/app.py] --server.port 8501
    

Stopping Points

  • Step 2: If multiple sub-skills seem relevant, ask user which aspect to focus on first
  • Step 4: Ask before starting the Streamlit app

Resources

  • Streamlit API Reference
  • Streamlit Gallery

Installation

Install using the Cortex CLI:

bash
$cortex skill install developing-with-streamlit

Requires Cortex CLI v2.0+. Install guide →

Repository Sources

Loading repository files...

SKILL.md Preview

SKILL.md
---
name: developing-with-streamlit
description: "**[REQUIRED]** Use for ALL Streamlit tasks: creating, editing, debugging, beautifying, styling, theming, optimizing, or deploying Streamlit applications. Also required for building custom components (inline or packaged), using st.components.v2, or any HTML/JS/CSS component work. Triggers: streamlit, st., dashboard, app.py, beautify, style, CSS, color, background, theme, button, widget styling, custom component, st.components, packaged component, pyproject.toml, asset_dir, CCv2, HTML/JS component."
---

# Developing with Streamlit

This is a **routing skill** that directs you to specialized sub-skills for Streamlit development.

## When to Use

Invoke this skill when the user's request involves:
- Creating a new Streamlit app
- Editing or modifying an existing Streamlit app
- Debugging Streamlit issues (errors, session state bugs, performance problems)
- Beautifying or improving the visual design of a Streamlit app
- Optimizing Streamlit performance (caching, fragments, reruns)
- Deploying Streamlit apps (locally or to Snowflake)
- Styling widgets (button colors, backgrounds, CSS customization)
- Any question about Streamlit widgets, layouts, or components

**Trigger phrases:** "streamlit", "st.", "dashboard", "app.py", "beautify app", "make it look better", "style", "CSS", "color", "background", "theme", "button", "slow rerun", "session state", "performance", "faster", "cache", "deploy"

## Workflow

```
Step 1: Locate the Streamlit source code
    ↓
Step 2: Identify task type and load appropriate sub-skill(s)
    ↓
Step 3: Apply guidance from sub-skill to edit code
    ↓
Step 4: Check if app is running and offer to run it
```

### Step 1: Locate the Streamlit Source Code (if needed)

**Goal:** Identify the app file(s) to edit. **Skip this step if already clear from context.**

**When to skip:**
- User mentioned a specific file path (e.g., "edit `src/app.py`")
- User has file(s) already in conversation context
- Working directory has an obvious single entry point (`app.py`, `streamlit_app.py`)

**When to search:**
- User says "my streamlit app" without specifying which file
- Multiple Python files exist and it's unclear which is the entry point

**If searching is needed:**

1. **Quick scan** for Streamlit files:
   ```bash
   find . -name "*.py" -type f | xargs grep -l "import streamlit\|from streamlit" 2>/dev/null | head -10
   ```

2. **Apply entry point heuristics** (in priority order):
   - `streamlit_app.py` at root → **this is the entry point** (canonical name)
   - `app.py` at root → likely entry point
   - File using `st.navigation` → entry point for multi-page apps
   - Single `.py` file at root with streamlit import → entry point
   - Files in `pages/` or `app_pages/` subdirectory → **NOT entry points** (these are sub-pages)

3. **If entry point is obvious** → use it, no confirmation needed
   
   Example: Found `streamlit_app.py` and `pages/metrics.py` → use `streamlit_app.py`

4. **Only ask if genuinely ambiguous** (e.g., multiple root-level candidates, none named `streamlit_app.py`):
   ```
   Found multiple potential entry points:
   - dashboard.py
   - main.py
   
   Which is your main app?
   ```

**Output:** Path to the main Streamlit source file(s)

### Step 2: Identify Task Type and Route to Sub-Skill

**Goal:** Determine what the user needs and load the appropriate guidance.

Use this routing table to select sub-skill(s). **Always read the sub-skill file** before making changes:

| User Need | Sub-skill to Read |
|-----------|-------------------|
| **Performance issues, slow apps, caching** | `read references/performance.md` |
| **Building a dashboard with KPIs/metrics** | `read references/dashboards.md` |
| **Improving visual design, icons, polish** | `read references/design.md` |
| **Choosing widgets (selectbox vs radio vs pills)** | `read references/selection-widgets.md` |
| **Styling widgets (button colors, backgrounds, CSS)** | `read references/theme.md` |
| **Layouts (columns, tabs, sidebar, containers)** | `read references/layouts.md` |
| **Displaying data (dataframes, charts)** | `read references/data-display.md` |
| **Multi-page app architecture** | `read references/multipage-apps.md` |
| **Session state and callbacks** | `read references/session-state.md` |
| **Markdown, colored text, badges** | `read references/markdown.md` |
| **Custom themes and colors** | `read references/theme.md` |
| **Chat interfaces and AI assistants** | `read references/chat-ui.md` |
| **Connecting to Snowflake** | `read references/snowflake-connection.md` |
| **Deploying to Snowflake (SiS)** | `read references/snowflake-deployment.md` |
| **Building or packaging a custom component, triggering events back to Python from JS/HTML, custom HTML/JS with event handling (CCv2), OR any UI element that doesn't exist as a native Streamlit widget** (e.g., drag-and-drop, custom interactive visualization, canvas drawing) | `read references/custom-components-v2.md` — **IMPORTANT: `st.components.v1` is deprecated. Never use v1 for new components; always use `st.components.v2.component()`.** |
| **Third-party components** | `read references/third-party-components.md` |
| **Code organization** | `read references/code-organization.md` |
| **Environment setup** | `read references/environment-setup.md` |
| **CLI commands** | `read references/cli.md` |

**Fallback — "this widget doesn't exist in Streamlit":**

If the user asks for a UI element or interaction that **has never been part of Streamlit's API** and cannot be built with any combination of native widgets (e.g., drag-and-drop, canvas drawing, custom interactive visualizations), **route to the CCv2 sub-skill** (`references/custom-components-v2.md`). **Do not** route to CCv2 for features that exist in newer Streamlit versions (e.g., `st.connection`, `st.segmented_control`) — suggest upgrading instead.

**Common combinations:**

For **beautifying/improving an app**, read in order:
1. `references/design.md`
2. `references/layouts.md`
3. `references/selection-widgets.md`

For **building a dashboard**, read:
1. `references/dashboards.md`
2. `references/data-display.md`

**IMPORTANT - Use templates:**

When creating a **new dashboard app**, prefer starting from a template in `assets/templates/apps/`:
- If a template closely matches the request, copy it and adapt:
  - `dashboard-metrics` / `dashboard-metrics-snowflake` — KPI cards with time-series charts
  - `dashboard-companies` — company/entity comparison
  - `dashboard-compute` / `dashboard-compute-snowflake` — resource/credit monitoring
  - `dashboard-feature-usage` — feature adoption tracking
  - `dashboard-seattle-weather` — public dataset exploration (local only)
  - `dashboard-stock-peers` / `dashboard-stock-peers-snowflake` — financial peer analysis
- If no template is a close match, start from scratch but borrow relevant patterns from the templates (e.g., caching with `@st.cache_data`, `filter_by_time_range()`, `st.set_page_config()`, chart utilities, layout structure)
- See `assets/templates/apps/README.md` for template descriptions

When **editing an existing app**, use templates as reference for best practices:
- Check `assets/templates/apps/` for caching patterns, layout structure, and Snowflake integration
- Apply consistent patterns from templates to improve the existing code

When applying a **custom theme**, use a template from `assets/templates/themes/`:
- Copy a theme directory (snowflake, dracula, nord, stripe, solarized-light, spotify, github, minimal)
- Themes include bundled fonts for Snowflake deployment compatibility
- See `assets/templates/themes/README.md` for theme previews

For **performance optimization**, read:
1. `references/performance.md`

### Step 3: Apply Guidance to Edit Code

**Goal:** Make changes to the Streamlit app following sub-skill best practices.

**Actions:**

1. Apply the patterns and recommendations from the loaded sub-skill(s)
2. Make edits to the source file(s) identified in Step 1
3. Preserve existing functionality while adding improvements

### Step 4: Check Running Apps and Offer to Run

**Goal:** Help the user see their changes by checking if their app is running.

**Actions:**

1. **Check** for running Streamlit apps on ports 850*:
   ```bash
   lsof -nP -iTCP -sTCP:LISTEN 2>/dev/null | grep -i python | awk '{print $2, $9}' | grep ':85' || echo "No Streamlit apps detected on ports 850*"
   ```

2. **Present** findings to user:

   **If app is running:**
   ```
   Found Streamlit app running:
   - PID: [pid] at http://localhost:[port]
   
   Your changes should be visible after a page refresh (Streamlit hot-reloads on file save).
   ```

   **If no app is running:**
   ```
   No Streamlit app detected on ports 850*.
   
   Would you like me to run the app? I can start it with:
     streamlit run [app_file.py]
   ```

3. **If user wants to run the app**, start it:
   ```bash
   streamlit run [path/to/app.py] --server.port 8501
   ```

## Stopping Points

- **Step 2**: If multiple sub-skills seem relevant, ask user which aspect to focus on first
- **Step 4**: Ask before starting the Streamlit app

## Resources

- [Streamlit API Reference](https://docs.streamlit.io/develop/api-reference)
- [Streamlit Gallery](https://streamlit.io/gallery)

Tags

#developing-with-streamlit

Related Skills

Browse all
v1.0.0

organization-management

cortex-community
Snowflake organization management — accounts, org users, org insights, org spending, org security, globalorgadmin. ORGANIZATION_USAGE views, cross-account analytics, org-wide metrics. Use when the user asks about: 30 day summary of my organization, 30-day summary, 30 day summary, accounts in my organization, list accounts, how many accounts, account editions, account regions, account inventory, organization users, organization user groups, executive summary of my org, org overview, org spending, org cost, org security posture, org reliability, org auth posture, org hub, org usage views, trust center, MFA readiness, login failures, warehouse credits, storage trends, edition distribution, who has globalorgadmin, what is globalorgadmin, globalorgadmin role, orgadmin role, organization administrator, org admin, enable orgadmin, disable orgadmin, org admin permissions, account admins, ORGANIZATION_USAGE, org-level, cross-account, org-wide.
#organization-management
Cortex
5015.0k
2 hours ago
v1.0.0

build-react-app

cortex-community
Build React/Next.js apps with Snowflake data. Use when: building dashboards, creating data apps, making analytics tools.
#build-react-app
Cortex
3751.5k
2 hours ago
v1.0.0

skill-development

cortex-community
Create, document, or audit skills for Cortex Code. Use when: creating new skills, capturing session work as skills, reviewing skills. Triggers: create skill, build skill, new skill, summarize session, capture workflow, audit skill, review skill.
#skill_development
Cortex
2083.9k
2 hours ago
v1.0.0

snowpark-python

cortex-community
[REQUIRED] Use for ALL requests related to deploying Snowpark Python scripts. Always load this skill first before handling any Snowpark Python deployment requests. Snowpark Python is Snowflake's Python API for data ingestion, transformation, user defined functions (UDF, UDAF, UDTF) and Python stored procedures (SP) deployment. Triggers: Snowpark, Python, UDF, Stored Procedure, snow snowpark CLI, Deploy.
#snowpark
Cortex
1893.7k
2 hours ago

Details

Stars482
Installs4.3k
Authorcortex-community
Versionv1.0.0
Updated2 hours ago
LicenseMIT
View Repository
quick install
$ cortex skill install developing-with-streamlit