refactor

Audit and correct naming, structure, and complexity in Kotlin and Swift code.

11|2|Updated Sep 8, 2015
One-click install
npx skills add https://github.com/jitrapon/astro-mobile --skill refactor-jitrapon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor
Source: https://github.com/jitrapon/astro-mobile/tree/main/.claude/skills/refactor
Command: npx skills add https://github.com/jitrapon/astro-mobile --skill refactor-jitrapon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you clean up code that has drifted in naming, structure, or complexity, so changes become easier to understand, maintain, and ship with confidence.

Core Features & Use Cases

  • Naming Audits: Review functions, types, files, and modules for names that match what they actually do.
  • Structure Improvements: Split overloaded classes, move helpers to the right domain, and remove awkward pass-throughs.
  • Complexity Cleanup: Reduce long methods, deep nesting, and oversized files by applying project conventions and lint expectations.
  • Use Case: A class now handles too many responsibilities, so you use this Skill to identify the boundary, propose a better name, and refactor the code into clearer pieces.

Quick Start

Ask the refactor skill to review the target file or symbol and suggest the smallest safe changes that improve naming, structure, and complexity.

Frequently Asked Questions about refactor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce code complexity and clean up naming in Swift or Kotlin projects?

To reduce code complexity and clean up naming, audit source code paths, split overloaded classes, and review symbols against project conventions. Apply lint thresholds from SwiftLint or Detekt to guide safe, standards-aligned refactoring changes.

How do I split a class that has too many responsibilities in Kotlin or Swift?

To split a class with too many responsibilities, identify domain boundaries, move helpers to the correct domain, and remove awkward pass-throughs. Propose better names for the resulting pieces to ensure the refactored structure remains easy to maintain.

Can I use Detekt or SwiftLint rules to guide safe refactoring changes?

Yes, you can use Detekt or SwiftLint rules to guide refactoring. The lint thresholds define standards for complexity and naming, ensuring the automated source code audits propose the smallest safe changes that align with project expectations.

What is the best way to review method and file naming conventions before a commit?

The best way to review naming conventions before a commit is running a pre-commit diff audit. This checks functions, types, and files to ensure names match their actual behavior, identifying mismatches early using project conventions from CLAUDE.md.

Does refactoring long methods and deep nesting require project convention files?

Yes, refactoring long methods and deep nesting requires project convention files. Conventions defined in CLAUDE.md provide the necessary context to safely reduce complexity and apply structural improvements that match the existing codebase standards.

What are the limitations of automated code structure improvements for mobile projects?

Automated code structure improvements are limited by the quality of your lint thresholds and CLAUDE.md conventions. Without clear boundary definitions and naming rules, the tool cannot safely propose the structural splits or rename reviews needed for complex refactoring.