clean-code-refactor

Refactor Python, JavaScript, C#, Rust, and Go code to resolve clean coding violations.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/OntoLedgy/ol_ai_context_library --skill clean-code-refactor-ontoledgy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code-refactor
Source: https://github.com/OntoLedgy/ol_ai_context_library/tree/main/skills/clean-code-refactor
Command: npx skills add https://github.com/OntoLedgy/ol_ai_context_library --skill clean-code-refactor-ontoledgy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill eliminates the tedious, error-prone manual work of identifying and fixing clean code violations across Python, JavaScript, C#, Rust, and Go codebases, ensuring consistent code quality without hours of manual review and reducing the risk of human error during refactoring.

Core Features & Use Cases

  • Multi-Language Support: Refactor code in Python, JavaScript/TypeScript, C#, Rust, and Go with language-specific best practices built in.
  • Dual Convention Sets: Enforce standard Clean Code (Robert C. Martin) rules or OB BORO Quick Style Guide conventions for OntoLedgy codebases.
  • Flexible Refactoring Modes: Target specific violation types (naming, error handling, function size, code smells, class structure) or run a full end-to-end refactoring workflow.
  • Safe Workflow: Follows a strict refactoring order to avoid rework, flags structural changes that are out of scope, and outputs review diffs by default to prevent unintended modifications.
  • Use Case: After running a clean-code-reviewer scan that flags a 54-line function with poor error handling and magic numbers, use this Skill to automatically extract the function into single-responsibility helpers, add proper error propagation, and replace hardcoded values with named constants.

Quick Start

Use the clean-code-refactor skill to fix all clean code violations in the src/data_processor.py file using the general standard, outputting a review diff for your approval before applying any changes.

Frequently Asked Questions about clean-code-refactor

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

FAQPage Schema
How do I automate clean code refactoring for Python and Rust?

Automate clean code refactoring for Python and Rust by rewriting existing code to resolve violations like poor naming, oversized functions, and code smells, producing review diffs for approval before applying fixes.

What is the safest way to fix code smells without introducing new defects?

The safest way to fix code smells without introducing new defects is to follow a strict refactoring sequence that outputs review diffs by default and flags structural changes requiring architect intervention before any modifications are applied.

Can I refactor specific clean code violations like improper error handling?

Yes, you can refactor specific clean code violations like improper error handling by using targeted refactoring modes to address naming, function size, class structure, or error propagation individually or across full codebases.

Does this refactoring approach support both standard Clean Code and custom style guides?

Yes, this refactoring approach supports both general Clean Code conventions by Robert C. Martin and the OB BORO Quick Style Guide standards, allowing you to enforce consistent code quality across different project requirements.

How do I handle structural code changes flagged during automated refactoring?

Handle structural code changes flagged during automated refactoring by routing them to an architect or engineer for manual intervention, ensuring out-of-scope modifications are separated from safe automated fixes like extracting helpers or replacing magic numbers.