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
npx skills add PostHog/ai-plugin --skill writing-streamlit-apps -a claude-codeWhat 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.pyfor a Streamlit view that counts PostHog events by day throughposthog_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-code2Manually: put the files in place
~/.claude/skills/writing-streamlit-apps/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/writing-streamlit-apps/
1Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill writing-streamlit-apps -a codex2Manually: put the files in place
.agents/skills/writing-streamlit-apps/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill writing-streamlit-apps -a cursor2Manually: put the files in place
.cursor/skills/writing-streamlit-apps/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install PostHog/ai-plugin skills/writing-streamlit-apps2Manually: put the files in place
.github/skills/writing-streamlit-apps/SKILL.md1Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill writing-streamlit-apps -a gemini-cli2Platform CLI
gemini skills install https://github.com/PostHog/ai-plugin --path skills/writing-streamlit-appsManually: put the files in place
.devin/skills/writing-streamlit-apps/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add PostHog/ai-plugin --skill writing-streamlit-apps -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.