Skip to content

swell-agents/coding-skills / skills/python-conventions

python-conventions

Verified

Apply Python conventions — uv, Ruff strict, mypy strict, pytest, pip-audit.

FileKindSize
SKILL.mdskill md1.4 KB
---
name: python-conventions
description: Apply Python conventions — uv, Ruff strict, mypy strict, pytest, pip-audit.
allowed-tools: Read, Edit, Write, Grep, Glob, Bash(uv *), Bash(uv run ruff *), Bash(uv run mypy *), Bash(uv run pytest *), Bash(uv run pip-audit *), Bash(uv run vulture *), Bash(uv run python *)
globs: "**/*.py"
paths: "**/*.py"
---

## Default Stack

If the repo doesn't define its own tooling, use:

- **UV** — dependency management, builds, running scripts
- **GitHub Actions** — CI/CD
- **Ruff** — linting and formatting, with these rule sets:
  - `E` (pycodestyle errors), `F` (pyflakes), `I` (isort), `UP` (pyupgrade)
  - `B` (flake8-bugbear), `SIM` (flake8-simplify), `PTH` (pathlib)
  - `PIE` (flake8-pie), `RUF` (ruff-specific), `T201` (no print)
  - `PLC0415` (import-outside-toplevel)
- **mypy** — strict mode (`strict = true`, `warn_return_any = true`, `warn_unused_configs = true`)
- **pytest** — testing (`pytest-cov`, `pytest-asyncio`)
- **vulture** — dead code detection
- **pip-audit** — dependency security audit

## Scratch Testing

**ALWAYS use `test.py`** in project root for:
- Ad-hoc testing, API calls, data exploration
- Any Python code that isn't a formal test or production code
- **NEVER use inline Python heredocs via Bash** (`uv run python3 << 'EOF'`)

Write code to `test.py`, then run with `uv run python test.py`. Comment out previous code — keeps history. Gitignored — never commit.
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall