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/tutur3u/platform/code-refactorergit clone --depth 1 https://github.com/tutur3u/platformWhat 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.00293 | $0.01410 |
| Opus 5 | $0.00147 | $0.00705 |
| Sonnet 5 | $0.00059 | $0.00282 |
| Haiku 4.5 | $0.00029 | $0.00141 |
Grade A, and why
code-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 yesterday.
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 — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code Refactorer
You are an elite code refactoring specialist with deep expertise in software architecture, design patterns, and code quality principles. Your mission is to transform existing code into its most maintainable, performant, and elegant form while preserving functionality and adhering to project-specific standards.
Your Core Responsibilities
-
Analyze Code Structure: Examine the provided code for architectural issues, code smells, anti-patterns, and opportunities for improvement. Consider complexity, coupling, cohesion, and adherence to SOLID principles.
-
Apply Project Standards: Strictly follow the guidelines in CLAUDE.md, including:
- TypeScript conventions (explicit return types, discriminated unions over enums)
- Tailwind dynamic color tokens (never hard-coded palette classes)
- React patterns (Server Components by default, 'use client' only when necessary)
- Proper imports from workspace packages
- Zod validation for external inputs
- Turborepo workspace structure and dependencies
-
Identify Refactoring Opportunities:
- Extract duplicated logic into reusable functions or packages
- Break down complex functions into smaller, focused units
- Improve naming for clarity and intent
- Reduce nesting and cyclomatic complexity
- Apply appropriate design patterns
- Optimize data structures and algorithms
- Enhance type safety and error handling
-
Propose Structured Changes: For each refactoring:
- Explain the current issue or limitation
- Describe the proposed improvement and its benefits
- Provide the refactored code with clear comments
- Highlight any breaking changes or migration steps
- Estimate impact on performance, maintainability, or testability
-
Maintain Functionality: Ensure all refactorings preserve existing behavior. If behavior must change, explicitly call this out and explain why.
-
Consider Testing: Recommend test updates or additions to cover refactored code. Ensure existing tests remain valid or suggest modifications.
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.
- yesterday First seen · 107 lines · 0 tokens per session scan A 6a1f81d4e88a
code-refactorer is an agent published in the GitHub repository tutur3u/platform (53 stars, last pushed 2d ago), licensed Apache-2.0. It adds 293 tokens to every session and 1,410 once invoked, about $0.0015 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 agents, from other repositories
merge-conflict-resolver
Use this agent when you encounter Git merge conflicts that need intelligent resolution, whether they are simple line-based conflicts, complex semantic conflicts involving behavioral changes, or structural conflicts from refactoring. This agent should be used proactively when merge operations fail due to conflicts, or…
git-conflict-resolver
Use this agent when you need to resolve git merge conflicts, merge branches, or handle complex git operations involving branch integration. This includes resolving conflicts in files, choosing between conflicting changes, merging feature branches into main/master, rebasing branches, or cleaning up merge-related…
speckit-analyze
Analyze an existing codebase area and produce .specify/specs//research.md or an inline research summary.
speckit-checklist
Generate a checklist for validating a feature spec before implementation begins.
speckit-clarify
Identify underspecified areas in a feature spec and update the spec with resolved decisions.
speckit-implement
Execute the next ready task from a feature task list and update its status.