code-refiner

Refactor Python, Go, TypeScript/JavaScript, and Rust code while preserving behavior.

310|45|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/Mathews-Tom/praxis-skills --skill code-refiner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-refiner
Source: https://github.com/Mathews-Tom/praxis-skills/tree/main/skills/code-refiner
Command: npx skills add https://github.com/Mathews-Tom/praxis-skills --skill code-refiner

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Long, tangled, or idiomatically inconsistent code that is hard to read, maintain, and review without changing its observable behavior; it reduces cognitive load and technical debt by applying targeted, behavior-preserving refinements.

Core Features & Use Cases

  • Multi-pass analysis: Reconnaissance, structural analysis, refactoring execution, verification, and reporting to ensure safe, incremental changes.
  • Language-agnostic guidance: Tailored idiom recommendations and tactics for Python, Go, TypeScript/JavaScript, and Rust using embedded references.
  • Automated metrics & verification: Uses a builtin Python complexity_report tool and git-based scope detection to quantify complexity deltas and run verification steps (tests, linters, manual trace).
  • Conservative behavioral constraints: Enforces strict rules to never change observable behavior, public APIs, or introduce new dependencies, with configurable aggressiveness modes (quick, standard, deep, surgical).
  • Developer-facing report generation: Produces per-file change summaries, complexity deltas, and risk assessments to build trust before committing.

Quick Start

Refine the recent git changes to reduce nesting and improve readability while preserving exact behavior.

Frequently Asked Questions about code-refiner

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

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

You can refactor recent git changes by applying targeted, behavior-preserving refinements to reduce nesting and improve readability. The process uses git-based scope detection to identify changed files, then applies multi-pass structural analysis and refactoring to simplify the code.

Can I use static analysis to simplify recent git changes in Python and TypeScript?

Yes, you can simplify recent git changes in Python, TypeScript, Go, and Rust. The refinement process applies language-specific idiom recommendations and uses a builtin Python complexity_report tool to quantify complexity deltas and run verification steps.

What is the safest way to remove dead code and reduce nesting in complex modules?

The safest approach uses multi-pass analysis with conservative behavioral constraints to remove dead code and reduce nesting. It enforces strict rules to never change observable behavior or introduce new dependencies, verifying results with linters and type-checks before generating a risk assessment.

Does behavior-preserving code refactoring support Rust and Go modules?

Yes, behavior-preserving refactoring supports Rust and Go modules, alongside Python and TypeScript/JavaScript. It provides tailored idiom recommendations and structural refactoring tactics specific to each language to simplify complex source code into idiomatic implementations.

What are the limitations of automated code refactoring with complexity analysis?

Automated code refactoring with complexity analysis is limited by strict constraints that prevent changing observable behavior, altering public APIs, or introducing new dependencies. It operates within configurable aggressiveness modes and relies on available linters, type-checkers, and tests for verification.