Claude Cursor Skill

python-conventions

Python code conventions covering type hints, Ruff formatting/linting, mypy/pyright, pytest, async I/O, uv packaging, and dependency security scanning. Load when writing or reviewing Python code.

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download goldziher-ai-rulez-internal_builtins_languages_python_skills_python-conventions-ca967ad.zip · 0 KB
Part of goldziher/ai-rulez — 151 skills

Install

skills CLI npx skills add https://github.com/Goldziher/ai-rulez/tree/main/internal/builtins/languages/python/skills/python-conventions
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install goldziher-ai-rulez@llmmart
Git git clone https://github.com/Goldziher/ai-rulez.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole goldziher/ai-rulez collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

  • Python 3.10+, type hints on all public APIs, avoid Any — use precise types, generics, or typing.Protocol.
  • Formatting/linting: a fast linter/formatter (e.g., Ruff), zero warnings; strict static type checking (e.g., mypy or pyright). Security: a SAST tool (e.g., Bandit).
  • Testing: pytest with function-based tests, pytest-cov (80%+), hypothesis for property-based.
  • Error handling: specific exceptions only, never bare except:, contextlib.suppress for intentional ignoring.
  • Dataclasses or Pydantic for structured data — avoid raw dicts for known schemas.
  • pathlib.Path over os.path for filesystem operations. Google-style docstrings on public APIs.
  • Async: async/await for I/O, never mix blocking and async, asyncio.gather() for concurrency.
  • Package management: a fast, lockfile-based package manager (e.g., uv) with the lockfile committed, build with a PEP 517 backend (e.g., maturin or hatchling).
  • Security: pip-audit for dependency CVE scanning. Zero tolerance for critical/high vulnerabilities.
  • Logging: structured logging (key=value / JSON) — never f-strings in log calls.
  • Pattern matching (match/case) for multi-branch type dispatch (3.10+).
  • Anti-patterns: mutable default args, import *, global state, time.sleep in async.
Files (ai-rulez)
  • SKILL.md 1.5 KB
    ---
    name: python-conventions
    description: Python code conventions covering type hints, Ruff formatting/linting, mypy/pyright, pytest, async I/O, uv packaging, and dependency security scanning. Load when writing or reviewing Python code.
    ---
    
    - Python 3.10+, type hints on all public APIs, avoid `Any` — use precise types, generics, or `typing.Protocol`.
    - Formatting/linting: a fast linter/formatter (e.g., Ruff), zero warnings; strict static type checking (e.g., mypy or pyright). Security: a SAST tool (e.g., Bandit).
    - Testing: `pytest` with function-based tests, `pytest-cov` (80%+), `hypothesis` for property-based.
    - Error handling: specific exceptions only, never bare `except:`, `contextlib.suppress` for intentional ignoring.
    - Dataclasses or Pydantic for structured data — avoid raw dicts for known schemas.
    - `pathlib.Path` over `os.path` for filesystem operations. Google-style docstrings on public APIs.
    - Async: `async`/`await` for I/O, never mix blocking and async, `asyncio.gather()` for concurrency.
    - Package management: a fast, lockfile-based package manager (e.g., uv) with the lockfile committed, build with a PEP 517 backend (e.g., maturin or hatchling).
    - Security: `pip-audit` for dependency CVE scanning. Zero tolerance for critical/high vulnerabilities.
    - Logging: structured logging (key=value / JSON) — never f-strings in log calls.
    - Pattern matching (`match`/`case`) for multi-branch type dispatch (3.10+).
    - Anti-patterns: mutable default args, `import *`, global state, `time.sleep` in async.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related