[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EMSXW5PATXNYSW9ZNJ25FS":3,"skill-same:01M7EMSXW5PATXNYSW9ZNJ25FS":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},"01M7EMSXW5PATXNYSW9ZNJ25FS","ams-design-patterns-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-design-patterns-pro\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: design-patterns-pro\ndescription: Apply classic design patterns judiciously: when each pattern fits, modern alternatives, and anti-patterns. Use when designing object interactions or reviewing pattern usage.\ncategory: development\n---\n\n# Design Patterns Pro\n\n## Overview\n\nDesign patterns are **a shared vocabulary for recurring design problems** — not a checklist to\napply. The professional skill isn't knowing 23 patterns; it's recognizing which problem you have,\npicking the simplest pattern that solves it, and knowing when modern language features made a\npattern unnecessary.\n\nThe through-line: patterns serve the design — if you're contorting code to fit a pattern, you have\nit backwards.\n\n## When to use\n\n- Designing how objects collaborate in unfamiliar code.\n- Reviewing code for pattern misuse or over-engineering.\n- Naming a design (\"this is basically Observer\") to communicate it.\n- Refactoring toward a cleaner structure with a known shape.\n- Learning to see past pattern names to the underlying forces.\n\n## Core concepts\n\n- **Patterns by purpose.** Creational (how objects are made: Factory, Builder, Singleton —\n  Singleton almost always wrong), Structural (how objects compose: Adapter, Decorator, Facade,\n  Composite), Behavioral (how objects interact: Observer, Strategy, Command, State, Template\n  Method). Classify the *problem* first; the pattern follows.\n- **The essential dozen (modern take).**\n  - *Strategy* — interchangeable algorithms (sorting, pricing rules); often just functions\u002Flambdas now.\n  - *Observer* — subscribe\u002Fnotify; language-level in reactive frameworks, event emitters elsewhere.\n  - *Decorator* — layered behavior (middleware, Python decorators); prefer composition.\n  - *Adapter* — translate interfaces at boundaries (anti-corruption layers).\n  - *Facade* — simplify a subsystem's interface for common use.\n  - *Factory* — when construction logic is non-trivial (parsing, DI containers); not for every `new`.\n  - *Builder* — complex objects with many optional parts (fluent APIs, test fixtures).\n  - *Command* — operations as objects (undo, queues, scheduling).\n  - *State* — behavior varying by state; often replaceable by state machines or polymorphism.\n  - *Template Method* — skeleton algorithm with hooks; often better as composition + strategy now.\n  - *Composite* — tree structures treated uniformly (UI trees, file systems).\n  - *Repository* — collection-like abstraction over persistence (a DDD staple).\n- **Patterns dissolved by language features.** Strategy → first-class functions; Observer →\n  signals\u002Freactive primitives; Singleton → DI containers or modules; Visitor → pattern matching;\n  Iterator → for-of\u002Fgenerators. Modern languages absorbed many GoF patterns — use the feature,\n  not the ceremony.\n- **Composition over inheritance.** The meta-pattern behind half the catalog: prefer composing\n  small behaviors over deep hierarchies. Most pattern misuse is inheritance where composition fit.\n\n## Practical workflow\n\n1. **Name the problem, not the pattern.** \"We need to swap pricing algorithms at runtime\" —\n   that's the requirement. *Then* notice it's Strategy-shaped.\n2. **Start with the simplest thing.** Functions before Strategy objects; a conditional before a\n   State hierarchy; direct calls before Observer. Introduce the pattern at the *second* or *third*\n   occurrence of the need.\n3. **Apply minimally.** Implement the pattern's essence, not its UML diagram. A Strategy can be\n   a function parameter — it doesn't need an abstract class and three subclasses on day one.\n4. **Check the modern alternative.** Could a lambda, a match expression, or a framework primitive\n   do this with less machinery? If yes, do that.\n5. **Name it when you use it.** If the design genuinely is Observer, say so in code\u002Fdocs — the\n   shared vocabulary is the point. Future readers pattern-match on names.\n6. **Review for pattern abuse.** AbstractFactoryFactory energy: patterns stacked on patterns,\n   speculative generality (\"we might need more strategies later\"), and patterns applied where a\n   plain function sufficed.\n\nPattern selection guide:\n\n```text\nVarying algorithm at runtime      → Strategy (or just a function parameter)\nReacting to state changes         → Observer \u002F signals \u002F events\nAdding behavior transparently     → Decorator (middleware, wrappers)\nIncompatible interfaces           → Adapter (at system boundaries)\nComplex construction              → Builder (many optionals) \u002F Factory (non-trivial creation)\nUndoable\u002Fqueueable operations     → Command\nBehavior depends on state         → State (or explicit state machine)\nTree structures                   → Composite\nSimplifying a subsystem           → Facade\n```\n\n## Common pitfalls\n\n- **Pattern-first design.** \"Let's use Abstract Factory here\" before understanding the problem.\n  Patterns are solutions looking for problems — make sure you have the problem first.\n- **Over-engineering via patterns.** Full GoF ceremony for one variation that an `if` or function\n  parameter would handle. YAGNI applies to patterns too.\n- **Singleton abuse.** Global mutable state with a fancy name — untestable, hidden coupling.\n  DI, modules, or explicit parameters instead. (True singletons: rare — loggers, maybe.)\n- **Inheritance-heavy patterns.** Template Method hierarchies five deep, fragile base classes.\n  Composition-based alternatives (strategy injection, hooks) are almost always more flexible.\n- **Ignoring language features.** Hand-rolled Observer with manual subscription lists in a\n  signals-based framework; Visitor pattern where pattern matching exists. Use the language.\n- **Pattern names as thought-terminating.** \"It's a Factory, don't question it\" — the name should\n  *start* the design conversation (does it fit? is it minimal?), not end it.\n- **Not refactoring toward patterns.** The flip side: duplicated conditionals that *scream*\n  Strategy\u002FState, left to rot because \"patterns are over-engineering.\" Let the need emerge, then\n  name and apply the pattern cleanly.\n","# Design Patterns Pro\n\n## Overview\n\nDesign patterns are **a shared vocabulary for recurring design problems** — not a checklist to\napply. The professional skill isn't knowing 23 patterns; it's recognizing which problem you have,\npicking the simplest pattern that solves it, and knowing when modern language features made a\npattern unnecessary.\n\nThe through-line: patterns serve the design — if you're contorting code to fit a pattern, you have\nit backwards.\n\n## When to use\n\n- Designing how objects collaborate in unfamiliar code.\n- Reviewing code for pattern misuse or over-engineering.\n- Naming a design (\"this is basically Observer\") to communicate it.\n- Refactoring toward a cleaner structure with a known shape.\n- Learning to see past pattern names to the underlying forces.\n\n## Core concepts\n\n- **Patterns by purpose.** Creational (how objects are made: Factory, Builder, Singleton —\n  Singleton almost always wrong), Structural (how objects compose: Adapter, Decorator, Facade,\n  Composite), Behavioral (how objects interact: Observer, Strategy, Command, State, Template\n  Method). Classify the *problem* first; the pattern follows.\n- **The essential dozen (modern take).**\n  - *Strategy* — interchangeable algorithms (sorting, pricing rules); often just functions\u002Flambdas now.\n  - *Observer* — subscribe\u002Fnotify; language-level in reactive frameworks, event emitters elsewhere.\n  - *Decorator* — layered behavior (middleware, Python decorators); prefer composition.\n  - *Adapter* — translate interfaces at boundaries (anti-corruption layers).\n  - *Facade* — simplify a subsystem's interface for common use.\n  - *Factory* — when construction logic is non-trivial (parsing, DI containers); not for every `new`.\n  - *Builder* — complex objects with many optional parts (fluent APIs, test fixtures).\n  - *Command* — operations as objects (undo, queues, scheduling).\n  - *State* — behavior varying by state; often replaceable by state machines or polymorphism.\n  - *Template Method* — skeleton algorithm with hooks; often better as composition + strategy now.\n  - *Composite* — tree structures treated uniformly (UI trees, file systems).\n  - *Repository* — collection-like abstraction over persistence (a DDD staple).\n- **Patterns dissolved by language features.** Strategy → first-class functions; Observer →\n  signals\u002Freactive primitives; Singleton → DI containers or modules; Visitor → pattern matching;\n  Iterator → for-of\u002Fgenerators. Modern languages absorbed many GoF patterns — use the feature,\n  not the ceremony.\n- **Composition over inheritance.** The meta-pattern behind half the catalog: prefer composing\n  small behaviors over deep hierarchies. Most pattern misuse is inheritance where composition fit.\n\n## Practical workflow\n\n1. **Name the problem, not the pattern.** \"We need to swap pricing algorithms at runtime\" —\n   that's the requirement. *Then* notice it's Strategy-shaped.\n2. **Start with the simplest thing.** Functions before Strategy objects; a conditional before a\n   State hierarchy; direct calls before Observer. Introduce the pattern at the *second* or *third*\n   occurrence of the need.\n3. **Apply minimally.** Implement the pattern's essence, not its UML diagram. A Strategy can be\n   a function parameter — it doesn't need an abstract class and three subclasses on day one.\n4. **Check the modern alternative.** Could a lambda, a match expression, or a framework primitive\n   do this with less machinery? If yes, do that.\n5. **Name it when you use it.** If the design genuinely is Observer, say so in code\u002Fdocs — the\n   shared vocabulary is the point. Future readers pattern-match on names.\n6. **Review for pattern abuse.** AbstractFactoryFactory energy: patterns stacked on patterns,\n   speculative generality (\"we might need more strategies later\"), and patterns applied where a\n   plain function sufficed.\n\nPattern selection guide:\n\n```text\nVarying algorithm at runtime      → Strategy (or just a function parameter)\nReacting to state changes         → Observer \u002F signals \u002F events\nAdding behavior transparently     → Decorator (middleware, wrappers)\nIncompatible interfaces           → Adapter (at system boundaries)\nComplex construction              → Builder (many optionals) \u002F Factory (non-trivial creation)\nUndoable\u002Fqueueable operations     → Command\nBehavior depends on state         → State (or explicit state machine)\nTree structures                   → Composite\nSimplifying a subsystem           → Facade\n```\n\n## Common pitfalls\n\n- **Pattern-first design.** \"Let's use Abstract Factory here\" before understanding the problem.\n  Patterns are solutions looking for problems — make sure you have the problem first.\n- **Over-engineering via patterns.** Full GoF ceremony for one variation that an `if` or function\n  parameter would handle. YAGNI applies to patterns too.\n- **Singleton abuse.** Global mutable state with a fancy name — untestable, hidden coupling.\n  DI, modules, or explicit parameters instead. (True singletons: rare — loggers, maybe.)\n- **Inheritance-heavy patterns.** Template Method hierarchies five deep, fragile base classes.\n  Composition-based alternatives (strategy injection, hooks) are almost always more flexible.\n- **Ignoring language features.** Hand-rolled Observer with manual subscription lists in a\n  signals-based framework; Visitor pattern where pattern matching exists. Use the language.\n- **Pattern names as thought-terminating.** \"It's a Factory, don't question it\" — the name should\n  *start* the design conversation (does it fit? is it minimal?), not end it.\n- **Not refactoring toward patterns.** The flip side: duplicated conditionals that *scream*\n  Strategy\u002FState, left to rot because \"patterns are over-engineering.\" Let the need emerge, then\n  name and apply the pattern cleanly.\n",{},"main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-design-patterns-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-design-patterns-pro",{"tool":37,"command":38},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill ams-design-patterns-pro",{"tool":40,"command":41},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill ams-design-patterns-pro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-design-patterns-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",[],[]]