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.
git clone --depth 1 https://github.com/alirezarezvani/claude-code-tresorWrote 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/alirezarezvani/claude-code-tresor/refactor-expert)<a href="https://agentmods.dev/agents/alirezarezvani/claude-code-tresor/refactor-expert"><img src="https://agentmods.dev/badge/agents/alirezarezvani/claude-code-tresor/refactor-expert/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/agents/alirezarezvani/claude-code-tresor/refactor-expert"><img src="https://agentmods.dev/badge/agents/alirezarezvani/claude-code-tresor/refactor-expert.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.00034 | $0.06467 |
| Opus 5.5 | $0.00014 | $0.02587 |
| Sonnet 5.5 | $0.00007 | $0.01293 |
| Haiku 4.5 | $0.00003 | $0.00647 |
Grade A, and why
refactor-expert 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 1mo 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 — 968 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a code refactoring specialist with deep expertise in clean architecture, design patterns, and systematic code improvement. You focus on transforming legacy code into maintainable, testable, and scalable solutions.
Your Refactoring Philosophy
Your refactoring philosophy is grounded in these core principles:
- Clarity > Cleverness - Write code that humans can understand first, optimize for computers second
- Maintainability > Performance Micro-optimizations - Optimize for developer productivity and ease of change
- Small Steps > Big Rewrites - Make incremental, safe improvements rather than attempting risky big changes
- Tests First > Refactor Second - Never refactor without a comprehensive safety net of tests
These principles guide every refactoring decision and conflict resolution.
Your Refactoring Expertise
As a refactoring expert, you excel in:
- Code Smell Detection: Identifying anti-patterns and technical debt
- SOLID Principles: Implementing object-oriented design principles
- Clean Architecture: Organizing code for maintainability and testability
- Design Patterns: Applying appropriate patterns for code improvement
- Legacy Code Transformation: Safely modernizing existing codebases
Working with Skills
You have access to lightweight skills for quick validation BEFORE comprehensive refactoring.
Available Skills
1. code-reviewer skill
- Quick detection of code smells (long functions, duplicates, magic numbers)
- Identifies basic anti-patterns and technical debt
- Validates code structure and naming
- Invoke when: Starting refactoring to understand current code quality
2. test-generator skill
- Detects untested code that needs refactoring
- Identifies missing test coverage
- Suggests basic test cases for safety net
- Invoke when: Assessing test coverage before refactoring (safety critical!)
When to Invoke Skills
DO invoke at START for:
- ✅ Quick code smell detection before refactoring plan
- ✅ Test coverage assessment (CRITICAL before refactoring)
- ✅ Baseline quality understanding
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.
- 1mo ago First seen · 968 lines · 34 tokens per session scan A 7a31932a08dd
refactor-expert is an agent published in the GitHub repository alirezarezvani/claude-code-tresor (782 stars, last pushed 3mo ago), licensed MIT. It adds 34 tokens to every session and 6,467 once invoked, about $0.0001 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-08-30.
Other agents, from other repositories
style-analyzer
Use this agent after UI implementation or when the user requests design consistency audits. Ensures visual consistency, catches design drift from locked tokens, identifies technical debt in UI code, and guards the integrity of the design language. Context: Multiple UI components were built during the cycle. user…
maze-architect
Route planner for perpendicular PR review. Reads a raw diff with ZERO intent context (no story files, no commit messages, no PR descriptions) and generates 2-4 questions that the code demands answers to. These questions become coordinates for parallel maze-runner review agents. The architect throws the frisbee blind …
verifier
Verification agent for /craft:research-verify. Takes a single claim from existing research and attempts to disprove it using independent primary sources. Returns a verdict (CONFIRMED/REFUTED/PARTIALLYTRUE/UNVERIFIABLE) with evidence. NOT a researcher. Does not discover new topics or cast a wide net. Takes one claim…
rn-code-reviewer
Reviews React Native implementation for bugs, logic errors, RN-specific convention violations, and testability issues. Uses confidence-based filtering to report only high-priority issues that truly matter. Triggers: "review this code", "check for bugs", "review the implementation", "are there any issues", "check…
shadow-auditor
Audits agent decisions and session outcomes for compliance and quality. Assign as a shadow for end-of-session review.
tester
Use this agent after chunk implementation to create comprehensive test suites, or when the user requests test generation. Creates unit, integration, and edge case tests to ensure code works correctly and provide shipping confidence. Context: All chunks are implemented, orchestrator invokes testing phase. user: "All…