refactor-loop

Automate a four-stage refactor loop with previews, compile checks, and validation.

Updated Mar 13, 2026
One-click install
npx skills add https://github.com/darylmcd/Roslyn-Backed-MCP --skill refactor-loop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-loop
Source: https://github.com/darylmcd/Roslyn-Backed-MCP/tree/main/skills/refactor-loop
Command: npx skills add https://github.com/darylmcd/Roslyn-Backed-MCP --skill refactor-loop

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides engineers through a disciplined four-stage refactor loop: pick a primitive, preview, apply with verification, and validate after the change, reducing risk and ensuring traceability.

Core Features & Use Cases

  • Structured multi-stage editing: orchestrates choose-preview-apply-validate cycles for non-trivial refactors.
  • Preview-driven safety: shows diffs and captures a preview token before applying.
  • Verification and validation: runs compile checks and post-edit validations to detect regressions.
  • Use Case: when renaming a symbol across files, extracting a method, or restructuring logic with safety checks.

Quick Start

Describe your refactor intent and let the tool perform the four-stage loop—pick a primitive, preview, apply with verify, then validate.

Frequently Asked Questions about refactor-loop

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

FAQPage Schema
How do I safely rename a symbol across multiple files without breaking my code?

Multi-file refactoring requires explicit previews, compile checks, and post-edit validation to prevent regressions. The tooling operates within an active workspace to capture preview tokens before applying any symbol-level changes.

What is the safest way to extract a method from existing code logic?

Safe method extraction follows a choose-preview-apply-validate cycle. By capturing a preview token and running post-edit validations, the process reduces risk and ensures the restructured logic maintains correctness before commit.

Can I preview code changes before applying a multi-file refactor?

Yes, preview-driven safety shows diffs and captures a preview token before applying changes. This ensures you review symbol-level and multi-file restructuring operations explicitly within your active workspace before anything is modified.

How do I validate code correctness after restructuring logic in a workspace?

To validate correctness after restructuring, run compile checks and post-edit validations as part of the apply-verify-validate loop. This detects regressions immediately after the change is applied within the active workspace.

When do I need a structured refactor loop instead of manual editing?

A structured refactor loop is needed for non-trivial changes like multi-file symbol renames or logic extractions. It reduces risk by orchestrating choose-preview-apply-validate cycles with explicit previews that manual editing lacks.

Does this refactoring approach work without external dependencies?

Yes, the refactoring approach operates within an active workspace and requires no external dependencies. It handles symbol-level and multi-file changes using explicit previews and built-in compile checks for correctness.