Teaching Claude Code Quality Patterns with a Custom Skill

January 9, 2026

The Dagster team has created a Claude skill that teaches AI assistants to write high-quality Python 3.13 code following their project conventions.

What It Does

The “dignified-python-313” skill provides structured guidance on:

Modern Python 3.13 Patterns: The skill enforces Python 3.13-specific conventions, like using native type syntax (list[str], str | None) instead of older alternatives, and avoiding from __future__ import annotations which is unnecessary in Python 3.13.

CLI Development: Complete patterns for building command-line interfaces with Click, including proper error handling with click.echo() instead of print(), directing errors to stderr, and treating CLI commands as error boundaries that catch exceptions and exit cleanly with SystemExit(1).

Subprocess Safety: Critical best practices like always using check=True with subprocess.run() to prevent silent failures, capturing both stdout and stderr for diagnostics, using timeouts to prevent hangs, and handling errors with proper context.

Why Custom Skills Matter

While AI assistants like Claude Code understand Python extensively, they need explicit guidance for project-specific conventions. Custom skills fill this gap by providing structured, machine-readable instructions that ensure consistent code quality across a project.

The skill approach complements broader resources like the handbook’s Modern Python Project Setup Guide for AI Assistants, allowing teams to layer project-specific patterns on top of general Python best practices.

Example Patterns

The skill enforces specific conventions that might otherwise vary across AI-generated code. For subprocess calls, it requires:

# Always use check=True
result = subprocess.run(
    ["command", "arg"],
    check=True,
    capture_output=True,
    text=True
)

For CLI error handling, it mandates:

# Catch exceptions at command boundary
@click.command()
def main():
    try:
        # domain logic here
    except DomainError as e:
        click.echo(f"Error: {e}", err=True)
        raise SystemExit(1)

Learn More

Last updated on

Please submit corrections and feedback...