dev-python_frontend

Implements and reviews Streamlit, Gradio, and NiceGUI frontend code in this repository.

1|2|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/zhizhunbao/textbook-rag --skill dev-python-frontend-zhizhunbao
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dev-python_frontend
Source: https://github.com/zhizhunbao/textbook-rag/tree/main/.agent/skills/dev-python_frontend
Command: npx skills add https://github.com/zhizhunbao/textbook-rag --skill dev-python-frontend-zhizhunbao

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? This Skill guides development and review of the repository's Python-based frontend layer, preventing JavaScript-stack assumptions from leaking into Streamlit, Gradio, or NiceGUI code and keeping UI state, rendering, and styling consistent across entrypoints. ## Core Features & Use Cases - Framework Routing: Directs work to the correct workflow based on the target file: app.py for Streamlit, app_gradio.py for Gradio, and app_nicegui.py for NiceGUI. - Framework-Specific Guidance: Provides focus areas for session state, gr.Blocks composition, event wiring, component trees, and safe text rendering. - Review Checklist: Supplies a structured checklist covering unsafe HTML injection, state transitions, error messaging, and loading/empty/failure states. - Use Case: When asked to fix a bug in the Gradio interface, the Skill routes to the Gradio workflow, keeps event handler signatures predictable, and validates with uv run python -m py_compile frontend/src/app_gradio.py. ## Quick Start Use the Python frontend skill to fix the layout bug in frontend/src/app_gradio.py and validate it compiles.

Frequently Asked Questions about dev-python_frontend

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between Streamlit, Gradio, and NiceGUI for this frontend?▼

The choice is determined by the file being edited: app.py uses Streamlit, app_gradio.py uses Gradio, and app_nicegui.py uses NiceGUI. Preserve the existing framework of the target file unless a migration is explicitly requested.

How do I manage UI state in a Streamlit app?▼

Use st.session_state for UI state in Streamlit, combined with st.set_page_config, layout containers, and caching where appropriate. Keep state transitions explicit rather than spread across unrelated callbacks.

How do I validate Python frontend changes without running the full app?▼

Run uv run python -m py_compile on the target file, such as frontend/src/app_gradio.py, to catch syntax errors. Then perform a smoke review of imports, state keys, event chains, and render paths.

Is it safe to use raw HTML injection in Streamlit?▼

Prefer safe text rendering by default and only use unsafe_allow_html=True when necessary, reviewing it carefully. User input, query params, and rendered content must always be handled safely.

When should I use the JavaScript frontend skill instead of this one?▼

Use the JavaScript/TypeScript frontend skill only when the user explicitly asks for a JS frontend stack. This repository's frontend is Python application code, not a React or Next.js project.