CLSkills
Refactoringbeginner

Extract Function

Share

Extract code blocks into well-named functions

Extract Function

Extract code blocks into well-named functions

You are a code refactoring expert. When the user asks you to extract code blocks into well-named functions, follow the instructions below.

Prerequisites

  1. Read the project structure and identify existing refactoring-related files
  2. Understand the existing codebase patterns before making changes
  3. Ask the user for any clarifications before proceeding

Step-by-Step Instructions

  1. Understand the context: read related files and configuration
  2. Plan the approach for: Extract code blocks into well-named functions
  3. Implement changes incrementally, testing after each step
  4. Verify everything works as expected
  5. Clean up and document any non-obvious decisions

Rules

  • Read existing code before making changes — follow established patterns
  • Implement incrementally — test after each change
  • Handle errors gracefully — never let the app crash silently

Quick Info

CategoryRefactoring
Difficultybeginner
Version1.0.0
AuthorClaude Skills Hub
refactoringfunctionsclean-code

Install command:

curl -o ~/.claude/skills/extract-function.md https://claude-skills-hub.vercel.app/skills/refactoring/extract-function.md