๐ŸŽฏ

refactoring-suggester

๐ŸŽฏSkill

from ntaksh42/agents

VibeIndex|
What it does

Suggests code refactoring opportunities by identifying and recommending improvements in code structure, readability, and maintainability across various programming languages.

๐Ÿ“ฆ

Part of

ntaksh42/agents(78 items)

refactoring-suggester

Installation

๐Ÿ“‹ No install commands found in docs. Showing default command. Check GitHub for actual instructions.
Quick InstallInstall with npx
npx skills add ntaksh42/agents --skill refactoring-suggester
2Installs
-
AddedFeb 4, 2026

Skill Details

SKILL.md

Suggest refactoring opportunities to improve code structure and maintainability. Use when improving code design or reducing complexity.

Overview

# Refactoring Suggester Skill

ใ‚ณใƒผใƒ‰ใฎใƒชใƒ•ใ‚กใ‚ฏใ‚ฟใƒชใƒณใ‚ฐๆๆกˆใ‚’่กŒใ†ใ‚นใ‚ญใƒซใงใ™ใ€‚

ไธปใชๆฉŸ่ƒฝ

  • Extract Method: ้•ทใ„ใƒกใ‚ฝใƒƒใƒ‰ใ‚’ๅˆ†ๅ‰ฒ
  • Rename: ๅˆ†ใ‹ใ‚Šใ‚„ใ™ใ„ๅ‘ฝๅใซๅค‰ๆ›ด
  • Remove Duplication: ้‡่ค‡ๆŽ’้™ค
  • Simplify Conditionals: ๆกไปถๅผใฎ็ฐก็•ฅๅŒ–
  • Design Patterns: ใƒ‘ใ‚ฟใƒผใƒณ้ฉ็”จๆๆกˆ

ใƒชใƒ•ใ‚กใ‚ฏใ‚ฟใƒชใƒณใ‚ฐไพ‹

Extract Method

```javascript

// Before

function processOrder(order) {

// ๆคœ่จผ

if (!order.items || order.items.length === 0) {

throw new Error('No items');

}

if (!order.customer) {

throw new Error('No customer');

}

// ไพกๆ ผ่จˆ็ฎ—

let total = 0;

for (const item of order.items) {

total += item.price * item.quantity;

}

const tax = total * 0.1;

total += tax;

// ไฟๅญ˜

const saved = db.orders.save(order);

return saved;

}

// After: Extract Method

function processOrder(order) {

validateOrder(order);

const total = calculateTotal(order);

return saveOrder(order, total);

}

function validateOrder(order) {

if (!order.items || order.items.length === 0) {

throw new Error('No items');

}

if (!order.customer) {

throw new Error('No customer');

}

}

function calculateTotal(order) {

const subtotal = order.items.reduce(

(sum, item) => sum + item.price * item.quantity,

0

);

return subtotal * 1.1; // +10% tax

}

function saveOrder(order, total) {

order.total = total;

return db.orders.save(order);

}

```

Replace Magic Numbers

```python

# Before

def calculate_price(item):

if item.category == 'premium':

return item.price * 0.9

elif item.category == 'vip':

return item.price * 0.8

return item.price * 1.0

# After

DISCOUNT_RATES = {

'premium': 0.9,

'vip': 0.8,

'regular': 1.0

}

def calculate_price(item):

rate = DISCOUNT_RATES.get(item.category, 1.0)

return item.price * rate

```

Simplify Conditionals

```typescript

// Before

function getShippingCost(weight: number, distance: number): number {

if (weight < 5) {

if (distance < 100) {

return 10;

} else {

return 15;

}

} else {

if (distance < 100) {

return 20;

} else {

return 25;

}

}

}

// After: Guard Clauses

function getShippingCost(weight: number, distance: number): number {

const isLight = weight < 5;

const isNear = distance < 100;

if (isLight && isNear) return 10;

if (isLight && !isNear) return 15;

if (!isLight && isNear) return 20;

return 25;

}

// Better: Lookup table

const SHIPPING_RATES = {

'light_near': 10,

'light_far': 15,

'heavy_near': 20,

'heavy_far': 25

};

function getShippingCost(weight: number, distance: number): number {

const weightKey = weight < 5 ? 'light' : 'heavy';

const distanceKey = distance < 100 ? 'near' : 'far';

const key = ${weightKey}_${distanceKey};

return SHIPPING_RATES[key];

}

```

ใƒใƒผใ‚ธใƒงใƒณๆƒ…ๅ ฑ

  • Version: 1.0.0

More from this repository10

๐ŸŽฏ
document-summarizer๐ŸŽฏSkill

Generates concise summaries of documents by extracting key information and condensing text into a more digestible format.

๐ŸŽฏ
algorithmic-art๐ŸŽฏSkill

Generates creative algorithmic art using p5.js, creating unique visual designs with patterns, fractals, and dynamic animations.

๐ŸŽฏ
sql-query-helper๐ŸŽฏSkill

Generates, optimizes, and explains SQL queries with best practices, providing intelligent database query solutions across multiple database platforms.

๐ŸŽฏ
plantuml-diagram๐ŸŽฏSkill

Generates PlantUML diagrams (class, sequence, component) to visually represent system architecture and UML models.

๐ŸŽฏ
azure-pipelines-generator๐ŸŽฏSkill

Generates Azure Pipelines YAML configurations automatically for CI/CD workflows, supporting multi-stage builds and deployments across different environments.

๐ŸŽฏ
kubernetes-helper๐ŸŽฏSkill

Assists Kubernetes users by generating, validating, and explaining Kubernetes manifests and configurations with AI-powered insights.

๐ŸŽฏ
using-git-worktrees๐ŸŽฏSkill

Creates isolated Git worktrees with smart directory selection and safety verification for feature work and branch management.

๐ŸŽฏ
dependency-analyzer๐ŸŽฏSkill

Analyzes project dependencies, identifies potential conflicts, and provides insights into library compatibility and version management.

๐ŸŽฏ
changelog-generator๐ŸŽฏSkill

Automatically generates comprehensive changelogs from git commit history, categorizing changes and creating structured release notes in multiple formats.

๐ŸŽฏ
azure-boards-helper๐ŸŽฏSkill

Manages Azure Boards work items by creating, querying, and automating work item workflows using WIQL and comprehensive templates.