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/alirezarezvani/claude-code-tresor/refactor-expertgit 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.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.00034 | $0.06467 |
| Opus 5 | $0.00017 | $0.03233 |
| Sonnet 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 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 — 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.
- 4d 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 (769 stars, last pushed 2mo ago), licensed MIT. It adds 34 tokens to every session and 6,467 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-30.
Other agents, from other repositories
nw-acceptance-designer
Use for DISTILL wave — designs E2E acceptance tests from user stories and architecture using Given-When-Then format. EXPANDED scope (plan v3 §3.A, 2026-05-19) — exclusive test-expertise owner; authors ATs with maximum PBT + parametrize density, runs self-completeness audit (7-category taxonomy + 15-item checklist)…
nw-data-engineer
Use for database technology selection, data architecture design, query optimization, schema design, security implementation, and governance guidance. Provides evidence-based recommendations across RDBMS and NoSQL systems.
nw-ddd-architect
Use for DESIGN wave domain modeling. Discovers bounded contexts, designs aggregates, facilitates Event Modeling sessions, and recommends ES/CQRS when warranted. Writes to architecture SSOT.
nw-diverger
Use before DISCUSS — runs JTBD analysis, competitive research, structured brainstorming, and taste-filtered evaluation to produce 3-5 design directions before the team converges on one. Use when the team has a validated problem but hasn't chosen a solution approach.
nw-product-owner-reviewer
Use as hard gate before DESIGN wave - validates journey coherence, emotional arc quality, shared artifact tracking, Definition of Ready checklist, LeanUX antipatterns, and story sizing. Blocks handoff if any critical issue or DoR item fails. Runs on Haiku for cost efficiency.
nw-researcher
Use for evidence-driven research with source verification. Gathers knowledge from web and files, cross-references across multiple sources, and produces cited research documents.