code-simplifier

Refactor code for readability and maintainability without changing behavior.

3|Updated Jan 14, 2014
One-click install
npx skills add https://github.com/prateek/dotfiles --skill code-simplifier-prateek
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-simplifier
Source: https://github.com/prateek/dotfiles/tree/main/.agents/skills/code-simplifier
Command: npx skills add https://github.com/prateek/dotfiles --skill code-simplifier-prateek

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Simplify and refine code for readability and maintainability without altering how it behaves, reducing cognitive load during reviews and speeding development.

Core Features & Use Cases

  • Targeted Refactors: Focus on small, reviewable surfaces like touched files or functions to minimize risk.
  • Behavior Preservation: Ensure inputs, outputs, side effects, and public APIs remain unchanged.
  • Standards Alignment: Apply project conventions, linters, and formatting to produce consistent code.
  • Use Case: When preparing a PR, produce a clean, well-documented patch that preserves behavior.

Quick Start

Provide the target code snippet or diff and request a readability-focused refactor while preserving behavior.

Frequently Asked Questions about code-simplifier

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

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

To refactor code for readability without changing behavior, focus on small, targeted edits within touched files or PR diffs while preserving inputs, outputs, side effects, and public APIs. This ensures safe, deterministic refactors that reduce cognitive load during reviews.

What is the best way to simplify code during a PR review?

The best way to simplify code during a PR review is to apply behavior-preserving refactors to small, reviewable surfaces like touched functions. Aligning changes with project conventions and linters produces a clean, well-documented patch that maintains original error semantics.

Can I clean up recently modified code without breaking public APIs?

Yes, you can clean up recently modified code without breaking public APIs by prioritizing small, safe edits that explicitly preserve public interfaces, error semantics, and side effects. This targeted approach minimizes risk when refactoring touched functions across a repository.

How do I ensure a code simplification patch follows project standards?

To ensure a code simplification patch follows project standards, apply existing project conventions, linters, and formatting rules during the refactor. This produces consistent, maintainable code that aligns with repository standards without altering functional behavior.

When should I not use automated code simplification on a repository?

You should avoid automated code simplification when dealing with functions where preserving specific error semantics or side effects is critical and difficult to verify. Refactoring should be limited to small, reviewable surfaces to ensure inputs and outputs remain completely unchanged.