# Refactor

> Restructure a codebase the way a principal engineer does as a product grows — merge redundant concepts, extract the horizontal layer four modules reimplemented, draw real module boundaries, lift a cohesive core out into its own package/SDK so it is testable and reusable, reorganize the tree so it matches the architecture, shrink an overgrown public surface, and give a concept the contract its job calls for — the provider pattern (Go interface, TS interface, Python Protocol, Rust trait) with one implementation per variant in a registry, instead of the same if/else-by-name chain repeated across twenty files. Evidence-first: a module dependency graph (god modules, cycles, extraction candidates, upward imports), measured agent traffic per file, and a surface census — then before/after architecture figures rendered with artifacts-cli, then behavior-preserving PRs. Triggers on: 'refactor this codebase', 'clean up the architecture', 'the codebase has gotten messy', 'agents keep getting lost in this repo', 'merge these duplicate concepts', 'extract an SDK', 'split this package', 'module boundaries', 'reorganize the file tree', 'circular dependencies', 'god module', 'too many commands', 'does the code match the docs', 'provider pattern', 'should this be an interface', 'if/else chain on a name', 'plugin architecture', 'strategy pattern'."

## Facts
- Page: https://tashan.sh/capability/skill-phnx-labs-refactor
- tashan id: skill:phnx-labs/refactor
- Source: https://github.com/phnx-labs/.agents
- Type: skill
- Category: devtools
- tashan score: 55.0 / 100
- Adoption: 20.0
- Upkeep: 98.0
- Freshness: 96.0
- Evidence coverage: 84% of the inputs this score can use
- Health: active
- Instruction depth: not yet graded
- Official: no

## Install

```sh
cp -r refactor ~/.claude/skills/
```

## Security audit
Not scanned. We audit npm-published capabilities; this one has no npm package we can resolve, or has not reached the queue. This is not a clean bill of health.

---
Measured 2026-09-12 by tashan (https://tashan.sh) from public evidence. Scorer s5.
