Refactor

From berkcangumusisik/claude-code-practices · View interactive version

Refactor is an AI agent skill from the GitHub repository berkcangumusisik/claude-code-practices. Refactors a file or function for clarity, maintainability, and performance without changing behavior

How to use this skill

Skill file

Refactor

Target: $1

Focus: $2 (or general if not specified)

  1. Read the file thoroughly.
  1. Identify refactoring opportunities:
  1. Show a before/after diff for each change. Explain the reasoning.
  1. List any tests that should be updated (behavior must be identical).
  1. Ask for confirmation, then apply changes.

Rule: Do not change observable behavior. If a change would affect behavior, note it and ask separately.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.