[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D3J5D96KD490MNEJCSAFZW":3,"skill-same:01M7D3J5D96KD490MNEJCSAFZW":75},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7D3J5D96KD490MNEJCSAFZW","refactoring",null,"Detect smell -> establish behavior -> regression test -> minimal transformation -> verify -> repeat","poppyTM\u002Faipo-lang","poppyTM","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F339400917?v=4","01M78F6YNKFR5S5JQR27X9F09Z","Poppy Team","01M7D3H3PCFF0AZSRPP5GTS76P",0,"MIT","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Faipo-lang\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frefactoring\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: refactoring\ndescription: Detect smell -> establish behavior -> regression test -> minimal transformation -> verify -> repeat\n---\n# Refactoring Engineering\n\n## 1. Smell Detection\nProactively identify code smells that indicate deeper design problems. Look for duplicated code, long methods, large classes, long parameter lists, divergent change, and shotgun surgery. Smells are heuristics, not strict rules; they guide you to areas needing investigation.\n\n## 2. Establishing Behavior\nBefore changing any code, you must deeply understand its current behavior, including edge cases and undocumented quirks. Read the code, consult domain experts, and review version control history. Do not guess; prove the behavior.\n\n## 3. Regression Testing\nEnsure a robust suite of fast, deterministic regression tests exists before refactoring. If tests are missing, write characterization tests (golden master tests) that lock down the current output for given inputs, regardless of whether that output is 'correct'.\n\n## 4. Minimal Transformation\nExecute refactoring in tiny, safe, verifiable steps. Use proven automated refactoring tools provided by your IDE whenever possible (e.g., Extract Method, Rename, Inline). Avoid manual text editing for structural changes to minimize human error.\n\n## 5. Verification\nRun the test suite immediately after every small transformation. If a test fails, you have taken too large a step or made a mistake. Undo (revert) immediately, break the step down into smaller pieces, and try again. Never commit broken code.\n\n## 6. Iterative Process\nRefactoring is not a single large event; it is an iterative loop: smell -> test -> refactor -> verify -> commit. Repeat this loop constantly. Keep refactoring commits separate from feature commits to ensure bisectability and clear history.\n\n## 7. Extract and Override\nWhen dealing with legacy code, use the Extract and Override Call pattern to break dependencies. Extract the problematic dependency instantiation into a protected factory method, then subclass and override it in your test to inject a mock or fake.\n\n## 8. Strangler Fig Application\nFor large-scale structural refactoring or rewriting, use the Strangler Fig pattern. Build the new system around the edges of the old system. Intercept calls, route them to the new system where implemented, and fall back to the old system otherwise. Gradually expand the new system.\n\n## 9. Parallel Change\nWhen changing APIs or database schemas, use the Parallel Change (Expand and Contract) pattern. 1. Expand: Add the new element alongside the old. 2. Migrate: Update clients to use the new element. 3. Contract: Remove the old element. This ensures backward compatibility during the transition.\n\n## 10. Feature Flags for Refactoring\nUse feature flags to hide large-scale refactorings in production until they are fully verified. Run both the old and new code paths concurrently in a 'dark launch' mode, compare their results, log discrepancies, and switch over only when confidence is high.\n\n","# Refactoring Engineering\n\n## 1. Smell Detection\nProactively identify code smells that indicate deeper design problems. Look for duplicated code, long methods, large classes, long parameter lists, divergent change, and shotgun surgery. Smells are heuristics, not strict rules; they guide you to areas needing investigation.\n\n## 2. Establishing Behavior\nBefore changing any code, you must deeply understand its current behavior, including edge cases and undocumented quirks. Read the code, consult domain experts, and review version control history. Do not guess; prove the behavior.\n\n## 3. Regression Testing\nEnsure a robust suite of fast, deterministic regression tests exists before refactoring. If tests are missing, write characterization tests (golden master tests) that lock down the current output for given inputs, regardless of whether that output is 'correct'.\n\n## 4. Minimal Transformation\nExecute refactoring in tiny, safe, verifiable steps. Use proven automated refactoring tools provided by your IDE whenever possible (e.g., Extract Method, Rename, Inline). Avoid manual text editing for structural changes to minimize human error.\n\n## 5. Verification\nRun the test suite immediately after every small transformation. If a test fails, you have taken too large a step or made a mistake. Undo (revert) immediately, break the step down into smaller pieces, and try again. Never commit broken code.\n\n## 6. Iterative Process\nRefactoring is not a single large event; it is an iterative loop: smell -> test -> refactor -> verify -> commit. Repeat this loop constantly. Keep refactoring commits separate from feature commits to ensure bisectability and clear history.\n\n## 7. Extract and Override\nWhen dealing with legacy code, use the Extract and Override Call pattern to break dependencies. Extract the problematic dependency instantiation into a protected factory method, then subclass and override it in your test to inject a mock or fake.\n\n## 8. Strangler Fig Application\nFor large-scale structural refactoring or rewriting, use the Strangler Fig pattern. Build the new system around the edges of the old system. Intercept calls, route them to the new system where implemented, and fall back to the old system otherwise. Gradually expand the new system.\n\n## 9. Parallel Change\nWhen changing APIs or database schemas, use the Parallel Change (Expand and Contract) pattern. 1. Expand: Add the new element alongside the old. 2. Migrate: Update clients to use the new element. 3. Contract: Remove the old element. This ensures backward compatibility during the transition.\n\n## 10. Feature Flags for Refactoring\nUse feature flags to hide large-scale refactorings in production until they are fully verified. Run both the old and new code paths concurrently in a 'dark launch' mode, compare their results, log discrepancies, and switch over only when confidence is high.\n\n",{"name":5,"description":7},"main","b2b8635798b0fab7a7c037608a616985cc1da742",".agents\u002Fskills\u002Frefactoring","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Faipo-lang","https:\u002F\u002Fwww.poppy.lat\u002Faipo\u002Fdocs\u002F","https:\u002F\u002Fgithub.com\u002FpoppyTM","https:\u002F\u002Fpoppy.lat","Construímos linguagens de programação e ferramentas para quem lê código com o mesmo cuidado com que escreve.","2026-11-02 17:30:11",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add poppyTM\u002Faipo-lang --skill refactoring",{"tool":39,"command":40},"bunx","bunx skills add poppyTM\u002Faipo-lang --skill refactoring",{"tool":42,"command":43},"pnpm","pnpm dlx skills add poppyTM\u002Faipo-lang --skill refactoring","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Faipo-lang\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frefactoring\u002FSKILL.md",true,[47,53,57,61,65,71],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"checks\u002Frefactoring-invariants.md","REFERENCE","参考文档",226,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Faipo-lang\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frefactoring\u002Fchecks\u002Frefactoring-invariants.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"examples\u002Fextract_method_refactoring.md",958,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Faipo-lang\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frefactoring\u002Fexamples\u002Fextract_method_refactoring.md",{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"manifest.json",1130,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Faipo-lang\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frefactoring\u002Fmanifest.json",{"path":62,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Frefactoring-patterns.md",1457,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Faipo-lang\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frefactoring\u002Freferences\u002Frefactoring-patterns.md",{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"scripts\u002Ffind_long_methods.sh","SCRIPT","脚本",1310,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Faipo-lang\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frefactoring\u002Fscripts\u002Ffind_long_methods.sh",{"path":72,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":73,"sourceHtmlUrl":74},"templates\u002Frefactoring-template.md",794,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Faipo-lang\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frefactoring\u002Ftemplates\u002Frefactoring-template.md",[76,83,89,95,101,108],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7D3JYBW82B2Q8XH75TKWBT7","lang-aipo","Aipo V1 canonical engineering, ADR-001 syntax conformance, braces blocks, Tipo:nome method bindings, structural interfaces, transactional failure handling, and anti-hallucination guardrails for LLMs.","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Faipo-lang\u002Fblob\u002Fmain\u002Fskills\u002Flang-aipo\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"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":86,"categories":87,"keywords":88,"publishedAt":19},"01M7D3JWY6HS47F1TRVX14SZ5F","goal-management","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Faipo-lang\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fgoal-management\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"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":92,"categories":93,"keywords":94,"publishedAt":19},"01M7D3JV6D1SPD1WNS14634CGV","evidence-collection","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Faipo-lang\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fevidence-collection\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"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":98,"categories":99,"keywords":100,"publishedAt":19},"01M7D3JSSDVRNC7W42KAFA65MH","code-review","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Faipo-lang\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fcode-review\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M7D3JPEZSE144W9T31QKB9XP","testing-quality","Testing pyramid, deterministic tests, regression tests, behavior assertions, test isolation, flaky detection, representative fixtures","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Faipo-lang\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftesting-quality\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":19},"01M7D3JJES8J9K0HXG45H27BRF","cognitive-clarity","Unambiguous communication, single-decision focus, visual structuring, and rationale-first explanation tailored for neurodivergent collaboration","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Faipo-lang\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcognitive-clarity\u002FSKILL.md",[],[]]