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/notysoty/openagentskills/refactor-plannernpx skills add Notysoty/openagentskills --skill refactor-plannergit clone --depth 1 https://github.com/Notysoty/openagentskillsWrote 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/notysoty/openagentskills/refactor-planner)<a href="https://agentmods.dev/skills/notysoty/openagentskills/refactor-planner"><img src="https://agentmods.dev/badge/skills/notysoty/openagentskills/refactor-planner.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.00022 | $0.01534 |
| Opus 5 | $0.00011 | $0.00767 |
| Sonnet 5 | $0.00004 | $0.00307 |
| Haiku 4.5 | $0.00002 | $0.00153 |
Grade A, and why
Refactor Planner 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 5d 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 — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactor Planner
What this skill does
This skill directs the agent to analyze a block of code (or an entire module) and produce an ordered, safe refactoring plan. Rather than rewriting everything at once, it breaks the work into small, reversible steps — each one leaving the tests green and the behavior unchanged. It identifies code smells, maps dependencies, flags high-risk areas, and sequences the changes so you can ship incrementally without introducing regressions.
Use this when you have messy, hard-to-understand code that works but needs cleaning up before you can safely add features.
How to use
Claude Code / Cline
Copy this file to .agents/skills/refactor-planner/SKILL.md in your project root.
Then ask the agent:
- "Use the Refactor Planner skill on
src/utils/dataProcessor.ts." - "Plan a safe refactor of this function using the Refactor Planner skill."
Paste in the code you want refactored, or point to a file path.
Cursor
Add the "Prompt / Instructions" section below to your .cursorrules file, or paste it directly into the Cursor AI pane before sharing the code you want refactored.
Codex
Paste the target code into the chat along with the instructions from the section below. For large files, include the full file plus any files that import from it so Codex can map dependencies.
The Prompt / Instructions for the Agent
When asked to plan a refactor, follow these steps precisely:
-
Read the code thoroughly. If a file path is given, read the full file. Also read any files that import from it or that it imports from, so you understand the dependency graph.
-
Identify code smells. Look for:
- Functions longer than 40 lines
- Deeply nested conditionals (more than 3 levels)
- Duplicated logic (copy-paste code)
- Magic numbers and hardcoded strings
- God objects or functions that do too many things
- Inconsistent naming conventions
- Mutable shared state
- Missing or misleading comments
- Dead code (unreachable or unused)
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.
- 5d ago First seen · 154 lines · 22 tokens per session scan A be69ab8fea80
Refactor Planner is a skill published in the GitHub repository Notysoty/openagentskills (9 stars, last pushed 22d ago), licensed MIT. It adds 22 tokens to every session and 1,534 once invoked, about $0.0001 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-31.
Other skills, from other repositories
absolute-simplify
Use when the user wants to simplify, clean up, refactor, tidy, or refine code — their staged/unstaged git changes or a target file/path. Reduces complexity, flattens nesting, removes redundancy and dead code, scores each change by value (holding low-value churn), then runs tests to prove nothing broke. Invoke on…
setup-craft-skills
Run once per repository to get the most out of the other craft skills (explain-back, name-things, delete-this, seams, loud-errors, boyscout, why-comments, fit-in). Scaffolds an optional shared CONTEXT.md — domain glossary, language/stack, conventions, and untouchables — that those skills read to match your project's…
explain-back
Use before trusting, merging, or building on top of code you (or an agent) just wrote or are about to change. The agent explains the code back in plain language — what it does, why it exists, what breaks if it's wrong — and refuses to proceed until the mental model is confirmed. Use when a diff looks fine but nobody…
loud-errors
Use when you spot a swallowed, vague, or context-losing error — an empty catch, a bare except: pass, catch (e) { console.log(e) } that then continues, throw new Error("something went wrong"), an error logged then ignored, or a caught exception that drops its cause. Makes failures loud and specific: each error says…
seams
Use when you want to unit-test logic but can't without a database, network, clock, or a pile of mocks — or when a function fetches, computes, branches on policy, and writes all in one breath. Splits the decision (pure logic) from the action (I/O and side effects) along the natural seam, so the logic becomes testable…
boyscout
Use when touching an existing file to make a change, so you leave it slightly cleaner than you found it without derailing into a giant refactor. Identifies small, safe, in-scope improvements adjacent to the change you're already making — a better name, a deleted dead line, an extracted helper, a clarified condition …