python-expert

A guide for writing and reviewing modern Python code, covering types, project structure, packaging, asynchronous code, errors, and performance.

In plain words
What is it for?
Use it when creating Python modules or packages, reviewing code, structuring projects, optimizing programs, or debugging async and other Python issues.
Why use it?
It helps keep Python code clear, maintainable, and suitable for production use.

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/apexiq/skillsmith/python_expert
Any agent
npx skills add ApexIQ/skillsmith --skill python_expert
Clone the repo
git clone --depth 1 https://github.com/ApexIQ/skillsmith

Made for: Claude Code, Codex.

Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,152 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00047 $0.02152
Opus 5 $0.00023 $0.01076
Sonnet 5 $0.00009 $0.00430
Haiku 4.5 $0.00005 $0.00215

Measured yesterday against content hash 4df7ba48dc97, 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 1 finding 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 yesterday.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

response = requests.get(f"/api/users/{uid}") # blocks
.agent/skills/python_expert/SKILL.md · 271 lines

How it starts

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

🐍 Python Expert — Production-Grade Python

Philosophy: Python's simplicity is its power. Write code that reads like well-edited prose — explicit, flat, and simple. If your code needs a comment to explain what it does, rewrite the code.

1. When to Use This Skill

  • Writing new Python modules, packages, or scripts
  • Reviewing Python code for idioms and best practices
  • Structuring Python projects for packaging and distribution
  • Optimizing Python performance
  • Writing async Python code
  • Debugging Python-specific issues

2. Modern Python Idioms (3.10+)

Type Hints — Always

# GOOD: Fully typed
def fetch_users(
    team_id: str,
    active_only: bool = True,
    limit: int = 100,
) -> list[User]:
    """Fetch users for a team."""
    ...

# BAD: No types — impossible to maintain
def fetch_users(team_id, active_only=True, limit=100):
    ...

Structural Pattern Matching (3.10+)

# GOOD: Pattern matching for complex dispatch
match command:
    case {"action": "create", "data": data}:
        return create_item(data)
    case {"action": "delete", "id": item_id}:
        return delete_item(item_id)
    case {"action": action}:
        raise ValueError(f"Unknown action: {action}")
    case _:
        raise ValueError("Invalid command format")

Dataclasses & Pydantic Over Raw Dicts

# GOOD: Typed, validated, documented
from dataclasses import dataclass, field
from datetime import datetime

@dataclass
class User:
    id: str
    name: str
    email: str
    role: str = "member"
    created_at: datetime = field(default_factory=datetime.now)

# BETTER for APIs: Pydantic with validation
from pydantic import BaseModel, EmailStr, Field

class UserCreate(BaseModel):
    name: str = Field(min_length=2, max_length=100)
    email: EmailStr
    role: str = Field(default="member", pattern="^(member|admin|viewer)$")

# BAD: Raw dict — no validation, no docs, typo-prone
user = {"name": "Jane", "emial": "[email protected]"}  # typo? who knows

Read the full file on GitHub · 271 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. yesterday First seen · 271 lines · 47 tokens per session scan A 4df7ba48dc97

Subscribe to this mod's changes

python-expert is a skill published in the GitHub repository ApexIQ/skillsmith (5 stars, last pushed 5mo ago), licensed MIT. It adds 47 tokens to every session and 2,152 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

reconciliation

Reconcile accounts by comparing GL balances to subledgers, bank statements, or third-party data. Use when performing bank reconciliations, GL-to-subledger recs, intercompany reconciliations, or identifying and categorizing reconciling items.

openyak/openyak · 54 tokens

rove

Use when controlling Rove tasks, parallel coding attempts, hosted agent sessions, task lifecycle, or the daemon-owned issue tracker from a shell. Also the ONLY channel for messaging another agent session on this machine — rove api send, never a peer/MCP side channel.

Sma1lboy/rove · 56 tokens

motion-graphics

Use when the user wants a short, design-led motion graphic where motion is the message: kinetic typography, stat or number count-up, chart/data-viz hit, logo sting, brand lockup, lower-third, callout, social overlay, animated headline/tweet/news item, motion poster, or quick captured-page highlight. Usually under 10s…

Sma1lboy/rove · 161 tokens

release

Autonomously cut a Rove (@sma1lboy/rove) release end-to-end — detect the semver bump from pending changesets (flagging an upstream minor you didn't intend), run the release gates, bump/tag/push via scripts/release.sh, then poll the GitHub Actions Release workflow with gh until npm publish completes, diagnosing CI…

Sma1lboy/rove · 155 tokens

file-issue

Turn a rough idea, a bug, or a batch of unsolved problems into well-structured GitHub issue(s) and file them with gh, auto-classifying type + labels from the content (recommend, then confirm) and following Rove's conventions (beginner-friendly framing, concrete file pointers, an acceptance checklist, zero AI/Anthropic…

Sma1lboy/rove · 184 tokens

hyperframes-cli

HyperFrames CLI dev loop. Use when running npx hyperframes init, add, catalog, capture, lint, validate, inspect, layout, snapshot, preview, play, render, publish, lambda, doctor, browser, info, upgrade, skills, compositions, docs, benchmark, telemetry, transcribe, or remove-background, or when troubleshooting the…

Sma1lboy/rove · 101 tokens