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 commands/jpesewang/solo-dev-workflow/smart-refactorgit clone --depth 1 https://github.com/jpeseWang/solo-dev-workflowWhat 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.00000 | $0.00550 |
| Opus 5 | $0.00000 | $0.00275 |
| Sonnet 5 | $0.00000 | $0.00110 |
| Haiku 4.5 | $0.00000 | $0.00055 |
Grade A, and why
smart-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 3d 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 — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are $DEV_ROLE, performing code refactoring to increase the AI quality score.
Objective
Refactor to achieve the highest score across the 4 AI scoring dimensions (Correctness 30% / Design 30% / Security 20% / Efficiency 20%).
Reference: .claude/commands/_shared/ai-checklist.md — the full checklist.
Input
$ARGUMENTS — the file path or module to refactor.
If not provided, check git diff dev...HEAD --name-only to refactor the changed files.
Actions
Step 1: Read and analyze the file
Read the file and evaluate it against the 4 dimensions in the shared checklist. List every violation in this format:
[CORRECTNESS] {file}:{line} - {issue}
[DESIGN] {file}:{line} - {issue}
[SECURITY] {file}:{line} - {issue}
[EFFICIENCY] {file}:{line} - {issue}
Step 2: Refactor in priority order
Following the "AUTO-FIX PRIORITY" section in the shared checklist:
- Correctness (30%) — fix first
- Design (30%)
- Security (20%)
- Efficiency (20%)
Fix rules:
- Only fix what is GENUINELY a problem
- Preserve behavior, only improve quality
- Do not add new features
- If a fix touches > 50% of the file, ask the user first
Step 3: Commit each concern separately
Split into multiple small commits — one concern type per commit:
refactor({module}): Extract {function} into dedicated utility
Reduce complexity in {component} by separating {concern}.
Improve readability and enable unit testing of extracted logic.
Call /commit for the automated pipeline (Jira ID, scoring check, etc.).
Add/Delete Balance
Scoring favors an add/del ratio of 0.2-0.6 (achieves 100 points for codebase_impact).
- When refactoring, prefer deleting old code rather than only adding new code
- Target: deletions / (additions + deletions) in the range 0.2-0.6
Rules
- Read the file BEFORE refactoring, do not guess
- DO NOT change behavior — only improve code quality
- Split commits by concern: 1 commit = 1 improvement type
- Use the conventional prefix
refactor(1.1x multiplier) - Every commit has a body explaining WHY
- Reply in English, listing the changes you made
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.
- 3d ago First seen · 66 lines · 0 tokens per session scan A ed7aaf109deb
smart-refactor is a command published in the GitHub repository jpeseWang/solo-dev-workflow (2 stars, last pushed 13d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 550 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-08-31.
Other commands, from other repositories
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.