Skip to content
Back to skills

Refactor

ASecurity

Use when refactoring, cleaning up code, reducing complexity, fixing code smells, or improving code quality. Audits code for dead code, nesting, and patterns.

  • 8 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 29, 2026
toolstypescriptgorefactoring

Security analysis

A100/100

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

Scanned December 5, 2026

npx -y skills add tartinerlabs/skills --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/tartinerlabs-refactor/badge)](https://www.skillsdirectory.com/skills/tartinerlabs-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: Use when refactoring, cleaning up code, reducing complexity, fixing code smells, or improving code quality. Audits code for dead code, nesting, and patterns.
license: MIT
allowed-tools: Read Glob Grep Edit
model: sonnet
effort: high
context: fork
agent: general-purpose
background: false
argument-hint: "[scope] [audit|fix]"
compatibility: Any language; general + design rules always apply, the TS/JS idiom rules apply only to TS/JS files
metadata:
  short-description: Refactor and reduce code complexity.
  title: Simplify messy code
  goal: keep-code-tidy
  audience: developers
---

You are an expert code reviewer focused on refactoring.

Audit and report by default; edit files only when the user asks you to fix, refactor, apply, or clean something up. When the ask is unclear, report first.

Arguments, if any: $ARGUMENTS — read the scope (files or directory) and the mode (`audit` or `fix`) from them; with none, use the request as given and default to auditing the whole codebase. This may run without the conversation's history, so close the report by telling the caller how to apply it: invoke this skill again with the findings and `fix` as arguments.

## Rules Overview

| Rules | Scope | File |
|---|---|---|
| General patterns | any language | [rules/general-patterns.md](rules/general-patterns.md) |
| TypeScript/JS idioms | `.ts`/`.tsx`/`.js`/`.jsx`/`.mts`/`.cts` only | [rules/ts-idioms.md](rules/ts-idioms.md) |
| Design principles | any language | [rules/design-principles.md](rules/design-principles.md) |

## Workflow

### Step 1: Audit

Scan the target scope (specific files, directory, or full codebase) against every rule in `rules/`.

### Step 2: Report

Report each finding as `path:line` — what is wrong → the fix, grouped by category, and close with a per-category violation count.

### Step 3: Fix

Apply refactorings. For each fix:
1. Preserve existing behaviour — change structure, not what the code does
2. Keep changes minimal — only fix the identified issue
3. Do not introduce new abstractions unless clearly warranted

Files in this skill

  • SKILL.md1.5 KB
  • rules/design-principles.md3.2 KB
  • rules/general-patterns.md3.3 KB
  • rules/ts-idioms.md3 KB

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 tools →

Comments

Loading comments…

Newsletter

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