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.
npx agentmods add skills/chen3feng/agent-skills/python-modernization-sweepnpx skills add chen3feng/agent-skills --skill python-modernization-sweepgit clone --depth 1 https://github.com/chen3feng/agent-skillsWhat 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 | $0.00037 | $0.04798 |
| Opus 5 | $0.00018 | $0.02399 |
| Sonnet 5 | $0.00007 | $0.00960 |
| Haiku 4.5 | $0.00004 | $0.00480 |
Grade A, and why
python-modernization-sweep scanned grade A with 1 finding 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 2d ago.
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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
# PLW1510 on a subprocess.run that returns returncode. How it starts
The opening of the file, as written. The whole thing — 401 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python modernization sweep
When to use
You own a Python codebase that has just dropped support for an old
interpreter (Py2, or <3.10), and you want to actually use the
newer language features that dropping support unlocked: f-strings,
super(), PEP 585 generics, match statements, type hints, etc.
Signals this skill applies:
- The user says "全面拥抱 Py3 新特性", "modernize this codebase", "clean up the Py2 shim residue", or similar.
- The repo still has
super(Cls, self),class X(object):,'%s' % x,u'...'literals,IOError/EnvironmentError, etc. - There is no (or patchy) type-hint coverage, and the user wants to start adding hints.
This is different from [python-code-audit-sweep] (which finds latent bugs with pyflakes + grep and splits them into bug / dead-code / style PRs). A modernization sweep introduces no bug fixes; every change is either a pure AST-level rewrite or a new type annotation.
Problem
The naive approach is one giant "modernize.py" PR that does everything at once:
- f-string rewrites for every
%and.format()call (often hundreds of sites). super()call modernization.- Dropping
(object)base class. - Adding type hints to every public function.
- Killing
deps=[]mutable-default args. - Turning
except IOErrorintoexcept OSError.
Reviewers cannot tell what is mechanical and what is semantic. The type-hint portion alone needs slow review; the f-string portion is 300 identical rewrites that no human should read line by line. They merge into one blob, one reviewer blocks on the hardest single line, and the whole modernization stalls for weeks.
A second failure mode: guessing what's in the repo. Without a
tool-assisted census, you don't know whether f-string rewrites are
20 sites or 400, whether there are 3 mutable-default anti-patterns
or 167, whether super() rewrites are AST-safe or whether
something is calling a sibling class's __init__ manually. Picking
tools before counting is how you end up writing manual sed scripts
for something pyupgrade --py310-plus would do in one command.
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.
- 2d ago First seen · 401 lines · 37 tokens per session scan A 6ebb4a8a8317
python-modernization-sweep is a skill published in the GitHub repository chen3feng/agent-skills (5 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 37 tokens to every session and 4,798 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
ruff-docs
Ruff — fast Python linter and formatter in Rust. 900+ rules, Black-compatible formatter, LSP, CI/CD.
sql-reporting
Conventions and review steps for writing analytics SQL against the warehouse. Use whenever the task involves querying tables, building a report, or aggregating metrics.
html-ppt-hermes-cyber-terminal
OpenDesign + BYOK: choosing and wiring your own model, hands-on — cost, quality, and the routing decision. Built as a decision-grade AI literacy deck for engineers, IT, applied-AI teams.
verify-security
安全校验关卡。自动扫描代码安全漏洞,检测危险模式,确保安全决策有文档记录。当用户提到安全扫描、漏洞检测、安全审计、代码安全、OWASP、注入检测、敏感信息泄露时使用。在新建模块、安全相关变更、攻防任务、重构完成时自动触发。.
development
开发语言能力索引。Python、Go、Rust、TypeScript、Java、C++、Shell。当用户提到编程、开发、代码、语言时路由到此。.
post-build-flow
Handles workflow verification and setup after build-workflow succeeds, or when the message contains workflow-verification-follow-up or workflow-setup-required. Load after direct builds, when verificationReadiness requires action, or on orchestrator verify/setup follow-up turns.