agentleFS
rommelporrasrommelporras/kiro-config/skills/python-audit/SKILL.md

python-audit

Skill13 starsChanged 7 months agoMITView on GitHub

Use when reviewing Python code quality — run ruff, check types, verify tests, flag common issues. Trigger on "audit", "code quality", "lint", "check code".

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After automated tools pass, check these (tools can't catch them):

    line 35

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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 Audit

Quick quality check for Python projects. Run the automated tools, flag what they miss.

Steps

1. Run automated checks

# Lint
uv run ruff check <package>/ tests/

# Format check
uv run ruff format --check <package>/ tests/

# Tests with coverage
uv run pytest tests/ -q

# Type check (if mypy configured)
uv run mypy <package>/

# Security scan
uv run bandit -r <package>/ -q

Fix any failures before proceeding. If ruff has auto-fixable issues, run ruff check --fix.

2. Manual review checklist

After automated tools pass, check these (tools can't catch them):

Error handling:

  • No silent except: pass or except Exception: pass — every handler logs or re-raises
  • Broad except Exception: has a justifying comment
  • Custom exceptions defined centrally, inherit from proper base

Design:

  • No functions over ~30 lines — suggest extraction
  • No functions with 5+ parameters — suggest config objects
  • No deep nesting (>3 levels) — suggest guard clauses
  • No mutable default arguments (def foo(items=[]))

Types:

  • All public functions have type annotations (params + return)
  • Modern syntax: X | Y, list[str], not Union, List
  • No unparameterized generics (deque → deque[str])

Tests:

  • Every public module has a test file
  • Coverage didn't drop from last commit
  • No print() in tests — use assertions
  • No time.sleep() for synchronization — use events/polling

Concurrency:

  • ThreadPoolExecutor has explicit max_workers — never unbounded
  • threading.Event checked in loops with event.wait(timeout=) — not busy-spinning
  • subprocess.run() has timeout= parameter — no hanging on external commands
  • No subprocess with shell=True — use args list for safety
  • No bare thread.start() without join or executor context manager

Security (beyond bandit):

  • No eval() or exec() on user input
  • No pickle.load() on untrusted data
  • No hardcoded credentials, tokens, or connection strings
  • subprocess calls use args list, never shell=True with user input
  • HTTP requests use https://, not http:// for external APIs
  • SQL queries use parameterized queries, never f-strings

3. Report

For each finding: file, line, what's wrong, suggested fix, priority (High/Medium/Low).

Group by: automated tool failures first, then manual findings.

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.