pythonide-widget

A Python-based toolkit guide for creating iOS Home Screen widgets in PythonIDE. Widgets are small information panels that can show text, values, charts, tables, and custom layouts.

In plain words
What is it for?
Use it to create or repair PythonIDE widgets, add preview settings or desktop interactions, and adapt layouts for different widget sizes.
Why use it?
It provides the supported structure and checks needed to make a widget runnable and correctly sized across widget families.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/python-ide/pythonide-skills/pythonide-widget
Any agent
npx skills add Python-IDE/pythonide-skills --skill pythonide-widget
Clone the repo
git clone --depth 1 https://github.com/Python-IDE/pythonide-skills

Made for: Claude Code, Codex.

Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,113 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00061 $0.01113
Opus 5 $0.00030 $0.00557
Sonnet 5 $0.00012 $0.00223
Haiku 4.5 $0.00006 $0.00111

Measured yesterday against content hash e8def4720cfd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pythonide-widget scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 1 executable file (examples/progress/main.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

pythonide-widget/SKILL.md · 98 lines

How it starts

The opening of the file, as written. The whole thing — 98 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PythonIDE Widget

Execution rulebook for Python-first iOS Home Screen widgets.

Read Before Coding

  1. Widget module
  2. Widget schema and widget.pyi
  3. llms-full.txt widget surface
  4. Focused guides: layout, parameters, interaction, timeline

Do not use AppUI, SwiftUI, TSX, HTML, or undocumented widget helpers.

Workflow

  1. Confirm the user wants a widget, not an AppUI MiniApp (pythonide router).
  2. Write one runnable Python file: import widget, one widget.Widget(...), documented primitives, w.render().
  3. Default target family: medium Home Screen unless the user asks otherwise.
  4. Use widget.param for preview-sheet tunables; use widget.state for desktop interactions.
  5. Branch with widget.family, widget.family_value(...), w.when(...), or w.unless(...) only when supporting multiple families.
  6. 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/file for preview-editable values
  • widget.state actions: increment(), decrement(), set(value), toggle(), toggle_item(value)
  • Layout containers use with blocks: with w.row(spacing=8): then child calls on indented lines
  • Use ctx = widget.context for size-aware composition inside ctx.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

Read the full file on GitHub · 98 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 98 lines · 61 tokens per session scan A e8def4720cfd

Subscribe to this mod's changes

pythonide-widget is a skill published in the GitHub repository Python-IDE/pythonide-skills (6 stars, last pushed 1mo ago), licensed MIT. It adds 61 tokens to every session and 1,113 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.