Skip to content
Back to skills

Refactoring Safely

ASecurity

Refactor without changing behaviour: characterisation tests, small steps, and mechanical transformations.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentsrefactoring

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add karthikrshet/saarthi --skill refactoring-safely --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Refactoring Safely?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Refactoring Safely
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/karthikrshet-refactoring-safely/badge)](https://www.skillsdirectory.com/skills/karthikrshet-refactoring-safely)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: refactoring-safely
description: "Refactor without changing behaviour: characterisation tests, small steps, and mechanical transformations."
tags: [core, quality]
---

# Refactoring Safely

## When to use

- Code is hard to change
- Before adding a feature to messy code

## Procedure

1. Add characterisation tests around current behaviour
2. Make one mechanical change at a time (rename, extract, inline, move)
3. Run tests after each
4. Commit often
5. Stop when the next feature becomes easy

## Checklist

- [ ] Behaviour unchanged (tests green throughout)
- [ ] No feature changes mixed in

## Anti-patterns

- Big-bang rewrites
- Refactoring without tests

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.