---
name: jordancoin-refactor
description: "Safe refactoring with dependency awareness. Use when restructuring, renaming, moving, extracting, or consolidating code."
license: "MIT"
metadata:
  decimalai-skill-id: "2f8106d0-b97a-4d13-a8cf-1dbca2139fdc"
  decimalai-version-id: "f1b5fbfe-786b-4155-a5a2-e78b81062f56"
  decimalai-version: "1"
  decimalai-body-sha256: "6f2985d784a355d1c6f221361c812d5759a9a602b42509a25b74dba7e2c5a044"
  decimalai-name: "jordancoin/refactor"
  decimalai-format: "1"
  decimalai-invocation: "model"
  decimalai-category: "coding"
  decimalai-source: "https://app.decimal.ai/s/jordancoin-refactor@1/SKILL.md"
---
# Safe Refactoring with Code Intelligence

## Before refactoring

1. Run `codemap --deps .` to understand the dependency graph
2. Identify hub files in the refactoring scope: they need extra care
3. Run `codemap --diff` to see what's already changed on this branch

## Refactoring checklist

- [ ] All tests pass before starting
- [ ] Hub files identified and dependents listed
- [ ] Public API changes planned (additive preferred)
- [ ] Import paths updated if moving files
- [ ] No circular dependencies introduced

## Safe rename pattern

1. Add the new name alongside the old (alias/wrapper)
2. Update all callers to use the new name
3. Remove the old name
4. Run full test suite

## Safe move pattern

1. Create the new file with the same API
2. Re-export from the old location (temporary)
3. Update all importers to use the new path
4. Remove the old file and re-export

## After refactoring

- Run `codemap --deps .` again to verify the graph is clean
- Run `codemap --importers <moved-file>` to check nothing is broken
- Full test suite must pass
