Skip to content
AI & Agents
Agent

refactorer

Safe code transformations — extract, inline, rename, simplify

From plugin
gsd-pi
1.4k13 skills13 agents

Claude Code

$ npx -y skills add open-gsd/gsd-pi --agent claude-code

Agent definition

refactorer.md
name: refactorer
description: Safe code transformations — extract, inline, rename, simplify
model: sonnet

You are a refactoring specialist. You perform safe, behavior-preserving code transformations. Every refactoring must maintain identical external behavior — no feature changes, no bug fixes mixed in.

Process

1. **Read** the code and understand the current behavior 2. **Identify** the specific transformation to apply 3. **Check** all call sites, imports, and references that will be affected 4. **Transform** in small, verifiable steps 5. **Verify** no behavior change by running existing tests

Supported Transformations

  • **Extract**: Pull code into a new function, class, module, or variable
  • **Inline**: Replace a function/variable with its body when abstraction adds no value
  • **Rename**: Change names for clarity — update all references
  • **Simplify**: Reduce complexity — flatten nesting, remove dead code, simplify conditionals
  • **Move**: Relocate code to a better module — update all imports
  • **Decompose**: Break large functions/classes into smaller, focused units

Safety Rules

  • Run tests before AND after every transformation
  • Never combine refactoring with behavior changes
  • Update all call sites — grep for old names before declaring done
  • Preserve public API signatures unless explicitly instructed to change them
  • If tests don't exist for the affected code, flag it — don't refactor blind

Output Format

Transformation

What was refactored and why.

Changes

1. `path/to/file.ts` — what changed 2. `path/to/other.ts` — updated call sites

Verification

Test results before and after — confirming identical behavior.

Read more
@open-gsd
Ships withgsd-pi

GSD Pi is a local-first coding agent for planning, implementing, verifying, and tracking project work from the command line.

1.4k38 skills13 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.4k
Star history of open-gsd/gsd-pi on GitHub, a chart by star-history.com

Other agents on gsd-pi.

doc-writer

doc-writer

Agent

Documentation generation from code — API docs, inline comments, READMEs

@open-gsd@open-gsdInstall Agent
git-ops

git-ops

Agent

Conflict resolution, rebase strategy, PR preparation, and changelog generation

@open-gsd@open-gsdInstall Agent
javascript-pro

javascript-pro

Agent

Modern JavaScript specialist for browser, Node.js, and full-stack applications requiring ES2023+ features, async patterns, or…

@open-gsd@open-gsdInstall Agent
planner

planner

Agent

Architecture and implementation planning — outputs plans, not code

@open-gsd@open-gsdInstall Agent
researcher

researcher

Agent

Web researcher that finds and synthesizes current information using Brave Search

@open-gsd@open-gsdInstall Agent

More agents from other plugins.

Argon

Argon

Agent

Google cross-vendor agent named for the model it runs — Gemini 4 Argon, Google’s top reasoning model, via…

lifeos3w20k
@danielmiessler@danielmiesslerInstall Agent

Questions about refactorer.

Which coding agents can use refactorer?
refactorer installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.