mastering-python-skill
Skill120 starsChanged 6 months agoMITView on GitHub
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".
- Reads credentials
- Installs packages
In this repository6 other files it gives its agents.
- agent-brain-plugin/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- .github/workflows/AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- .github/workflows/CLAUDE.mdCLAUDE.md
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 47
Create and activate virtual environment
- Distinctive: line 65
Follow project structure from project-structure.md
- Distinctive: line 75
Run tests with coverage
- Distinctive: line 138
Non-Python languages: Use language-specific skills
- Distinctive: line 139
ML/AI model internals: Use PyTorch/TensorFlow skills
- Distinctive: line 140
Cloud infrastructure: Use AWS/GCP skills for infra (this covers code)
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Mastering Python Skill
Production-ready Python patterns with runnable code examples.
Contents
- Workflow
- Reference Files
- Sample CLI Tools
- When NOT to Use
- Full Table of Contents
Workflow
Phase 1: Setup
- Verify Python version
python --version # Require 3.10+, prefer 3.12+ - Create and activate virtual environment
python -m venv .venv && source .venv/bin/activate - Install dependencies
poetry install # or: pip install -r requirements.txt
Phase 2: Develop
- Reference appropriate patterns:
- Types → type-systems.md
- Async → async-programming.md
- APIs → fastapi-patterns.md
- DB → database-access.md
- Follow project structure from project-structure.md
Phase 3: Validate
- Run quality checks
ruff check . && ruff format --check . mypy src/ - Run tests with coverage
pytest -v --cov=src --cov-report=term-missing
Phase 4: Deploy
- Build and verify package
python -m build && twine check dist/* - 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 dependenciesReference 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+
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

