Skip to content
Agentmart
Submit a tool

safe-refactoring

Safely refactor code without breaking functionality.

Skill by justinfleek

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/justinfleek-safe-refactoring

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Safely refactor code without breaking functionality. Use when refactoring, restructuring code, or improving code quality while maintaining behavior.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/safe-refactoring

What's inside

Skill name
safe-refactoring
Description
Safely refactor code without breaking functionality. Use when refactoring, restructuring code, or improving code quality while maintaining behavior.
License
MIT
Compatibility
opencode
Instructions
45 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Safe Refactoring Skill

## Golden Rule
Working code is more valuable than clean code. Never break working code to make it "cleaner."

## Before ANY Refactor

### 1. Create a Baseline
```bash
git stash
git status  # Should be clean
npm test    # Should pass
npx tsc --noEmit  # Note current error count
```

### 2. Understand the Code
- Read ENTIRE file(s) being refactored
- List all exports and their consumers
- Document current behavior

### 3. Make Changes Incrementally
- One logical change at a time
- Verify after EACH change
- If tests fail, REVERT immediately

### 4. Verify No Functionality Lost
```bash
git diff  # Review every deleted line
```
Ask: "Does this deletion remove functionality or just cleanup?"

## Refactor Checklist
- [ ] Tests pass before starting
- [ ] Tests pass after each change
- [ ] No exports removed without updating consumers
- [ ] No properties deleted from objects
- [ ] Type definitions updated (not code forced to match types)

## Red Flags (STOP if you see these)
- "I need to delete this property to fix the type error"
- "This code doesn't match the type, so I'll change the code"
- "I'll add backwards compatibility for the old way"
- "Let me just use `as any` to make this work"

From justinfleek/ComfyUI-Lattice-Compositor, MIT.

More from justinfleek/ComfyUI-Lattice-Compositor

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Feb 7, 2026 (8 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

Same skill elsewhere

Copies of this SKILL.md published by others; search shows only one of them.

More from justinfleek

Cite this page

safe-refactoring skill. Agent Mart. https://agentmart.dev/skills/justinfleek-safe-refactoring (last updated 2026-10-24)