refactor

Reviews code changes and proposes structural refactors with Mermaid before/after diagrams.

9|Updated Jul 17, 2026
One-click install
npx skills add https://github.com/Yassimba/loom --skill refactor-yassimba
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor
Source: https://github.com/Yassimba/loom/tree/main/skills/refactor
Command: npx skills add https://github.com/Yassimba/loom --skill refactor-yassimba

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Code changes often accumulate incidental complexity, spaghetti branching, and duplicated machinery that behavior-correct reviews miss. This Skill performs a strict, multi-topic refactor review of uncommitted changes and presents visual before/after proposals before touching any code. ## Core Features & Use Cases - Multi-topic review: Dispatches focused review passes for structural simplification, OSS dependency replacement, design patterns, tests, and type contracts, each following a shared review contract with behavior-preservation evidence. - Visual proposals: Presents proposed refactors as Mermaid diagrams (flowchart, class, sequence, and more) with color-coded added, removed, and changed elements plus explicit before/after code snippets. - Approval-gated implementation: Implements only the proposals the user explicitly approves, keeping behavior changes flagged for explicit consent. - Use Case: After finishing a feature branch, run the skill to audit the diff for missed simplifications, replace hand-rolled machinery with standard library or existing dependencies, and get a diagram-backed plan before committing. ## Quick Start Use the refactor skill to review my current uncommitted changes and show me the proposed simplifications with Mermaid diagrams.

Frequently Asked Questions about refactor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review uncommitted changes for refactoring opportunities?

Invoke the refactor skill with an optional scope; it inspects dirty and untracked source files, excluding generated and vendored output. It then runs topic-specific reviews and presents proposals as Mermaid diagrams with before/after code snippets.

What kinds of refactoring does this review cover?

It covers five topics: structural simplification, replacing custom machinery with OSS or standard library candidates, design pattern alignment, test simplification without losing fault detection, and type contract improvements. Each topic follows a shared review contract with behavior-preservation evidence.

Does the refactor review change code automatically?

No. The skill presents proposed refactors in chat with diagrams and code snippets, then asks for approval before implementing anything. Behavior-changing proposals are explicitly flagged and require separate consent.

Can it suggest replacing custom code with existing libraries?

Yes. The OSS topic compares custom machinery against a catalog of Python and JavaScript/TypeScript standard library and package candidates, weighing semantic fit, migration cost, and total ownership cost before recommending a swap.

When should I not use a strict refactor review?

Avoid it for early exploratory code where structure is still in flux, or when a change is intentionally temporary. The review demands no structural regressions and no missed simplifications, which can slow down experimental iteration.