safe-refactor

Coordinates large-scale refactors via Map, Safety Net, Implement, and Close phases.

38|15|Updated Jul 26, 2023
One-click install
npx skills add https://github.com/sisense/compose-sdk-monorepo --skill safe-refactor-sisense
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: safe-refactor
Source: https://github.com/sisense/compose-sdk-monorepo/tree/main/.claude/skills/safe-refactor
Command: npx skills add https://github.com/sisense/compose-sdk-monorepo --skill safe-refactor-sisense

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Execute large, multi-step refactors with a disciplined, risk-aware workflow that protects observable behavior while enabling progress.

Core Features & Use Cases

  • Phase-driven orchestration: Map, Safety Net, Implement, Close, with hard exit gates at each phase.
  • Dual-agent workflow: An orchestrator and a specialized refactor-worker subagent to execute deterministic steps.
  • Working-notes driven: Uses a live plan to ensure traceability and rollback capability across steps.

Quick Start

Initiate the workflow by documenting the scope in working notes, then trigger the orchestrator to map the plan and spawn step agents.

Frequently Asked Questions about safe-refactor

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

FAQPage Schema
How do I safely orchestrate large-scale code refactors across many files?

Safely orchestrate large-scale code refactors using a two-tier orchestration model that maps scope, builds safety nets, implements stepwise changes, and verifies behavior through gated phases to protect observable behavior.

What is the best way to preserve observable behavior during a multi-step code refactor?

Preserve observable behavior during refactoring by establishing characterization tests as a safety net before implementation, then using committed-reviewed results and hard exit gates to validate each step.

How does the two-tier orchestration model work for complex refactoring tasks?

The two-tier orchestration model uses an orchestrator to map the plan and spawn a dedicated refactor-worker subagent, driving stepwise implementation through a live working-notes plan for traceability and rollback.

Can I execute automated refactoring without losing traceability across steps?

Execute automated refactoring with full traceability by maintaining a live working-notes plan that tracks each deterministic step, ensuring rollback capability and committed-reviewed results throughout the workflow.

What are the phases of a risk-aware code refactoring workflow?

A risk-aware code refactoring workflow enforces a four-phase process: Map the scope, build the Safety Net, Implement changes stepwise, and Close with verification, using hard exit gates at each phase.

When should I use a dedicated refactor-worker for code quality improvements?

Use a dedicated refactor-worker for code quality improvements when changes touch many files or modules, requiring deterministic step execution and gated verification to maintain safety during large-scale transformations.