Index of every page on this site: llms.txt
All skills
tirth8205 avatar

/refactor-safely

@bbdda4b
Run it yourself

Plan and execute safe refactoring using dependency analysis

Use this Skill: https://skilld.dev/gh/tirth8205/code-review-graph/refactor-safely

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈19 tokens for metadata: the name and description. ≈326 when used: this file.

How this Skill uses context

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈77 characters, or 1.0%.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Refactor Safely

Plan a refactor from the dependency graph and apply renames from a preview.

Steps

  1. Call refactor_tool with mode="suggest" for refactoring candidates, or mode="dead_code" for unreferenced code.
  2. For a rename, call refactor_tool with mode="rename", old_name and new_name. Check the returned edit list before applying.
  3. Call apply_refactor_tool with the returned refactor_id to apply the rename.
  4. Before a large refactor, call get_impact_radius_tool and get_affected_flows_tool to see the dependents and critical paths involved.
  5. Call find_large_functions_tool to find functions worth splitting.
  6. After the change, call detect_changes_tool to confirm the impact matches the plan.

Token Efficiency Rules

  • Call get_minimal_context_tool(task="<your task>") before any other graph tool.
  • Pass detail_level="minimal" unless it is not enough. Minimal drops source, so leave semantic_search_nodes_tool(include_source=True) and get_review_context_tool at standard.
  • Prefer a targeted query_graph_tool call over a broad listing call.
  • Budget: about five tool calls per task. Source snippets stand in for file reads.
  • Read the implementation and its tests before changing code. The graph narrows scope; it does not replace the source.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts10d3 checks · Risk SAFE
  • Gen Agent Trust Hub11d

    The skill provides a framework for refactoring code using dependency analysis tools. It is generally safe for its intended purpose but carries a low risk of indirect prompt injection, as malicious instructions embedded in source code comments could potentially influence the agent during the analysis and refactoring process.

  • Socket10d

    No alerts

  • Snyk11d

    Risk: LOW · No issues

Signed by skilld at bbdda4b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 2 weeks ago

README badge

README badge for tirth8205/code-review-graph/refactor-safely