[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6QQEXMZ8ERYE4F67AVEDTDT":3,"skill-same:01M6QQEXMZ8ERYE4F67AVEDTDT":53},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":27,"linkOnly":28,"markdownContent":29,"markdownBody":30,"frontMatter":31,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":14,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M6QQEXMZ8ERYE4F67AVEDTDT","dry-refactoring",null,"Guided workflow to eliminate copy-paste duplication detected by jscpd.","lfr-ai\u002Fcopier-fullstack-template","lfr-ai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F233346551?v=4","01M6QPWTJWTSJV1TQTTY8ZPBYJ","Laurits Fromberg","01M6QPWTQ47BZGA4TH17H14N80",0,"MIT","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Fdry-refactoring\u002FSKILL.md",[],[19,20,21,22,23,24,25,26],"refactoring","dry","dry refactoring","workflow","duplication","copy","paste","jscpd","2026-11-10 10:12:30",false,"---\nname: dry-refactoring\ndescription: Guided workflow to eliminate copy-paste duplication detected by jscpd.\n---\n\n# dry-refactoring\n\nGuided workflow to eliminate copy-paste duplication in source code. Use after running jscpd to detect clones.\n\n## Prerequisites\n\nFirst, run jscpd to identify duplications:\n\n```bash\nnpx jscpd@4.0.5 --reporters ai \u003Cpath>\n```\n\n## Workflow\n\n1. Run jscpd with `--reporters ai` on the target path\n2. Parse each clone line to identify the two duplicated locations\n3. Read both code fragments from the source files\n4. Understand what the duplicated code does\n5. Design a refactoring: extract a shared function, class, module, or constant\n6. Apply the refactoring — update both locations and all other usages\n7. Re-run jscpd to confirm the clone is eliminated\n8. Repeat for remaining clones, highest-impact first\n\n## Refactoring Strategies\n\n| Strategy | When |\n|----------|------|\n| Extract function | Same logic repeated with different inputs |\n| Extract constant | Same literal values repeated |\n| Extract base class | Parallel class hierarchies with shared behaviour |\n| Extract module | Shared utilities across multiple modules |\n| Template method | Same algorithm structure, different steps |\n","# dry-refactoring\n\nGuided workflow to eliminate copy-paste duplication in source code. Use after running jscpd to detect clones.\n\n## Prerequisites\n\nFirst, run jscpd to identify duplications:\n\n```bash\nnpx jscpd@4.0.5 --reporters ai \u003Cpath>\n```\n\n## Workflow\n\n1. Run jscpd with `--reporters ai` on the target path\n2. Parse each clone line to identify the two duplicated locations\n3. Read both code fragments from the source files\n4. Understand what the duplicated code does\n5. Design a refactoring: extract a shared function, class, module, or constant\n6. Apply the refactoring — update both locations and all other usages\n7. Re-run jscpd to confirm the clone is eliminated\n8. Repeat for remaining clones, highest-impact first\n\n## Refactoring Strategies\n\n| Strategy | When |\n|----------|------|\n| Extract function | Same logic repeated with different inputs |\n| Extract constant | Same literal values repeated |\n| Extract base class | Parallel class hierarchies with shared behaviour |\n| Extract module | Shared utilities across multiple modules |\n| Template method | Same algorithm structure, different steps |\n",{"name":5,"description":7},"main","f726ce2f2bb4e3bcc2f56c066598f4acd910c5ee","template\u002F.github\u002Fskills\u002Fdry-refactoring","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template","https:\u002F\u002Fgithub.com\u002Flfr-ai","Optimizing for elegance","2026-07-20 12:19:48",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add lfr-ai\u002Fcopier-fullstack-template --skill dry-refactoring",{"tool":45,"command":46},"bunx","bunx skills add lfr-ai\u002Fcopier-fullstack-template --skill dry-refactoring",{"tool":48,"command":49},"pnpm","pnpm dlx skills add lfr-ai\u002Fcopier-fullstack-template --skill dry-refactoring","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Fdry-refactoring\u002FSKILL.md",true,[],[54,87,99,105,122,128],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":70,"publishedAt":27},"01M6QQGVYW8BZ3W165A5YMJ1PF","ui-ux-frontend","Frontend UX, accessibility, responsive layout, and Storybook interaction quality standards.","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Fui-ux-frontend\u002FSKILL.md",[60,65],{"categoryNo":61,"categoryName":62,"taxonomyType":63,"taxonomyTypeDesc":64},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",{"categoryNo":66,"categoryName":67,"taxonomyType":68,"taxonomyTypeDesc":69},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86],"ui ux","ui ux frontend","ui","ux","frontend","storybook","frontend ux","interaction","layout","responsive","mdx","tsx","standards","quality","accessibility","css",{"skillNo":88,"name":89,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":95,"publishedAt":27},"01M6QQGS7N3ENQZR2Y5JBRYDHD","testing-conventions","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Ftesting-conventions\u002FSKILL.md",[92],{"categoryNo":93,"categoryName":94,"taxonomyType":63,"taxonomyTypeDesc":64},"01JBSEEDCAT000000000000008","测试与质量",[96,97,98],"conventions","testing conventions","testing",{"skillNo":100,"name":101,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":27},"01M6QQGQKA9Q6A147WXMS7QPGX","tdd","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Ftdd\u002FSKILL.md",[],[101],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":112,"publishedAt":27},"01M6QQG5AZPRWSR6SSCCDDPAM3","shadcn-ui","shadcn\u002Fui component conventions and composition patterns","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Fshadcn-ui\u002FSKILL.md",[111],{"categoryNo":66,"categoryName":67,"taxonomyType":68,"taxonomyTypeDesc":69},[113,73,114,115,82,116,117,118,119,96,120,121],"shadcn ui","shadcn","component","Composition","src","composition patterns","presentation","patterns","ui component",{"skillNo":123,"name":124,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":27},"01M6QQG3WMMB8X8C4T8PR7WBV4","sdd","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Fsdd\u002FSKILL.md",[],[124],{"skillNo":129,"name":130,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":27},"01M6QQG241NAC5PQFXFD01NR16","quality-gate","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Fquality-gate\u002FSKILL.md",[],[134,84,135],"quality gate","gate"]