From typegraph
Verifies refactor safety for TypeScript modules by tracing call chains, checking circular dependencies, and analyzing module boundaries before renaming, moving, or restructuring code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/typegraph:refactor-safetyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Verify a refactor is safe before making changes by checking call chains, circular dependencies, and module boundaries.
Verify a refactor is safe before making changes by checking call chains, circular dependencies, and module boundaries.
Call ts_trace_chain on the symbol being refactored to understand its full definition chain. This reveals all the layers of indirection the refactor needs to preserve.
Call ts_import_cycles filtered to the file being refactored. If the file participates in a cycle, the refactor must not break or worsen it.
Call ts_module_boundary with the files involved in the refactor (source + destination). Check:
Call ts_references on the key symbol to get the complete list of call sites that need updating.
Present a safety assessment:
User: "I want to move AuthService from packages/core to apps/gateway"
1. ts_trace_chain -> AuthService defined in core, consumed via Layer in gateway
2. ts_import_cycles -> No cycles involving AuthService.ts
3. ts_module_boundary -> 12 incoming edges (other core modules import it), 3 outgoing
4. ts_references -> 23 references across 15 files
CAUTION: AuthService has 12 incoming edges within packages/core.
Moving it to apps/gateway would break the core -> gateway dependency direction.
Consider: keep the interface in core, move only the Live implementation.
npx claudepluginhub guyowen/typegraph-mcpAnalyzes the impact of changing a TypeScript symbol by combining blast radius, dependents, and module boundary analysis. Useful before modifying widely-used symbols or assessing refactoring risk.
Safe refactoring workflow using trace-mcp — assess risk, find candidates, check impact, and rename symbols across all files without missing import sites or cross-file references.
Safely refactors code by renaming symbols, extracting modules, splitting functions/services using GitNexus tools for impact analysis, dry-run previews, and change detection.