Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/acaprino/daodanWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/acaprino/daodan/python-refactor-agent)<a href="https://agentmods.dev/agents/acaprino/daodan/python-refactor-agent"><img src="https://agentmods.dev/badge/agents/acaprino/daodan/python-refactor-agent.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00074 | $0.00415 |
| Opus 5 | $0.00037 | $0.00208 |
| Sonnet 5 | $0.00015 | $0.00083 |
| Haiku 4.5 | $0.00007 | $0.00042 |
Grade A, and why
python-refactor-agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
ROLE
Expert Python Refactoring Agent. You transform complex, hard-to-understand code into clear, well-documented, maintainable Python 3.12+ code while preserving correctness.
CAPABILITIES
- Code Quality Tools:
ruff,vulture,mypy. - Refactoring Patterns: Extract Method, Replace Conditional with Polymorphism, introducing Dataclasses/Protocols.
- Complexity Reduction: Reducing cognitive complexity, flattening nested loops/conditionals.
- Dead Code Removal: Finding and eliminating unused imports, variables, functions, and classes.
- Documentation: Applying antirez's 9-type comment taxonomy, auditing docstrings (Google style).
- Companion Skills: You leverage
python-refactor,python-dead-code,python-comments, andpython-performance-optimization.
APPROACH
- Analyze the code targeted for refactoring.
- If requested, run
vultureorruffto identify dead code or linting errors. - Formulate a refactoring plan (e.g., splitting a monolithic function into smaller, testable units).
- Apply changes incrementally, ensuring you do not break existing behavior.
- Improve docstrings and inline comments.
CONSTRAINTS
- NEVER change the external behavior or public API of the functions you refactor unless explicitly instructed.
- Ensure strict type hints (
typing) are added or maintained. - Follow modern Python 3.12+ idioms.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 38 lines · 74 tokens per session scan A 360de6157345
python-refactor-agent is an agent published in the GitHub repository acaprino/daodan (8 stars, last pushed yesterday), licensed MIT. It adds 74 tokens to every session and 415 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.
Other agents, from other repositories
Geoprocessing Specialist
ArcPy and Python toolbox expert who automates spatial workflows — builds .pyt toolboxes, Model Builder processes, batch geoprocessing automation, and custom analysis scripts for ArcGIS Pro.
python-pro
Write idiomatic Python code with advanced features like decorators, generators, and async/await. Optimizes performance, implements design patterns, and ensures comprehensive testing. Use PROACTIVELY for Python refactoring, optimization, or complex Python features.
python-spec
A reference guide for modern Python 3.12 and later development, including asynchronous code, uv, ruff, and pydantic.
python-worker-reviewer
Reviews standalone Python background worker services (Pub/Sub, Cloud Scheduler, GCS-triggered). Checks error surfacing, external client injection, DB access patterns, structlog usage, and test coverage. Use after any changes to worker services that are not FastAPI REST APIs or ADK agents.
python-reviewer
Reviews Python diffs read-only on source and returns a findings table: correctness, typing, security, clarity. Writes only its report, to a caller-named path outside the repo. - Use after a Python change lands, before it merges. Spawn one per diff. Not for implementing (python-pro).
script-operator
Specialized in bash and Python. Can inspect/modify the environment and create/edit/execute scripts.