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.svg" alt="Measured on agentmods" 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 | $0.00036 | $0.00587 |
| Sonnet 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 8d 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.
- 8d ago First seen · 112 lines · 73 tokens per session scan A fec64e09a27e
refactor is a skill published in the GitHub repository pproenca/dot-skills (203 stars, last pushed 23d ago), licensed MIT. It adds 73 tokens to every session and 1,173 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-08-30.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…
next-partial-prefetching-adoption
Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…
chronicle
Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…