{"id":"e0a0c1fd-3a98-427e-84c9-2c2c626ea5e7","shortId":"jy2a93","kind":"skill","title":"Refactor","tagline":"Awesome Copilot skill by Github","description":"# Refactor\n\n## Overview\n\nImprove code structure and readability without changing external behavior. Refactoring is gradual evolution, not revolution. Use this for improving existing code, not rewriting from scratch.\n\n## When to Use\n\nUse this skill when:\n\n- Code is hard to understand or maintain\n- Functions/classes are too large\n- Code smells need addressing\n- Adding features is difficult due to code structure\n- User asks \"clean up this code\", \"refactor this\", \"improve this\"\n\n---\n\n## Refactoring Principles\n\n### The Golden Rules\n\n1. **Behavior is preserved** - Refactoring doesn't change what the code does, only how\n2. **Small steps** - Make tiny changes, test after each\n3. **Version control is your friend** - Commit before and after each safe state\n4. **Tests are essential** - Without tests, you're not refactoring, you're editing\n5. **One thing at a time** - Don't mix refactoring with feature changes\n\n### When NOT to Refactor\n\n```\n- Code that works and won't change again (if it ain't broke...)\n- Critical production code without tests (add tests first)\n- When you're under a tight deadline\n- \"Just because\" - need a clear purpose\n```\n\n---\n\n## Common Code Smells & Fixes\n\n### 1. Long Method/Function\n\n```diff\n# BAD: 200-line function that does everything\n- async function processOrder(orderId) {\n-   // 50 lines: fetch order\n-   // 30 lines: validate order\n-   // 40 lines: calculate pricing\n-   // 30 lines: update inventory\n-   // 20 lines: create shipment\n-   // 30 lines: send notifications\n- }\n\n# GOOD: Broken into focused functions\n+ async function processOrder(orderId) {\n+   const order = await fetchOrder(orderId);\n+   validateOrder(order);\n+   const pricing = calculatePricing(order);\n+   await updateInventory(order);\n+   const shipment = await createShipment(order);\n+   await sendNotifications(order, pricing, shipment);\n+   return { order, pricing, shipment };\n+ }\n```\n\n### 2. Duplicated Code\n\n```diff\n# BAD: Same logic in multiple places\n- function calculateUserDiscount(user) {\n-   if (user.membership === 'gold') return user.total * 0.2;\n-   if (user.membership === 'silver') return user.total * 0.1;\n-   return 0;\n- }\n-\n- function calculateOrderDiscount(order) {\n-   if (order.user.membership === 'gold') return order.total * 0.2;\n-   if (order.user.membership === 'silver') return order.total * 0.1;\n-   return 0;\n- }\n\n# GOOD: Extract common logic\n+ function getMembershipDiscountRate(membership) {\n+   const rates = { gold: 0.2, silver: 0.1 };\n+   return rates[membership] || 0;\n+ }\n+\n+ function calculateUserDiscount(user) {\n+   return user.total * getMembershipDiscountRate(user.membership);\n+ }\n+\n+ function calculateOrderDiscount(order) {\n+   return order.total * getMembershipDiscountRate(order.user.membership);\n+ }\n```\n\n### 3. Large Class/Module\n\n```diff\n# BAD: God object that knows too much\n- class UserManager {\n-   createUser() { /* ... */ }\n-   updateUser() { /* ... */ }\n-   deleteUser() { /* ... */ }\n-   sendEmail() { /* ... */ }\n-   generateReport() { /* ... */ }\n-   handlePayment() { /* ... */ }\n-   validateAddress() { /* ... */ }\n-   // 50 more methods...\n- }\n\n# GOOD: Single responsibility per class\n+ class UserService {\n+   create(data) { /* ... */ }\n+   update(id, data) { /* ... */ }\n+   delete(id) { /* ... */ }\n+ }\n+\n+ class EmailService {\n+   send(to, subject, body) { /* ... */ }\n+ }\n+\n+ class ReportService {\n+   generate(type, params) { /* ... */ }\n+ }\n+\n+ class PaymentService {\n+   process(amount, method) { /* ... */ }\n+ }\n```\n\n### 4. Long Parameter List\n\n```diff\n# BAD: Too many parameters\n- function createUser(email, password, name, age, address, city, country, phone) {\n-   /* ... */\n- }\n\n# GOOD: Group related parameters\n+ interface UserData {\n+   email: string;\n+   password: string;\n+   name: string;\n+   age?: number;\n+   address?: Address;\n+   phone?: string;\n+ }\n+\n+ function createUser(data: UserData) {\n+   /* ... */\n+ }\n\n# EVEN BETTER: Use builder pattern for complex construction\n+ const user = UserBuilder\n+   .email('test@example.com')\n+   .password('secure123')\n+   .name('Test User')\n+   .address(address)\n+   .build();\n```\n\n### 5. Feature Envy\n\n```diff\n# BAD: Method that uses another object's data more than its own\n- class Order {\n-   calculateDiscount(user) {\n-     if (user.membershipLevel === 'gold') {\n+       return this.total * 0.2;\n+     }\n+     if (user.accountAge > 365) {\n+       return this.total * 0.1;\n+     }\n+     return 0;\n+   }\n+ }\n\n# GOOD: Move logic to the object that owns the data\n+ class User {\n+   getDiscountRate(orderTotal) {\n+     if (this.membershipLevel === 'gold') return 0.2;\n+     if (this.accountAge > 365) return 0.1;\n+     return 0;\n+   }\n+ }\n+\n+ class Order {\n+   calculateDiscount(user) {\n+     return this.total * user.getDiscountRate(this.total);\n+   }\n+ }\n```\n\n### 6. Primitive Obsession\n\n```diff\n# BAD: Using primitives for domain concepts\n- function sendEmail(to, subject, body) { /* ... */ }\n- sendEmail('user@example.com', 'Hello', '...');\n\n- function createPhone(country, number) {\n-   return `${country}-${number}`;\n- }\n\n# GOOD: Use domain types\n+ class Email {\n+   private constructor(public readonly value: string) {\n+     if (!Email.isValid(value)) throw new Error('Invalid email');\n+   }\n+   static create(value: string) { return new Email(value); }\n+   static isValid(email: string) { return /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email); }\n+ }\n+\n+ class PhoneNumber {\n+   constructor(\n+     public readonly country: string,\n+     public readonly number: string\n+   ) {\n+     if (!PhoneNumber.isValid(country, number)) throw new Error('Invalid phone');\n+   }\n+   toString() { return `${this.country}-${this.number}`; }\n+   static isValid(country: string, number: string) { /* ... */ }\n+ }\n+\n+ // Usage\n+ const email = Email.create('user@example.com');\n+ const phone = new PhoneNumber('1', '555-1234');\n```\n\n### 7. Magic Numbers/Strings\n\n```diff\n# BAD: Unexplained values\n- if (user.status === 2) { /* ... */ }\n- const discount = total * 0.15;\n- setTimeout(callback, 86400000);\n\n# GOOD: Named constants\n+ const UserStatus = {\n+   ACTIVE: 1,\n+   INACTIVE: 2,\n+   SUSPENDED: 3\n+ } as const;\n+\n+ const DISCOUNT_RATES = {\n+   STANDARD: 0.1,\n+   PREMIUM: 0.15,\n+   VIP: 0.2\n+ } as const;\n+\n+ const ONE_DAY_MS = 24 * 60 * 60 * 1000;\n+\n+ if (user.status === UserStatus.INACTIVE) { /* ... */ }\n+ const discount = total * DISCOUNT_RATES.PREMIUM;\n+ setTimeout(callback, ONE_DAY_MS);\n```\n\n### 8. Nested Conditionals\n\n```diff\n# BAD: Arrow code\n- function process(order) {\n-   if (order) {\n-     if (order.user) {\n-       if (order.user.isActive) {\n-         if (order.total > 0) {\n-           return processOrder(order);\n+         } else {\n+           return { error: 'Invalid total' };\n+         }\n+       } else {\n+         return { error: 'User inactive' };\n+       }\n+     } else {\n+       return { error: 'No user' };\n+     }\n+   } else {\n+     return { error: 'No order' };\n+   }\n+ }\n\n# GOOD: Guard clauses / early returns\n+ function process(order) {\n+   if (!order) return { error: 'No order' };\n+   if (!order.user) return { error: 'No user' };\n+   if (!order.user.isActive) return { error: 'User inactive' };\n+   if (order.total <= 0) return { error: 'Invalid total' };\n+   return processOrder(order);\n+ }\n\n# EVEN BETTER: Using Result type\n+ function process(order): Result<ProcessedOrder, Error> {\n+   return Result.combine([\n+     validateOrderExists(order),\n+     validateUserExists(order),\n+     validateUserActive(order.user),\n+     validateOrderTotal(order)\n+   ]).flatMap(() => processOrder(order));\n+ }\n```\n\n### 9. Dead Code\n\n```diff\n# BAD: Unused code lingers\n- function oldImplementation() { /* ... */ }\n- const DEPRECATED_VALUE = 5;\n- import { unusedThing } from './somewhere';\n- // Commented out code\n- // function oldCode() { /* ... */ }\n\n# GOOD: Remove it\n+ // Delete unused functions, imports, and commented code\n+ // If you need it again, git history has it\n```\n\n### 10. Inappropriate Intimacy\n\n```diff\n# BAD: One class reaches deep into another\n- class OrderProcessor {\n-   process(order) {\n-     order.user.profile.address.street;  // Too intimate\n-     order.repository.connection.config;  // Breaking encapsulation\n+   }\n+ }\n\n# GOOD: Ask, don't tell\n+ class OrderProcessor {\n+   process(order) {\n+     order.getShippingAddress();  // Order knows how to get it\n+     order.save();  // Order knows how to save itself\n+   }\n+ }\n```\n\n---\n\n## Extract Method Refactoring\n\n### Before and After\n\n```diff\n# Before: One long function\n- function printReport(users) {\n-   console.log('USER REPORT');\n-   console.log('============');\n-   console.log('');\n-   console.log(`Total users: ${users.length}`);\n-   console.log('');\n-   console.log('ACTIVE USERS');\n-   console.log('------------');\n-   const active = users.filter(u => u.isActive);\n-   active.forEach(u => {\n-     console.log(`- ${u.name} (${u.email})`);\n-   });\n-   console.log('');\n-   console.log(`Active: ${active.length}`);\n-   console.log('');\n-   console.log('INACTIVE USERS');\n-   console.log('--------------');\n-   const inactive = users.filter(u => !u.isActive);\n-   inactive.forEach(u => {\n-     console.log(`- ${u.name} (${u.email})`);\n-   });\n-   console.log('');\n-   console.log(`Inactive: ${inactive.length}`);\n- }\n\n# After: Extracted methods\n+ function printReport(users) {\n+   printHeader('USER REPORT');\n+   console.log(`Total users: ${users.length}\\n`);\n+   printUserSection('ACTIVE USERS', users.filter(u => u.isActive));\n+   printUserSection('INACTIVE USERS', users.filter(u => !u.isActive));\n+ }\n+\n+ function printHeader(title) {\n+   const line = '='.repeat(title.length);\n+   console.log(title);\n+   console.log(line);\n+   console.log('');\n+ }\n+\n+ function printUserSection(title, users) {\n+   console.log(title);\n+   console.log('-'.repeat(title.length));\n+   users.forEach(u => console.log(`- ${u.name} (${u.email})`));\n+   console.log('');\n+   console.log(`${title.split(' ')[0]}: ${users.length}`);\n+   console.log('');\n+ }\n```\n\n---\n\n## Introducing Type Safety\n\n### From Untyped to Typed\n\n```diff\n# Before: No types\n- function calculateDiscount(user, total, membership, date) {\n-   if (membership === 'gold' && date.getDay() === 5) {\n-     return total * 0.25;\n-   }\n-   if (membership === 'gold') return total * 0.2;\n-   return total * 0.1;\n- }\n\n# After: Full type safety\n+ type Membership = 'bronze' | 'silver' | 'gold';\n+\n+ interface User {\n+   id: string;\n+   name: string;\n+   membership: Membership;\n+ }\n+\n+ interface DiscountResult {\n+   original: number;\n+   discount: number;\n+   final: number;\n+   rate: number;\n+ }\n+\n+ function calculateDiscount(\n+   user: User,\n+   total: number,\n+   date: Date = new Date()\n+ ): DiscountResult {\n+   if (total < 0) throw new Error('Total cannot be negative');\n+\n+   let rate = 0.1; // Default bronze\n+\n+   if (user.membership === 'gold' && date.getDay() === 5) {\n+     rate = 0.25; // Friday bonus for gold\n+   } else if (user.membership === 'gold') {\n+     rate = 0.2;\n+   } else if (user.membership === 'silver') {\n+     rate = 0.15;\n+   }\n+\n+   const discount = total * rate;\n+\n+   return {\n+     original: total,\n+     discount,\n+     final: total - discount,\n+     rate\n+   };\n+ }\n```\n\n---\n\n## Design Patterns for Refactoring\n\n### Strategy Pattern\n\n```diff\n# Before: Conditional logic\n- function calculateShipping(order, method) {\n-   if (method === 'standard') {\n-     return order.total > 50 ? 0 : 5.99;\n-   } else if (method === 'express') {\n-     return order.total > 100 ? 9.99 : 14.99;\n+   } else if (method === 'overnight') {\n+     return 29.99;\n+   }\n+ }\n\n# After: Strategy pattern\n+ interface ShippingStrategy {\n+   calculate(order: Order): number;\n+ }\n+\n+ class StandardShipping implements ShippingStrategy {\n+   calculate(order: Order) {\n+     return order.total > 50 ? 0 : 5.99;\n+   }\n+ }\n+\n+ class ExpressShipping implements ShippingStrategy {\n+   calculate(order: Order) {\n+     return order.total > 100 ? 9.99 : 14.99;\n+   }\n+ }\n+\n+ class OvernightShipping implements ShippingStrategy {\n+   calculate(order: Order) {\n+     return 29.99;\n+   }\n+ }\n+\n+ function calculateShipping(order: Order, strategy: ShippingStrategy) {\n+   return strategy.calculate(order);\n+ }\n```\n\n### Chain of Responsibility\n\n```diff\n# Before: Nested validation\n- function validate(user) {\n-   const errors = [];\n-   if (!user.email) errors.push('Email required');\n+   else if (!isValidEmail(user.email)) errors.push('Invalid email');\n+   if (!user.name) errors.push('Name required');\n+   if (user.age < 18) errors.push('Must be 18+');\n+   if (user.country === 'blocked') errors.push('Country not supported');\n+   return errors;\n+ }\n\n# After: Chain of responsibility\n+ abstract class Validator {\n+   abstract validate(user: User): string | null;\n+   setNext(validator: Validator): Validator {\n+     this.next = validator;\n+     return validator;\n+   }\n+   validate(user: User): string | null {\n+     const error = this.doValidate(user);\n+     if (error) return error;\n+     return this.next?.validate(user) ?? null;\n+   }\n+ }\n+\n+ class EmailRequiredValidator extends Validator {\n+   doValidate(user: User) {\n+     return !user.email ? 'Email required' : null;\n+   }\n+ }\n+\n+ class EmailFormatValidator extends Validator {\n+   doValidate(user: User) {\n+     return user.email && !isValidEmail(user.email) ? 'Invalid email' : null;\n+   }\n+ }\n+\n+ // Build the chain\n+ const validator = new EmailRequiredValidator()\n+   .setNext(new EmailFormatValidator())\n+   .setNext(new NameRequiredValidator())\n+   .setNext(new AgeValidator())\n+   .setNext(new CountryValidator());\n```\n\n---\n\n## Refactoring Steps\n\n### Safe Refactoring Process\n\n```\n1. PREPARE\n   - Ensure tests exist (write them if missing)\n   - Commit current state\n   - Create feature branch\n\n2. IDENTIFY\n   - Find the code smell to address\n   - Understand what the code does\n   - Plan the refactoring\n\n3. REFACTOR (small steps)\n   - Make one small change\n   - Run tests\n   - Commit if tests pass\n   - Repeat\n\n4. VERIFY\n   - All tests pass\n   - Manual testing if needed\n   - Performance unchanged or improved\n\n5. CLEAN UP\n   - Update comments\n   - Update documentation\n   - Final commit\n```\n\n---\n\n## Refactoring Checklist\n\n### Code Quality\n\n- [ ] Functions are small (< 50 lines)\n- [ ] Functions do one thing\n- [ ] No duplicated code\n- [ ] Descriptive names (variables, functions, classes)\n- [ ] No magic numbers/strings\n- [ ] Dead code removed\n\n### Structure\n\n- [ ] Related code is together\n- [ ] Clear module boundaries\n- [ ] Dependencies flow in one direction\n- [ ] No circular dependencies\n\n### Type Safety\n\n- [ ] Types defined for all public APIs\n- [ ] No `any` types without justification\n- [ ] Nullable types explicitly marked\n\n### Testing\n\n- [ ] Refactored code is tested\n- [ ] Tests cover edge cases\n- [ ] All tests pass\n\n---\n\n## Common Refactoring Operations\n\n| Operation                                     | Description                           |\n| --------------------------------------------- | ------------------------------------- |\n| Extract Method                                | Turn code fragment into method        |\n| Extract Class                                 | Move behavior to new class            |\n| Extract Interface                             | Create interface from implementation  |\n| Inline Method                                 | Move method body back to caller       |\n| Inline Class                                  | Move class behavior to caller         |\n| Pull Up Method                                | Move method to superclass             |\n| Push Down Method                              | Move method to subclass               |\n| Rename Method/Variable                        | Improve clarity                       |\n| Introduce Parameter Object                    | Group related parameters              |\n| Replace Conditional with Polymorphism         | Use polymorphism instead of switch/if |\n| Replace Magic Number with Constant            | Named constants                       |\n| Decompose Conditional                         | Break complex conditions              |\n| Consolidate Conditional                       | Combine duplicate conditions          |\n| Replace Nested Conditional with Guard Clauses | Early returns                         |\n| Introduce Null Object                         | Eliminate null checks                 |\n| Replace Type Code with Class/Enum             | Strong typing                         |\n| Replace Inheritance with Delegation           | Composition over inheritance          |","tags":["refactor","awesome","copilot","github"],"capabilities":["skill","source-github","category-awesome-copilot"],"categories":["awesome-copilot"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/github/awesome-copilot/refactor","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"install_from":"skills.sh"}},"qualityScore":"0.300","qualityRationale":"deterministic score 0.30 from registry signals: · indexed on skills.sh · published under github/awesome-copilot","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T19:40:24.573Z","embedding":null,"createdAt":"2026-04-18T20:24:35.625Z","updatedAt":"2026-04-22T19:40:24.573Z","lastSeenAt":"2026-04-22T19:40:24.573Z","tsv":"'-1234':621 '/.test':578 '/somewhere':802 '0':285,302,319,482,508,701,753,987,1064,1132,1168 '0.1':283,300,315,480,506,656,1023,1074 '0.15':635,658,1099 '0.2':277,294,313,474,501,660,1020,1093 '0.25':1014,1083 '1':79,183,619,645,1334 '10':827 '100':1140,1179 '1000':670 '14.99':1142,1181 '18':1231,1235 '2':93,259,631,647,1349 '20':214 '200':188 '24':667 '29.99':1148,1190 '3':102,334,649,1365 '30':202,210,218 '365':477,504 '4':115,387,1380 '40':206 '5':128,449,798,1011,1081,1393 '5.99':1133,1169 '50':198,354,1131,1167,1409 '555':620 '6':517 '60':668,669 '7':622 '8':683 '86400000':638 '9':785 '9.99':1141,1180 'abstract':1249,1252 'activ':644,896,900,911,947 'active.foreach':904 'active.length':912 'ad':56 'add':163 'address':55,402,420,421,446,447,1356 'age':401,418 'agevalid':1325 'ain':155 'amount':385 'anoth':457,837 'api':1452 'arrow':688 'ask':65,849 'async':194,227 'await':233,242,247,250 'awesom':2 'back':1504 'bad':187,263,338,392,453,521,626,687,789,831 'behavior':17,80,1489,1511 'better':429,762 'block':1238 'bodi':376,531,1503 'bonus':1085 'boundari':1436 'branch':1348 'break':846,1556 'broke':157 'broken':223 'bronz':1030,1076 'build':448,1310 'builder':431 'calcul':208,1154,1162,1174,1186 'calculatediscount':467,511,1002,1052 'calculateorderdiscount':287,328 'calculatepr':240 'calculateship':1123,1192 'calculateuserdiscount':270,321 'callback':637,679 'caller':1506,1513 'cannot':1069 'case':1470 'category-awesome-copilot' 'chain':1200,1246,1312 'chang':15,86,98,140,151,1372 'check':1577 'checklist':1403 'circular':1443 'citi':403 'clariti':1531 'class':345,361,362,371,377,382,465,493,509,546,580,833,838,853,1158,1170,1182,1250,1284,1296,1422,1487,1492,1508,1510 'class/enum':1582 'class/module':336 'claus':727,1569 'clean':66,1394 'clear':177,1434 'code':10,29,41,52,62,69,89,145,160,180,261,689,787,791,805,817,1353,1360,1404,1417,1427,1431,1464,1482,1580 'combin':1561 'comment':803,816,1397 'commit':108,1343,1375,1401 'common':179,305,1474 'complex':434,1557 'composit':1589 'concept':526 'condit':685,1120,1539,1555,1558,1560,1563,1566 'console.log':885,888,889,890,894,895,898,906,909,910,913,914,917,925,928,929,941,965,967,969,974,976,981,984,985,989 'consolid':1559 'const':231,238,245,310,436,611,615,632,642,651,652,662,663,674,795,899,918,961,1100,1210,1271,1313 'constant':641,1551,1553 'construct':435 'constructor':549,582 'control':104 'copilot':3 'countri':404,537,540,585,593,606,1240 'countryvalid':1328 'cover':1468 'creat':216,364,563,1346,1495 'createphon':536 'createship':248 'createus':347,397,425 'critic':158 'current':1344 'data':365,368,426,460,492 'date':1006,1057,1058,1060 'date.getday':1010,1080 'day':665,681 'dead':786,1426 'deadlin':172 'decompos':1554 'deep':835 'default':1075 'defin':1448 'deleg':1588 'delet':369,811 'deleteus':349 'depend':1437,1444 'deprec':796 'descript':1418,1478 'design':1112 'diff':186,262,337,391,452,520,625,686,788,830,877,997,1118,1203 'difficult':59 'direct':1441 'discount':633,653,675,1045,1101,1107,1110 'discount_rates.premium':677 'discountresult':1042,1061 'document':1399 'doesn':84 'domain':525,544 'dovalid':1288,1300 'due':60 'duplic':260,1416,1562 'earli':728,1570 'edg':1469 'edit':127 'elimin':1575 'els':705,710,715,720,1088,1094,1134,1143,1217 'email':398,412,439,547,561,568,572,579,612,1215,1223,1293,1308 'email.create':613 'email.isvalid':555 'emailformatvalid':1297,1319 'emailrequiredvalid':1285,1316 'emailservic':372 'encapsul':847 'ensur':1336 'envi':451 'error':559,597,707,712,717,722,736,742,748,755,771,1067,1211,1244,1272,1276,1278 'errors.push':1214,1221,1226,1232,1239 'essenti':118 'even':428,761 'everyth':193 'evolut':21 'exist':28,1338 'explicit':1460 'express':1137 'expressship':1171 'extend':1286,1298 'extern':16 'extract':304,871,933,1479,1486,1493 'featur':57,139,450,1347 'fetch':200 'fetchord':234 'final':1047,1108,1400 'find':1351 'first':165 'fix':182 'flatmap':782 'flow':1438 'focus':225 'fragment':1483 'friday':1084 'friend':107 'full':1025 'function':190,195,226,228,269,286,307,320,327,396,424,527,535,690,730,766,793,806,813,881,882,935,958,970,1001,1051,1122,1191,1207,1406,1411,1421 'functions/classes':48 'generat':379 'generatereport':351 'get':862 'getdiscountr':495 'getmembershipdiscountr':308,325,332 'git':823 'github':6 'god':339 'gold':274,291,312,471,499,1009,1017,1032,1079,1087,1091 'golden':77 'good':222,303,357,406,483,542,639,725,808,848 'gradual':20 'group':407,1535 'guard':726,1568 'handlepay':352 'hard':43 'hello':534 'histori':824 'id':367,370,1035 'identifi':1350 'implement':1160,1172,1184,1498 'import':799,814 'improv':9,27,72,1392,1530 'inact':646,714,750,915,919,930,953 'inactive.foreach':923 'inactive.length':931 'inappropri':828 'inherit':1586,1591 'inlin':1499,1507 'instead':1544 'interfac':410,1033,1041,1152,1494,1496 'intim':844 'intimaci':829 'introduc':990,1532,1572 'invalid':560,598,708,756,1222,1307 'inventori':213 'isvalid':571,605 'isvalidemail':1219,1305 'justif':1457 'know':342,859,866 'larg':51,335 'let':1072 'line':189,199,203,207,211,215,219,962,968,1410 'linger':792 'list':390 'logic':265,306,485,1121 'long':184,388,880 'magic':623,1424,1548 'maintain':47 'make':96,1369 'mani':394 'manual':1385 'mark':1461 'membership':309,318,1005,1008,1016,1029,1039,1040 'method':356,386,454,872,934,1125,1127,1136,1145,1480,1485,1500,1502,1516,1518,1523,1525 'method/function':185 'method/variable':1529 'miss':1342 'mix':136 'modul':1435 'move':484,1488,1501,1509,1517,1524 'ms':666,682 'much':344 'multipl':267 'must':1233 'n':945 'name':400,416,443,640,1037,1227,1419,1552 'namerequiredvalid':1322 'need':54,175,820,1388 'negat':1071 'nest':684,1205,1565 'new':558,567,596,617,1059,1066,1315,1318,1321,1324,1327,1491 'notif':221 'null':1257,1270,1283,1295,1309,1573,1576 'nullabl':1458 'number':419,538,541,589,594,608,1044,1046,1048,1050,1056,1157,1549 'numbers/strings':624,1425 'object':340,458,488,1534,1574 'obsess':519 'oldcod':807 'oldimplement':794 'one':129,664,680,832,879,1370,1413,1440 'oper':1476,1477 'order':201,205,232,237,241,244,249,252,256,288,329,466,510,692,694,704,724,732,734,738,760,768,775,777,781,784,841,856,858,865,1124,1155,1156,1163,1164,1175,1176,1187,1188,1193,1194,1199 'order.getshippingaddress':857 'order.repository.connection.config':845 'order.save':864 'order.total':293,299,331,700,752,1130,1139,1166,1178 'order.user':696,740,779 'order.user.isactive':698,746 'order.user.membership':290,296,333 'order.user.profile.address.street':842 'orderid':197,230,235 'orderprocessor':839,854 'ordertot':496 'origin':1043,1105 'overnight':1146 'overnightship':1183 'overview':8 'own':490 'param':381 'paramet':389,395,409,1533,1537 'pass':1378,1384,1473 'password':399,414,441 'pattern':432,1113,1117,1151 'paymentservic':383 'per':360 'perform':1389 'phone':405,422,599,616 'phonenumb':581,618 'phonenumber.isvalid':592 'place':268 'plan':1362 'polymorph':1541,1543 'premium':657 'prepar':1335 'preserv':82 'price':209,239,253,257 'primit':518,523 'principl':75 'printhead':938,959 'printreport':883,936 'printusersect':946,952,971 'privat':548 'process':384,691,731,767,840,855,1333 'processedord':770 'processord':196,229,703,759,783 'product':159 'public':550,583,587,1451 'pull':1514 'purpos':178 'push':1521 'qualiti':1405 'rate':311,317,654,1049,1073,1082,1092,1098,1103,1111 're':122,126,168 'reach':834 'readabl':13 'readon':551,584,588 'refactor':1,7,18,70,74,83,124,137,144,873,1115,1329,1332,1364,1366,1402,1463,1475 'relat':408,1430,1536 'remov':809,1428 'renam':1528 'repeat':963,977,1379 'replac':1538,1547,1564,1578,1585 'report':887,940 'reportservic':378 'requir':1216,1228,1294 'respons':359,1202,1248 'result':764,769 'result.combine':773 'return':255,275,281,284,292,298,301,316,323,330,472,478,481,500,505,507,513,539,566,574,601,702,706,711,716,721,729,735,741,747,754,758,772,1012,1018,1021,1104,1129,1138,1147,1165,1177,1189,1197,1243,1264,1277,1279,1291,1303,1571 'revolut':23 'rewrit':31 'rule':78 'run':1373 'safe':113,1331 'safeti':992,1027,1446 'save':869 'scratch':33 'secure123':442 'send':220,373 'sendemail':350,528,532 'sendnotif':251 'setnext':1258,1317,1320,1323,1326 'settimeout':636,678 'shipment':217,246,254,258 'shippingstrategi':1153,1161,1173,1185,1196 'silver':280,297,314,1031,1097 'singl':358 'skill':4,39 'small':94,1367,1371,1408 'smell':53,181,1354 'source-github' 'standard':655,1128 'standardship':1159 'state':114,1345 'static':562,570,604 'step':95,1330,1368 'strategi':1116,1150,1195 'strategy.calculate':1198 'string':413,415,417,423,553,565,573,586,590,607,609,1036,1038,1256,1269 'strong':1583 'structur':11,63,1429 'subclass':1527 'subject':375,530 'superclass':1520 'support':1242 'suspend':648 'switch/if':1546 'tell':852 'test':99,116,120,162,164,444,1337,1374,1377,1383,1386,1462,1466,1467,1472 'test@example.com':440 'thing':130,1414 'this.accountage':503 'this.country':602 'this.dovalidate':1273 'this.membershiplevel':498 'this.next':1262,1280 'this.number':603 'this.total':473,479,514,516 'throw':557,595,1065 'tight':171 'time':133 'tini':97 'titl':960,966,972,975 'title.length':964,978 'title.split':986 'togeth':1433 'tostr':600 'total':634,676,709,757,891,942,1004,1013,1019,1022,1055,1063,1068,1102,1106,1109 'turn':1481 'type':380,545,765,991,996,1000,1026,1028,1445,1447,1455,1459,1579,1584 'u':902,905,921,924,950,956,980 'u.email':908,927,983 'u.isactive':903,922,951,957 'u.name':907,926,982 'unchang':1390 'understand':45,1357 'unexplain':627 'untyp':994 'unus':790,812 'unusedth':800 'updat':212,366,1396,1398 'updateinventori':243 'updateus':348 'usag':610 'use':24,36,37,430,456,522,543,763,1542 'user':64,271,322,437,445,468,494,512,713,719,744,749,884,886,892,897,916,937,939,943,948,954,973,1003,1034,1053,1054,1209,1254,1255,1267,1268,1274,1282,1289,1290,1301,1302 'user.accountage':476 'user.age':1230 'user.country':1237 'user.email':1213,1220,1292,1304,1306 'user.getdiscountrate':515 'user.membership':273,279,326,1078,1090,1096 'user.membershiplevel':470 'user.name':1225 'user.status':630,672 'user.total':276,282,324 'user@example.com':533,614 'userbuild':438 'userdata':411,427 'usermanag':346 'users.filter':901,920,949,955 'users.foreach':979 'users.length':893,944,988 'userservic':363 'userstatus':643 'userstatus.inactive':673 'valid':204,1206,1208,1251,1253,1259,1260,1261,1263,1265,1266,1281,1287,1299,1314 'validateaddress':353 'validateord':236 'validateorderexist':774 'validateordertot':780 'validateuseract':778 'validateuserexist':776 'valu':552,556,564,569,628,797 'variabl':1420 'verifi':1381 'version':103 'vip':659 'without':14,119,161,1456 'won':149 'work':147 'write':1339","prices":[{"id":"50290365-b363-43f0-9a33-aca3a16cbfbe","listingId":"e0a0c1fd-3a98-427e-84c9-2c2c626ea5e7","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"github","category":"awesome-copilot","install_from":"skills.sh"},"createdAt":"2026-04-18T20:24:35.625Z"}],"sources":[{"listingId":"e0a0c1fd-3a98-427e-84c9-2c2c626ea5e7","source":"github","sourceId":"github/awesome-copilot/refactor","sourceUrl":"https://github.com/github/awesome-copilot/tree/main/skills/refactor","isPrimary":false,"firstSeenAt":"2026-04-18T21:51:02.545Z","lastSeenAt":"2026-04-22T18:53:05.723Z"},{"listingId":"e0a0c1fd-3a98-427e-84c9-2c2c626ea5e7","source":"skills_sh","sourceId":"github/awesome-copilot/refactor","sourceUrl":"https://skills.sh/github/awesome-copilot/refactor","isPrimary":true,"firstSeenAt":"2026-04-18T20:24:35.625Z","lastSeenAt":"2026-04-22T19:40:24.573Z"}],"details":{"listingId":"e0a0c1fd-3a98-427e-84c9-2c2c626ea5e7","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"github","slug":"refactor","source":"skills_sh","category":"awesome-copilot","skills_sh_url":"https://skills.sh/github/awesome-copilot/refactor"},"updatedAt":"2026-04-22T19:40:24.573Z"}}