simple-refactor

Propose safe small refactors to improve code readability without changing behavior.

Updated Dec 28, 2025
One-click install
npx skills add https://github.com/oalansilva/crypto --skill simple-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: simple-refactor
Source: https://github.com/oalansilva/crypto/tree/main/.codex/skills/planning/simple-refactor
Command: npx skills add https://github.com/oalansilva/crypto --skill simple-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers quickly improve code readability by suggesting small, non-behavior-changing refactors when codebases feel noisy or repetitive.

Core Features & Use Cases

  • Identify duplication or overly long functions.
  • Propose safe extractions, naming improvements, and minor refactor steps.
  • Provide validation checks to ensure behavior remains unchanged.

Quick Start

Identify a target function with duplication or long blocks and propose a small, safe refactor.

Frequently Asked Questions about simple-refactor

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

FAQPage Schema
How do I refactor long functions to improve code readability?

Refactor long functions by identifying repetitive blocks and proposing safe extractions or naming improvements. This process detects duplication in moderate-sized codebases and suggests concrete changes to enhance code readability without altering behavior.

What is a safe code refactor that does not change behavior?

A safe code refactor improves readability through minor steps like extraction and renaming while ensuring behavior remains unchanged. Validation checks and tests verify that the internal structural changes introduce no functional side effects.

How do I extract duplicated code blocks in Python and JavaScript?

Extract duplicated code blocks in Python and JavaScript by detecting refactor opportunities within long functions and proposing concrete extraction changes. This isolates repetitive logic into separate, readable units without changing the original behavior.

Can I improve code maintenance by renaming variables in noisy codebases?

Improve code maintenance by proposing naming improvements and minor refactor steps in noisy codebases. Renaming variables and functions clarifies intent, which reduces cognitive load and makes ongoing maintenance significantly easier.

What is the best way to verify behavior remains unchanged after a refactor?

Verify behavior remains unchanged after a refactor by running validation checks and existing tests against the modified codebase. This ensures that proposed extraction or rename changes preserve the original functional output.

When should I avoid doing small refactors on my codebase?

Avoid small refactors when the codebase lacks test coverage to verify behavior remains unchanged. Without validation checks, even minor extraction or rename operations risk introducing undetected functional regressions.