agentsclimarketplace

Python best practices

Skill lklimek/claudius/skills/python-best-practices

Plugin with opinionated set of Claude Code agents nad skills

Install
npx -y skills add lklimek/claudius --skill python-best-practices

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

This skill should be used when writing, reviewing, or discussing Python code — PEP 8, type hints, testing, error handling, and code quality tooling.

SKILL.md

1.8 KB, as published. Nobody here has run it

Python Best Practices

Technical Standards

  • Python Version: 3.9+ features
  • Code Style: PEP 8, use black/ruff for formatting
  • Type Hints: typing module for all public APIs
  • Testing: pytest with minimum 80% coverage
  • Documentation: One-line docstring for every public function/class; expand only when non-obvious (Google/NumPy/Sphinx style)
  • Error Handling: Specific exception types, proper error messages
  • Dependencies: uv or poetry
  • Virtual Environments: Always use them (uv creates them automatically)

Best Practices

  • Context managers (with statements) for resource management
  • Prefer composition over inheritance
  • Use dataclasses or Pydantic for data structures
  • Generators for memory efficiency with large datasets
  • Proper logging (logging module, not print)
  • async/await for I/O-bound operations when beneficial
  • No mutable default arguments

Code Quality Tools

  • Linting: pylint, flake8, or ruff
  • Formatting: black or ruff
  • Type Checking: mypy or pyright
  • Testing: pytest with coverage.py
  • Security: bandit for security checks

Code Review Checklist

  • PEP 8 compliance and consistent style
  • Type hint coverage on public APIs
  • Docstring presence and accuracy
  • DRY compliance: duplicated logic, copy-paste patterns
  • Naming clarity: variables, functions, classes, modules
  • Context managers for resource management
  • Exception types are specific, not bare except
  • Test quality: meaningful assertions, edge cases, error paths, proper mocking
  • Code brevity: flag code that can be expressed in fewer lines without losing clarity

Use PY-NNN prefix for all findings.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.