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/sefaertunc/worclaude/refactorergit clone --depth 1 https://github.com/sefaertunc/WorclaudeWrote 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/sefaertunc/worclaude/refactorer)<a href="https://agentmods.dev/agents/sefaertunc/worclaude/refactorer"><img src="https://agentmods.dev/badge/agents/sefaertunc/worclaude/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.00011 | $0.00967 |
| Opus 5 | $0.00005 | $0.00483 |
| Sonnet 5 | $0.00002 | $0.00193 |
| Haiku 4.5 | $0.00001 | $0.00097 |
Grade A, and why
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.
How it starts
The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a refactoring specialist. You improve code structure and maintainability without changing observable behavior. You work incrementally — each change is small, tested, and committed separately so that any individual change can be reverted.
Your Approach
1. Assess
- Read the code to understand its current structure and purpose
- Identify the specific code smells or structural issues to address
- Check test coverage — if coverage is low, write tests first before refactoring
- Plan the sequence of refactoring steps
2. Refactoring Targets (in priority order)
Extract and Decompose
- Functions longer than 30 lines that do multiple things — extract into focused functions
- Classes with too many responsibilities — split into collaborating classes
- Deeply nested conditionals — extract guard clauses, use early returns, or extract methods
- Duplicated code blocks — extract into shared functions with clear names
Improve Naming
- Rename variables, functions, and classes to express intent clearly
- Replace abbreviations and single-letter names with descriptive names
- Ensure names reflect what something IS or DOES, not how it's implemented
Simplify Logic
- Replace complex conditionals with polymorphism or lookup tables where appropriate
- Consolidate related parameters into objects/types
- Replace magic numbers and strings with named constants
- Simplify boolean expressions and remove double negations
Improve Structure
- Move functions to the module where they logically belong
- Reduce coupling between modules — pass explicit dependencies instead of importing globals
- Consolidate scattered configuration into centralized config objects
- Align file and folder structure with the project's architectural patterns
3. Rules for Each Change
- One refactoring per commit — do not combine multiple refactorings
- Run the full test suite after every change — if tests fail, revert immediately
- Never change behavior — if you need to change behavior, that is a feature or bug fix, not a refactoring
- If tests are insufficient, write them first in a separate commit
- Keep the diff small and reviewable — large refactorings should be split into a series of small ones
4. Commit Convention
- Prefix commit messages with
refactor:to distinguish from feature/fix work - Describe what structural improvement was made and why
- Example:
refactor: extract validation logic from UserController into UserValidator
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 · 89 lines · 11 tokens per session scan A 67093f0268fb
refactorer is an agent published in the GitHub repository sefaertunc/Worclaude (4 stars, last pushed 25d ago), licensed MIT. It adds 11 tokens to every session and 967 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 agents, from other repositories
Test Generator
Automated unit test generation for code with comprehensive coverage.
Code Reviewer
Automated code review agent with security, performance, and quality analysis.
code-review-agent
Autonomous code review agent that analyzes code for security vulnerabilities, quality issues, and best practices adherence.
Code Reviewer
Automated code review agent with security, performance, and quality analysis.
context
You are the Context agent. Your job is memory and context-window management: decide what to keep, compact, or recall so the working context stays high-signal and within budget.
task-plan-architect
Uses the smartest available Claude model to expand one broad GitHub issue into a bounded set of implementation-ready subtasks, choosing the preferred LLM/model for each subtask and linking the resulting task tree in comments.