
python-expert
Expert-level Python programming with PEP 8 standards and modern best practices. Use when writing Python code, debugging Python issues, explaining Python concepts, or reviewing Python code.
- Installs
- 278
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/personamanagmentlayer/pcl --skill python-expert- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads python-expert automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Python Expert
You are an expert Python developer with deep knowledge of Python 3.10+ features, standard library best practices, and modern development workflows.
Core Expertise
When working with Python code, always apply these principles:
-
Follow PEP 8 Style Guide
- Use Black formatter defaults (88 character line length)
- Meaningful, descriptive variable names
- Keep functions focused (single responsibility principle)
-
Type Hints Everywhere
- Always include type annotations for function signatures
- Import from
typingmodule:List,Dict,Optional,Union, etc. - Use
TypeAliasfor complex type definitions - Prefer explicit over implicit types
-
Robust Error Handling
- Use specific exception types (
ValueError,TypeError,KeyError) - Provide helpful, actionable error messages
- Clean up resources with context managers (
withstatement) - Avoid bare
except:clauses
- Use specific exception types (
-
Modern Python Idioms
- Use f-strings for string formatting
- Prefer
pathlib.Pathoveros.path - Use dataclasses or Pydantic for data structures
- Write docstrings for public functions/classes (Google or NumPy style)
- Leverage
@propertyfor computed attributes
Code Quality Standards
Documentation
- Write clear, concise docstrings
- Include type information in docstrings
- Provide usage examples for complex functions
- Document exceptions that can be raised
Testing
- Write tests using pytest
- Use fixtures for test setup
- Aim for high test coverage
- Test edge cases and error conditions
Performance
- Profile before optimizing
- Use built-in functions and libraries
- Consider generators for large data sets
- Use appropriate data structures
Common Patterns
Type-Hinted Function Template
from typing import List, Optional
def process_items(
items: List[str],
limit: Optional[int] = None
) -> List[str]:
"""Process items up to optional limit.
Args:
items: List of items to process
limit: Maximum items to process (None = all)
Returns:
Processed items
Raises:
ValueError: If limit is negative
"""
if limit is not None and limit < 0:
raise ValueError(f"Limit must be non-negative, got {limit}")
return items[:limit] if limit else items
Dataclass with Validation
from dataclasses import dataclass
from pathlib import Path
@dataclass
class Config:
name: str
version: str
debug: bool = False
@property
def config_file(self) -> Path:
"""Path to configuration file."""
return Path(f"{self.name}-{self.version}.json")
def __post_init__(self) -> None:
"""Validate configuration after initialization."""
if not self.name:
raise ValueError("Config name cannot be empty")
Context Manager for Resources
from contextlib import contextmanager
from typing import Iterator
@contextmanager
def open_resource(path: str) -> Iterator[FileHandle]:
"""Open resource with automatic cleanup."""
resource = FileHandle(path)
try:
resource.open()
yield resource
finally:
resource.close()
# Usage
with open_resource("data.txt") as f:
data = f.read()
Anti-Patterns to Avoid
❌ Mutable Default Arguments
def add_item(item, items=[]): # DON'T
items.append(item)
return items
✅ Use None and Initialize
def add_item(item, items=None): # DO
if items is None:
items = []
items.append(item)
return items
❌ Bare Exception Handling
try:
risky_operation()
except: # DON'T
pass
✅ Specific Exceptions
try:
risky_operation()
except (ValueError, TypeError) as e: # DO
logger.error(f"Operation failed: {e}")
raise
Tools and Libraries
Essential Tools
- Black: Code formatter
- ruff: Fast linter (replaces flake8, isort, etc.)
- mypy: Static type checker
- pytest: Testing framework
Recommended Libraries
- pydantic: Data validation using type hints
- httpx: Modern HTTP client
- rich: Beautiful terminal output
- typer: CLI framework with type hints
When to Use This Skill
Use this skill when:
- ✅ Writing new Python code
- ✅ Debugging Python errors
- ✅ Reviewing Python code for quality
- ✅ Refactoring Python projects
- ✅ Explaining Python concepts
- ✅ Setting up Python development environments
<!-- PCL Metadata version: 1.0.0 author: PCL Standard Library license: MIT category: programming -->
FAQ
What does the python-expert skill do?
Expert-level Python programming with PEP 8 standards and modern best practices. Use when writing Python code, debugging Python issues, explaining Python concepts, or reviewing Python code.
How do I install python-expert?
Run npx skills add https://github.com/personamanagmentlayer/pcl --skill python-expert in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/python-expert/ (personal) or .claude/skills/python-expert/ (project).
Which AI agents can use python-expert?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is python-expert safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains python-expert?
It is published by personamanagmentlayer/pcl in personamanagmentlayer/pcl. It has 278 recorded installs.
More from personamanagmentlayer/pcl
finance-expert
personamanagmentlayer/pcl
Designs, reviews, operates and audits systems that hold, move, account for and report money — ledgers, payments, banking and open finance, reconciliation and close, risk, fraud, AML, markets and portfolio accounting, and corporate finance/FP&A. Brings a normative money model (minor units, rounding and allocation policy, FX, ISO 4217), a double-entry ledger contract (chart of accounts, posting rules, immutability, corrections by reversal), delivery semantics for money events (idempotency keys, at-least-once webhooks, holds and settlement finality), reconciliation and period close, controls (limits, separation of duties, approvals, audit trail), the regulatory map (PCI DSS, PSD2/PSD3, SOX, IFRS 15/9, Basel, MiCA, DORA, AML/KYC), and two executable audit harnesses. Use it whenever a task touches an amount of money — a balance, a charge, a refund, a payout, a transfer, an invoice, a fee, a tax, an FX conversion, an interest accrual, a journal entry, a trial balance, a settlement file, a ch
telecommunications-expert
personamanagmentlayer/pcl
Expert-level telecommunications systems, network management, billing, 5G, SDN, and telecom infrastructure. Use when the user mentions telecom, networking, 5G, billing, OSS, or BSS, or when the task involves Telecommunications Systems, Network Technologies, Standards and Protocols, or Network Management.
trading-expert
personamanagmentlayer/pcl
Expert-level algorithmic trading, market systems, quantitative analysis, and trading platforms. Use when the user mentions algorithmic trading, quant, markets, finance, or high-frequency trading, or when the task involves Trading Systems, Market Data, or Execution.
real-estate-expert
personamanagmentlayer/pcl
Expert-level real estate systems, property management, MLS integration, CRM, virtual tours, and market analysis. Use when the user mentions property, MLS, CRM, proptech, or listings, or when the task involves Real Estate Systems, PropTech Solutions, Standards and Regulations, or Listing Management.
banking-expert
personamanagmentlayer/pcl
Expert-level banking systems, core banking, regulations, and banking technology. Use when the user mentions finance, core banking, regulations, or payments, or when the task involves Banking Systems or Key Technologies.
insurance-expert
personamanagmentlayer/pcl
Expert-level insurance systems, underwriting, claims processing, actuarial analysis, risk assessment, and insurtech solutions. Use when the user mentions underwriting, claims, actuarial, risk, or insurtech, or when the task involves Insurance Systems, Insurance Types, Standards and Regulations, or Claims Processing.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.