python-expert

A Python coding guide for writing, debugging, explaining, and reviewing Python code using common style and design practices.

In plain words
What is it for?
Use it to create or review Python 3.10+ code, add type hints, handle errors, and apply standard library practices.
Why use it?
It helps keep Python code readable, consistent, and safer to maintain.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/personamanagmentlayer/pcl/python-expert
Any agent
npx skills add personamanagmentlayer/pcl --skill python-expert
Clone the repo
git clone --depth 1 https://github.com/personamanagmentlayer/pcl

Made for: Claude Code, Codex.

Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,134 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00038 $0.01134
Opus 5 $0.00019 $0.00567
Sonnet 5 $0.00008 $0.00227
Haiku 4.5 $0.00004 $0.00113

Measured 2d ago against content hash 4b3497954fcd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

python-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/examples/skills/python-expert/SKILL.md · 198 lines

How it starts

The opening of the file, as written. The whole thing — 198 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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:

  1. Follow PEP 8 Style Guide

    • Use Black formatter defaults (88 character line length)
    • Meaningful, descriptive variable names
    • Keep functions focused (single responsibility principle)
  2. Type Hints Everywhere

    • Always include type annotations for function signatures
    • Import from typing module: List, Dict, Optional, Union, etc.
    • Use TypeAlias for complex type definitions
    • Prefer explicit over implicit types
  3. Robust Error Handling

    • Use specific exception types (ValueError, TypeError, KeyError)
    • Provide helpful, actionable error messages
    • Clean up resources with context managers (with statement)
    • Avoid bare except: clauses
  4. Modern Python Idioms

    • Use f-strings for string formatting
    • Prefer pathlib.Path over os.path
    • Use dataclasses or Pydantic for data structures
    • Write docstrings for public functions/classes (Google or NumPy style)
    • Leverage @property for 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

Read the full file on GitHub · 198 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 198 lines · 38 tokens per session scan A 4b3497954fcd

Subscribe to this mod's changes

python-expert is a skill published in the GitHub repository personamanagmentlayer/pcl (41 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 38 tokens to every session and 1,134 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

google-agents-cli-deploy

This skill should be used when the user wants to "deploy an agent", "deploy my ADK agent", "set up CI/CD", "configure secrets", "troubleshoot a deployment", or needs guidance on Agent Runtime, Cloud Run, or GKE deployment targets, or binding an agent to an Agent Gateway. Covers deployment workflows, service accounts…

google/agents-cli · 153 tokens

google-agents-cli-eval

This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Agent Platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset…

google/agents-cli · 149 tokens

google-agents-cli-workflow

This skill should be used when the user wants to "develop an agent", "build an agent using ADK", "run the agent locally", "debug agent code", "test an agent", "deploy an agent", "publish an agent", "monitor an agent", or needs the ADK (Agent Development Kit) development lifecycle and coding guidelines. Entrypoint for…

google/agents-cli · 126 tokens

google-agents-cli-observability

This skill should be used when the user wants to "set up tracing", "monitor my agent", "configure logging", "add observability", "debug production traffic", or needs guidance on monitoring deployed agents, including ADK (Agent Development Kit) agents. Covers Cloud Trace, prompt-response logging, BigQuery Agent…

google/agents-cli · 127 tokens

google-agents-cli-publish

This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini Enterprise", "publish to Gemini Enterprise", or needs guidance on the agents-cli publish gemini-enterprise command. Also use when the user wants to "manage agents in Agent Registry"…

google/agents-cli · 141 tokens

google-agents-cli-scaffold

This skill should be used when the user wants to "create an agent project", "start a new ADK project", "build me a new agent", "add CI/CD to my project", "add deployment", "enhance my project", or "upgrade my project". Part of the agents-cli skills suite. Covers agents-cli scaffold create, scaffold enhance, and…

google/agents-cli · 135 tokens