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".
In this repository19 other files it gives its agents.
- agent-auditSkill
- codebase-auditSkill
- commitSkill
- design-and-specSkill
- dispatching-parallel-agentsSkill
- doc-driftSkill
- execution-planningSkill
- explain-codeSkill
- post-implementationSkill
- pushSkill
- receiving-code-reviewSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- terraform-auditSkill
- test-driven-developmentSkill
- trace-codeSkill
- typescript-auditSkill
- verification-before-completionSkill
- writing-plansSkill
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
- Distinctive: line 35
After automated tools pass, check these (tools can't catch them):
≈ “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.
Files
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>/ -qFix 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: passorexcept 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], notUnion,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:
ThreadPoolExecutorhas explicitmax_workers— never unboundedthreading.Eventchecked in loops withevent.wait(timeout=)— not busy-spinningsubprocess.run()hastimeout=parameter — no hanging on external commands- No
subprocesswithshell=True— use args list for safety - No bare
thread.start()without join or executor context manager
Security (beyond bandit):
- No
eval()orexec()on user input - No
pickle.load()on untrusted data - No hardcoded credentials, tokens, or connection strings
subprocesscalls use args list, nevershell=Truewith user input- HTTP requests use
https://, nothttp://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.
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
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.

