pythonPython coding guidelines and best practices. Use when writing, reviewing, or refactoring Python code. Enforces PEP 8 style, syntax validation via py_compile, unit test execution, modern Python versions only (no EOL), uv for dependency management when available, and idiomatic Pythonic patterns.
Install via ClawdBot CLI:
clawdbot install adarshdigievo/python# Syntax check (always)
python -m py_compile *.py
# Run tests if present
python -m pytest tests/ -v 2>/dev/null || python -m unittest discover -v 2>/dev/null || echo "No tests found"
# Format check (if available)
ruff check . --fix 2>/dev/null || python -m black --check . 2>/dev/null
Check for uv first, fall back to pip:
# Prefer uv if available
if command -v uv &>/dev/null; then
uv pip install <package>
uv pip compile requirements.in -o requirements.txt
else
pip install <package>
fi
For new projects with uv: uv init or uv venv && source .venv/bin/activate
# ✅ List/dict comprehensions over loops
squares = [x**2 for x in range(10)]
lookup = {item.id: item for item in items}
# ✅ Context managers for resources
with open("file.txt") as f:
data = f.read()
# ✅ Unpacking
first, *rest = items
a, b = b, a # swap
# ✅ EAFP over LBYL
try:
value = d[key]
except KeyError:
value = default
# ✅ f-strings for formatting
msg = f"Hello {name}, you have {count} items"
# ✅ Type hints
def process(items: list[str]) -> dict[str, int]:
...
# ✅ dataclasses/attrs for data containers
from dataclasses import dataclass
@dataclass
class User:
name: str
email: str
active: bool = True
# ✅ pathlib over os.path
from pathlib import Path
config = Path.home() / ".config" / "app.json"
# ✅ enumerate, zip, itertools
for i, item in enumerate(items):
...
for a, b in zip(list1, list2, strict=True):
...
# ❌ Mutable default arguments
def bad(items=[]): # Bug: shared across calls
...
def good(items=None):
items = items or []
# ❌ Bare except
try:
...
except: # Catches SystemExit, KeyboardInterrupt
...
except Exception: # Better
...
# ❌ Global state
# ❌ from module import *
# ❌ String concatenation in loops (use join)
# ❌ == None (use `is None`)
# ❌ len(x) == 0 (use `not x`)
test_.py, test functions test_python -m pytest -vdef fetch_user(user_id: int, include_deleted: bool = False) -> User | None:
"""Fetch a user by ID from the database.
Args:
user_id: The unique user identifier.
include_deleted: If True, include soft-deleted users.
Returns:
User object if found, None otherwise.
Raises:
DatabaseError: If connection fails.
"""
py_compile)pytest).format() or %pathlib for file pathsGenerated Mar 1, 2026
A development team uses this skill to enforce consistent Python coding standards during peer reviews, ensuring all new code adheres to PEP 8, includes type hints, and avoids anti-patterns before merging into the main branch. This reduces technical debt and improves maintainability across projects.
An online learning platform integrates this skill to automatically validate student-submitted Python assignments, checking for syntax errors, style compliance, and modern Python features. It provides instant feedback, helping learners adopt best practices early in their coding journey.
A startup building a minimum viable product (MVP) in Python applies this skill to establish a clean codebase from the start, using uv for dependency management and enforcing testing and documentation standards. This accelerates development while ensuring scalability and code quality.
Maintainers of an open-source Python library use this skill to automate code quality checks in CI/CD pipelines, ensuring contributions meet style guidelines, pass tests, and use modern Python versions. This streamlines collaboration and maintains project reliability.
A data science team adopts this skill to standardize Python scripts for data analysis and machine learning, enforcing best practices like context managers for file I/O and type hints to improve code readability and reproducibility in research projects.
Offer a cloud-based service that integrates this skill into development workflows, providing automated code reviews, style enforcement, and testing for Python projects. Revenue is generated through subscription tiers based on team size and feature access.
Provide expert consulting services to help organizations adopt these Python guidelines, including workshops, code audits, and custom integration into existing systems. Revenue comes from hourly rates or project-based contracts.
Develop a plugin for popular IDEs like VS Code or PyCharm that embeds this skill, offering basic code linting and suggestions for free, with advanced features like automated refactoring and detailed reports available in a paid version.
💬 Integration Tip
Integrate this skill into CI/CD pipelines using tools like GitHub Actions or GitLab CI to automatically run syntax checks and tests on every commit, ensuring consistent code quality without manual intervention.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Provides a 7-step debugging protocol plus language-specific commands to systematically identify, verify, and fix software bugs across multiple environments.
A comprehensive skill for using the Cursor CLI agent for various software engineering tasks (updated for 2026 features, includes tmux automation guide).
Write, run, and manage unit, integration, and E2E tests across TypeScript, Python, and Swift using recommended frameworks.
Control and operate Opencode via slash commands. Use this skill to manage sessions, select models, switch agents (plan/build), and coordinate coding through Opencode.
Coding style memory that adapts to your preferences, conventions, and patterns for consistent coding.