home / skills / shotaiuchi / dotclaude / refactor-impact

refactor-impact skill

/dotclaude/skills/refactor-impact

This skill analyzes blast radius, identifies affected consumers, and assesses risk levels to guide safe refactoring decisions.

npx playbooks add skill shotaiuchi/dotclaude --skill refactor-impact

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.0 KB
---
name: refactor-impact
description: >-
  Blast radius and risk assessment for refactoring. Apply when analyzing
  affected consumers, change propagation, risk levels, and areas requiring
  extra caution during refactoring.
user-invocable: false
---

# Impact Assessor Analysis

Analyze the blast radius of changes, identify affected consumers, and assess risk levels.

## Analysis Checklist

### Blast Radius Analysis
- Map all modules directly affected by the refactoring
- Trace transitive impact through dependency chains
- Identify cross-service or cross-repository effects
- Estimate the number of files, functions, and tests impacted

### Consumer Impact
- List all internal consumers of the code being changed
- Identify external consumers (APIs, SDKs, plugins)
- Check for downstream services that depend on behavior
- Assess impact on build pipelines and deployment processes

### Risk Categorization
- Classify changes by likelihood of causing regression
- Assess severity of potential failures for each change
- Identify single points of failure in the refactoring plan
- Rate overall risk considering both likelihood and severity

### Caution Areas
- Flag code with high business criticality (payments, auth, data)
- Identify areas with poor test coverage in the blast radius
- Mark recently modified code that may have unstable behavior
- Highlight shared utilities used by many unrelated features

### Rollback Impact
- Assess difficulty of reverting each change independently
- Identify data migrations that complicate rollback
- Check for state changes that cannot be undone automatically
- Plan communication strategy if rollback is needed

## Output Format

Report findings with impact ratings:

| Impact | Description |
|--------|-------------|
| Breaking | Change will cause failures in production if not coordinated |
| High | Significant risk to critical functionality or many consumers |
| Medium | Moderate risk with known mitigation strategies |
| Low | Minimal risk, isolated change with limited blast radius |

Overview

This skill provides a focused blast radius and risk assessment for planned refactors. It helps you identify affected modules and consumers, estimate change propagation, and surface areas that require extra caution. The output ranks impact and guides rollback and mitigation planning.

How this skill works

The assessor maps directly affected modules and traces transitive dependencies to visualize the blast radius. It enumerates internal and external consumers, evaluates test coverage and recent churn, and scores each change by likelihood and severity. The result is a concise impact report with categorized risk levels and recommended caution areas.

When to use it

  • Before merging large refactors or API changes
  • When redesigning shared libraries or utilities
  • Prior to data migrations or schema changes
  • Before cross-repository or cross-service upgrades
  • When planning releases touching critical business flows

Best practices

  • Map dependency chains and prioritize high-consumer modules first
  • Run targeted tests and measure coverage within the blast radius
  • Flag and add tests for areas with recent churn or low coverage
  • Prepare rollback plans for changes with stateful or irreversible effects
  • Communicate risk and mitigation to owners of affected consumers

Example use cases

  • Refactoring a shared auth library used by multiple services
  • Renaming or changing the signature of a public API endpoint
  • Consolidating utilities into a single package consumed across teams
  • Introducing a database schema migration that updates persisted state
  • Splitting a monolith module into microservices

FAQ

What output format should I expect?

A concise report listing impacted modules, affected consumers, risk ratings (Breaking, High, Medium, Low), and recommended mitigation steps.

How are risk levels determined?

Risk is assessed by combining likelihood of regression (based on change size, churn, and test coverage) with failure severity (business criticality and number of consumers).