streamlit-core
仓库创建 2026年7月5日最近提交 22 天前SkillHot 收录 22 天前
▸ 精选理由
解决常见的重跑/状态丢失问题,是 Streamlit 开发必读。
这个 Skill 做什么
说明 Streamlit 的执行模型、session_state、缓存与 rerun 原理,便于调试。
帮你把 Streamlit 程序里那些莫名其妙的重跑、状态丢失、按钮失灵问题挑出来并解释清楚。适合写或调试任何 Streamlit app,尤其是遇到无限 rerun、刷新后值回到初始、或 callback/表单行为怪异时用。核心提醒你:每次交互都会从头跑完脚本,真正的状态只有 st.session_state 和当前控件值,缓存与 rerun、callbacks、forms、fragments 的交互都围绕这个模型展开。
▸ 展开 SKILL.md 英文原文
Streamlit execution model — reruns, session_state, callbacks, forms, caching, fragments. Use when writing or debugging ANY Streamlit app, especially infinite rerun loops, values that reset or vanish on refresh, buttons that "don't work", state errors, or live/auto-refreshing sections.
0
Stars
0
Forks
6
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/4k7yvjv7w4-ops/streamlit-agent-skills/main/streamlit-core/SKILL.md或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/4k7yvjv7w4-ops/streamlit-agent-skills/main/streamlit-core/SKILL.md"SKILL.MD 节选查看完整文件 ↗
# Streamlit core (1.58.x) — execution model, state, refresh **The one mental model:** on EVERY user interaction (any widget touched), Streamlit re-executes the WHOLE script top-to-bottom. There are no event handlers, no persistent locals, no main loop. A run is a pure function of `st.session_state` + current widget values. Everything below follows from this. Runnable proof of every claim: `st_core_lab.py` in this skill folder (`python -m streamlit run ~/.roo/skills/streamlit-core/st_core_lab.py`). Verified on Streamlit **1.58**, API-checked on **1.55**: everything in this skill exists on both (`st.fragment(run_every=)` needs ≥1.37). ## Hard rules (violations = the classic broken app) 1.
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有