plugins/python3-development/skills/textual/SKILL.md
Use when building Textual TUI apps — creating widgets, laying out screens, handling events, managing reactivity, testing with Pilot, or running background workers. Covers App lifecycle, CSS styling, screen stack, reactive attributes, custom messages, actions, bindings, and the Worker API.
npx skillsauth add jamie-bitflight/claude_skills textualInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Provides patterns, API constraints, and working examples for building terminal applications with the Textual framework.
Consult ../python3-development/references/python3-standards.md when applying shared architecture, typing, testing, or CLI rules; full standards, graphs, and amendment process are documented there.
TRIGGER: Activate when the user asks about Textual — building TUI apps, widgets, CSS styling, reactive attributes, testing, or concurrency.
COVERS:
@on decoratorrun_test, Pilot API (press, click, hover, pause)pytest-textual-snapshot@work, run_worker, thread workers, worker events)DOES NOT COVER:
flowchart TD
Task([Task received]) --> Q1{Task type?}
Q1 -->|App structure or lifecycle| App[Load app-and-screens.md]
Q1 -->|Widget creation or builtins| Wid[Load widgets.md]
Q1 -->|Layout or CSS styling| CSS[Load layout-and-css.md]
Q1 -->|Events, messages, or actions| Evt[Load events-and-actions.md]
Q1 -->|Reactive attributes or data binding| React[Load reactivity.md]
Q1 -->|Testing or background tasks| Test[Load testing-and-workers.md]
Q1 -->|Multiple concerns| Multi[Load relevant files]
App class basics, run/exit/suspend, CSS loading, screen stack (push/pop/switch), modal screens, returning data from screens, and modes.
Load when the user asks about App setup, screen navigation, modal dialogs, or multi-screen apps.
references/app-and-screens.md
Custom widget creation, Static, Default CSS, focusability, bindings, Rich renderables, Line API, compound widgets, coordinating via messages, and the builtin widget catalog.
Load when the user asks about creating widgets, choosing a builtin widget, or structuring compound UIs.
references/widgets.md
Layout types (vertical, horizontal, grid), utility containers, docking, layers, offsets, CSS selectors, pseudo-classes, combinators, specificity, variables, nested CSS, and the style property reference.
Load when the user asks about arranging widgets, CSS syntax, selectors, or style properties.
references/layout-and-css.md
Message queue, event handler naming convention, @on decorator, handler arguments, async handlers, event bubbling, custom messages, preventing messages, actions, action strings, namespaces, key bindings, dynamic actions, and the builtin actions list.
Load when the user asks about handling user input, defining key bindings, creating custom events, or action strings.
references/events-and-actions.md
Reactive attributes, var, smart refresh, layout-triggering reactives, validation methods, watch methods, dynamic watchers, recompose, compute methods, set_reactive, mutable reactives (mutate_reactive), and data binding.
Load when the user asks about reactive state, auto-refresh, watchers, computed values, or binding parent state to child widgets.
references/reactivity.md
run_test, Pilot API (press, click, hover, pause), terminal size simulation, snapshot testing with pytest-textual-snapshot, run_worker, the @work decorator, worker state lifecycle, thread workers, and worker events.
Load when the user asks about writing tests, simulating input, snapshot comparisons, background HTTP requests, or preventing UI blocking.
references/testing-and-workers.md
# Minimal app
from textual.app import App, ComposeResult
from textual.widgets import Label
class MyApp(App):
CSS = "Screen { align: center middle; }"
def compose(self) -> ComposeResult:
yield Label("Hello!")
if __name__ == "__main__":
MyApp().run()
# Reactive + watch
from textual.reactive import reactive
from textual.widget import Widget
class Counter(Widget):
count = reactive(0)
def watch_count(self, value: int) -> None:
self.refresh()
def render(self) -> str:
return str(self.count)
# Worker for background HTTP
from textual import work
import httpx
class MyApp(App):
@work(exclusive=True)
async def fetch(self, url: str) -> None:
async with httpx.AsyncClient() as client:
response = await client.get(url)
self.query_one("#result").update(response.text)
# Test with Pilot
async def test_button() -> None:
app = MyApp()
async with app.run_test() as pilot:
await pilot.click("#submit")
assert app.query_one("#result").renderable == "done"
development
When an application needs to store config, data, cache, or state files. When designing where user-specific files should live. When code writes to ~/.appname or hardcoded home paths. When implementing cross-platform file storage with platformdirs.
testing
Enforce mandatory pre-action verification checkpoints to prevent pattern-matching from overriding explicit reasoning. Use this skill when about to execute implementation actions (Bash, Write, Edit) to verify hypothesis-action alignment. Blocks execution when hypothesis unverified or action targets different system than hypothesis identified. Critical for preventing cognitive dissonance where correct diagnosis leads to wrong implementation.
tools
Reference guide for the Twelve-Factor App methodology — 15 principles (12 original + 3 modern extensions) for building portable, resilient, cloud-native applications. Use when evaluating application architecture, designing cloud-native services, reviewing codebases for methodology compliance, advising on configuration, scaling, observability, security, and deployment patterns. Incorporates the 2025 open-source community evolution and cloud-native reinterpretations of each factor.
tools
Converts user-facing documentation (how-to guides, tutorials, API references, examples) in any format — Markdown, PDF, DOCX, PPTX, XLSX, AsciiDoc, RST, HTML, Jupyter notebooks, man pages, TOML/YAML/JSON configs, and plain text — into Claude Code skill directories with SKILL.md plus thematically grouped references/*.md files. Use when given a docs directory or mixed-format documentation to transform into an AI skill. Uses MCP file-reader server for binary formats.