python

A set of best practices for Python projects, including project setup, type annotations, style, file handling, and asynchronous code. Python is a programming language commonly used for web services, automation, and data work.

In plain words
What is it for?
Use it when setting up Python projects, writing typed functions and classes, managing dependencies, formatting code, handling files, or building asynchronous features.
Why use it?
It helps keep Python code consistent, checked for type errors, and easier to maintain. It also replaces older project-configuration and formatting approaches with current ones.

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/andresquirogadev/skillsense/python
Any agent
npx skills add andresquirogadev/skillsense --skill python
Clone the repo
git clone --depth 1 https://github.com/andresquirogadev/skillsense

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 545 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.00000 $0.00545
Opus 5 $0.00000 $0.00272
Sonnet 5 $0.00000 $0.00109
Haiku 4.5 $0.00000 $0.00055

Measured yesterday against content hash b4f29790fc1d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

python 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 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.

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.

packages/catalog/skills/python/SKILL.md · 46 lines

How it starts

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

Python Skill

You are working on a Python project. Apply these best practices.

Project Setup

  • Use pyproject.toml for all project metadata and tool configuration — avoid legacy setup.py / setup.cfg.
  • Use uv or poetry for dependency management; commit the lockfile.
  • Use Python 3.12+ features: type parameter syntax (type Point = tuple[int, int]), tomllib, match statements.

Type Hints

  • Annotate all function signatures and class attributes.
  • Use built-in generics directly: list[str], dict[str, int], tuple[int, ...] (no need to import from typing in 3.9+).
  • Use X | Y union syntax instead of Union[X, Y] (Python 3.10+).
  • Use TypedDict for dict shapes; use dataclasses.dataclass or Pydantic models for structured data.
  • Run mypy --strict or pyright in CI.

Code Style

  • Follow PEP 8; use ruff for linting and formatting (replaces flake8 + black + isort).
  • Use f-strings for interpolation — not % formatting or .format().
  • Use pathlib.Path instead of os.path for file system operations.
  • Use context managers (with statements) for resources (files, DB connections, locks).

Async

  • Use asyncio with async def / await for I/O-bound concurrency.
  • Use asyncio.gather() for concurrent coroutines.
  • Use anyio or trio for more structured concurrency when needed.
  • Add from __future__ import annotations to defer evaluation of annotations in async code (Python 3.9).

Testing

  • Use pytest with pytest-asyncio for async tests.
  • Use tmp_path fixture for temporary files — never use hardcoded paths in tests.
  • Use monkeypatch to override environment variables and module attributes.
  • Use pytest.raises(ValueError, match="…") for expected exception messages.

Security

  • Never use eval() or exec() with user input.
  • Use secrets module for cryptographic random values — not random.
  • Validate and sanitize all external inputs; use Pydantic for structured validation.
  • Pin dependencies in requirements.txt or the lockfile; run pip-audit or safety in CI.

Read the full file on GitHub · 46 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 · 46 lines · 0 tokens per session scan A b4f29790fc1d

Subscribe to this mod's changes

python is a skill published in the GitHub repository andresquirogadev/skillsense (2 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 545 tokens. 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-31.

Related

Other skills, from other repositories

paseo-plugin

Build and manage trusted local Paseo plugins. Use when the user asks to create, edit, install, reload, enable, disable, remove, or troubleshoot a Paseo plugin; add a native surface or sidebar item; use Paseo from plugin code; add plugin RPCs; or contribute composer attachments.

getpaseo/paseo · 66 tokens

paseo-help

Answer questions about the Paseo product and app, including setup, configuration, connectivity, providers, workspaces, updates, logs, and troubleshooting. Use when a user inside Paseo asks how Paseo works, how to configure it, or why something is broken; use the paseo skill instead to operate agents and workspaces…

getpaseo/paseo · 75 tokens

paseo

Paseo reference for managing projects, workspaces, workspace scripts, agents, schedules, and heartbeats.

getpaseo/paseo · 26 tokens

paseo-advisor

Spin up a single agent as an advisor — second opinion on the current task. Use when the user says "advisor", "second opinion", "what does X think", or wants an outside take without delegating the work itself.

getpaseo/paseo · 52 tokens

paseo-committee

Form a committee of two high-reasoning agents to step back, do root cause analysis, and produce a plan. Use when stuck, looping, tunnel-visioning, or facing a hard planning problem.

getpaseo/paseo · 48 tokens

paseo-handoff

Hand off the current task to another agent with full context. Use when the user says "handoff", "hand off", "hand this to", or wants to pass work to another agent.

getpaseo/paseo · 45 tokens