Agent Native

managing-streamlit-apps

Manage Streamlit apps running in PostHog sandboxes through the full lifecycle: create, set or edit source code, start and stop the sandbox, poll status, and…

by PostHogOfficial publisher

Identity proven by GitHub's verified organisation badge (PostHog)

Agents
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
License
MIT (permissive)
Pin
244c70dpinned Oct 9, 2026
Context cost
about 1,400 tokenswhen the skill loads
GitHub stars
40,191on posthog/posthog
Scripts
None found

What it does

“Create, deploy, and operate Streamlit apps in PostHog via the streamlit-apps MCP tools — create an app, set its source, read and patch its code, start and stop its sandbox, poll status, list versions, delete, and share the app with humans via its PostHog URL. Use when asked to "create a streamlit app", "deploy a data app", "ship a dashboard app", "restart/stop my app", "why is my app not running", or "give me a link to the app".”
The author's description, from SKILL.md

Generated summary from the skill's own text

Manage Streamlit apps running in PostHog sandboxes through the full lifecycle: create, set or edit source code, start and stop the sandbox, poll status, and share via PostHog URL. The agent can upload Python files and assets, create new versions atomically, and troubleshoot deployment issues.

When to use it

  • User asks to create, deploy, or update a Streamlit data app
  • Need to start, stop, or restart a Streamlit app sandbox
  • Provide a shareable link to a running Streamlit app
  • Update app code without losing work to concurrent edits

When not to

  • Streamlit-apps feature flag is disabled for the organization
  • Writing the Streamlit app code itself; see writing-streamlit-apps skill instead

Install

These commands install from the publisher's repository and need no account.

skills CLI

npx skills add posthog/posthog --skill managing-streamlit-apps

Installs from the repository's default branch, which may have changed since the commit we checked.

GitHub CLI 2.90 or later

gh skill install posthog/posthog managing-streamlit-apps@244c70d066c0b441e3b8cc6875f914c5e09c42b3

Installs the commit we checked (244c70d).

Copy by hand

Download the folder at 244c70d and put it in .claude/skills/managing-streamlit-apps for Claude Code and in .agents/skills/managing-streamlit-apps for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.

Skill folder on GitHub at 244c70d

Claude Code plugin

/plugin install posthog@claude-plugins-official

The publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.

Copy for your agent

A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.

Prompt

Install the agent skill "managing-streamlit-apps" by PostHog.

Source, pinned to commit 244c70d066c0b441e3b8cc6875f914c5e09c42b3:
https://github.com/posthog/posthog/tree/244c70d066c0b441e3b8cc6875f914c5e09c42b3/products/streamlit_apps/skills/managing-streamlit-apps

1. Download that folder at exactly this commit. Do not use the default branch.
2. Copy every file unchanged, keeping the folder structure, into .claude/skills/managing-streamlit-apps/ for Claude Code and .agents/skills/managing-streamlit-apps/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist.
3. Do not edit the files, and do not run any script in the folder unless I ask you to.
4. When you are done, list the files you copied and where you put them.

Listing and checks: https://www.agentnative.dev/skills/posthog/managing-streamlit-apps-posthog

SKILL.md at the pin

---
name: managing-streamlit-apps
description: Create, deploy, and operate Streamlit apps in PostHog via the streamlit-apps MCP tools — create an app, set its source, read and patch its code, start and stop its sandbox, poll status, list versions, delete, and share the app with humans via its PostHog URL. Use when asked to "create a streamlit app", "deploy a data app", "ship a dashboard app", "restart/stop my app", "why is my app not running", or "give me a link to the app".
---

# Managing Streamlit apps

A Streamlit app is a Python data app running in an isolated sandbox inside PostHog.
Each app has immutable versions of its code; one version is active; a sandbox process serves the active version.
The full lifecycle is driven with the `streamlit-apps-*` MCP tools.

## The happy path: create → set source → start → share

1. `streamlit-apps-create` with a `name` (optionally `description`, `cpu_cores` 0.25–8, `memory_gb` 0.5–16, defaults 0.5 / 1).
   The app exists but has no code yet.
2. `streamlit-apps-set-source` with the complete `app.py` source as one string.
   Extra files ride along in the same call: `files` maps a project-relative path to text (helper modules, CSV, JSON), `assets` maps a path to base64 (Parquet, images).
   This creates version 1 and activates it.
   Write the source per the `writing-streamlit-apps` skill — in particular use `posthog_apps.query()` for PostHog data, never `import posthog`.
3. `streamlit-apps-start`.
   Returns immediately; the sandbox boots asynchronously.
4. Poll `streamlit-apps-status` until `status` is `running` (typically well under a minute).
   If it lands on `error`, read `last_error` — see Troubleshooting below.
5. Share the app: the `_posthogUrl` returned by create/get/start (`/streamlit-apps/{short_id}`) is the app's page in PostHog.
   That link is what you give humans.
   Viewers need to be logged into PostHog with access to the project (the app renders in an authenticated iframe; there is no public URL).

## Whose data the app reads

The app's queries run with the data access of the person who authored the **active version** — set the source, and the app reads what you can read.
Anyone who can view the app sees those results, so treat publishing an app as sharing that data with everyone on the project.
An app whose version author has since been deleted can't start; upload a new version to fix it.

## Updating code

Change an existing app in two steps, so you never ship an old copy over newer work:

1. `streamlit-apps-get-source` reads the active version (or `version_number` for an older one).
   It returns `version_number`, a manifest of every file, and the text of each text file.
   Binary files appear without content.
   For a large app, pass `paths` (comma-separated) to read only the files you need.
2. `streamlit-apps-edit-source` with `base_version` set to that `version_number`.
   `file_edits` holds exact `old` → `new` text replacements per file, `create_files` adds new text files, `delete_files` removes files.
   Each `old` must match exactly once, so include enough surrounding lines to make it unique.
   Files you do not touch stay byte-for-byte the same in the new version.

If the active version changed after your read, edit-source returns 409 with `current_version`.
This happens when another session ships a version, or when a person rolls the app back to an older version.
Read `current_version` again and redo your edits on it.
Do not fall back to set-source to force your copy through.

Keep `streamlit-apps-set-source` for a new app or a full rewrite.
It replaces every file, so pass `files` and `assets` again too; a version holds only what that call carried.

Both tools create the next version and activate it.
A running sandbox is stopped so it can't keep serving stale code — call `streamlit-apps-start` afterwards to serve the new version.
Versions are immutable, but not permanent: `streamlit-apps-versions` lists the newest 50, and non-active versions older than 30 days are deleted along with their code.
There is no rollback tool: to roll back, read the old version with `streamlit-apps-get-source` and set its files again with set-source.
Binary assets are not inlined there, so a rollback of an app with assets also needs a saved copy of those files.

## Stopping, idling, and deleting

- `streamlit-apps-stop` stops the sandbox; code and versions are untouched. Starting again later is cheap.
- Idle sandboxes are stopped automatically after a period of no activity — a stopped app is normal, not an error. Start it again when needed.
- `streamlit-apps-delete` stops any sandbox and soft-deletes the app. Confirm with the user before deleting anything you didn't create in this conversation.

## Troubleshooting

- **`status: error` with `last_error: "Start failed: ..."`** — the sandbox failed to provision or boot. Retry `streamlit-apps-start` once; if it persists, surface `last_error` to the user (provisioning failures are usually platform-side, not app-side).
- **Tool calls return 403 "Streamlit apps is not available."** — the `streamlit-apps` feature flag is off for this organization. This is a rollout gate, not an error you can fix; tell the user.
- **App runs but a query inside it fails** — that's an app-code concern; see `writing-streamlit-apps` (bridge limits: 30s execution, 256 MB memory per query).
- **App shows old code after set-source** — you skipped step "start after set-source"; the sandbox was stopped and needs a start.

## Renaming and resizing

`streamlit-apps-update` changes an app's name, description, `cpu_cores` (0.25–8), or `memory_gb` (0.5–16); only the fields you pass change.
New sizing applies the next time the sandbox starts, so stop + start after resizing a running app.
Defaults (0.5 CPU / 1 GB) fit typical dashboard apps.
Raise `memory_gb` only when the app itself holds large DataFrames in memory — the 256 MB HogQL bridge query cap is server-side and does NOT change with sandbox sizing, so bigger sandboxes don't fix failing queries.

From posthog/posthog at 244c70d, shown as plain text under its license: MIT (permissive). The license text is in LICENSE.

View SKILL.md on GitHub at 244c70d

Files

1 file, 6.1 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.

Skill folder on GitHub at 244c70d

Also in

The same SKILL.md content appears in these places too. We list it once and credit the oldest public source.

All 50 skills from PostHog

More from PostHog

  • analyzing-experiment-session-replays

    This skill enables agents to analyze session recordings from experiment variants to identify behavioral differences between control and test groups.

    Claude Code, Codex, Cursor +4 · about 2.3K tokens · pinned 7 days ago

  • analyzing-offline-evaluations

    This skill inspects and compares offline AI evaluation experiments stored in PostHog, diagnoses case-level regressions, and tracks scorer changes across…

    Claude Code, Codex, Cursor +4 · about 1.5K tokens · pinned 7 days ago

  • auditing-warehouse-view-health

    Audits materialized views in a PostHog data warehouse to identify failed views and flag unused ones that waste compute resources.

    Claude Code, Codex, Cursor +4 · about 1.4K tokens · pinned 7 days ago

  • authoring-data-quality-checks

    This skill adds data quality checks (like dbt tests) on warehouse tables, views, and HogQL metrics, supporting assertions such as not-null, uniqueness…

    Claude Code, Codex, Cursor +4 · about 2.5K tokens · pinned 7 days ago

  • authoring-scouts

    This skill helps engineers write, edit, and adapt PostHog Signals scouts, scheduled agents that scan projects and report findings to an inbox.

    Claude Code, Codex, Cursor +4 · about 10.6K tokens · pinned 7 days ago

  • building-a-dashboard

    This skill constructs or modifies PostHog dashboards by selecting and arranging insight tiles.

    Claude Code, Codex, Cursor +4 · about 2.1K tokens · pinned 7 days ago

All Cloud and DevOps skills
  • huggingface-spaces

    Create and deploy machine-learning applications on Hugging Face Spaces using Gradio, Docker, or Static SDKs.

    by Hugging FaceOfficial publisher

    Claude Code, Codex, Cursor +4 · about 4.3K tokens · pinned 7 days ago

  • huggingface-vision-trainer

    Trains vision models for object detection, image classification, and SAM/SAM2 segmentation on Hugging Face Jobs cloud GPUs.

    by Hugging FaceOfficial publisher

    Contains scripts

    Claude Code · about 7.3K tokens · pinned 7 days ago

  • amazon-eventbridge-event-bus

    Enables building event-driven applications on AWS EventBridge custom event buses with publish/subscribe routing, event retention, filtering, transformation…

    by Amazon (AWS)Official publisher

    Claude Code, Codex, Cursor +3 · about 8.4K tokens · pinned 7 days ago

  • authoring-mwaa-workflow

    Writes and deploys production workflow artifacts for Amazon MWAA: Python DAGs for provisioned environments or YAML workflows for Serverless.

    by Amazon (AWS)Official publisher

    Claude Code, Codex, Cursor +4 · about 2.5K tokens · pinned 7 days ago

  • aws-containers

    Provides domain expertise for deploying and managing containerized workloads on AWS using EKS, ECS, Fargate, and Elastic Beanstalk.

    by Amazon (AWS)Official publisher

    Claude Code, Codex, Cursor +4 · about 1.4K tokens · pinned 7 days ago

  • aws-fault-injection-service

    Plans, builds, runs, and analyzes chaos engineering experiments using AWS Fault Injection Service to test application resilience.

    by Amazon (AWS)Official publisher

    Claude Code, Codex, Cursor +3 · about 1.9K tokens · pinned 7 days ago

The skills listed here are third-party software, collected from public GitHub repositories as a catalog of recent skills and provided as is. Agent Native does not write or control them and is not responsible for any harm, loss or damage caused by installing or using them. Labels and checks describe what we saw at one commit and are not a guarantee. Read a skill's files before you run it. Terms of use