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 skills add arnabdeypolimi/claude_code_setup --skill code-refactorgit clone --depth 1 https://github.com/arnabdeypolimi/claude_code_setupWrote 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/skills/arnabdeypolimi/claude_code_setup/code-refactor)<a href="https://agentmods.dev/skills/arnabdeypolimi/claude_code_setup/code-refactor"><img src="https://agentmods.dev/badge/skills/arnabdeypolimi/claude_code_setup/code-refactor/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/arnabdeypolimi/claude_code_setup/code-refactor"><img src="https://agentmods.dev/badge/skills/arnabdeypolimi/claude_code_setup/code-refactor.svg" alt="Reviewed on agentmods" width="80" 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.00085 | $0.00783 |
| Opus 5.5 | $0.00034 | $0.00313 |
| Sonnet 5.5 | $0.00017 | $0.00157 |
| Haiku 4.5 | $0.00009 | $0.00078 |
Grade A, and why
code-refactor 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 1mo 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.
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.
How it starts
The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code Refactor Skill
Systematically refactor Python code to match this repo's standards.
Workflow
1. Read Target Code
Read every file in the target module. Never propose changes to code you haven't read.
2. Audit Against Checklist
Run through references/checklist.md and note every violation. Group them by category so the user can see the full picture before any edits are made.
3. Run Static Analysis
uv run ruff check <target>
uv run mypy <target>
Report all errors as part of the audit — these are additional violations on top of the checklist.
4. Apply Fixes
Apply all fixes. Prefer the Edit tool over Write for existing files (smaller diffs, easier review). Make all independent edits in parallel.
Priority order (highest impact first):
- Type safety — enums over bare strings,
from __future__ import annotations, proper return types - Pydantic — snake_case fields with aliases,
model_config, field validators (seereferences/pydantic-patterns.md) - Error handling — replace
assertwithif/raise, add context to re-raised exceptions - Python best practices — frozen dataclasses, Protocol types, avoid mutable defaults
- PyTorch/Lightning — only apply if the module contains
torchornn.Modulecode (seereferences/pytorch-patterns.md) - Docs — public functions must have docstrings (see
references/docs-patterns.md)
5. Verify
uv run ruff check <target>
uv run ruff format <target>
uv run mypy <target>
uv run pytest tests/unit/<target-name>/ -v
All checks must pass before declaring done. If tests fail, fix them — don't skip.
6. Summarise
Report a table of every change made, grouped by category. Include file and line references.
Repo-Specific Conventions
- Python: 3.12 — use
StrEnum,match,X | Yunions,from __future__ import annotationsin every file - Linter/Formatter: Ruff (88 char line length)
- Type checker: mypy (strict — all errors must be resolved)
- Package manager: uv (
uv run <cmd>) - Tests: pytest, mirror source structure under
tests/unit/ - Logging:
from logging_utils import get_loggerthenlogger = get_logger(__name__)— neverlogging.getLogger(__name__)orprint() - Imports: stdlib → third-party → local, each group separated by blank line
- Config: TOML or YAML only — never JSON for config files
What ships with it
4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 1mo ago First seen · 83 lines · 85 tokens per session scan A f8943f59b0dd
code-refactor is a skill published in the GitHub repository arnabdeypolimi/claude_code_setup (4 stars, last pushed 1mo ago), licensed MIT. It adds 85 tokens to every session and 783 once invoked, about $0.0003 per session on Opus 5.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-08-31.
Other skills, from other repositories
py-reviewer
Review selected Python code for typing, async and exception behavior, resource ownership, data access, framework boundaries, and concrete contract defects in the project's actual runtime.
ha-dev-workflow-apply
Applies and validates the HA code-style / strict-typing / validation workflow (spec/ha/dev-workflow) against an existing HA Custom Integration — Ruff format, ordered imports, f-strings (logging excepted), file-header docstrings, full type annotations, a local mypy-strict profile as the platinum strict-typing bridge…
clean-code-python
Use when writing or reviewing Python — deeper idioms (type hints, dataclasses/pydantic, no mutable defaults, EAFP, pathlib, context managers, comprehensions).
django-testing
Django testing discipline — TDD workflow for Django/DRF (RED-GREEN-REFACTOR against models, views, serializers, permissions), pytest-django and factory patterns, database and transaction handling in tests, API client testing, AND the verification gates a Django change must pass before it ships (migrations check…
python-patterns
Pythonic idioms, PEP 8 standards, type hints, and best practices for building robust, efficient, and maintainable Python applications.
python-anti-patterns
Use this skill when reviewing Python code for common anti-patterns to avoid. Use as a checklist when reviewing code, before finalizing implementations, or when debugging issues that might stem from known bad practices.