# Refactor

> Refactor - Refactoring Proposals

- Skill: `nwiizo/refactor` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add nwiizo/refactor`
- Raw SKILL.md: https://api.skillmd.com/api/skills/nwiizo/refactor/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: nwiizo (https://skillmd.com/u/nwiizo)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/nwiizo/refactor

---


# Refactor - Refactoring Proposals

## Execution Steps

1. Run `cargo run -- coupling $ARGUMENTS` to analyze
2. Identify specified issue type (default: all)
3. Propose refactoring steps with Before/After code examples
4. Present priority table and phased migration plan

## Issue Types

| Type | Description |
|------|-------------|
| `global-complexity` | Strong coupling to distant modules |
| `cascading-change` | Coupling to volatile modules |
| `inappropriate-intimacy` | Internal access across boundaries |
| `high-efferent` | Too many outgoing dependencies |
| `high-afferent` | Too many incoming dependencies |
| `all` | All issue types (default) |

## Verification

```bash
# Before refactoring
cargo run -- coupling --summary ./src > before.txt

# After refactoring
cargo run -- coupling --summary ./src > after.txt

# Compare
diff before.txt after.txt
```

## Guidelines

- Split large changes into small commits
- Verify tests pass at each step
- Document change intent for reviewers

Code pattern examples: [patterns.md](patterns.md)

