antrophiclove
← Kütüphaneye dön
Kurulum
mkdir -p .claude/commands && curl -sL https://www.antrophiclove.com/api/kaynak/refactor-py/raw -o .claude/commands/refactor-py.md

Hedef dosya: .claude/commands/refactor-py.md

Refactor Python code for clarity, performance, and Pythonic idioms.

Steps

  1. Read the target Python file or module.
  2. Identify refactoring opportunities:
  3. Apply Pythonic improvements:
  4. Improve code structure:
  5. Improve error handling:
  6. Run the tests to verify behavior is unchanged.
  7. Run linting tools (ruff, flake8) to verify style compliance.

Format

File: <path>
Refactorings Applied:
  - <pattern replaced> -> <Pythonic alternative>
Lines Changed: <before> -> <after>

Rules

  • Never change behavior during refactoring.
  • Run tests after every refactoring step.
  • Follow PEP 8 style guidelines.