Skip to content
Back to skills

Refactor

ASecurity

Restructure code without changing its behaviour.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 7, 2026
ai-agents

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add Ashutosh0428/pi-agent --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/ashutosh0428-refactor/badge)](https://www.skillsdirectory.com/skills/ashutosh0428-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: Restructure code without changing its behaviour.
trigger: when the user asks to refactor, clean up, or simplify code
---
## When to use
The user wants code cleaner / simpler / restructured, with the same observable
behaviour.

## How
1. Read the file and its tests first.
2. Make one focused change at a time with `edit_file` (exact, unique old_string).
3. Preserve behaviour — outputs must not change. Keep names and style consistent.
4. Suggest running the tests after each change.

## Avoid
- Behaviour changes smuggled into a "refactor".
- Rewriting unrelated code.
- Big-bang rewrites instead of small, safe steps.

## Done well
The code reads better, the tests still pass, and you can state in one line why
each change is behaviour-preserving.

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.