trace-mcp Safe Refactoring Workflow
A disciplined refactoring playbook that drives trace-mcp tools to assess risk, map impact, rename atomically, and verify results.
Dev & CodingIntermediate★ 140⑂ 19AI score 7/10Last updated: Sep 5, 2026
What it does
- Runs
assess_change_riskbefore any edit, scoring churn, complexity, fan-in/fan-out and test coverage. - Uses
get_refactor_candidatesto find genuine refactor targets instead of guessing. - Pulls the reverse-dependency graph with
get_change_impactso every affected file, symbol and test is reviewed first. - Forbids
Edit+replace_allrenames; mandatescheck_rename(collision detection) thenapply_rename(definition, imports, re-exports, call sites, JSX, tests in one atomic op). - Delegates function extraction to
extract_functionso closure-variable capture isn't missed. - Post-refactor checklist:
register_editto reindex, re-run the complexity report, runget_tests_forresults, andcheck_quality_gateswithscope: "changed".
Who it's for
- Developers already running the trace-mcp MCP server on an indexed codebase.
- Teams burned by cross-file rename breakage and missed import sites.
- Engineers who want measurable proof that a refactor lowered complexity.
Examples
- "Rename
UserServicetoAccountService" → collision check, then repo-wide atomic rename. - "Extract lines 42–67 of
src/checkout.tsinto a function" →extract_functionhandles capture analysis. - "Is it safe to restructure this module?" → risk score plus a full impact list before any edit.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/nikolai-vysotskyi/trace-mcp/HEAD/skills/trace-mcp-refactoring/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/trace-mcp-refactoring folder from the GitHub repo nikolai-vysotskyi/trace-mcp into my ~/.claude/skills/trace-mcp-refactoring/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/nikolai-vysotskyi/trace-mcp.git /tmp/trace-mcp && mkdir -p ~/.claude/skills && cp -r /tmp/trace-mcp/skills/trace-mcp-refactoring ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Install and configure the trace-mcp MCP server in Claude Code and index your project (see the repo README). The skill is inert without it.
- Clone the repository:
git clone https://github.com/nikolai-vysotskyi/trace-mcp.git - Copy the skill folder:
mkdir -p ~/.claude/skills && cp -r trace-mcp/skills/trace-mcp-refactoring ~/.claude/skills/ - Restart Claude Code and confirm the skill appears in your skills list.
- Ask for a rename or extraction (e.g. "rename this symbol everywhere") and the skill will start with the risk assessment step.
View source on GitHub ↗License: MIT