agentsclimarketplace

Refactor safely

Skill cristianorj22/arthus-harness/plugins/mcp-code-review-graph/claude/skills/refactor-safely

Opinionated Claude Code scaffolder — agents, skills, hooks, slash commands. Like create-t3-app, but for your .claude/. Install months of Claude Code discipline in 30 seconds.

Install
npx -y skills add cristianorj22/arthus-harness --skill refactor-safely

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Plan and execute safe refactoring using dependency analysis from the code-review-graph MCP. Use for renames, dead-code removal, or extract-function refactors where breadth-of-impact matters.

SKILL.md

1.6 KB, as published. Nobody here has run it

Refactor Safely

Use the knowledge graph to plan and execute refactoring with confidence.

Steps

  1. Use refactor_tool with mode="suggest" for community-driven refactoring suggestions.
  2. Use refactor_tool with mode="dead_code" to find unreferenced code.
  3. For renames, use refactor_tool with mode="rename" to preview all affected locations.
  4. Use apply_refactor_tool with the refactor_id to apply renames.
  5. After changes, run detect_changes to verify the refactoring impact.

Safety Checks

  • Always preview before applying (rename mode gives you an edit list).
  • Check get_impact_radius before major refactors.
  • Use get_affected_flows to ensure no critical paths are broken.
  • Run find_large_functions to identify decomposition targets.

Token Efficiency Rules

  • ALWAYS start with get_minimal_context(task="<your task>") before any other graph tool.
  • Use detail_level="minimal" on all calls. Only escalate to "standard" when minimal is insufficient.
  • Target: complete any review/debug/refactor task in ≤5 tool calls and ≤800 total output tokens.

Cross-link

  • Pairs with refactor-cleaner agent — agent runs knip/depcheck/ts-prune; this skill does graph-driven dead-code + rename preview.
  • For SAFE-tier removals (orphan exports), prefer the refactor-cleaner agent. For STRUCTURAL refactors (rename a function used in 30 places), use this skill first.

Gives 0 of the 12 instructions most refactoring skills give

Counted across 521 of the 525 authors here whose files we hold, read 2026-08-06

  • run tests after each changein 59 of 521, across 56 files
  • write tests before refactoringin 27 of 521, across 24 files
  • preserve external behaviorin 26 of 521, across 22 files
  • remove dead codein 25 of 521, across 24 files
  • make small incremental changesin 20 of 521, across 17 files
  • break the implementation into tiny commitsin 18 of 521, across 5 files
  • ask the user about alternative optionsin 17 of 521, across 4 files
  • create a GitHub issue with the planin 17 of 521, across 4 files
  • explore the repository to verify assertionsin 17 of 521, across 4 files
  • interview the user about the refactorin 16 of 521, across 3 files
  • check the codebase for test coveragein 16 of 521, across 3 files
  • refactor one thing at a timein 16 of 521, across 12 files

Said here and by no other author read

  • Use refactor_tool in dead_code mode for unused code
  • Use refactor_tool in rename mode to preview locations
  • Run find_large_functions to identify decomposition targets

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.