Skip to main content
skill CX Codex

writing-streamlit-apps — Claude Code skill: use and install

The writing-streamlit-apps skill guides Python code for Streamlit apps that read PostHog data inside a sandbox. Use it when building or debugging dashboards with tables and charts.

no license 177 installs ★ 101 updated 2026-10-24

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add PostHog/ai-plugin --skill writing-streamlit-apps -a claude-code
Open on GitHub

What writing-streamlit-apps does

This skill covers source code for Streamlit 1.31 in a PostHog sandbox. Apps read project data through posthog_apps.query(), which returns a pandas.DataFrame from HogQL. It also explains how to cache bridge calls, keep values in st.session_state, arrange screens with columns, tabs, and expanders, and render charts or data tables.

The entry file is app.py. Helper modules and bundled data can sit beside it, with file paths resolved from Path(__file__).parent. The image includes Python 3.11 and packages such as pandas, plotly, duckdb, and scikit-learn; the sandbox does not install extra packages with pip.

A free-form widget value must not be placed directly into HogQL, since viewers could submit queries using the app author’s access. Server-side time and memory caps also make bounded, aggregated queries necessary before data reaches pandas. Files written in the sandbox disappear after a restart.

What it helps with

  • write a Streamlit app backed by PostHog data
  • build a screen with metrics, tables, and charts
  • cache query results across Streamlit reruns
  • preserve user choices in st.session_state
  • handle a failed HogQL query without a stack trace

Example prompts for the agent

  • Write app.py for a Streamlit view that counts PostHog events by day through posthog_apps.query().
  • Add cached queries and a bounded period selector, keeping free-form text out of HogQL.
  • Debug the failed query in this app and show the error with st.error.

How to install writing-streamlit-apps

1Skills CLI (Vercel)

npx skills add PostHog/ai-plugin --skill writing-streamlit-apps -a claude-code

2Manually: put the files in place

~/.claude/skills/writing-streamlit-apps/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/writing-streamlit-apps/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about writing-streamlit-apps

How do I install writing-streamlit-apps in Claude Code?

Run npx skills add PostHog/ai-plugin --skill writing-streamlit-apps -a claude-code, then check ~/.claude/skills/writing-streamlit-apps/SKILL.md.

What does writing-streamlit-apps do?

It guides the agent through writing Streamlit source for a PostHog sandbox, including posthog_apps.query(), screen layout, caching, and rerun state.

Which libraries can the app use?

The sandbox provides Python 3.11, streamlit 1.31, pandas, numpy, polars, plotly, matplotlib, seaborn, scipy, scikit-learn, pyarrow, duckdb, requests, beautifulsoup4, lxml, sqlalchemy, and aiohttp. Extra packages cannot be added with pip.

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set82

The whole set →
signals-scout-tasks signals-scout-tasks — a scout skill for PostHog Tasks: it tracks how task runs get delivered and, on a slower pass, looks for the same request coming up again in tasks people wrote. CX Codex +1 179installs managing-streamlit-apps managing-streamlit-apps controls Streamlit apps in PostHog sandboxes using MCP tools, handling everything from provisioning to safe code patching. CX Codex +1 179installs modeling-activation-metrics modeling-activation-metrics builds an activation model: a per-user or per-account activated flag plus an activation-rate metric. Useful while the “aha moment” is still a guess. CX Codex +1 178installs modeling-conversion-metrics modeling-conversion-metrics builds a reusable conversion model: funnel steps, a conversion window, drop-off and time to convert. Works on PostHog warehouse views in HogQL or in a dbt project. CX Codex +1 178installs modeling-revenue-metrics modeling-revenue-metrics builds reusable revenue models for MRR, ARR, churn, ARPU and LTV from PostHog views or dbt. Use it for revenue analysis by customer, product or period. CX Codex +1 175installs modeling-product-usage-metrics modeling-product-usage-metrics builds retention, frequency, and lifecycle models using PostHog HogQL views or dbt data marts with built-in tests. CX Codex +1 175installs modeling-dimension-tables modeling-dimension-tables builds star-schema dimension tables in PostHog HogQL views or dbt projects so you avoid repetitive joins across your metrics. CX Codex +1 174installs modeling-warehouse-foundations modeling-warehouse-foundations sets core guidelines for building PostHog data models via native HogQL views or an external dbt setup. CX Codex +1 172installs

Project sponsors

Companies that keep this analytics open