python-simplifier

Analyze Python AST to compute complexity and detect code smells.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/charlesmsiegel/claude-tooling --skill python-simplifier-charlesmsiegel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-simplifier
Source: https://github.com/charlesmsiegel/claude-tooling/tree/main/skills/python-simplifier
Command: npx skills add https://github.com/charlesmsiegel/claude-tooling --skill python-simplifier-charlesmsiegel

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Python code often becomes tangled and hard to maintain. This Skill simplifies overly complex Python code, improving readability and quality.

Core Features & Use Cases

  • Analyze code to reduce cyclomatic and cognitive complexity while preserving behavior.
  • Detect code smells, anti-patterns, and over-engineering for targeted refactoring.
  • Generate actionable recommendations and example patterns to guide improvements in real projects.
  • Use cases include cleaning up legacy modules, refactoring Django apps, and improving readability of data-processing scripts.

Quick Start

Simplify the provided Python snippet or module to a cleaner, more maintainable version.

Frequently Asked Questions about python-simplifier

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

FAQPage Schema
How do I reduce cyclomatic complexity in Python code?

To reduce cyclomatic complexity in Python code, this Skill analyzes the AST to compute complexity metrics, flags code smells, and generates actionable refactoring recommendations for cleaner solutions.

What is cognitive complexity and how do I detect it in Python scripts?

Cognitive complexity measures how difficult code is for humans to understand. This Skill detects it in Python scripts by analyzing the AST to flag code smells and overengineering indicators, providing JSON or text outputs for targeted refactoring.

How do I refactor a legacy Python module to improve readability?

To refactor a legacy Python module for readability, this Skill simplifies overly complex code into idiomatic solutions while preserving behavior, using AST analysis to detect dead code and coupling issues.

Can I use this to simplify a large Django app codebase?

Yes, you can use this to simplify a large Django app codebase. It is applicable to diverse Python codebases, from small scripts to large modules, analyzing code to reduce complexity and detect anti-patterns for targeted refactoring.

What are common Python code smells and anti-patterns to look for?

Common Python code smells include overengineering, dead code, and potential coupling issues. This Skill identifies these anti-patterns by analyzing the AST, computing complexity metrics, and flagging areas that require targeted refactoring.

Does this approach work for small data-processing scripts?

Yes, this approach works for small data-processing scripts. The Skill is designed to handle diverse Python codebases, analyzing code to reduce cognitive complexity and improve readability across both small scripts and large modules.