plugins/python3-development/skills/rich/SKILL.md
Use when writing Python code with the Rich library — console output with markup, tables, progress bars, syntax highlighting, pretty printing, logging, or tracebacks. Covers Console, markup syntax, renderables (Panel/Table/Tree), Progress, Live, RichHandler, and the __rich_console__ protocol.
npx skillsauth add jamie-bitflight/claude_skills richInstall 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.
Enables writing correct Rich terminal UI code — markup, styled output, tables, progress tracking, live displays, logging integration, and custom renderables.
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 writing Python code that imports from rich or when asked to add terminal UI, colored output, progress bars, tables, syntax highlighting, or pretty printing to a Python CLI.
COVERS:
track(), Progress) and Live displaysRichHandler for stdlib logging and traceback installationText class and programmatic style buildingSyntax, Markdown, Pretty / pprint, JSON__rich_console__ and __rich_repr__ protocols for custom objectsDOES NOT COVER:
flowchart TD
Start([Rich task]) --> Q1{Task type?}
Q1 -->|Print styled output or markup| Markup[Load console-and-markup.md]
Q1 -->|Build table, panel, tree, columns| Render[Load renderables.md]
Q1 -->|Progress bar or live update| Prog[Load progress-and-live.md]
Q1 -->|Syntax highlight or pretty-print code/data| TextSyn[Load text-and-syntax.md]
Q1 -->|Logging or traceback display| LogTB[Load logging-and-tracebacks.md]
Q1 -->|Custom renderable, layout, or highlighter| Adv[Load advanced-patterns.md]
Console class instantiation and constructor parameters, print() / log() / rule() / status() methods, markup syntax (BBCode-style tags), style definition strings, color formats (named / 256-number / hex / rgb), style attributes (bold/italic/underline/etc.), Style class, Theme class, environment variables, output capture and export.
Load when writing console.print(), applying colors/styles, using Rich markup tags, or configuring console behavior.
references/console-and-markup.md
Panel, Table (add_column, add_row, constructor options, column options), Tree (add, style, guide_style), Columns layout, Padding, Rule, Align, and Box styles. Includes constructor signatures and all key parameters verbatim from source docs.
Load when building structured output with boxes, tables, tree views, or multi-column layouts.
references/renderables.md
track() function, Progress class (add_task, update, advance), task management (visible, indeterminate, transient), all built-in column classes (BarColumn, TextColumn, TimeRemainingColumn, SpinnerColumn, etc.), Live class, and console.status() spinner.
Load when adding progress tracking, spinners, or live-updating output to a CLI.
references/progress-and-live.md
Text class (append, stylize, highlight_regex, assemble, from_markup), Syntax class (from_path, line_numbers, theme, line_range), Markdown renderable, pprint / Pretty, JSON renderable, and the __rich_repr__ protocol with @rich.repr.auto decorator.
Load when highlighting code blocks, rendering markdown, pretty-printing data structures, or customizing object repr output.
references/text-and-syntax.md
RichHandler constructor parameters (full table), per-message markup/highlighter overrides via extra={}, rich_tracebacks=True for exceptions in log output, tracebacks_suppress for framework frames, traceback.install() for global handler, console.print_exception() parameters, and max_frames behavior.
Load when integrating Rich with Python's logging module, installing a global traceback handler, or improving exception display.
references/logging-and-tracebacks.md
__rich__ protocol (return renderable from object), __rich_console__ protocol (generator yielding renderables or Segments), __rich_measure__ for custom width reporting, Layout class (split_column, split_row, update, named panes), RegexHighlighter subclassing, built-in highlighters, inspect() function, and REPL installation.
Load when writing custom renderables, building multi-pane full-screen layouts, implementing custom syntax highlighting, or debugging Python objects.
references/advanced-patterns.md
# Install
pip install rich
# Drop-in print replacement
from rich import print
print("[bold red]Hello[/bold red] [green]world[/green]")
# Console (preferred for production code)
from rich.console import Console
console = Console()
console.print("[bold]Hello[/bold]", style="green")
console.rule("[bold red]Section")
# Style string formats
console.print("text", style="bold red underline on white")
console.print("text", style="#af00ff")
console.print("text", style="rgb(175,0,255)")
# Progress bar — simple
from rich.progress import track
for item in track(sequence, description="Processing..."):
process(item)
# Progress bar — multiple tasks
from rich.progress import Progress
with Progress() as progress:
task = progress.add_task("[cyan]Working...", total=100)
progress.update(task, advance=10)
# Logging
import logging
from rich.logging import RichHandler
logging.basicConfig(
level="NOTSET", format="%(message)s",
datefmt="[%X]", handlers=[RichHandler()]
)
# Tracebacks
from rich.traceback import install
install(show_locals=True)
# Table
from rich.table import Table
table = Table("Name", "Value")
table.add_row("foo", "bar")
console.print(table)
# Panel
from rich.panel import Panel
console.print(Panel("content", title="Title"))
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.