Refactor

From hua-bang/pulse-agent · View interactive version

Refactor is an AI agent skill from the GitHub repository hua-bang/pulse-agent. Refactor code to improve structure, readability, and maintainability without changing behavior

How to use this skill

Skill file

Code Refactoring Skill

This skill guides systematic code refactoring while preserving functionality.

Refactoring Principles

Extract Method/Function

Simplify Conditionals

Remove Duplication

Improve Naming

Organize Code

Refactoring Workflow

  1. Understand First: Read and understand the existing code
  2. Ensure Tests: Make sure tests exist or write them
  3. Small Steps: Make incremental changes
  4. Test After Each Step: Verify functionality is preserved
  5. Review: Check if the code is clearer than before

Common Refactoring Patterns

Safety Guidelines

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.