Index of every page on this site: llms.txt
All skills
Run it yourself

This skill should be used when the user asks to "clean up code", "remove dead code", "simplify this function", "this code is too complex", "reduce complexity", "find unused imports", "code quality sweep", or "/simplifier". Focuses on dead code, complexity reduction, and duplication removal.

  • 6 files
  • 17.5 KB
  • Updated 2 days ago
  • GitHub
Use this Skill: https://skilld.dev/gh/utkudarilmaz/claude-code-setup/simplifier

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencespython-patterns.md

≈702 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Python Simplification Patterns

Dead Code

# DEAD: Unused import
import os  # Never used

# DEAD: Unused variable
config = load_config()  # Never referenced

# DEAD: Unreachable code
def process():
    return early
    print("never runs")

# DEAD: Unused function
def _old_helper():  # No callers found
    pass

# DEAD: Redundant pass
class MyError(Exception):
    pass  # Only needed if class body is truly empty and has no docstring

Complexity

# COMPLEX: Deep nesting
def process(data):
    if data:
        if data.valid:
            if data.items:
                # logic buried

# SIMPLIFIED: Early returns
def process(data):
    if not data or not data.valid or not data.items:
        return
    # logic at top level
# COMPLEX: Manual dict building
result = {}
for item in items:
    result[item.key] = item.value

# SIMPLIFIED: Dict comprehension
result = {item.key: item.value for item in items}
# COMPLEX: Nested try/except
def fetch_data():
    try:
        response = requests.get(url)
        try:
            data = response.json()
            try:
                return process(data)
            except ProcessError:
                return default
        except json.JSONDecodeError:
            return default
    except requests.RequestException:
        return default

# SIMPLIFIED: Combined exception handling
def fetch_data():
    try:
        response = requests.get(url)
        data = response.json()
        return process(data)
    except (requests.RequestException, json.JSONDecodeError, ProcessError):
        return default

Python-Specific Checks

Pattern Issue Fix
def fn(items=[]) Mutable default argument shared across calls Use None default, assign inside
except Exception: / except: Broad exception catches everything Catch specific exceptions
type(x) == str Doesn't handle subclasses Use isinstance(x, str)
Unused *args, **kwargs Unnecessary parameter forwarding Remove if not needed
len(x) == 0 / len(x) > 0 Non-Pythonic truth testing Use if not x: / if x:
Manual context management Missing with statement Use with open() instead of manual close
Shadowing builtins list = [1,2], id = 5 Use descriptive names
global keyword Hidden state mutation Pass as parameter or use class
String concatenation in loops O(n^2) allocation Use "".join() or f-strings
Bare assert in production Disabled with -O flag Use explicit if/raise
Shell commands with shell=True Command injection risk, complexity Use subprocess.run() with list args
Nested list comprehensions Readability issue when > 2 levels Extract to loops or helper functions

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 7ee2637. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 days ago

README badge

README badge for utkudarilmaz/claude-code-setup/simplifier