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 Pharaoh-so/pharaoh-mcp --skill refactorgit clone --depth 1 https://github.com/Pharaoh-so/pharaoh-mcpWrote 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/pharaoh-so/pharaoh-mcp/refactor)<a href="https://agentmods.dev/skills/pharaoh-so/pharaoh-mcp/refactor"><img src="https://agentmods.dev/badge/skills/pharaoh-so/pharaoh-mcp/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/pharaoh-so/pharaoh-mcp/refactor"><img src="https://agentmods.dev/badge/skills/pharaoh-so/pharaoh-mcp/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.00068 | $0.00431 |
| Opus 5.5 | $0.00027 | $0.00172 |
| Sonnet 5.5 | $0.00014 | $0.00086 |
| Haiku 4.5 | $0.00007 | $0.00043 |
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 9d 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.
What it actually says
Safe Refactor
Step-by-step workflow to safely refactor a function or module with full blast radius awareness. Uses safe-refactor — a 6-step process that maps every caller, identifies affected tests, flags unreachable code, and warns about high-risk downstream paths before a single line changes.
When to Use
Invoke before refactoring any function, module, or file — especially shared utilities, exports used across multiple modules, or anything with an unclear caller graph. Use it whenever the blast radius of a change is unknown.
Workflow
- Call
get_module_contextfor the module containing the target to understand its current structure. - Call
get_blast_radiusfor the target to identify all downstream callers and affected modules. - Call
search_functionsto check if the refactored version's name already exists elsewhere.
Do not propose a refactoring plan until all 3 steps are complete.
Output
A refactoring plan containing:
- Callers to update: every function and file that calls the target, with update requirements
- Tests to change: test files covering the refactored code, with required modifications
- Dead code: unreachable code paths that can be deleted during the refactor
- High-risk paths: downstream modules with wide blast radius or high complexity scores
- Naming conflicts: existing functions whose names would conflict with the refactored version
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.
- 9d ago First seen · 35 lines · 68 tokens per session scan A 091ccfbf43cc
refactor is a skill published in the GitHub repository Pharaoh-so/pharaoh-mcp (2 stars, last pushed today), licensed MIT. It adds 68 tokens to every session and 431 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-10-21.
Other skills, from other repositories
codespaces
Build and query architecture-aware code search, dependency graphs, call flows, impact analysis, and belief maps for Python, TypeScript, TSX, Rust, C#, Java, Go, Ruby, and Ruby on Rails repositories. Use before non-trivial code changes to find module boundaries, blast radius, architecture violations, and the minimal…
codebase-intelligence
Query the codebase-intelligence CLI to understand TypeScript architecture, dependencies, blast radius, and risk before reading files. Use for any "how is this structured", "what breaks if I change X", "where is the complexity" question.
dotnet-analyzer-code-quality
Detect code quality issues, architecture rule violations, code smells, technical debt, dead code, and performance problems in .NET projects using Roslyn-powered MCP tools. Use when the user asks to check code quality, detect code smells, measure technical debt, generate quality reports, check architecture rules, find…
code-quality-principles
Applies KISS, YAGNI, and SOLID principles for clean code with reduced complexity. Use when refactoring or reviewing code for over-engineering.
plugin-review
Review plugin quality with tiered checks and dependency scoping. Use for PR and pre-release audits.
improve-codebase-architecture
Review module boundaries, interface depth and high-leverage refactors with evidence.