refactor-check

Solid

Safety analysis before refactoring -- dependency graph, test coverage, public API exposure, blast radius verdict.

AI & Automation 53 stars 9 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 88/100

Stars 20%
58
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Refactor Check Analyze whether a refactoring is safe BEFORE making changes. Produces a verdict with specific risks and mitigation steps. ## Steps 1. **Get the full dependency graph** for the target: - `graph(action="update")` to ensure graph is current - `query(action="query", pattern="callers_of", target="<name>")` -- who calls this - `query(action="query", pattern="callees_of", target="<name>")` -- what this calls - `query(action="query", pattern="imports_of", target="<name>")` -- what this imports - If it is a class: `query(action="query", pattern="inheritors_of", target="<name>")` and `query(action="query", pattern="children_of", target="<name>")` 2. **Identify test coverage**: - `query(action="query", pattern="tests_for", target="<name>")` -- direct tests - For each caller, also check `tests_for` to see if callers have integration tests covering this function indirectly - Record: number of direct tests, number of callers with tests, number of callers without tests 3. **Flag public API exposure**: - Check if the target is exported from a package `__init__.py`, `index.ts`, or similar - Check if the target is referenced from outside its own module/package - Check if the target appears in documentation or type stubs - Public API = any function/class importable by external consumers 4. **Estimate blast radius**: - `query(action="impact", target="<name>")` -- full impact analysis - Count: total impacted files, total impacted fu...

Details

Author
n24q02m
Repository
n24q02m/better-code-review-graph
Created
2 months ago
Last Updated
2 days ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category