Agent skill

python3-core

Python engineering foundation for all projects. Activates automatically on any Python task — establishes coding standards, SOLID guidance, typing policy, testing defaults, tooling expectations, and code smell detection as design signals. Routes to specialist skills for TDD, CLI, web, data, or constrained environments.

Stars 33
Forks 4

Install this agent skill to your Project

npx add-skill https://github.com/Jamie-BitFlight/claude_skills/tree/main/plugins/python-engineering/skills/python3-core

SKILL.md

Python Engineering Standards

Consult references/python3-standards.md for the full standards document.

Standing Defaults (apply to every Python task)

Code Quality

  • Python 3.11+ native types: list[str], str | None, Self, TypeAlias
  • Google-style docstrings (Args/Returns/Raises)
  • SOLID principles as active design guidance, not checklist items
  • Functions under 50 lines; max 3 nesting levels
  • __all__ in public modules
  • No Any, broad object, or unchecked cast() in internal code
  • Code smells are design signals to investigate, not noise to suppress

Type Coverage

  • Type coverage is a project health metric
  • Adapt strictness to project constraints (see typing policy below)
  • Boundary modules are the ONLY place Any is permitted
  • Boundary code must validate and convert raw input immediately

Testing Defaults

  • pytest + pytest-mock (never unittest.mock)
  • AAA pattern; behavioral test names (test_{fn}_{scenario}_{result})
  • 80% coverage minimum; 95% + mutation testing for critical paths
  • Dual-hypothesis on test failure: both test-bug and implementation-bug are possible

Tooling

  • uv for dependency management
  • ruff for linting and formatting
  • ty (Astral) as default type checker; keep mypy/pyright when the project already uses them
  • pytest for testing
  • hatchling as default build backend
  • Detect active checker from .pre-commit-config.yaml then CI, not from presence of config sections

Design Principles

  • Code smell detection drives refactoring decisions
  • Fail-fast error handling: catch specific exceptions only when you can recover or add context
  • Use e.add_note() for exception context; never swallow exceptions
  • Protocol classes for dependency injection and duck typing
  • Factory patterns for complex object creation

Typing Policy

Rules

  1. Any, broad object, and unchecked cast() are FORBIDDEN in normal internal code
  2. They are ALLOWED only at explicit system boundaries where unknown-shape external data enters
  3. Boundary code must live in dedicated validator, parser, adapter, or boundary modules
  4. Boundary code must immediately validate and convert raw input into strongly typed internal objects
  5. If Pydantic is available, prefer Pydantic models or TypeAdapter
  6. If Hypothesis is available, boundary validation should include property-based tests
  7. Boundary modules may be the only place with narrow lint exceptions for Any
  8. The typed core must not receive raw unvalidated payloads

Strategy Selection (auto-detected)

Load python3-typing for the full matrix. Summary:

Python Version Dependencies Available Strategy
3.10 constrained stdlib only TypeAlias, Protocol, TypeGuard; no third-party
3.11+ stdlib stdlib only TypeAlias, TypeVar, Self, TypedDict + NotRequired
3.11+ with Pydantic pydantic available Pydantic models at boundaries; TypeAdapter for ad-hoc
3.11+ with Hypothesis hypothesis available Property-based tests for validators and boundaries
3.12 type statement for type aliases
3.13 TypeIs (PEP 742) replaces TypeGuard where bidirectional narrowing needed
3.14 Deferred evaluation of annotations (PEP 649)

Domain Routing

Only load when the task clearly matches. Do NOT preload all of these.

TDD Workflow

Load python3-tdd when the task involves test-driven development, writing tests before implementation, or red-green-refactor workflows.

CLI Applications

Load python3-cli when building Typer/Rich CLI tools, scripts with progress bars, or terminal output.

Web Applications

Load python3-web when working with FastAPI, Starlette, Django, or Flask.

Data / Scientific Python

Load python3-data when working with pandas, numpy, scipy, jupyter, or data pipelines.

Constrained / Legacy Environments

Load python3-stdlib-only ONLY when confirmed environment restrictions prevent dependency installation (airgapped, no uv, no internet). Do NOT assume restrictions.

Quality Workflows

  • /python-engineering:review — comprehensive code review (manual entrypoint)
  • /python-engineering:cleanup — progressive quality improvement (manual entrypoint)
  • /python-engineering:lint — deterministic quality checks (manual entrypoint)
  • /python-engineering:debug — structured debugging (manual entrypoint)

Tool-Specific

Load python3-tools when the task involves uv, Hatchling, ty, pre-commit, TOML editing, or PyPI packaging.

Assets

Templates available at ${CLAUDE_PLUGIN_ROOT}/skills/python3-core/assets/:

  • version.py — dual-mode version management
  • hatch_build.py — build hook template
  • example.pre-commit-config.yaml — standard git hooks
  • .editorconfig — editor formatting

Expand your agent's capabilities with these related and highly-rated skills.

Jamie-BitFlight/claude_skills

ccc

This skill should be used when code search is needed (whether explicitly requested or as part of completing a task), when indexing the codebase after changes, or when the user asks about ccc, cocoindex-code, or the codebase index. Trigger phrases include 'search the codebase', 'find code related to', 'update the index', 'ccc', 'cocoindex-code'.

33 4
Explore
Jamie-BitFlight/claude_skills

agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

33 4
Explore
Jamie-BitFlight/claude_skills

delegate

Quick delegation template for sub-agent prompts. Use when assigning work to a sub-agent, before invoking the Agent tool, or when preparing prompts for specialized agents. Provides the WHERE-WHAT-WHY framework. For comprehensive delegation guidance, activate the agent-orchestration how-to-delegate skill.

33 4
Explore
Jamie-BitFlight/claude_skills

swarm-spawning

Spawn agents and teammates in Claude Code swarms. Use when choosing between subagents vs teammates, selecting agent types (Explore, Plan, general-purpose, plugin agents), configuring spawn backends (in-process, tmux, iterm2), or setting environment variables for spawned agents.

33 4
Explore
Jamie-BitFlight/claude_skills

knowledge-explorer

Manage the research/ knowledge base (KB) of tool and library research entries. Use when browsing KB topics, adding new research entries, updating existing entries with dated revisions, fetching GitHub repo metadata into a draft KB entry, or migrating old-format entries to skill-spec frontmatter. Triggers on tasks like "what do we have on X", "add this to the KB", "update the KB entry for Y", "fetch github info for owner/repo", or "migrate old entries".

33 4
Explore
Jamie-BitFlight/claude_skills

design-anti-patterns

Enforce anti-AI UI design rules based on the Uncodixfy methodology. Use when generating HTML, CSS, React, Vue, Svelte, or any frontend UI code. Prevents "Codex UI" — the generic AI aesthetic of soft gradients, floating panels, oversized rounded corners, glassmorphism, hero sections in dashboards, and decorative copy. Applies constraints from Linear/Raycast/Stripe/GitHub design philosophy: functional, honest, human-designed interfaces. Triggers on: UI generation, dashboard building, frontend component creation, CSS styling, landing page design, or any task producing visual interface code.

33 4
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results