[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FFR8B4WCVB8DFBKEMMZ57Q":3,"skill-same:01M6FFR8B4WCVB8DFBKEMMZ57Q":55},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":28,"linkOnly":29,"markdownContent":30,"markdownBody":30,"frontMatter":31,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":35,"repositoryHtmlUrl":36,"repositoryHomepageUrl":37,"ownerHtmlUrl":38,"ownerBlogUrl":6,"ownerDescription":39,"updatedAt":40,"install":41,"resources":54},"01M6FFR8B4WCVB8DFBKEMMZ57Q","tdd-workflows-tdd-refactor",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Frmyndharis\u002Fantigravity-skills\u002Ftdd-workflows-tdd-refactor\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000007","代码审查","SCENARIO","使用场景",[23,24,25,26,27],"tdd","workflows","refactor","tdd workflows tdd refactor","tdd workflows","2026-11-10 10:12:30",false,"## Use this skill when\n\n- Working on tdd workflows tdd refactor tasks or workflows\n- Needing guidance, best practices, or checklists for tdd workflows tdd refactor\n\n## Do not use this skill when\n\n- The task is unrelated to tdd workflows tdd refactor\n- You need a different domain or tool outside this scope\n\n## Instructions\n\n- Clarify goals, constraints, and required inputs.\n- Apply relevant best practices and validate outcomes.\n- Provide actionable steps and verification.\n- If detailed examples are required, open `resources\u002Fimplementation-playbook.md`.\n\nRefactor code with confidence using comprehensive test safety net:\n\n[Extended thinking: This tool uses the tdd-orchestrator agent (opus model) for sophisticated refactoring while maintaining all tests green. It applies design patterns, improves code quality, and optimizes performance with the safety of comprehensive test coverage.]\n\n## Usage\n\nUse Task tool with subagent_type=\"tdd-orchestrator\" to perform safe refactoring.\n\nPrompt: \"Refactor this code while keeping all tests green: $ARGUMENTS. Apply TDD refactor phase:\n\n## Core Process\n\n**1. Pre-Assessment**\n- Run tests to establish green baseline\n- Analyze code smells and test coverage\n- Document current performance metrics\n- Create incremental refactoring plan\n\n**2. Code Smell Detection**\n- Duplicated code → Extract methods\u002Fclasses\n- Long methods → Decompose into focused functions\n- Large classes → Split responsibilities\n- Long parameter lists → Parameter objects\n- Feature Envy → Move methods to appropriate classes\n- Primitive Obsession → Value objects\n- Switch statements → Polymorphism\n- Dead code → Remove\n\n**3. Design Patterns**\n- Apply Creational (Factory, Builder, Singleton)\n- Apply Structural (Adapter, Facade, Decorator)\n- Apply Behavioral (Strategy, Observer, Command)\n- Apply Domain (Repository, Service, Value Objects)\n- Use patterns only where they add clear value\n\n**4. SOLID Principles**\n- Single Responsibility: One reason to change\n- Open\u002FClosed: Open for extension, closed for modification\n- Liskov Substitution: Subtypes substitutable\n- Interface Segregation: Small, focused interfaces\n- Dependency Inversion: Depend on abstractions\n\n**5. Refactoring Techniques**\n- Extract Method\u002FVariable\u002FInterface\n- Inline unnecessary indirection\n- Rename for clarity\n- Move Method\u002FField to appropriate classes\n- Replace Magic Numbers with constants\n- Encapsulate fields\n- Replace Conditional with Polymorphism\n- Introduce Null Object\n\n**6. Performance Optimization**\n- Profile to identify bottlenecks\n- Optimize algorithms and data structures\n- Implement caching where beneficial\n- Reduce database queries (N+1 elimination)\n- Lazy loading and pagination\n- Always measure before and after\n\n**7. Incremental Steps**\n- Make small, atomic changes\n- Run tests after each modification\n- Commit after each successful refactoring\n- Keep refactoring separate from behavior changes\n- Use scaffolding when needed\n\n**8. Architecture Evolution**\n- Layer separation and dependency management\n- Module boundaries and interface definition\n- Event-driven patterns for decoupling\n- Database access pattern optimization\n\n**9. Safety Verification**\n- Run full test suite after each change\n- Performance regression testing\n- Mutation testing for test effectiveness\n- Rollback plan for major changes\n\n**10. Advanced Patterns**\n- Strangler Fig: Gradual legacy replacement\n- Branch by Abstraction: Large-scale changes\n- Parallel Change: Expand-contract pattern\n- Mikado Method: Dependency graph navigation\n\n## Output Requirements\n\n- Refactored code with improvements applied\n- Test results (all green)\n- Before\u002Fafter metrics comparison\n- Applied refactoring techniques list\n- Performance improvement measurements\n- Remaining technical debt assessment\n\n## Safety Checklist\n\nBefore committing:\n- ✓ All tests pass (100% green)\n- ✓ No functionality regression\n- ✓ Performance metrics acceptable\n- ✓ Code coverage maintained\u002Fimproved\n- ✓ Documentation updated\n\n## Recovery Protocol\n\nIf tests fail:\n- Immediately revert last change\n- Identify breaking refactoring\n- Apply smaller incremental changes\n- Use version control for safe experimentation\n\n## Example: Extract Method Pattern\n\n**Before:**\n```typescript\nclass OrderProcessor {\n  processOrder(order: Order): ProcessResult {\n    \u002F\u002F Validation\n    if (!order.customerId || order.items.length === 0) {\n      return { success: false, error: \"Invalid order\" };\n    }\n\n    \u002F\u002F Calculate totals\n    let subtotal = 0;\n    for (const item of order.items) {\n      subtotal += item.price * item.quantity;\n    }\n    let total = subtotal + (subtotal * 0.08) + (subtotal > 100 ? 0 : 15);\n\n    \u002F\u002F Process payment...\n    \u002F\u002F Update inventory...\n    \u002F\u002F Send confirmation...\n  }\n}\n```\n\n**After:**\n```typescript\nclass OrderProcessor {\n  async processOrder(order: Order): Promise\u003CProcessResult> {\n    const validation = this.validateOrder(order);\n    if (!validation.isValid) return ProcessResult.failure(validation.error);\n\n    const orderTotal = OrderTotal.calculate(order);\n    const inventoryCheck = await this.inventoryService.checkAvailability(order.items);\n    if (!inventoryCheck.available) return ProcessResult.failure(inventoryCheck.reason);\n\n    await this.paymentService.processPayment(order.paymentMethod, orderTotal.total);\n    await this.inventoryService.reserveItems(order.items);\n    await this.notificationService.sendOrderConfirmation(order, orderTotal);\n\n    return ProcessResult.success(order.id, orderTotal.total);\n  }\n\n  private validateOrder(order: Order): ValidationResult {\n    if (!order.customerId) return ValidationResult.invalid(\"Customer ID required\");\n    if (order.items.length === 0) return ValidationResult.invalid(\"Order must contain items\");\n    return ValidationResult.valid();\n  }\n}\n```\n\n**Applied:** Extract Method, Value Objects, Dependency Injection, Async patterns\n\nCode to refactor: $ARGUMENTS\"\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Frmyndharis\u002Fantigravity-skills\u002Ftdd-workflows-tdd-refactor",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":42,"prompt":52,"zipAvailable":53},[43,46,49],{"tool":44,"command":45},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill tdd-workflows-tdd-refactor",{"tool":47,"command":48},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill tdd-workflows-tdd-refactor",{"tool":50,"command":51},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill tdd-workflows-tdd-refactor","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Frmyndharis\u002Fantigravity-skills\u002Ftdd-workflows-tdd-refactor\u002FSKILL.md",true,[],[56,68,78,87,93,100],{"skillNo":57,"name":58,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":64,"publishedAt":28},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[61],{"categoryNo":62,"categoryName":63,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[65,66,67],"model","model hierarchy","model hierarchy skill",{"skillNo":69,"name":70,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":74,"publishedAt":28},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[73],{"categoryNo":62,"categoryName":63,"taxonomyType":20,"taxonomyTypeDesc":21},[75,76,77],"MCP","zoom","zoom mcp",{"skillNo":79,"name":80,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":28},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[84,85,86,76],"sdk","zoom apps sdk","apps",{"skillNo":88,"name":89,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":28},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[89],{"skillNo":94,"name":95,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":99,"publishedAt":28},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[98],{"categoryNo":62,"categoryName":63,"taxonomyType":20,"taxonomyTypeDesc":21},[95],{"skillNo":101,"name":102,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":28},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[102]]