refactor-recommender

refactor-recommender is a skill for Claude Code from fjpulidop/specrails-core. It costs 39 tokens per session (1,932 once invoked), scanned A, original, MIT.

A codebase scanner that finds possible refactoring work and ranks it by expected impact, effort, and value to defined user personas. Refactoring means restructuring code to improve it without changing what it does.

In plain words
What is it for?
Use it to scan the whole project or selected paths, review scored recommendations, and optionally create the highest-priority findings as GitHub Issues or local tickets.
Why use it?
It helps teams decide which cleanup is worth doing first instead of relying on an unranked list of technical issues.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: reads .claude/ paths.

Part of the specrails plugin — 28 skills, 14 agents shipped together

Good fit Use it to scan the whole project or selected paths, review scored…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fjpulidop/specrails-core/refactor-recommender
Install

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.

Any agent
npx skills add fjpulidop/specrails-core --skill refactor-recommender
Clone the repo
git clone --depth 1 https://github.com/fjpulidop/specrails-core

Made for: Claude Code.

Or install specrails, the plugin that ships this one along with the rest of its 28 skills, 14 agents.

Wrote 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.

agentmods badge for refactor-recommender

README.md
[![agentmods](https://agentmods.dev/badge/skills/fjpulidop/specrails-core/refactor-recommender.svg)](https://agentmods.dev/skills/fjpulidop/specrails-core/refactor-recommender)
Your own site
<a href="https://agentmods.dev/skills/fjpulidop/specrails-core/refactor-recommender"><img src="https://agentmods.dev/badge/skills/fjpulidop/specrails-core/refactor-recommender.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,932 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.01932
Opus 5 $0.00019 $0.00966
Sonnet 5 $0.00008 $0.00386
Haiku 4.5 $0.00004 $0.00193

Measured 7d ago against content hash 7e4d8c56548d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

refactor-recommender 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 7d 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.

specrails-plugin/skills/refactor-recommender/SKILL.md · 220 lines

How it starts

The opening of the file, as written. The whole thing — 220 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Scan the codebase for refactoring opportunities, score each by impact/effort ratio and VPC persona value, and optionally create GitHub Issues for the top findings in the configured backlog provider (read from .specrails/backlog-config.json).

Input: $ARGUMENTS — optional: comma-separated paths to scope the analysis. Flags: --dry-run (print findings without creating issues).


Phase 0: Pre-flight

Check whether the GitHub CLI is available:

Read `.specrails/backlog-config.json` to determine `BACKLOG_PROVIDER` (default: `github`) and `BACKLOG_WRITE` (default: `true`).
- If `BACKLOG_PROVIDER=github`: run `gh auth status`. If it fails, set `BACKLOG_WRITE=false` and warn the user that issues cannot be created.
- If `BACKLOG_PROVIDER=local`: use `.specrails/local-tickets.json` for local issue storage.
- If `BACKLOG_PROVIDER=none`: set `BACKLOG_WRITE=false`.

Set GH_AVAILABLE=true if the command succeeds, GH_AVAILABLE=false otherwise. Do not stop — analysis proceeds regardless. Parse --dry-run from $ARGUMENTS and set DRY_RUN=true if present.


Phase 1: Scope

Parse paths from $ARGUMENTS after stripping any flags. If no paths are provided, scan the entire repository.

Always exclude the following from all analysis:

  • node_modules/
  • .git/
  • .claude/
  • vendor/
  • dist/
  • build/

Phase 1.5: VPC Context

Check whether persona files exist at .claude/agents/personas/. This path is present in any repo that has run /specrails:setup.

ls .claude/agents/personas/ 2>/dev/null

If the directory exists and contains persona files, set VPC_AVAILABLE=true. Otherwise set VPC_AVAILABLE=false and skip all VPC steps (they are optional enrichment, not blockers).

When VPC_AVAILABLE=true, read each persona file and extract a compact VPC summary. For each persona record:

  • name — persona display name (e.g. "Alex — The Lead Dev")
  • top_jobs — up to 3 functional jobs relevant to code quality and maintainability
  • critical_pains — up to 3 pains marked Critical or High related to code reliability, complexity, or developer experience
  • high_gains — up to 3 gains marked High related to code clarity, speed, or confidence

Read the full file on GitHub · 220 lines

Changes

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.

  1. 7d ago First seen · 220 lines · 39 tokens per session scan A 7e4d8c56548d

Subscribe to this mod's changes

refactor-recommender is a skill published in the GitHub repository fjpulidop/specrails-core (9 stars, last pushed 1mo ago), licensed MIT. It adds 39 tokens to every session and 1,932 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.

Related

Other skills, from other repositories

review-loop

Run the adversarial verification loop — implement, then hand the change to a fresh checker that did not write it, fix what it finds, and re-dispatch until APPROVE. Use before claiming any behavioural change is done, and on requests like "review loop", "adversarial review", "independent review", "get this verified"…

sangrokjung/claude-forge · 100 tokens

security-review

Perform a focused security review of pending git changes to identify high-confidence security vulnerabilities with real exploitation potential. Use this skill when the user asks for a security review, security audit, vulnerability scan, or wants to check pending changes on a branch for security issues before merging.…

waybarrios/opencode-power-pack · 64 tokens

huggingface-llm-trainer

Train or fine-tune language models with TRL or Unsloth on Hugging Face Jobs, including SFT, DPO, GRPO, reward models, and GGUF conversion. Use for cloud LLM training; use huggingface-vision-trainer for vision tasks.

waybarrios/opencode-power-pack · 65 tokens

huggingface-vision-trainer

Train object-detection, image-classification, or SAM segmentation models on Hugging Face Jobs. Use for vision fine-tuning and evaluation; use huggingface-llm-trainer for language models.

waybarrios/opencode-power-pack · 48 tokens

code-quality

Agents should invoke this skill for code reviews, linting/formatting setup, maintainability checks, complexity concerns, warning cleanup, coding standards, or quality gates in Rust, TypeScript, Python, shell, and mixed repos.

waybarrios/opencode-power-pack · 49 tokens

semgrep-rule-variant-creator

Creates language variants of existing Semgrep rules. Use when porting a Semgrep rule to specified target languages. Takes an existing rule and target languages as input, produces independent rule+test directories for each language.

waybarrios/opencode-power-pack · 50 tokens