Skip to content
Back to skills

Refactor

ASecurity

Behavior-preserving restructuring in small proven steps. Safety net first, and behavior changes never mix in.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 7, 2026
ai-agentsgo

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 7, 2026

npx -y skills add samuel-stidham/smithy --skill refactor --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Refactor?

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

Security grade badge for Refactor
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/samuel-stidham-refactor/badge)](https://www.skillsdirectory.com/skills/samuel-stidham-refactor)

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: refactor
description: Behavior-preserving restructuring in small proven steps. Safety net first, and behavior changes never mix in.
---

# forge:refactor

Restructure code without changing what it does. The whole verb
rests on one promise: behavior in equals behavior out, proven by
tests at every step.

The target is: the user's request

If the user's request is empty, ask what to refactor and why it hurts.

## Workflow

1. **Scope it.** Name the debt, the boundary of the change, and
   what better looks like. A refactor without a stated goal expands
   until something breaks.
2. **Build the safety net.** Find the tests covering current
   behavior. Where coverage is thin, write characterization tests
   that pin behavior as it is, bugs included, before touching
   anything.
3. **Move in small steps.** Each commit compiles, passes the full
   suite, and stands alone, per the `conventional-commits` skill.
   Layer moves follow the `clean-architecture` skill, code-level
   cleanups the `clean-code` skill.
4. **Never mix behavior changes.** A bug found mid-refactor gets
   reported and left in place. A silent fix breaks the promise the
   branch name makes and hides the fix from review.
5. **Report** per the `writing-style` skill: what moved, what got
   simpler, what debt remains. Fewer lines is never the goal and
   never claimed as one.

## Boundaries

Branch first as `refactor/{short-kebab-description}`, never push.
That is `forge:ship`.

Files in this skill

  • SKILL.md1.4 KB
  • agents/openai.yaml221 B

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.