Refactor

Refactors complex codebases while preserving behavior and guided by tests, PRD, and documentation.

54|7|Updated Sep 19, 2021
One-click install
npx skills add https://github.com/Vrooli/Vrooli --skill refactor-vrooli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Refactor
Source: https://github.com/Vrooli/Vrooli/tree/main/scenarios/prompt-manager/store/skills/packs/core/refactor
Command: npx skills add https://github.com/Vrooli/Vrooli --skill refactor-vrooli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Brings disciplined, behavior-preserving refactors to local scenarios suffering from tech debt by keeping focus on structure, readability, and maintainability without changing intended outcomes.

Core Features & Use Cases

  • Guided Priority Scoping: Start each iteration with tidiness-manager recommend-refactors for {{TARGET}} to highlight stale, complex, or duplicated areas demanding cleanup.
  • Behavior Safety: Treat passing tests, the PRD, and operational targets as the source of truth so every change preserves user workflows, API contracts, and safety guarantees.
  • Documentation & Knowledge Integration: Read the {{TARGET}} problems doc via knowledge-observatory-tools, capture insights for the Tech Debt section, and note remaining structural issues for future refactors.

Quick Start

Ask the refactor skill to run tidiness-manager recommend-refactors for the current target and review the returned files for structured cleanup opportunities.

Frequently Asked Questions about Refactor

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

FAQPage Schema
How do I refactor complex code to improve maintainability without changing behavior?

This Skill refactors code by applying tidiness-manager recommendations to identify complex areas, using passing tests, PRD, and documentation as the source of truth to preserve all intended behavior and safety assertions.

What is the best way to identify which files need refactoring in a local software project?

You can find refactoring targets by running tidiness-manager recommend-refactors for your target, which highlights stale, complex, or duplicated areas demanding cleanup and structural restoration.

Does this refactoring approach require existing tests and documentation?

Yes, this approach requires passing tests, a PRD, and operational documentation to define behavior, ensuring every structural change preserves user workflows, API contracts, and safety guarantees.

How do I track tech debt and structural issues discovered during a code refactor?

Track tech debt by reading your target's problems doc via knowledge-observatory-tools, capturing insights in the Tech Debt section, and noting remaining structural issues for future refactoring iterations.

Can I use this to clean up duplicated code without breaking safety assertions?

Yes, you can clean up duplicated code safely because the Skill treats tests and operational targets as the source of truth, keeping safety assertions unchanged throughout the structural refactor.