refactor

Refactor codebases with typecheck and test verification plus git revert.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/mferris77/SpringBoard --skill refactor-mferris77
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor
Source: https://github.com/mferris77/SpringBoard/tree/main/vscode-citadel-harness/skills/refactor
Command: npx skills add https://github.com/mferris77/SpringBoard --skill refactor-mferris77

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Large-scale refactors are risky because small changes can introduce type errors, break tests, or leave broken imports across many files; this Skill enforces safety by planning, verifying, and reverting refactors so behavior remains unchanged.

Core Features & Use Cases

  • Baseline Verification: Establishes typecheck and test baselines before any edits to detect pre-existing issues and prevent new regressions.
  • Planned, File-by-File Execution: Produces a concrete plan, creates targets, updates importers, and applies minimal edits in an order that minimizes intermediate breakage.
  • Automated Fix & Revert Workflow: Runs verification, attempts up to two automated fixes for new errors, and performs a full git revert if verification still fails.
  • Use Case: Rename a core exported symbol, extract authentication logic into a new module, or move and split files while ensuring all imports and tests remain valid.

Quick Start

Invoke the refactor skill with a clear target, for example: /refactor extract the auth logic into a separate module.

Frequently Asked Questions about refactor

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

FAQPage Schema
How do I safely refactor code across multiple files without breaking tests?

Safe multi-file refactoring requires establishing baseline typecheck and test verification before edits, applying changes file-by-file, and automatically reverting via git if verification fails. This ensures behavior remains unchanged throughout the process.

Can I rename an exported symbol or extract logic into a new module and automatically revert if it fails?

Yes, automated refactoring applies to renames, extracts, moves, and splits while enforcing baseline test parity. If new errors appear after edits, it attempts two automated fixes and performs a full git revert if verification still fails.

What do I need to safely refactor a codebase using automated rollback?

Automated rollback refactoring requires a codebase under version control with a passing test suite. The process establishes baseline typecheck and test verification before any edits to detect pre-existing issues and prevent new regressions.

What's the best way to execute large-scale code refactors without introducing type errors?

The best way to execute large-scale refactors is through planned, file-by-file execution that updates importers and applies minimal edits in an order that minimizes intermediate breakage, followed by typecheck and test verification.

Why does my multi-file refactor leave broken imports across the codebase?

Multi-file refactors leave broken imports when changes are applied without updating importers or establishing a concrete execution plan. Safe refactoring produces a plan, creates targets, updates importers, and applies minimal edits to prevent this.