code-cleaning

Clean and refactor staged Python code during pre-commit flows.

346|50|Updated Jan 17, 2026
One-click install
npx skills add https://github.com/liza-mas/liza --skill code-cleaning-liza-mas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-cleaning
Source: https://github.com/liza-mas/liza/tree/main/skills/code-cleaning
Command: npx skills add https://github.com/liza-mas/liza --skill code-cleaning-liza-mas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps ensure code quality by automatically cleaning and refactoring Python changes during pre-commit, reducing human drift and maintaining readability across the codebase.

Core Features & Use Cases

  • Pre-flight checks automation: Verifies staged changes, runs tests, checks coverage, and guards against large diffs before applying transformations.
  • Deterministic refactoring: Applies small, focused changes that improve style and structure without altering behavior, following SOLID and DRY principles.
  • Batch-driven workflow: Processes changes in batches with approval prompts, supports test maintenance updates, and minimizes risk of breaking tests.

Quick Start

Run the code-cleaner against your currently staged changes to begin the pre-flight checks and the transformation loop. Follow the prompts to approve batches, review proposed changes, and run tests as required.

Frequently Asked Questions about code-cleaning

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

FAQPage Schema
How do I automate Python code cleanup before git commits?

Automating Python code cleanup before git commits involves running a pre-commit process that targets staged changes. This Skill verifies diffs, applies deterministic refactoring, and runs tests to ensure maintainability without altering behavior.

What is deterministic refactoring for staged Python code?

Deterministic refactoring for staged Python code applies small, focused style and structure improvements following SOLID and DRY principles. It enhances readability and maintainability without altering program behavior.

Can I run pre-commit static analysis on only the git diff?

Yes, you can target only the git diff for static analysis. This Skill uses diff-based targeting to ensure batch transformations and pre-flight checks apply exclusively to your staged Python code changes.

Does pre-commit refactoring automatically update tests?

Pre-commit refactoring supports test maintenance updates during batch transformations. It minimizes breaking risk by running validation checks and prompting for approval before applying any code modifications.

What are the limitations of batch-driven code cleaning workflows?

Batch-driven code cleaning workflows require approval prompts for each transformation batch and include explicit failure handling. The process halts if pre-flight checks detect large diffs or failing tests to protect codebase quality.