Files
dotfiles/.config/opencode/skills/python/SKILL.md
T
colem a4fc747df2 feat(opencode): add language-specific coding skills
- add conventions for Bash, C#, Go, Python, and TypeScript
- add frontend guidance for HTMX, PrimeVue, and Vue
- document formatting, typing, testing, async, and framework-specific practices
- reference official documentation for framework API details
2026-08-11 15:28:09 -05:00

971 B

name, description
name description
python Python conventions (PEP 8, ruff, type hints). Use when editing .py files.

Python Conventions

Style

  • Follow PEP 8; run ruff check and ruff format for linting and formatting.
  • Let ruff manage line length and import ordering; do not hand-format against it.

Typing

  • Add type hints on all function signatures; prefer modern syntax (list[int], X | None) on supported Python versions.
  • Use dataclasses (or Pydantic where validation is required) for structured data.
  • Prefer an explicit exception hierarchy over bare except:.

Idioms

  • Prefer pathlib.Path over os.path.
  • Use f-strings for interpolation; use the logging module with structured handlers instead of print in libraries.
  • Prefer comprehensions and generator expressions over manual loops where readability is preserved.

Testing

  • Use unittest (or pytest if the project adopts it); mirror the source layout under a tests/ directory.