refactoring-detection

Detect code smells and refactoring candidates across TypeScript, Rust, Go, and Python.

Updated Jan 8, 2026
One-click install
npx skills add https://github.com/takemo101/compose-workflow --skill refactoring-detection
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-detection
Source: https://github.com/takemo101/compose-workflow/tree/main/.opencode/skill/refactoring-detection
Command: npx skills add https://github.com/takemo101/compose-workflow --skill refactoring-detection

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ast-grep, jscpd, jq, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the detection of code smells and potential refactoring opportunities across multiple programming languages, providing actionable insights and effort estimations to improve code quality.

Core Features & Use Cases

  • Automated Code Analysis: Scans codebases for common anti-patterns like large functions, excessive parameters, any types, empty catch blocks, and leftover console.log statements.
  • Multi-Language Support: Includes detection patterns for TypeScript, Rust, Go, and Python.
  • Duplicate Code Detection: Identifies duplicated code blocks using jscpd.
  • Effort Estimation: Calculates estimated time to refactor based on the type and severity of detected issues.
  • Use Case: Integrate this Skill into your CI/CD pipeline to automatically flag code that needs refactoring before it gets merged, ensuring maintainability and reducing technical debt.

Quick Start

Run the refactoring detection skill on the current directory to find and report code quality issues.

Frequently Asked Questions about refactoring-detection

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

FAQPage Schema
How do I detect code smells and estimate refactoring effort in a TypeScript project?

Code smell detection and refactoring effort estimation run automatically by scanning your project using AST parsing to identify large files, long functions, `any` types, and empty catch blocks. The tool calculates estimated time to refactor based on issue type and severity across TypeScript, Rust, Go, and Python.

What's the best way to find duplicate code blocks across Rust and Go codebases?

Finding duplicate code blocks across Rust and Go codebases is handled by the integrated `jscpd` tool, which identifies duplicated code patterns. Results are aggregated into a refactoring report alongside complexity and code smell detections for a complete maintainability overview.

Can I use ast-grep for automated code quality analysis in Python?

Automated code quality analysis in Python is supported using `ast-grep` for AST pattern matching to detect anti-patterns like empty catch blocks and excessive parameters. The Skill includes specific detection patterns tailored for Python projects out of the box.

Does this refactoring detection tool work with multiple programming languages?

Refactoring detection works with multiple programming languages including TypeScript, Rust, Go, and Python. It analyzes language-specific issues like `any` types in TypeScript and provides cross-language duplicate code detection using `jscpd`.

How do I integrate code complexity analysis into a CI/CD pipeline?

Code complexity analysis integrates into a CI/CD pipeline by running the detection script on your repository to automatically flag code that needs refactoring before merge. This ensures maintainability and reduces technical debt by catching large functions and leftover `console.log` statements early.

What types of technical debt and code smells can be automatically detected?

Technical debt and code smells automatically detected include large files, long functions, excessive parameters, `any` types, empty catch blocks, leftover `console.log` statements, and duplicate code blocks. Each detected issue includes a severity-based effort estimation for prioritization.