python-pro

Creates Python 3.12+ async code with strict typing and test coverage.

1|1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/corticalstack/claude-code-flow --skill python-pro-corticalstack
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-pro
Source: https://github.com/corticalstack/claude-code-flow/tree/main/.claude/skills/python-pro
Command: npx skills add https://github.com/corticalstack/claude-code-flow --skill python-pro-corticalstack

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill solves the problem of building reliable Python codebases by enforcing strong static typing, modern async patterns, and production-grade quality gates so you can ship with confidence.

Core Features & Use Cases

  • Type-safe Python 3.12+: Apply PEP 695 generics, Protocols, TypedDict, and strict typing across public APIs.
  • Async-first structured concurrency: Implement concurrency with asyncio.TaskGroup and timeouts with asyncio.timeout for predictable failure behavior.
  • Production-ready robustness: Add consistent error handling, context managers, dataclasses for internal structures, and Pydantic v2 only at trust boundaries (API I/O/config).

Quick Start

Ask for a Python module implementation that follows mypy --strict, ruff check, ruff format, uses asyncio.TaskGroup for concurrency, and includes a pytest test suite with fixtures targeting robust type coverage.

Frequently Asked Questions about python-pro

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement structured concurrency with asyncio TaskGroup in Python 3.12?

Structured concurrency with asyncio TaskGroup is implemented by managing concurrent tasks within a single scope to ensure predictable failure behavior. This approach uses asyncio.timeout to enforce cancellation rules, preventing silent task leaks and unhandled background exceptions.

What's the best way to enforce strict type safety and PEP 695 generics in Python?

Strict type safety with PEP 695 generics is enforced by applying Protocols and TypedDict across public APIs to meet mypy --strict requirements. This methodology ensures reliable static typing for Python 3.12+ codebases, catching type errors during static analysis rather than runtime.

How do I set up pytest and ruff for production-grade Python workflows?

Setting up pytest and ruff for production workflows involves configuring ruff check and ruff format for linting, while designing pytest test suites with targeted fixtures. This combination enforces code quality standards and achieves over 90% test coverage for reliable codebases.

When should I use Pydantic v2 versus dataclasses for Python validation?

Pydantic v2 should be used only at trust boundaries such as API I/O and configuration parsing, while dataclasses are applied for internal data structures. This separation enforces validation-oriented data handling without adding unnecessary overhead to internal application logic.

Can I use mypy strict mode with asyncio and pathlib in production Python applications?

Yes, mypy strict mode works with asyncio and pathlib in production Python applications by enforcing type annotations on all async task groups and path manipulation operations. This combination ensures robust file system handling and predictable asynchronous execution.