agentleFS
abdullahkhawerabdullahkhawer/devops-skills/skills/python-linting/SKILL.md

python-linting

Skill8 starsChanged 6 months agoApache-2.0View on GitHub

Lint and format Python code using ruff, flake8, black, and mypy according to standard conventions. Use when asked to lint, format, or check style/type issues in Python files.

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run this skill when asked to lint, format, check style, or check types for Python code.

    line 8
  2. Distinctive:

    Check which linting/formatting tools are configured or installed, in order of preference:

    line 12
  3. Very specific:

    Prefer ruff if configured or installed — it replaces flake8, isort, and much of pylint with a single fast tool.

    line 22
  4. Very specific:

    Only run auto-fix commands after showing the user what will change and getting explicit confirmation.

    line 77
  5. Very specific:

    Import order: standard library, then third-party, then local — grouped and alphabetized (isort/ruff default).

    line 84
  6. Distinctive:

    No unused imports or variables.

    line 86
  7. Very specific:

    No bare except: clauses — always catch specific exceptions.

    line 87
  8. Distinctive:

    NEVER install a new linter, formatter, or dependency without asking the user first.

    line 91
  9. Distinctive:

    Always run in check/diff mode first — only apply auto-fixes after the user confirms.

    line 92
  10. Distinctive:

    If no configuration exists, ask the user whether to add one or use tool defaults, rather than silently picking one.

    line 94
  11. Distinctive:

    If a finding requires a logic change (not just style), explain the risk before suggesting a fix.

    line 96

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Python Linting Skill

Run this skill when asked to lint, format, check style, or check types for Python code.

Step 1 — Detect available tooling

Check which linting/formatting tools are configured or installed, in order of preference:

# Config files (indicate which tool the project already uses)
ls pyproject.toml setup.cfg .flake8 mypy.ini 2>/dev/null

# Installed tools
which ruff black flake8 mypy isort 2>/dev/null

Prefer ruff if configured or installed — it replaces flake8, isort, and much of pylint with a single fast tool. Fall back to flake8 + black + isort if ruff is not available. Do not install new tools without asking the user first.


Step 2 — Run linting (read-only check)

# Preferred
ruff check .

# Fallback
flake8 .

Report all findings grouped by file, with line numbers and rule codes.


Step 3 — Run formatting check

# Preferred
ruff format --check --diff .

# Fallback
black --check --diff .
isort --check-only --diff .

Show the proposed diff to the user before applying any formatting changes.


Step 4 — Run type checking (if type hints are used)

mypy .

Skip this step if the project has no type hints and no mypy configuration.


Step 5 — Apply fixes (only with user confirmation)

# Preferred
ruff check --fix .
ruff format .

# Fallback
black .
isort .

Only run auto-fix commands after showing the user what will change and getting explicit confirmation. Never auto-fix mypy type errors — these require manual code changes.


Standard conventions enforced

  • Line length: 88 (black/ruff default) or 79 (PEP 8 strict) — follow whatever the project's config specifies; do not override it.
  • Import order: standard library, then third-party, then local — grouped and alphabetized (isort/ruff default).
  • Naming: snake_case for functions/variables, PascalCase for classes, UPPER_SNAKE_CASE for constants (PEP 8).
  • No unused imports or variables.
  • No bare except: clauses — always catch specific exceptions.

Rules

  • NEVER install a new linter, formatter, or dependency without asking the user first.
  • Always run in check/diff mode first — only apply auto-fixes after the user confirms.
  • Respect the project's existing configuration (pyproject.toml, setup.cfg, .flake8) — do not suggest a different tool or ruleset than what is already configured.
  • If no configuration exists, ask the user whether to add one or use tool defaults, rather than silently picking one.
  • Report the exact command run and its full output — do not summarize away findings.
  • If a finding requires a logic change (not just style), explain the risk before suggesting a fix.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.