omar-obando/qwen-orchestrator/refactoring

Claude Code and agent skill by omar-obando/qwen-orchestrator

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Code refactoring skill focused on safe, incremental transformations that preserve behavior. Covers extract method, rename, introduce parameter, replace conditional with polymorphism, and other Fowler refactoring patterns.

Install

npx vskill@latest install omar-obando/qwen-orchestrator/refactoring

SKILL.md

Refactoring Skill — Safe Code Transformations

This skill provides systematic refactoring guidance ensuring behavior preservation.

Core Principle

Refactoring changes the STRUCTURE without changing the BEHAVIOR.
If behavior needs to change, that's a feature — do it separately.

Refactoring Catalog

Extract Method
typescript
// BEFORE
function printOwing(invoice) {
// Print banner
console.log('*******************');
console.log('*** Customer Owes ***');
console.log('*******************');
// Calculate outstanding
let outstanding = 0;
for (const o of invoice.orders) {
outstanding += o.amount;
}
// Print details
console.log(`name: ${invoice.customer}`);
console.log(`amount: ${outstanding}`);
}
// AFTER
function printOwing(invoice: Invoice): void {
printBanner();
const outstanding = calculateOutstanding(invoice.orders);
printDetails(invoice.customer, outstanding);
}
Replace Conditional with Polymorphism
typescript
// BEFORE
function getDiscount(customerType: string): number {
if (customerType === 'premium') return 0.2;
if (customerType === 'gold') return 0.15;
if (customerType === 'silver') return 0.1;
return 0;
}
// AFTER
abstract class Customer {
abstract getDiscount(): number;
}
class PremiumCustomer extends Customer {
getDiscount(): number {
return 0.2;
}
}
class GoldCustomer extends Customer {
getDiscount(): number {
return 0.15;
}
}
Introduce Parameter Object
typescript
// BEFORE
function createReport(
title: string,
startDate: Date,
endDate: Date,
format: string,
includeCharts: boolean,
groupBy: string
) { ... }
// AFTER
interface ReportOptions {
title: string;
dateRange: { start: Date; end: Date };
format: 'pdf' | 'html' | 'csv';
includeCharts: boolean;
groupBy: 'day' | 'week' | 'month';
}
function createReport(options: ReportOptions) { ... }

Safe Refactoring Protocol

  1. GREEN: Ensure all tests pass before starting
  2. SMALL: Make one refactoring at a time
  3. TEST: Run tests after EACH refactoring step
  4. COMMIT: Commit after each successful refactoring
  5. REVIEW: Code review the refactoring separately

Refactoring Checklist

Before refactoring:

  • [ ] All existing tests pass
  • [ ] Test coverage is adequate for the code being refactored
  • [ ] No feature work mixed in
  • [ ] Rollback plan exists (git commit before starting)

During refactoring:

  • [ ] One transformation at a time
  • [ ] Tests run after each step
  • [ ] No behavior changes
  • [ ] No dead code left behind

After refactoring:

  • [ ] All tests still pass
  • [ ] No new lint warnings
  • [ ] Code is cleaner than before
  • [ ] No functionality lost

Forbidden Actions

  • NEVER mix refactoring with feature changes
  • NEVER refactor without passing tests first
  • NEVER skip running tests between steps
  • NEVER leave dead code after refactoring
  • NEVER change behavior during refactoring

When NOT to Use

Do NOT use this skill when:

  • Writing new application logic (use domain-driven skill)
  • Designing database schemas (use database-design skill)
  • Writing API endpoint implementations (use api-design skill)
  • Reviewing code for security issues (use code-review skill)
  • Performing security audits (use security-auditor skill)
  • Writing SQL queries (use sql-best-practices skill)
  • Designing multi-page website layouts (use design-system skill)
  • Reviewing git workflows (use git-workflow skill)

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/omar-obando/qwen-orchestrator/refactoring/badge)](https://verified-skill.com/skills/omar-obando/qwen-orchestrator/refactoring)

Something wrong with this skill or its page? Tell us.