Skip to content
Development
Command

/devkit.refactor

Provides guided code refactoring capability with deep codebase understanding, compatibility options, and comprehensive verification. Use when restructuring or improving existing code.

From plugin
developer-kit
32148 skills44 agents48 commands
Install
$ npx -y skills add giuseppe-trisciuoglio/developer-kit --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/devkit.refactor

Context preview

What this command does when you run it.

Provides guided code refactoring capability with deep codebase understanding, compatibility options, and comprehensive verification. Use when restructuring or improving existing code.

Command definition

devkit.refactor.md
description: Provides guided code refactoring capability with deep codebase understanding, compatibility options, and comprehensive verification. Use when restructuring or improving existing code.
argument-hint: "[ --lang=java|spring|typescript|nestjs|react|python|general ] [ --scope=file|module|feature ] [ refactor-description ]"
allowed-tools: Task, Read, Write, Edit, Bash, Grep, Glob, TodoWrite, AskUserQuestion
model: inherit

Code Refactoring

Overview

You are helping a developer refactor existing code. Follow a systematic approach: deeply understand the codebase and its dependencies, clarify compatibility requirements, design safe refactoring strategies, implement incrementally, and verify thoroughly.

Usage

/developer-kit:devkit.refactor [--lang=java|spring|typescript|nestjs|react|python|general] [--scope=file|module|feature] [refactor-description]

Arguments

| Argument | Description | |--------------|------------------------------------------| | `$ARGUMENTS` | Combined arguments passed to the command |

Current Context

The command will automatically gather context information when needed:

  • Current git branch and status
  • Recent commits and changes
  • Available when the repository has history

Execution Instructions

**Agent Selection**: Based on the `--lang` parameter, select the appropriate agents:

Integration with Sub-agents

This command leverages four specialized sub-agents for comprehensive refactoring:

Language/Framework Selection

Parse $ARGUMENTS to detect the optional `--lang` parameter:

  • `--lang=spring` or `--lang=java`: Use Java/Spring Boot specialized agents
  • `--lang=typescript` or `--lang=ts`: Use TypeScript specialized agents
  • `--lang=nestjs`: Use NestJS specialized agents
  • `--lang=react`: Use React frontend specialized agents
  • `--lang=aws`: Use AWS specialized agents (architecture, CloudFormation, IaC)
  • `--lang=python` or `--lang=py`: Use Python specialized agents
  • `--lang=general` or no flag: Use general-purpose agents (default)

Scope Selection

Parse $ARGUMENTS to detect the optional `--scope` parameter:

  • `--scope=file`: Single file refactoring
  • `--scope=module`: Module/package level refactoring
  • `--scope=feature`: Cross-cutting feature refactoring (default)

**Agent Mapping by Language:**

| Phase | General (default) | Java/Spring Boot (`--lang=spring` or `--lang=java`) | TypeScript (`--lang=typescript` or `--lang=ts`) | NestJS (`--lang=nestjs`) | React (`--lang=react`) | AWS (`--lang=aws`) | Python (`--lang=python` or `--lang=py`) | |---------------------|--------------------------------------------|-------------------------------------------------------------|-----------------------------------------------------------------|-----------------------------------------------------------------|--------------------------------------------------------------|----------------------------------------------------|---------------------------------------------------------| | Deep Exploration | `developer-kit:general-code-explorer` | `developer-kit-java:spring-boot-backend-development-expert` | `developer-kit:general-code-explorer` | `developer-kit-typescript:nestjs-backend-development-expert` | `developer-kit-typescript:react-frontend-development-expert` | `developer-kit-aws:aws-solution-architect-expert` | `developer-kit:general-code-explorer` | | Refactoring Expert | `developer-kit:refactor-expert` | `developer-kit-java:java-refactor-expert` | `developer-kit-typescript:typescript-refactor-expert` | `developer-kit-typescript:typescript-refactor-expert` | `developer-kit-typescript:typescript-refactor-expert` | `developer-kit-aws:refactor-expert` | `developer-kit-python:python-refactor-expert` | | Architecture Review | `developer-kit:general-software-architect` | `developer-kit-java:java-software-architect-review` | `developer-kit-typescript:typescript-software-architect-review` | `developer-kit-typescript:typescript-software-architect-review` | `developer-kit-typescript:react-software-architect-review` | `developer-kit-aws:aws-solution-architect-expert` | `developer-kit-python:python-software-architect-expert` | | Code Review | `developer-kit:general-code-reviewer` | `developer-kit-java:spring-boot-code-review-expert` | `developer-kit:general-code-reviewer` | `developer-kit-typescript:nestjs-code-review-expert` | `developer-kit:general-code-reviewer` | `developer-kit-aws:aws-architecture-review-expert` | `developer-kit-python:python-code-review-expert` |

Core Principles

  • **Backward compatibility first — NEVER SKIP**: Phases marked with **[GATE]** MANDATORY STOP POINT are hard gates. You MUST

call the AskUserQuestion tool and wait for the user's response before proceeding. Skipping these phases or proceeding without user input is a workflow violation. Always clarify if breaking changes are acceptable before proceeding.

  • **Deep understanding required**: Refactoring requires comprehensive knowledge of dependencies, usages, and side

effects

  • **Incremental changes**: Prefer small, verifiable changes over large rewrites
  • **Test coverage awareness**: Understand existing test coverage before modifying code
  • **Structured user interaction**: You MUST use the AskUserQuestion tool for all decision points
  • **Use TodoWrite**: Track all progress throughout
  • **No time estimates**: DO NOT provide or request time estimates

---

Phase 1: Refactoring Discovery

**Goal**: Understand what needs to be refactored and why

**Initial request**: $ARGUMENTS

**Actio

Read more
Ships withdeveloper-kit

Modular plugin marketplace for Claude Code and agentic CLIs, with validated, spec-driven skills, agents, commands, and workflows for Java, TypeScript, Python, PHP, AWS, and AI.

Get the whole plugin, auto-invoked
Stats
321
Stars
1
Views
37
Forks
Maintained
Maintenance
Python
Language
MIT
License
1mo ago
Last commit
9mo ago
Created

Repo: giuseppe-trisciuoglio/developer-kit