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.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.1 | $0.00000 | $0.01824 |
| Opus 5 | $0.00000 | $0.00912 |
| Sonnet 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 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 — 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.
- 2d 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 7mo 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.
Other commands, from other repositories
sdd-init
Initialize SDD context — detects project stack and bootstraps persistence backend.
review-branch
Review the current branch's diff against base by dispatching atomic-reviewer. No orchestration loop, no spec required — pre-flight before /commit pr or /commit merge.
init
Install the formatters this repository needs, with every command visible before it runs.
review-sdk-app
Review and validate a Claude Agent SDK application against best practices.
repo-audit
Audit a codebase (local or remote GitHub/GitLab) against architecture principles and requirements, surfacing drift, risk, and missing decisions.
security-review
AI-powered security review of the current git diff (or specified paths). Dispatches the security-reviewer agent and prints findings grouped by severity.