Rechercher

PythonReactSEOPDF
GitHub Skill

refactormethods

Extract small, focused methods from large code blocks

SDiamante13☆ 6 Étoiles du dépôt0 Forks du dépôt

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

Voir la source ↗Guides

Instructions

Extract Methods Refactor

Ask the user for the file or directory to refactor. Support multiple files if a directory is provided.

Process

Work through these steps in order, making a separate commit for each extraction:

  1. Extract simple helper methods

    • Calculations, formatting, simple logic
    • Single responsibility, behavior-focused names
    • Pass necessary parameters rather than sharing state
  2. Extract complex logic blocks

    • Validation, transformations, data processing
    • Well-named methods that reveal intent
    • Apply proper access modifiers (private for helpers)
  3. Extract control flow sections

    • Only when it improves readability
    • Avoid over-extraction that hurts clarity

After EACH extraction:

  • Run tests automatically
  • If tests fail, revert the change immediately
  • If tests pass and using IDE refactoring tool, commit: . r <description>
  • If tests pass but manual refactoring, commit: ^ r <description>

Guidelines

  • Extract pragmatically to improve code organization
  • Name methods based on behavior not implementation
  • Ensure each method ≤ 25 lines
  • Preserve original functionality exactly

Output

  • If no methods to extract, report "No methods to extract"
  • Otherwise provide brief summary (e.g., "Extracted 5 methods from 3 large blocks")

Commit Format

Use Arlo's Commit Notation (ACN):

  • . r extract validateUserCredentials method - IDE refactoring
  • ^ r extract transformRawStockData method - Manual refactoring

Exemples

Consultez les exemples du dépôt source.

Voir la source ↗

Historique source

Date d’indexation
2026-03-11
Mise à jour de l’index
2026-03-11
Branch
main

Les dates concernent ce répertoire. Consultez le dépôt pour l’historique du code.

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!