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/nmime/motiv-buyWrote 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/commands/nmime/motiv-buy/refactor)<a href="https://agentmods.dev/commands/nmime/motiv-buy/refactor"><img src="https://agentmods.dev/badge/commands/nmime/motiv-buy/refactor/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/commands/nmime/motiv-buy/refactor"><img src="https://agentmods.dev/badge/commands/nmime/motiv-buy/refactor.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.00000 | $0.01824 |
| Opus 5.5 | $0.00000 | $0.00730 |
| Sonnet 5.5 | $0.00000 | $0.00365 |
| Haiku 4.5 | $0.00000 | $0.00182 |
Grade A, and why
refactor 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 3mo 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 — 217 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are working on the current project. The user has requested to refactor specific files tagged with @ symbols in their arguments: "$ARGUMENTS"
Auto-Loaded Project Context:
@/CLAUDE.md @/docs/ai-context/project-structure.md @/docs/ai-context/docs-overview.md
Step 1: Parse Tagged Files
Extract all @ tagged file paths from the user's arguments. Only process files that are explicitly tagged with @ symbols.
Example parsing:
- Input: "refactor @src/big-file.ts @components/Large.svelte"
- Extract: ["src/big-file.ts", "components/Large.svelte"]
Step 2: Validate and Analyze Files
For each tagged file:
- Verify file exists - If file doesn't exist, inform user and skip
- Read file contents - Understand the structure and dependencies
- Analyze current directory structure - Map existing patterns around the file
Step 3: Intelligent Analysis Strategy Decision
Think deeply about the safest and most effective refactoring approach based on the auto-loaded project context. Based on the initial analysis from Step 2 and the auto-loaded project context, intelligently decide the optimal approach for each file:
Strategy Options:
Direct Refactoring (0-1 sub-agents):
- Simple files with clear, obvious split points
- Files with minimal external dependencies
- Standard refactoring patterns (e.g., extract utils, split large classes)
- Low risk of breaking changes
Focused Analysis (2-3 sub-agents):
- Moderate complexity with specific concerns
- Files with moderate dependency footprint
- When one aspect needs deep analysis (e.g., complex dependencies OR intricate file structure)
Comprehensive Analysis (3+ sub-agents):
- High complexity files with multiple concerns
- Extensive dependency networks
- Novel refactoring patterns not seen in project
- High risk of breaking changes
- Files that are central to multiple systems
Step 4: Execute Chosen Strategy
For Direct Refactoring:
Proceed with straightforward refactoring using the initial analysis and project context.
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.
- 3mo ago First seen · 217 lines · 0 tokens per session scan A 3e72bb9febac
refactor is a command published in the GitHub repository nmime/motiv-buy (0 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,824 tokens. 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-09-04.
refactor compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| refactornmime/motiv-buy | Command | 0 | 10mo ago | MIT | A | 0 | Claude Code |
| review-branchdamusix/atomic-claude | Command | 117 | 2d ago | MIT | A | 35 | Claude Code |
| diff-reviewcoco-research/coco | Command | 324 | today | Apache-2.0 | A | 11 | Claude Code |
| initazrtydxb/procoder | Command | 212 | today | Apache-2.0 | A | 16 | Claude Code |
| spec-trace-requirementsrjmurillo/ai-agents | Command | 50 | today | Apache-2.0 | A | 0 | GitHub Copilot |
| merge-conflict-analysisrjmurillo/ai-agents | Command | 50 | today | Apache-2.0 | A | 0 | GitHub Copilot |
| refactorRchGrav/claudebox | Command | 1.2k | 2mo ago | MIT | A | 9 | Claude Code |