Pythonide widget
Official Agent Skills for building PythonIDE AppUI MiniApps, widgets, automations, and native iOS integrations with Codex, Cursor, and Claude Code.
npx -y skills add Python-IDE/pythonide-skills --skill pythonide-widgetAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 5 stars5 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Create or repair PythonIDE iOS Home Screen widgets using widget.Widget(), widget.param, widget.state, charts, tables, canvas layouts, and family branching. Use when the user asks for a WidgetKit widget, desktop widget script, or widget preview — not an AppUI MiniApp.
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
4.3 KB, as published. Nobody here has run it
PythonIDE Widget
Execution rulebook for Python-first iOS Home Screen widgets.
Read Before Coding
- Widget module
- Widget schema and widget.pyi
- llms-full.txt widget surface
- Focused guides: layout, parameters, interaction, timeline
Do not use AppUI, SwiftUI, TSX, HTML, or undocumented widget helpers.
Workflow
- Confirm the user wants a widget, not an AppUI MiniApp (
pythoniderouter). - Write one runnable Python file:
import widget, onewidget.Widget(...), documented primitives,w.render(). - Default target family: medium Home Screen unless the user asks otherwise.
- Use
widget.paramfor preview-sheet tunables; usewidget.statefor desktop interactions. - Branch with
widget.family,widget.family_value(...),w.when(...), orw.unless(...)only when supporting multiple families. - Repair layout issues before claiming completion.
Default Pattern
import widget
ctx = widget.context
accent = widget.param.color("Accent", "#34D399")
count = widget.state.int("count", 0)
w = widget.Widget(background=("#F8FAFC", "#0B1220"), style="clean")
w.text("Today", size=16, weight="semibold").line_limit(1).min_scale(0.72)
w.value(count, unit="x").content_transition("numericText").monospaced_digit()
w.progress(min(int(count), 10), total=10, color=accent, height=8)
if ctx.content_height >= 120:
w.button("+1", action=count.increment(), background=accent, color="#FFFFFF")
w.render()
Generation Rules
- One
widget.Widget()entry per script - Prefer documented primitives:
text,rich_text,value,symbol,svg,image,shape,rect,circle,path,table,line_chart,bar_chart,ring_chart,progress,row,column,layer,grid,region,canvas,button,link,toggle widget.param.color/slider/number/text/bool/choice/filefor preview-editable valueswidget.stateactions:increment(),decrement(),set(value),toggle(),toggle_item(value)- Layout containers use
withblocks:with w.row(spacing=8):then child calls on indented lines - Use
ctx = widget.contextfor size-aware composition insidectx.content_width/ctx.content_height - Add
.line_limit(...)and.min_scale(...)to long text - Widget animations are timeline/state-update animations, not continuous 60fps app loops
Family Policy
| Request | Target |
|---|---|
| Unspecified | medium only |
Explicit small | one title, one value, one compact visual |
Explicit large | add real extra content, do not stretch medium |
| All Home Screen sizes | branch per family |
| Accessory families | only when explicitly requested |
Hard Stops
- No
appui,scene, oruiin widget deliverables - No invented APIs or compatibility aliases omitted from public schema
- No claiming gradients, network data, charts, or interaction unless coded with documented APIs
- No
w.row(w.text(...), spacing=8)— usewith w.row(...)
Repair Hints
| Issue | Fix |
|---|---|
| Blank widget | restore w.render() |
| Cropped text | shorten, branch by family, add .line_limit(1).min_scale(0.6) |
| Crowded medium | remove optional metrics or reduce chart density |
| Table lines too heavy | line_width="hairline" |
| Tap no effect | use widget.state action reference |
| Network failure | cache_json(..., default=...) fallback |
Examples
examples/progress/— medium widget with param, state, and progress bar
Boundary
Widgets are not MiniApps. If the user wants in-app navigation, forms, or multi-screen tools, switch to pythonide-appui.