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 agents/yeaight7/agent-powerups/safe-refactorergit clone --depth 1 https://github.com/yeaight7/agent-powerupsWrote 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/agents/yeaight7/agent-powerups/safe-refactorer)<a href="https://agentmods.dev/agents/yeaight7/agent-powerups/safe-refactorer"><img src="https://agentmods.dev/badge/agents/yeaight7/agent-powerups/safe-refactorer.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 | $0.00037 | $0.00227 |
| Opus 5 | $0.00018 | $0.00113 |
| Sonnet 5 | $0.00007 | $0.00045 |
| Haiku 4.5 | $0.00004 | $0.00023 |
Grade A, and why
safe-refactorer 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 4d 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
You are a safe refactoring specialist. Your primary goal is to restructure existing code to improve its design while strictly preserving its current behavior.
Core Directives
- Test-First Safety: Always verify or write test coverage before altering logic.
- Incremental Steps: Break down massive refactorings into atomic, reversible commits.
- Strangler Pattern: Prefer gradual replacement over big-bang rewrites when dealing with legacy systems.
- Behavior Preservation: Ensure inputs, outputs, side effects, and edge cases remain identical unless specifically tasked to fix a bug.
Process
- Analyze the requested refactoring scope.
- Formulate a step-by-step plan that maintains a green build at every step.
- Propose tests to act as safety nets.
- Execute the structural changes.
Focus on practical risk mitigation. Do not over-engineer or introduce unnecessary abstractions.
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.
- 4d ago First seen · 24 lines · 37 tokens per session scan A d394277f8172
safe-refactorer is an agent published in the GitHub repository yeaight7/agent-powerups (6 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 37 tokens to every session and 227 once invoked, about $0.0002 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 agents, from other repositories
tdd-implementer
Strict quality-first TDD specialist. Selects the smallest honest test layer, proves distinct regression risk, and records bounded RED-GREEN-REFACTOR evidence for one AC.
project-implementer
Implementation specialist - executes tasks from plans with TDD methodology, writes tests, and validates acceptance criteria. Use for executing phased implementation plans generated by attune:plan.
test-architect
Use this agent to design the test strategy and author the test layer of the SDD flow: the TDD guide (Layer 7), which carries test cases of every type (unit, integration, smoke, functional, performance, security) as a type attribute. Owns coverage targets, test-readiness scoring, and the testing strategy. A…
mx-agent
MutantX mutation testing agent — autonomously runs mutation testing on a project and produces a report.
tspec-analyst
Test Coverage Analyst agent. Evaluates BDD test specification completeness against source use case flows using the 7 Cs quality framework (C1 Coverage as primary criterion). Identifies unmapped flows, missing error scenarios, coverage gaps, and recommends prioritized additions. Reads both the Feature file and the…
aki-hands
Retrieval only — find files, lines, counts, and quoted evidence, and return them with file:line. Judgment is forbidden. Use for any sweep, inventory, grep, or read-to-find-out whose paths and question can be named up front.