# Clean Architecture Refactor

> Refactors codebases toward clean architecture boundaries and dependency direction. Use when services mix domain, application, and infrastructure concerns.

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

---


# Clean Architecture Refactor

## Workflow

1. Map current layers and identify dependency violations.
2. Define target boundaries (Web, Application, Domain, Infrastructure).
3. Extract interfaces/ports and move implementations outward.
4. Isolate domain logic from frameworks and persistence details.
5. Propose incremental migration slices with risk notes.

## Output template

```md
## Boundary violations
- Item:

## Refactor slices
1. Slice, impact, rollback
2. Slice, impact, rollback
```

