Agent Skills: Mastering Python Skill

Modern Python coaching covering language foundations through advanced production patterns. Use when asked to "write Python code", "explain Python concepts", "set up a Python project", "configure Poetry or PDM", "write pytest tests", "create a FastAPI endpoint", "run uvicorn server", "configure alembic migrations", "set up logging", "process data with pandas", or "debug Python errors". Triggers on "Python best practices", "type hints", "async Python", "packaging", "virtual environments", "Pydantic validation", "dependency injection", "SQLAlchemy models".

UncategorizedID: SpillwaveSolutions/doc-serve-skill/mastering-python-skill

Install this agent skill to your local

pnpm dlx add-skill https://github.com/SpillwaveSolutions/agent-brain/tree/HEAD/.claude/skills/mastering-python-skill

Skill Files

Browse the full folder contents for mastering-python-skill.

Download Skill

Loading file tree…

.claude/skills/mastering-python-skill/SKILL.md

Skill Metadata

Name
mastering-python-skill
Description
Modern Python coaching covering language foundations through advanced production patterns. Use when asked to "write Python code", "explain Python concepts", "set up a Python project", "configure Poetry or PDM", "write pytest tests", "create a FastAPI endpoint", "run uvicorn server", "configure alembic migrations", "set up logging", "process data with pandas", or "debug Python errors". Triggers on "Python best practices", "type hints", "async Python", "packaging", "virtual environments", "Pydantic validation", "dependency injection", "SQLAlchemy models".

Mastering Python Skill

Production-ready Python patterns with runnable code examples.

Contents


Workflow

Phase 1: Setup

  1. Verify Python version

    python --version  # Require 3.10+, prefer 3.12+
    
  2. Create and activate virtual environment

    python -m venv .venv && source .venv/bin/activate
    
  3. Install dependencies

    poetry install  # or: pip install -r requirements.txt
    

Phase 2: Develop

  1. Reference appropriate patterns:

  2. Follow project structure from project-structure.md

Phase 3: Validate

  1. Run quality checks

    ruff check . && ruff format --check .
    mypy src/
    
  2. Run tests with coverage

    pytest -v --cov=src --cov-report=term-missing
    

Phase 4: Deploy

  1. Build and verify package

    python -m build && twine check dist/*
    
  2. Deploy per docker-deployment.md or ci-cd-pipelines.md

Pre-Completion Checklist:

- [ ] All tests pass
- [ ] mypy reports no errors
- [ ] ruff check clean
- [ ] Coverage ≥80%
- [ ] No security warnings in dependencies

Reference Files

| Category | Files | Key Topics | |----------|-------|------------| | Foundations | syntax-essentials, type-systems, project-structure, code-quality | Variables, type hints, generics, src layout, ruff, mypy | | Patterns | async-programming, error-handling, decorators, context-managers, generators | async/await, exceptions, Result type, with statements, yield | | Testing | pytest-essentials, mocking-strategies, property-testing | Fixtures, parametrize, unittest.mock, Hypothesis | | Web APIs | fastapi-patterns, pydantic-validation, database-access | Dependencies, middleware, validators, SQLAlchemy async | | Packaging | poetry-workflow, pyproject-config, docker-deployment | Lock files, PEP 621, multi-stage builds | | Production | ci-cd-pipelines, monitoring, security | GitHub Actions, OpenTelemetry, OWASP, JWT |

See TOC.md for detailed topic lookup.


Sample CLI Tools

Runnable examples demonstrating production patterns:

| Tool | Demonstrates | Reference | |------|-------------|-----------| | async_fetcher.py | Async HTTP, rate limiting, error handling | async-programming.md | | config_loader.py | Pydantic settings, .env files, validation | pydantic-validation.md | | db_cli.py | SQLAlchemy async CRUD, repository pattern | database-access.md | | code_validator.py | Run→check→fix with ruff and mypy | code-quality.md |

# Test examples
python sample-cli/async_fetcher.py https://httpbin.org/get
python sample-cli/config_loader.py --show-env
python sample-cli/db_cli.py init --sample-data && python sample-cli/db_cli.py list
python sample-cli/code_validator.py src/

When NOT to Use

  • Non-Python languages: Use language-specific skills
  • ML/AI model internals: Use PyTorch/TensorFlow skills
  • Cloud infrastructure: Use AWS/GCP skills for infra (this covers code)
  • Legacy Python 2: Focus is Python 3.10+