code-cleaning

Refactor staged Python code during pre-commit Git workflows.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Abkr1/liza --skill code-cleaning
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-cleaning
Source: https://github.com/Abkr1/liza/tree/main/skills/code-cleaning
Command: npx skills add https://github.com/Abkr1/liza --skill code-cleaning

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables safe, automatic refactoring of Python code during pre-commit checks, improving readability and maintainability without altering behavior.

Core Features & Use Cases

  • Incremental refactoring: applies small, well-scoped changes to the staged code (rename variables, extract helpers, improve naming, adjust formatting) during pre-commit runs.
  • Safety constraints: preserves existing functionality by limiting transformations to non-breaking edits and requiring tests to pass before commit.
  • Use Case: when preparing a PR with a cleaner codebase, run pre-commit cleanup to ensure consistency across the repository.

Quick Start

Use the pre-commit workflow to automatically clean code on commit.

  • git add -A
  • git commit -m "style: apply code-cleaning with pre-commit"

Frequently Asked Questions about code-cleaning

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

FAQPage Schema
How do I automatically refactor Python code during pre-commit?▼

To automatically refactor Python code during pre-commit, you can use a dedicated pre-commit hook that applies small, safe transformations to your staged Git changes. This ensures clean code without altering behavior.

What is incremental refactoring in a Git workflow?▼

Incremental refactoring in a Git workflow applies small, well-scoped changes to staged code, such as renaming variables or extracting helpers. This improves readability and maintainability before a commit is finalized.

Can I use pre-commit hooks to clean up code for a pull request?▼

Yes, you can use pre-commit hooks to clean up code for a pull request. Running the cleanup process on staged changes ensures consistency and improved readability across the repository before submission.

Does automated Python refactoring preserve existing functionality?▼

Automated Python refactoring preserves existing functionality by limiting transformations to non-breaking edits and requiring tests to pass before the commit is allowed to complete.

What do I need to set up before running automated code cleaning in Git?▼

Before running automated code cleaning in Git, you need Python and the pre-commit framework installed. These allow the refactoring hook to process staged changes safely within your repository.

What are the limitations of safe code transformations during pre-commit?▼

The limitations of safe code transformations during pre-commit include restricting edits to small, non-breaking changes and requiring passing tests, which prevents large or risky refactoring operations.