agentleFS
sscodeaisscodeai/agency-agents-ja/.claude/skills/refactor-safely/skill.md

Refactor Safely

Skill10 starsChanged 6 months agoMITView on GitHub

Plan and execute safe refactoring using dependency analysis

4 other projects use a version of this, 2 of them edited.

Adopted by

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 2

    1. nilsteampassnet/TeamPass★ 1.9k100% same
    2. dorian-akhs/skills★ 0100% same

    Edited · 2

    1. microsoft/Microsoft365DSC★ 2.5k100% same
    2. theexperiencecompany/gaia★ 325100% same

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 2 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

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

    line 8
  2. Very specific:

    Use refactor_tool with mode="suggest" for community-driven refactoring suggestions.

    line 12
  3. Very specific:

    Use refactor_tool with mode="dead_code" to find unreferenced code.

    line 13
  4. Very specific:

    Use apply_refactor_tool with the refactor_id to apply renames.

    line 15
  5. Very specific:

    After changes, run detect_changes to verify the refactoring impact.

    line 16
  6. Distinctive:

    Always preview before applying (rename mode gives you an edit list).

    line 20
  7. Very specific:

    Check get_impact_radius before major refactors.

    line 21
  8. Very specific:

    Use get_affected_flows to ensure no critical paths are broken.

    line 22
  9. Very specific:

    Run find_large_functions to identify decomposition targets.

    line 23
  10. Very specific:

    ALWAYS start with get_minimal_context(task="<your task>") before any other graph tool.

    line 26
  11. Very specific:

    Use detail_level="minimal" on all calls.

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
skill.md

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.