refactor-component

Apply behaviour-preserving refactors to components with minimal diffs and test proofs.

Updated Apr 18, 2026
One-click install
npx skills add https://github.com/Flintmere/flintmere --skill refactor-component-flintmere
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-component
Source: https://github.com/Flintmere/flintmere/tree/main/.claude/skills/refactor-component
Command: npx skills add https://github.com/Flintmere/flintmere --skill refactor-component-flintmere

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Refactor a component, module, or src/lib file in Flintmere without altering its observable behaviour, reducing complexity when a file grows large or duplication accumulates, while preserving external interfaces.

Core Features & Use Cases

  • Behaviour-preserving refactors that reduce line-count or consolidate duplication without changing how the system behaves externally.
  • Enforced workflow of applying one kind of change per commit to keep history clean and auditable.
  • Tests remain the contract; if tests drift, the refactor is paused and reconciled to maintain correctness.

Quick Start

Plan the smallest safe change and run the test suite to verify behaviour is preserved.

Frequently Asked Questions about refactor-component

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

FAQPage Schema
How do I refactor code safely without changing behaviour?

To refactor code safely, identify and apply the smallest single-kind modification per commit, then require a passing test suite as proof. This produces a minimal diff and a before/after summary without altering observable behaviour.

What is a behaviour-preserving refactor and when do I need it?

A behaviour-preserving refactor reduces line-count or consolidates duplication without changing external interfaces. You need it when a file grows large or duplication accumulates, while tests remain the contract for correctness.

How do I keep version control history clean during a code refactor?

Keep version control history clean during a code refactor by limiting changes to one kind of modification per commit. This yields an auditable, minimal diff that is easy to review and verify against the test suite.

What should I do if tests drift while refactoring a module?

If tests drift while refactoring a module, pause the refactor and reconcile the tests immediately. Tests act as the contract; reconciling them maintains correctness and preserves the original observable behaviour.

Do I need a passing test suite before refactoring a component?

Yes, you need a passing test suite before refactoring a component to verify behaviour is preserved. The test suite acts as the contract; a test-pass proof is required to complete the minimal diff safely.