repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

prompts/refactor.md

Raw

description: Refactor code safely argument-hint: ""

Refactor code safely

Refactor code:

Target: $ARGUMENTS

  1. Analyze - Understand current structure
  2. Plan - List refactoring steps
  3. Tests - Ensure coverage before changes (use /test)
  4. Refactor - Apply changes incrementally
  5. Verify - Run tests after each step

Common patterns: extract function, remove duplication, simplify conditionals.

Markdown source
File outline
---
description: Refactor code safely
argument-hint: "<file-or-directory>"
---

# Refactor code safely

Refactor code:

**Target**:
$ARGUMENTS

1. **Analyze** - Understand current structure
2. **Plan** - List refactoring steps
3. **Tests** - Ensure coverage before changes (use /test)
4. **Refactor** - Apply changes incrementally
5. **Verify** - Run tests after each step

Common patterns:
extract function, remove duplication, simplify conditionals.