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 pproenca/dot-skills --skill refactorgit clone --depth 1 https://github.com/pproenca/dot-skillsWrote 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/pproenca/dot-skills/refactor)<a href="https://agentmods.dev/skills/pproenca/dot-skills/refactor"><img src="https://agentmods.dev/badge/skills/pproenca/dot-skills/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/pproenca/dot-skills/refactor"><img src="https://agentmods.dev/badge/skills/pproenca/dot-skills/refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Socket pass
- Snyk pass
- NVIDIA SkillSpector pass
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.00073 | $0.01173 |
| Opus 5.5 | $0.00029 | $0.00469 |
| Sonnet 5.5 | $0.00015 | $0.00235 |
| Haiku 4.5 | $0.00007 | $0.00117 |
Grade A, and why
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 3mo 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 — 112 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Fowler/Martin Code Refactoring Best Practices
Comprehensive code refactoring guide based on Martin Fowler's catalog and Clean Code principles, designed for AI agents and LLMs. Contains 43 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.
When to Apply
Reference these guidelines when:
- Refactoring existing code to improve maintainability
- Decomposing long methods or large classes
- Reducing coupling between components
- Simplifying complex conditional logic
- Reviewing code for code smells and anti-patterns
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Structure & Decomposition | CRITICAL | struct- |
| 2 | Coupling & Dependencies | CRITICAL | couple- |
| 3 | Naming & Clarity | HIGH | name- |
| 4 | Conditional Logic | HIGH | cond- |
| 5 | Abstraction & Patterns | MEDIUM-HIGH | pattern- |
| 6 | Data Organization | MEDIUM | data- |
| 7 | Error Handling | MEDIUM | error- |
| 8 | Micro-Refactoring | LOW | micro- |
Quick Reference
1. Structure & Decomposition (CRITICAL)
struct-extract-method- Extract Method for Long Functionsstruct-single-responsibility- Apply Single Responsibility Principlestruct-extract-class- Extract Class from Large Classstruct-compose-method- Compose Method for Readable Flowstruct-function-length- Keep Functions Under 20 Linesstruct-replace-method-with-object- Replace Method with Method Objectstruct-parameter-object- Introduce Parameter Object
2. Coupling & Dependencies (CRITICAL)
couple-dependency-injection- Use Dependency Injectioncouple-hide-delegate- Hide Delegate to Reduce Couplingcouple-remove-middle-man- Remove Middle Man When Excessivecouple-feature-envy- Fix Feature Envy by Moving Methodscouple-interface-segregation- Apply Interface Segregation Principlecouple-preserve-whole-object- Preserve Whole Object Instead of Fields
What ships with it
48 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.
- AGENTS.md 8.6 KB
- assets/templates/_template.md 827 B
- metadata.json 882 B
- README.md 4.3 KB
- references/_sections.md 1.9 KB
- references/cond-consolidate.md 2.3 KB
- references/cond-decompose.md 2.2 KB
- references/cond-guard-clauses.md 2.3 KB
- references/cond-lookup-table.md 2.5 KB
- references/cond-polymorphism.md 2.5 KB
- references/cond-special-case.md 2.4 KB
- references/couple-dependency-injection.md 2.3 KB
- references/couple-feature-envy.md 2.0 KB
- references/couple-hide-delegate.md 1.8 KB
- references/couple-interface-segregation.md 2.2 KB
- references/couple-preserve-whole-object.md 2.1 KB
- references/couple-remove-middle-man.md 2.0 KB
- references/data-encapsulate-collection.md 2.2 KB
- references/data-encapsulate-record.md 2.5 KB
- references/data-replace-primitive.md 2.8 KB
- references/data-replace-temp-with-query.md 2.1 KB
- references/data-split-variable.md 2.7 KB
- references/error-custom-exceptions.md 3.1 KB
- references/error-exceptions-over-codes.md 2.7 KB
- references/error-fail-fast.md 2.5 KB
- references/error-separate-concerns.md 3.3 KB
- references/micro-inline-variable.md 2.2 KB
- references/micro-remove-dead-code.md 2.1 KB
- references/micro-rename-for-clarity.md 2.0 KB
- references/micro-simplify-expressions.md 2.0 KB
- references/name-avoid-abbreviations.md 1.8 KB
- references/name-avoid-encodings.md 2.0 KB
- references/name-consistent-vocabulary.md 1.8 KB
- references/name-intention-revealing.md 1.4 KB
- references/name-searchable-names.md 1.7 KB
- references/pattern-composition-over-inheritance.md 2.3 KB
- references/pattern-extract-superclass.md 2.5 KB
- references/pattern-factory.md 3.3 KB
- references/pattern-open-closed.md 2.7 KB
- references/pattern-strategy.md 3.0 KB
- references/pattern-template-method.md 3.1 KB
- references/struct-compose-method.md 2.7 KB
- references/struct-extract-class.md 2.2 KB
- references/struct-extract-method.md 2.4 KB
- references/struct-function-length.md 3.0 KB
- references/struct-parameter-object.md 2.5 KB
- references/struct-replace-method-with-object.md 3.7 KB
- references/struct-single-responsibility.md 2.2 KB
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.
- 3mo ago First seen · 112 lines · 73 tokens per session scan A fec64e09a27e
refactor is a skill published in the GitHub repository pproenca/dot-skills (231 stars, last pushed 3mo ago), licensed MIT. It adds 73 tokens to every session and 1,173 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-30.
refactor compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| refactorpproenca/dot-skills | Skill | 231 | 3mo ago | MIT | A | 73 | Claude Code, Codex |
| imagegenopenai/codex | Skill | 137k | today | Apache-2.0 | A | 113 | Codex |
| playwright-climicrosoft/playwright | Skill | 101k | today | Apache-2.0 | A | 19 | Claude Code |
| browser-automationopenclaw/openclaw | Skill | 395k | today | MIT | A | 36 | Claude Code |
| systematic-debuggingobra/superpowers | Skill | 331k | 3d ago | MIT | A | 21 | Claude Code |
| free-llm-apismnfst/awesome-free-llm-apis | Skill | 15k | yesterday | CC0-1.0 | A | 113 | Claude Code, Codex |
| next-cache-components-adoptionvercel/next.js | Skill | 144k | today | MIT | A | 95 | Claude Code |