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/jpeseWang/solo-dev-workflowWrote 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/jpesewang/solo-dev-workflow/smart-refactor)<a href="https://agentmods.dev/commands/jpesewang/solo-dev-workflow/smart-refactor"><img src="https://agentmods.dev/badge/commands/jpesewang/solo-dev-workflow/smart-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/jpesewang/solo-dev-workflow/smart-refactor"><img src="https://agentmods.dev/badge/commands/jpesewang/solo-dev-workflow/smart-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.00550 |
| Opus 5.5 | $0.00000 | $0.00220 |
| Sonnet 5.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 2mo 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.
- 2mo 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 2mo 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
refactor-clean
Refactor provided code for cleanliness, maintainability, and alignment with SOLID principles and modern best practices — no over-engineering.
deep-audit.skeleton
Description: This section is populated by Bootstrap with manifest data. Required manifest fields: project.description, stack.primary, project.structure, project.subprojects, stack.orm, stack.authmethod Example output.
harness:audit
Cross-dimensional codebase audit orchestrator — classify repo shape, fan out parallel read-only audit agents, dedup and severity-rank findings against existing issues, publish grouped tracking issues.
modify
Command "modify" from MartyBonacci/specswarm, covering user input, flag parsing, parse flags from arguments, mode routing and goal.
prism-graph
Export Prism's graph of this repository and summarise it.
hotfix
Ship a fast branch-based P0 hotfix — diagnose, implement, open a ready-for-review PR, then verify + review after (deferred by design).