Expert guidance for developing Streamlit features, components, and tests. Understands the full stack architecture (Python/Tornado backend, React/TypeScript frontend, WebSocket communication) and follows Streamlit's development conventions.
This skill provides expert guidance for developing features, components, and tests in the Streamlit open-source project. Streamlit is an Apache 2.0 licensed Python library for creating interactive web applications and dashboards focused on data apps and internal tools.
Streamlit uses a client-server architecture:
- `elements/` — Backend code for elements and widgets
- `runtime/` — App runtime and execution logic
- `web/` — Web server and CLI implementation
- `tests/` — Python unit tests
- `app/` — Streamlit application UI
- `lib/` — Shared TypeScript library (elements, widgets, layouts)
- `connection/` — WebSocket connection handling
Always prefer `make` targets over direct tool invocation:
```bash
make help # Show all available commands
make check # Run all checks on changed files
make autofix # Auto-fix linting and formatting
make protobuf # Recompile Protocol Buffers
```
**CRITICAL:** Always use `uv run` prefix for Python commands:
```bash
uv run pytest path/to/test_file.py # Run specific tests
make python-tests # Run all Python tests
make python-lint # Lint with ruff
make python-format # Format with ruff
make python-types # Type check with mypy & ty
```
**Never run Python commands without `uv run` prefix.**
```bash
make frontend-dev # Start dev server (hot-reload)
make frontend-fast # Build frontend with Vite
make frontend-lint # Lint with eslint
make frontend-format # Format with eslint
make frontend-types # Type check with tsc
make frontend-tests # Run Vitest unit tests
```
**CRITICAL:** Do NOT run `uv run pytest` directly on E2E tests. Use make instead:
```bash
make run-e2e-test st_command_test.py
uv run pytest e2e_playwright/st_command_test.py
```
Use `make debug` to run both backend and frontend with hot-reload:
```bash
make debug my_app.py
```
This command:
Logs are written to:
Logs persist after exit for debugging but are cleared on next run.
Run `make check` to verify all changes pass:
1. **Running Python without `uv run`** — Always prefix Python commands
2. **Running E2E tests with pytest directly** — Use `make run-e2e-test` instead
3. **Running make from wrong directory** — Always run from repository root
4. **Forgetting to recompile protobufs** — Run `make protobuf` after proto changes
5. **Not restarting debug after lib changes** — Backend changes to `lib/streamlit/` require restart
| Task | Command |
|------|---------|
| Run specific Python test | `uv run pytest path/to/test.py` |
| Run E2E test | `make run-e2e-test test_name.py` |
| Start debugging | `make debug app.py` |
| Check all changes | `make check` |
| Auto-fix issues | `make autofix` |
| Recompile protobufs | `make protobuf` |
| Frontend dev server | `make frontend-dev` |
| View all commands | `make help` |
Use this skill when:
This skill provides the knowledge and conventions needed to work effectively within the Streamlit codebase while following project standards and best practices.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/streamlit-development-expert/raw