streamlit/assessing-external-test-risk
Assesses whether branch or PR changes are high-risk for externally hosted or embedded Streamlit usage and recommends whether external e2e coverage with `@pytest.mark.external_test` is needed. Use during code review, PR triage, or test planning when changes touch routing, auth, websocket/session behavior, embedding, assets, cross-origin behavior, SiS/Snowflake runtime, storage, or security headers.
npx skills add https://github.com/streamlit/streamlit --skill assessing-external-test-risk
Use this skill to decide whether a branch or PR should include external e2e coverage using @pytest.mark.external_test.
This helps protect deployments that commonly involve proxies, embedded iframe contexts, CSP constraints, and other browser security boundaries.
This skill is for risk assessment and recommendation. It does not auto-mark tests unless explicitly requested.
Use an any-hit policy:
Evaluate all categories. A single hit is enough to recommend external coverage.
server.baseUrlPath, catch-alls, request methods, URL resolution, redirects, or status codes._streamlit_user, _streamlit_xsrf, CSRF/XSRF handling, server.trustedUserHeaders, or session-to-identity binding.postMessage), iframe sizing or resize behavior, iframe sandbox or allow attributes, or permissions policy behavior in embedded contexts.server.customComponentBaseUrlPath), or proxying rules for static/component assets.crossOrigin usage, external-origin fetches or external networks behavior, or backend URL discovery via window.__streamlit.*.running_in_sis(), get_active_session(), Snowflake connection/session semantics, or SiS-specific environment flags.10. Client storage behavior
localStorage, or sessionStorage usage that may differ in embedded or third-party contexts.11. Security headers and browser policies
Use this exact structure:
## External test recommendation
- Recommend external_test: [Yes/No]
- Triggered categories: [List category numbers and names, or "None"]
- Evidence:
- `<path>`: [short reason from diff]
- `<path>`: [short reason from diff]
- Suggested external_test focus areas:
- [Concrete scenario to validate externally]
- [Concrete scenario to validate externally]
- Confidence: [High/Medium/Low]
- Assumptions and gaps: [Unknowns, missing context, or why confidence is reduced]
Diff includes:
lib/streamlit/web/server/starlette/starlette_routes.py route changesallow attributesExpected output:
Recommend external_test: YesDiff includes:
Expected output:
Recommend external_test: NoNoneTake streamlit/assessing-external-test-risk from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.