원클릭으로
agilab-streamlit-pages
Streamlit page authoring patterns for AGILAB (session_state safety, keys, rerun, UX).
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Streamlit page authoring patterns for AGILAB (session_state safety, keys, rerun, UX).
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Maintain repo-managed agent skills across `.claude/skills` and `.codex/skills`, including targeted sync, validation, index regeneration, drift checks, and Tokki skill visibility. Use when adding or updating a shared skill, migrating a user-managed skill into the repo, or reconciling agent skill copies without overwriting unrelated skills.
Review AGILAB changes for security hardening risks. Use when code, docs, or workflows touch installers, Streamlit exposure, cluster/SSH/share behavior, app execution, notebooks, LLM connectors, secrets, PyPI/GitHub/Hugging Face publishing, dependency policy, or external repositories.
Route terse AGILAB operator requests such as "do it", "review AGILAB", "next move", "update repos", "merge it", "check again", "release", and "cluster validation" into the right repo skills, safety mode, validation depth, and output contract using session-derived policy.
Create, edit, inspect, or explain presentation slide decks (`.pptx`) with PptxGenJS, bundled layout helpers, and render/validation utilities. Use when tasks involve building a new PowerPoint deck, recreating slides from screenshots/PDFs/reference decks, modifying content while preserving editable output, extracting or explaining a specific slide, adding charts/diagrams/visuals, or diagnosing layout issues such as overflow, overlaps, and font substitution.
Produce deep AGILAB audit and code-review artifacts with evidence-backed findings, mandatory architecture-foundation readiness, blast-radius tracing, security/test posture, and prioritized recommendations. Use when the user says "review AGILAB", "audit AGILAB", "code review AGILAB", "deep review", "architecture review", "security review", asks for a review document, or asks for comparison-quality critique rather than a quick fix.
Documentation workflow for AGILAB (sources vs generated HTML, public constraints, consistency checks).
| name | agilab-streamlit-pages |
| description | Streamlit page authoring patterns for AGILAB (session_state safety, keys, rerun, UX). |
| license | BSD-3-Clause (see repo LICENSE) |
| metadata | {"updated":"2026-07-04T00:00:00.000Z"} |
Use this skill when editing:
src/agilab/main_page.pysrc/agilab/pages/*.pysrc/agilab/apps-pages/*/src/*/*.pyapp_args_form.py views in AGILAB-managed app reposapps-pages as app-agnostic analysis sidecars by default. A page should
inspect artifacts, manifests, metrics, or settings from the selected active
app; it should not own the domain workflow.apps-pages for
packaging or launch reasons, document it as an explicit opt-in playground or
exception. Do not describe it as a generic app-agnostic view.app_args_form.py views are app UI, not apps-pages. Use them when an
app needs persisted execution fields in ORCHESTRATE.app_args_form.py views, do a field-consistency pass before
closing the change: compare the app ArgsModel, seed app_settings.toml,
guided-mode widgets, preview-helper inputs, and persisted candidate payload.
Runtime-relevant args must either be visible in the guided form or explicitly
documented as intentionally advanced; do not leave required execution fields
available only through generic edit mode. Preview helpers should consume the
current widget value for any exposed field, not the stale defaults_model
value.agi_env.streamlit_args.render_form
with an explicit container such as st.sidebar:
render_form(defaults_model, container=st.sidebar).agi_env.streamlit_args; do not hard-code a
project name or page bundle just because one app wants sidebar controls.[app_surface] in the app's app_settings.toml
with a project-local entrypoint such as pytorch_playground/app_surface.py.
Use [pages] restrict_to_view_module = true for app-surface-first projects;
an empty or missing pages.view_module may be migrated to the virtual
view_app_ui launcher so the app surface is selected and visible in the
ANALYSIS sidebar. Do not create a generic apps-pages/view_<app> bridge for
this.view_app_ui as an internal route key, not a user-facing label. Sidebar
links for app surfaces should use [app_surface].title, route through the app
surface renderer, and avoid exposing duplicate view_app_ui bridge links.view_app_ui may be the default selected sidebar launcher, but users must
still be able to add other installed analysis views through the same existing
selector instead of a custom "additional views" control.Never assign st.session_state["k"] = … after a widget with key="k" was created.
st.session_state.setdefault("k", default) before the widget.app_settings["cluster"] or app_settings["args"], update only that
persisted payload after render. Do not write the normalized value back into
the widget key unless you do it before widget creation, behind a rerun, or
through a versioned replacement key.StreamlitAPIException.Do not both pre-seed st.session_state[key] and pass a widget default/value/index for
the same keyed widget. Pick one source of initialization:
st.session_state untouched before creation, orst.session_state before creation and omit the widget default.
This avoids Streamlit warnings such as "created with a default value but also had its
value set via the Session State API".
Shared widget wrappers should drop their default argument when the key already
exists in session state.If you need to “reset” a widget value:
When Streamlit raises a duplicate-widget ID error, check whether the page or app surface is being rendered twice before only adding widget keys. Add stable keys for repeated controls, but fix duplicate entrypoint execution at the source.
setdefault at the top of the page.f"cluster_pool__{app_name}", not "cluster_pool".app_settings should hydrate widget keys on page init and after project switches.st.session_state.st.session_stateapp_settings["cluster"], app_settings["args"], or equivalent persisted payloads as the serializable config contract.
~/.agilab/.env~/.local/share/agilab/.agilab-pathst.session_state["env"]active_app or APPS_PATHManager env must point at the source app path, not $HOME/agi-space.env object before
rendering headers, buttons, or action state. Rendering first and repairing later leaves
stale paths visible to users and can make action buttons operate on the wrong project.st.session_state
when touching page bootstrap, sidebar project selection, or ORCHESTRATE header state.Last generated ...) rather than implying it reflects the current unsaved inputs.app_settings.toml unless they are real app args.Install agi-app for package/catalog install
and Deploy scheduler & workers for manager/worker environment deployment.Deploy scheduler & workers can correctly call AGI.install: the API
prepares manager and worker runtime environments and reuses an already-ready
local manager environment rather than forcing a reinstall.main_page.py, page_bootstrap.py, workflow_ui.py,
page_project_selector.py, lazy-import wrappers, CSS class names, and tests.
Add or update a negative regression assertion for removed text so tests do
not encode newly introduced clutter as expected behavior.tools/agilab_widget_robot.py,
tools/agilab_widget_robot_matrix.py, tools/agilab_web_robot.py,
tools/ui_robot_canary.py, tools/ui_robot_coverage_contract.py, and the
paired robot/action-contract tests. A page-only rename can leave hosted
selected-action profiles, above-fold canaries, and coverage contracts looking
for the old label even when the UI tests pass.ready, not set, or missing without useful context.Workflow graph instead of DAG shapeStages and dependencies for project workflow instead of graph-only jargon such as nodes and edgesPlan, steps, outputs, Creates, and Uses for multi-app workplans
before technical DAG, artifact, node, or edge wordingShow graph control when the
graph can be too small to readProject name when the widget selects a projectrun_*.log files under the app run
environment instead of adding another persisted setting.run_manifest.json, evidence_graph.json, workflow_run_manifest.json,
notebook_export_manifest.json, or a dry-run report, do not stop at showing
the file path. Render a compact human inspection surface for the contents:
status, counts, schema, key rows, validation issues, and artifact links. Keep
the raw path visible for audit/replay.Open buttons, or another selector unless the second surface adds a distinct
workflow stage.current_page over a selectbox plus Open button when
the user only needs to jump to a target. Add a tiny helper to construct and test
the encoded URL instead of inlining query-string formatting in the render block.pages.view_module; remove stale
default_view/default_views values only when that behavior is intentionally
replaced by the new launcher model.st.navigation, st.switch_page targets must be the main app file or an
exact file under pages/ relative to the Streamlit entrypoint. Do not hard-code
stale numeric filenames such as pages/3_WORKFLOW.py; route through central
page constants and add a focused test when a wizard button or deep link opens
another page.Update selected or Remove selected cannot survive
after a product copy decision.example notebook when the user cannot know where that file is. Prefer explicit copy
such as Create from built-in notebook, say that no file needs to be found
or uploaded, and show the project that will be created.app_settings.toml over page-level hardcoded paths.pages.<page_name> for app-specific defaults that should be portable across apps and machines.src/.../app_settings.toml is only the seed.~/.agilab/apps/<app>/app_settings.toml.flight_project, exclude view_maps_network while keeping generic views such as view_maps, view_maps_3d, and view_barycentric available.restrict_to_view_module unless hiding every undeclared generic view is the intended product behavior.view_maps_network, supported defaults now include:
dataset_base_choicedataset_custom_basedataset_subpathdefault_traj_globsdefault_allocation_globsdefault_baseline_globscloudmap_sat_pathcloudmap_ivdl_pathview_maps_network state for user choices, but put repo/app conventions under pages.view_maps_network.AgiEnv.base_worker_cls first. AgiEnv already populates this
from worker source inspection, so page code should not import app worker classes
just to decide which controls to show.DagWorker, known DAG-derived workers such as Sb3TrainerWorker, and
custom *Dag*Worker base names as DAG-capable for UI decisions.endswith("dag-worker"); they drift from the AgiEnv contract and silently fail
for real base names like DagWorker.st.experimental_rerun(); use st.rerun().st.error("Short actionable summary.")st.caption("Full diagnostic")st.code(diagnostic_text, language="text")st.error() or st.code().traceback.format_exc() directly to st.error(); Streamlit message
boxes collapse readability and can flatten newlines.st.code; keep the original
exception/message unchanged for logs and assertions that depend on exact text.test/test_streamlit_diagnostic_rendering.py green when touching
diagnostic rendering paths.ActionResult.status"failed" in line
unless the surrounding phrase is part of a known fatal contract; benign warnings
can contain words like failed.stderr == failure rules.Run readiness, Autopilot, Recommended actions, Expected outputs, and
Fastest safe plan. Avoid exposing internal DAG jargon when the user is
deciding whether to run, reuse, or repair the workflow.lab_stages.toml explains whether code came from safe actions or
raw Python.asyncio.create_task(...), yield once with await asyncio.sleep(0),
then poll at a short fixed interval and update the placeholder until the task
is done. Do not depend only on log callbacks; quiet processes still need a
visible timer.last_run_elapsed_seconds and last_run_elapsed_label; never mutate a key
already owned by a rendered widget.f\"{page_id}:df_files\", not "df_files".