Skip to content
Back to skills

Refactor Project

ASecurity

Executes automated project-wide refactoring with a focus on cross-file optimization. This skill should be used when the user asks for project-wide refactoring, cross-file simplification, consistency standardization across the codebase, duplication reduction, or invokes "/refactor-project".

  • 593 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 11, 2026
code-qualitygobashnoderefactoringgit

Security analysis

A100/100

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

Scanned September 11, 2026

npx -y skills add FradSer/dotclaude --skill refactor-project --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Refactor Project?

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

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

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-project
description: Executes automated project-wide refactoring with a focus on cross-file optimization. This skill should be used when the user asks for project-wide refactoring, cross-file simplification, consistency standardization across the codebase, duplication reduction, or invokes "/refactor-project".
argument-hint: (no arguments needed)
allowed-tools: ["Task", "Read", "Bash(git:*)", "Grep", "Glob"]
user-invocable: true
---

# Refactor Project Command

Execute automated project-wide refactoring using `refactor:code-simplifier` agent with cross-file optimization focus.

## Pre-operation Checks
**Goal**: Ensure project-wide execution is explicit and reproducible.

**Actions**:
1. Run `git rev-parse --is-inside-work-tree`; if false, inform user that project-wide mode requires a git workspace
2. Record current revision with `git rev-parse --short HEAD` and include it in final summary for rollback context
3. Ignore command arguments and proceed with full-project discovery

## Phase 1: Analyze Project Scope
**Goal**: Discover all code files and display scope summary.

**Actions**:
1. Find all code files using Glob patterns for common extensions
2. Filter out `node_modules/`, `.git/`, `dist/`, `build/`, `vendor/`, `.venv/`
3. Group files by language/extension and identify primary source directories
4. Display scope summary (file count, languages, directories) then proceed automatically

See `references/scope-analysis.md` for exclusion patterns and edge cases.

## Phase 2: Launch Refactoring Agent
**Goal**: Execute `refactor:code-simplifier` agent with project-wide scope and cross-file focus.

**Actions**:
1. Launch `refactor:code-simplifier` agent with all discovered code files
2. Pass cross-file optimization emphasis: duplication reduction, consistent patterns
3. Pass aggressive mode flag for legacy code removal
4. Agent auto-loads `refactor:best-practices` skill and applies language-specific patterns

See `references/agent-configuration.md` for detailed Task parameters.

## Phase 3: Summary
**Goal**: Report comprehensive summary of project-wide changes.

**Actions**:
1. Report total files refactored (count and percentage of project)
2. List changes categorized by improvement type and cross-file improvements made
3. List best practices applied and legacy code removed
4. Suggest test suite to run and recommend reviewing changes in logical groups
5. Provide safer rollback command tied to recorded baseline (for example: `git restore --worktree --staged .`)

See `references/output-requirements.md` for detailed summary format.

## Requirements

- Execute immediately after displaying scope (no confirmation needed)
- Refactor entire project across all discovered code files
- Prioritize cross-file duplication reduction and consistent patterns
- Preserve behavior and public interfaces unless user explicitly requests a behavior change

Files in this skill

  • SKILL.md2.8 KB
  • references/agent-configuration.md6.9 KB
  • references/output-requirements.md9.1 KB
  • references/scope-analysis.md5.3 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.

Comments

Loading comments…

Newsletter

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