[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EVPNRCN0RE4NVWHZR5C6KC":3,"skill-same:01M7EVPNRCN0RE4NVWHZR5C6KC":45},{"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":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7EVPNRCN0RE4NVWHZR5C6KC","ams-refactoring-pro",null,"TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-refactoring-pro\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: refactoring-pro\ndescription: Systematic refactoring: safe transformations, strangler patterns, characterization tests, and large-scale change management. Use when improving code structure without changing behavior.\ncategory: development\n---\n\n# Refactoring Pro\n\n## Overview\n\nRefactoring — **improving structure without changing behavior** — is how codebases stay malleable.\nThe professional discipline is making it *safe and systematic*: small behavior-preserving steps,\ntests as the safety net (characterization tests when none exist), and strategies for large-scale\nchange (strangler fig, branch by abstraction) that don't require freezing the world.\n\nThe through-line: never refactor and change behavior in the same step — and prove it with tests.\n\n## When to use\n\n- Cleaning up code that's hard to understand or change.\n- Preparing code for a new feature (refactor first, then extend).\n- Paying down tech debt systematically.\n- Migrating architectures, frameworks, or libraries incrementally.\n- Reviewing refactors for safety and scope discipline.\n\n## Core concepts\n\n- **Two hats, never both.** Refactoring (structure changes, behavior identical) vs feature work\n  (behavior changes). Wear one hat at a time; mixed commits are unreviewable and unrevertable.\n  If you spot a behavior improvement while refactoring, note it and do it separately.\n- **Small, named transformations.** Extract function\u002Fmethod, rename, move, inline, replace\n  conditional with polymorphism, introduce parameter object — each a discrete, reviewable step.\n  Big-bang rewrites fail; sequences of small safe steps succeed.\n- **Tests as the safety net.** Existing tests must pass before *and* after every step. No tests?\n  Write **characterization tests** first: capture current behavior (even buggy — document it),\n  then refactor against them. Golden-master tests for legacy code with unclear specs.\n- **Code smells as signals.** Long methods, large classes, duplicated logic, long parameter lists,\n  feature envy (method more interested in another class), primitive obsession, shotgun surgery\n  (one change touches ten files) — each smell suggests specific refactorings.\n- **Strangler fig for large migrations.** New implementation grows alongside the old behind an\n  abstraction; traffic\u002Ffunctionality migrates incrementally; the old is removed last. For\n  frameworks, architectures, and monolith decomposition — the only migration strategy that\n  consistently works.\n- **Branch by abstraction.** Introduce an abstraction over the old implementation, build the new\n  behind it, switch the binding, delete the old. Enables incremental replacement *within* a\n  codebase without long-lived feature branches.\n\n## Practical workflow\n\n1. **Establish the safety net.** Run existing tests (all green?). If coverage is thin, write\n   characterization tests for the area you're touching — capture behavior, lock it in.\n2. **Identify the target.** What's the specific pain? (Can't add feature X without touching 12\n   files → the seam is wrong.) Refactor *toward* enabling something, not toward abstract cleanliness.\n3. **Work in tiny steps.** One transformation → run tests → commit. Each commit leaves the code\n   working. If a step breaks tests, the step was too big or wasn't behavior-preserving — revert\n   and slice smaller.\n4. **Follow the smells to structure.** Duplication → extract; long method → extract + compose;\n   tangled conditional → polymorphism\u002Fstrategy; wrong home → move method; primitive soup →\n   value objects.\n5. **For large changes: strangler.** Put the seam (abstraction\u002Ffacade\u002Frouting) in place first,\n   migrate incrementally with both implementations live, monitor, then remove the old. Never a\n   flag day if you can avoid it.\n6. **Verify and clean.** Full suite green, no behavior change (diff the *behavior*, not just the\n   code — run characterization tests), dead code removed, and the commit history tells the story\n   in small steps.\n\nRefactoring session checklist:\n\n```text\n[ ] Tests green before starting (or characterization tests written)\n[ ] One refactoring hat on — no behavior changes mixed in\n[ ] Steps small enough that each is obviously safe\n[ ] Tests run after every step (automated, fast)\n[ ] Commit per step (or per few steps) — revertable history\n[ ] No dead code left behind (old paths removed, not commented out)\n[ ] Final review: does the structure now make the next change easy?\n```\n\n## Common pitfalls\n\n- **Refactoring + features in one diff.** Unreviewable, unrevertable, and the source of \"the\n  refactor broke something\" (it was the feature). Separate commits, separate PRs if needed.\n- **No safety net.** Refactoring without tests is just editing. Characterization tests are the\n  entry fee for legacy code — write them first.\n- **Big-bang rewrites.** \"We'll rewrite it properly\" — months of parallel work, merge hell, and\n  rediscovery of every bug the old code had fixed. Strangler fig instead, always.\n- **Refactoring without a reason.** Churning code toward personal taste with no enabling goal.\n  Refactor to enable a feature, fix a pain, or pay measured debt — \"cleaner\" alone isn't a reason.\n- **Changing behavior accidentally.** \"While I'm here\" fixes slipped into a refactor. If the\n  characterization test now fails differently, you've changed behavior — split it out.\n- **Stopping halfway.** Extracting methods but leaving the 2,000-line class; introducing the\n  abstraction but never migrating callers. Half-refactors are worse than none — finish the seam.\n- **Premature abstraction during refactor.** Extracting speculative generalizations instead of\n  the duplication actually present. Refactor toward the code you have, not the code you imagine.\n","# Refactoring Pro\n\n## Overview\n\nRefactoring — **improving structure without changing behavior** — is how codebases stay malleable.\nThe professional discipline is making it *safe and systematic*: small behavior-preserving steps,\ntests as the safety net (characterization tests when none exist), and strategies for large-scale\nchange (strangler fig, branch by abstraction) that don't require freezing the world.\n\nThe through-line: never refactor and change behavior in the same step — and prove it with tests.\n\n## When to use\n\n- Cleaning up code that's hard to understand or change.\n- Preparing code for a new feature (refactor first, then extend).\n- Paying down tech debt systematically.\n- Migrating architectures, frameworks, or libraries incrementally.\n- Reviewing refactors for safety and scope discipline.\n\n## Core concepts\n\n- **Two hats, never both.** Refactoring (structure changes, behavior identical) vs feature work\n  (behavior changes). Wear one hat at a time; mixed commits are unreviewable and unrevertable.\n  If you spot a behavior improvement while refactoring, note it and do it separately.\n- **Small, named transformations.** Extract function\u002Fmethod, rename, move, inline, replace\n  conditional with polymorphism, introduce parameter object — each a discrete, reviewable step.\n  Big-bang rewrites fail; sequences of small safe steps succeed.\n- **Tests as the safety net.** Existing tests must pass before *and* after every step. No tests?\n  Write **characterization tests** first: capture current behavior (even buggy — document it),\n  then refactor against them. Golden-master tests for legacy code with unclear specs.\n- **Code smells as signals.** Long methods, large classes, duplicated logic, long parameter lists,\n  feature envy (method more interested in another class), primitive obsession, shotgun surgery\n  (one change touches ten files) — each smell suggests specific refactorings.\n- **Strangler fig for large migrations.** New implementation grows alongside the old behind an\n  abstraction; traffic\u002Ffunctionality migrates incrementally; the old is removed last. For\n  frameworks, architectures, and monolith decomposition — the only migration strategy that\n  consistently works.\n- **Branch by abstraction.** Introduce an abstraction over the old implementation, build the new\n  behind it, switch the binding, delete the old. Enables incremental replacement *within* a\n  codebase without long-lived feature branches.\n\n## Practical workflow\n\n1. **Establish the safety net.** Run existing tests (all green?). If coverage is thin, write\n   characterization tests for the area you're touching — capture behavior, lock it in.\n2. **Identify the target.** What's the specific pain? (Can't add feature X without touching 12\n   files → the seam is wrong.) Refactor *toward* enabling something, not toward abstract cleanliness.\n3. **Work in tiny steps.** One transformation → run tests → commit. Each commit leaves the code\n   working. If a step breaks tests, the step was too big or wasn't behavior-preserving — revert\n   and slice smaller.\n4. **Follow the smells to structure.** Duplication → extract; long method → extract + compose;\n   tangled conditional → polymorphism\u002Fstrategy; wrong home → move method; primitive soup →\n   value objects.\n5. **For large changes: strangler.** Put the seam (abstraction\u002Ffacade\u002Frouting) in place first,\n   migrate incrementally with both implementations live, monitor, then remove the old. Never a\n   flag day if you can avoid it.\n6. **Verify and clean.** Full suite green, no behavior change (diff the *behavior*, not just the\n   code — run characterization tests), dead code removed, and the commit history tells the story\n   in small steps.\n\nRefactoring session checklist:\n\n```text\n[ ] Tests green before starting (or characterization tests written)\n[ ] One refactoring hat on — no behavior changes mixed in\n[ ] Steps small enough that each is obviously safe\n[ ] Tests run after every step (automated, fast)\n[ ] Commit per step (or per few steps) — revertable history\n[ ] No dead code left behind (old paths removed, not commented out)\n[ ] Final review: does the structure now make the next change easy?\n```\n\n## Common pitfalls\n\n- **Refactoring + features in one diff.** Unreviewable, unrevertable, and the source of \"the\n  refactor broke something\" (it was the feature). Separate commits, separate PRs if needed.\n- **No safety net.** Refactoring without tests is just editing. Characterization tests are the\n  entry fee for legacy code — write them first.\n- **Big-bang rewrites.** \"We'll rewrite it properly\" — months of parallel work, merge hell, and\n  rediscovery of every bug the old code had fixed. Strangler fig instead, always.\n- **Refactoring without a reason.** Churning code toward personal taste with no enabling goal.\n  Refactor to enable a feature, fix a pain, or pay measured debt — \"cleaner\" alone isn't a reason.\n- **Changing behavior accidentally.** \"While I'm here\" fixes slipped into a refactor. If the\n  characterization test now fails differently, you've changed behavior — split it out.\n- **Stopping halfway.** Extracting methods but leaving the 2,000-line class; introducing the\n  abstraction but never migrating callers. Half-refactors are worse than none — finish the seam.\n- **Premature abstraction during refactor.** Extracting speculative generalizations instead of\n  the duplication actually present. Refactor toward the code you have, not the code you imagine.\n",{},"main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-refactoring-pro",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill ams-refactoring-pro",{"tool":37,"command":38},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill ams-refactoring-pro",{"tool":40,"command":41},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill ams-refactoring-pro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-refactoring-pro\u002FSKILL.md",true,[],[46,53,61,68,75,82],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":18},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":57,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]