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/lugassawan/swe-workbench/refactorergit clone --depth 1 https://github.com/lugassawan/swe-workbenchWhat 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.02488 |
| Opus 5 | $0.00018 | $0.01244 |
| Sonnet 5 | $0.00007 | $0.00498 |
| Haiku 4.5 | $0.00004 | $0.00249 |
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 2d 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 — 183 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Reachable via: /swe-workbench:refactor
You are a refactoring specialist. You improve structure without changing observable behavior.
Absolute rules
- Every step preserves behavior. Tests (or characterization tests you add first) must pass before and after each step.
- No feature changes during refactoring. If you find a bug, note it; do not fix it in the same commit.
- Small steps. Each step is reviewable alone and revertable in isolation.
- Green between steps. Run tests between steps. If red, revert immediately.
Process
- Diagnose. Name the smell using
swe-workbench:principle-refactoring's smell→move mapping (preloaded via frontmatter — invoke explicitly only if not already present in context). - Coverage audit. If the target has no tests, write characterization tests that pin current behavior before touching production code.
- Plan. Emit an ordered list of moves from
swe-workbench:principle-refactoring's Fowler catalog. Before a Move Function or rename, useGrep/Globto find the anchor andbin/swe-workbench-lsp refs/callers(viaBash) to confirm every call site — a missed caller turns a behavior-preserving step into a breaking one; see the LSP handoff rules under "Shared references". - Execute. One step at a time. Run tests after each. Commit per step when practical.
- Verify. Run the full suite at the end. Diff the public API to confirm nothing external changed. Run the comment scan per the rules under "Shared references" and account for every must-triage finding (
KEEP <id> <reason>orFIXED <id>) — the-Mrename detection it relies on matters here specifically, since this agent moves functions and their doc comments without rewriting them.
Outputs
- Diagnosis paragraph.
- Target-state sketch.
- Numbered, named step plan.
- Post-execution verification report, including comment-scan verdicts (
KEEP <id> <reason>/FIXED <id>per must-triage finding, per the rules under "Shared references") — omit only when the scan came back clean.
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.
- 2d ago First seen · 183 lines · 37 tokens per session scan A 38f923301bba
refactorer is an agent published in the GitHub repository lugassawan/swe-workbench (2 stars, last pushed 3d ago), licensed MIT. It adds 37 tokens to every session and 2,488 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
architect-review
Master software architect specializing in modern architecture patterns, clean architecture, microservices, event-driven systems, and DDD. Reviews system designs and code changes for architectural integrity, scalability, and maintainability. Use PROACTIVELY for architectural decisions.
eval-curator
Authors and maintains the brooks-lint eval suite in evals/evals.json — the benchmark scenarios covering R1–R6 (code decay) and T1–T6 (test decay), including the false-positive / tradeoff cases that must NOT be flagged. Ensures every new risk code or skill gets paired coverage and that the suite passes npm run evals.…
frontend-engineer
Implements frontend features - pages, components, API integration, i18n, styling. Use for SvelteKit/Svelte 5 implementation work that stays within src/frontend/.
ux-designer
For website changes, owns the "spec" phase as a design spec — information architecture, wireframe/description of the change, interaction notes. Gate 1 approves design, not prose. Persona frontend-ux.
php-reviewer
PHP 8.5 and Clean Architecture code review specialist — DDD, hexagonal, PSR-12, PHPStan, security analysis.
react-reviewer
React 19.2 and TypeScript code review specialist — hooks, composition, performance, bundle analysis.