Mark Ku's Blog
VS Code Extension

Refactory

Refactorings that know your conventions: where interfaces live, where DI is registered, whether 'use client' belongs. What generic tools can't know, it learns from your repo.

Install from MarketplaceRead the full guide
34
Refactoring actions
18
Languages
534
Automated tests
Free to useNo solution load · never slows VS Code down
Refactor This — Ctrl+Alt+Shift+T
Refactor This menu

Intro video

One minute to see what Refactory solves

What makes it different

Six things that separate having it from not having it

🏠

The generated code looks like your teammates wrote it

Other tools

A fixed template: the interface lands in whatever folder the tool prefers, and the field naming, the this., the XML docs all differ from the file next door — so half the PR comments end up being about formatting.

Refactory

Conventions are measured from the class being edited and its neighbours. Underscores if you use underscores, XML docs if you write XML docs, and Extract Interface goes into the folder your repo actually uses. The result passes your own analyzers instead of flooding review.

🛡️

It refuses when unsure — and names the value

Other tools

A type it can't derive becomes any; a missing constructor argument becomes null!. It compiles, it fails at runtime, and code review cannot see it.

Refactory

Every refactoring has exactly three states: available, available-with-warnings (preview forced), or unavailable with a reason you can read. A plausible-but-wrong result is the one corruption no later gate catches — so it isn't produced.

🔥

It answers "which one first", not "here are 800 warnings"

Other tools

Hundreds of warnings at once, all apparently equal in weight — so the whole rule set gets disabled and nobody looks again.

Refactory

Hotspots = git churn × complexity. A complex file nobody touches is not the emergency a complex file touched weekly is; the dashboard ranks the ten that cost you most and jumps you straight to them.

📈

"Is this getting better?" has an answer

Other tools

Only "how many problems are there right now" — nothing to compare against yesterday. Trends mean standing up a SonarQube-class server, wiring CI, and staffing it.

Refactory

Every completed scan stores a snapshot (last 100 kept), drawn as a trend chart with the per-rule delta against the previous run: +3 cs.magicNumber, −2 react.indexAsKey. All local — no server, no account.

🤖

The AI is yours, not the extension's

Other tools

Sign up, subscribe, ship your source to somebody else's server, and pay by the token.

Refactory

It only writes the prompt; what runs is the claude CLI already on your machine — your login, your model, your approval flow, and you watch the diff land. Your source never leaves your computer, and the extension never sees an API key. No Claude Code installed? Everything else still works.

🌐

Everyday refactorings for 13 more languages, nothing to install

Other tools

Invert if, merge nested if, introduce variable — every JetBrains IDE has had these for fifteen years and VS Code has them for almost no language, and where it does you first install a language server and load the project.

Refactory

Python, Go, Java, Kotlin, Rust, PHP, C, C++, Objective-C, Dart, Swift and Scala all have them, off a single lexical pass — no language server, no SDK, no project load. Open a .go file in a bare VS Code with nothing installed and they are still there.

Three engines, one job each

Never rebuilds what the editor already has — only fills what nobody serves

⚛️

TypeScript / React engine

Extract component (same file or new file), extract hook, safe delete, rename a prop including every call site, import path conversion, 'use client' boundary diagnostics — JavaScript and JSX included.

TS · TSX · JS · JSX

🧩

C# engine (Roslyn sidecar)

Add injected dependency (six coordinated edits), extract interface into the folder your repo actually uses, sync interface members to every implementation, DI registration, clone a controller into the next API version.

C# · .NET 8

🌐

Polyglot lexer engine

Invert if, merge / split if, introduce / inline variable, De Morgan's law, convert to interpolated string — no language server, no SDK, nothing to install.

Python · Go · Java · Kotlin · Rust · PHP · C · C++ · Obj-C · Dart · Swift · Scala

Key features

Details built so the generated code looks like its neighbours wrote it

🎯

Refactor This menu

One keystroke lists everything applicable here, built-in refactorings alongside Refactory's; unavailable actions are listed too, with the reason.

🏠

Convention-aware

Extract Interface learns its target folder from sibling classes; underscores, this., XML docs are measured from the class being edited, not read from settings.

🔗

Solution-shaped multi-file ops

Adding an injected dependency lands six edits at once: using, field, XML doc, constructor parameter, <param> tag, assignment — one undo stop.

⚛️

React semantics

Extract component infers prop types, carries 'use client' to the new file verbatim, and exports module constants instead of duplicating them.

✏️

IDE-grade linked edit

While naming, the call site, interface, function and type reference all enter edit mode together — type once, all update.

🛡️

Refusals over features

Underivable types refuse and name the prop, dependency arrays are never modified, a manual new blocks injection — uncertainty is stated, never approximated.

Never slows the editor

No solution load, no TypeScript program; cross-file questions are answered by a declaration index and an import graph, built in under a second.

📝

Project convention file

.refactory.json is committed — conventions belong to the repository, not personal settings; anything absent is detected.

🔍

37 code-smell rules

The "compiles, but will hurt you" layer for React and C#: sync-over-async, components defined inside components, state mutated in place — traps are warnings, taste is a hint.

📊

Code Health dashboard

Scan the whole workspace (nothing opened, no Problems flood), group by file or rule, eight themes, and Copy report drops Markdown straight into a PR.

📐

Complexity and an A–F health score

Cyclomatic complexity per function, method and constructor, counted identically in both engines so a mixed repo's numbers are comparable; every file gets a 0–100 score graded A–F, plus a workspace-wide Most complex functions list.

🕰️

Scan history and trends

Every completed workspace scan stores a snapshot (last 100 kept), drawn as a trend chart with the per-rule delta since the previous run. Cancelled scans record nothing — a half-finished sweep would draw a phantom improvement.

🔥

Hotspots: churn × complexity

One git log for the whole repository, joined against the health score — frequently edited and complex ranks first. Not a git repository? The section is simply absent, never an error.

Deep review briefing

✦ Review on any file or hotspot writes a Markdown briefing — metrics, churn, hotspot rank, every finding with its rule id and line — then opens your own claude session pointed at it. Review top 3 briefs the three riskiest files in one session, because "which of these first?" cannot be answered by a session that sees only one.

🤖

Fix with Claude Code

A quick fix that opens your local claude session on that smell — your login, your model, your approval flow; the extension only writes the prompt.

🧹

Clean Up This File

Applies every mechanical fix with exactly one correct answer at once (throw ex; → throw; and friends) — one undo reverts the lot.

Real screenshots and recordings

Everything below is a real editor capture, not a mockup

Refactor This menu

Refactor This menu

Built-in refactorings sit alongside Refactory's in one menu; recently used actions float to the top, unavailable ones carry their reason.

React extract component (recording)

React extract component (recording)

Select JSX, run, name in place — props inferred from captured values, four positions linked-editing together.

C# add injected dependency (recording)

C# add injected dependency (recording)

Six edits land at once: the using is inserted in sorted position, the <param> tag at the matching parameter position.

Refactor Preview coordinated edits

Refactor Preview coordinated edits

Plans carrying warnings force a preview — every edit is visible before it lands.

Code Health dashboard

Code Health dashboard

A workspace overview of all 37 smells: grouped by file or rule, filterable by severity, click to jump — eight themes to pick from.

Complexity, trends and hotspots

Complexity, trends and hotspots

Health scores, the most complex functions, a trend bar per scan with the per-rule delta, and the churn × complexity hotspot ranking — this is the page that answers "what should I fix first?".

Live smell detection (recording)

Live smell detection (recording)

React problems get squiggled the moment you type them, and the squiggles and Problems entries disappear the moment the code is fixed — no save, no waiting for CI.

Three ways in

Position decides everything — nothing is offered "just in case"

  • The Refactor This menu — unbound on every platformCtrl+Alt+Shift+T
  • The native lightbulb menu, with Refactory's actions nested in the groups they belong toCtrl+.
  • Commands that operate on a whole file (e.g. convert every import)Ctrl+Shift+P → Refactory

How to install

  1. 1

    Press Ctrl+Shift+X in VS Code to open the Extensions panel.

  2. 2

    Search for "Refactory" and click Install.

  3. 3

    Open a file in any supported language and press Ctrl+Alt+Shift+T. C# features need a .NET 8 runtime; without one only the C# half switches off.

Or install straight from the Marketplace, or run the command below.

Refactoring that knows your conventions

Free to use, it never slows VS Code down, and your source never leaves your machine. 34 actions, 37 code-smell rules, A–F health scores and hotspot ranking, across 18 languages. Install Refactory from the Marketplace now.

Refactory — Convention-Aware Refactoring for VS Code | Mark Ku's Tech Blog - Mark Ku's Tech Notes