[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EMJ4G3JSDGCDC7W6MHBDMS":3,"skill-same:01M7EMJ4G3JSDGCDC7W6MHBDMS":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},"01M7EMJ4G3JSDGCDC7W6MHBDMS","ams-clean-architecture",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-clean-architecture\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: clean-architecture\ndescription: Clean\u002Fhexagonal architecture: dependency rules, ports and adapters, layering, and testable boundaries. Use when structuring applications for maintainability and testability.\ncategory: development\n---\n\n# Clean Architecture\n\n## Overview\n\nClean Architecture (and its cousin Hexagonal\u002FPorts-and-Adapters) is **a dependency discipline**:\nbusiness logic sits at the center, depending on nothing; infrastructure (databases, frameworks, UI)\nsits at the edges, depending inward through abstractions. The result: domain logic testable without\ndatabases or frameworks, and infrastructure replaceable without touching the domain.\n\nThe through-line: the Dependency Rule — source code dependencies point inward only. Frameworks are\ndetails.\n\n## When to use\n\n- Structuring a new application for long-term maintainability.\n- Untangling business logic from framework\u002Fdatabase coupling.\n- Making domain logic unit-testable without infrastructure.\n- Reviewing layering violations in a codebase.\n- Deciding where new code belongs in a layered app.\n\n## Core concepts\n\n- **The Dependency Rule.** Inner layers know nothing of outer layers. Domain → (nothing).\n  Application → domain. Infrastructure → application + domain (implements their interfaces).\n  A use case never imports a database driver; the database adapter implements the use case's\n  repository interface.\n- **Layers.** Entities (domain objects + business rules) → Use Cases \u002F Application services\n  (orchestrate entities toward user goals) → Interface Adapters (controllers, presenters,\n  repository implementations) → Frameworks & Drivers (DB, web framework, UI). Name them per your\n  stack, but keep the direction.\n- **Ports and adapters.** The application defines *ports* (interfaces: `OrderRepository`,\n  `PaymentGateway`); infrastructure provides *adapters* (PostgresOrderRepository,\n  StripePaymentGateway). The app never names a concrete infrastructure class — only the port.\n- **Dependency inversion in practice.** High-level modules define the abstractions they need;\n  low-level modules implement them. Composition root (main\u002Fstartup) wires concrete adapters.\n  This inverts the \"natural\" direction where app code calls the DB directly.\n- **Screaming architecture.** The top-level structure should say what the app *does* (orders,\n  billing, shipping) not what it's built with (controllers, models, utils). Package by feature\u002F\n  component first, layer within.\n- **Testability as a side effect.** When the domain depends on nothing, unit tests need no mocks\n  of infrastructure — pure, fast, deterministic. Adapters get thin integration tests against real\n  infrastructure.\n\n## Practical workflow\n\n1. **Identify the core domain.** What are the business rules that must survive a framework change?\n   That's the center. Everything else is a detail.\n2. **Define ports from the application's needs.** What does the use case need? (`findOrderById`,\n   `chargeCard`) — interfaces shaped by the caller, not by the database's convenience.\n3. **Write the domain + use cases first.** Pure logic, no framework imports, tested without\n   infrastructure. This is the valuable 80% — build it where it's cleanest.\n4. **Add adapters at the edges.** Controllers translate HTTP → use-case calls; repositories\n   translate domain ↔ persistence; gateways wrap external APIs. Adapters are thin and boring.\n5. **Wire at the composition root.** `main`\u002Fstartup creates concrete adapters and injects them.\n   Only here does the app know it's Postgres and not SQLite.\n6. **Enforce the rule.** Architecture tests (dependency checkers: no `import` from domain to\n   infrastructure) in CI. The rule erodes without enforcement — one convenient shortcut at a time.\n\nLayer sketch:\n\n```text\nsrc\u002F\n├── domain\u002F            # entities, value objects, domain services, domain events\n│   └── order\u002F         #   Order, Money, OrderPlaced — zero external imports\n├── application\u002F       # use cases + ports (interfaces)\n│   └── order\u002F         #   PlaceOrderUseCase, OrderRepository (port), PaymentGateway (port)\n├── adapters\u002F          # implementations of ports + delivery mechanisms\n│   ├── persistence\u002F   #   PostgresOrderRepository implements OrderRepository\n│   ├── web\u002F           #   OrderController → PlaceOrderUseCase\n│   └── payment\u002F       #   StripePaymentGateway implements PaymentGateway\n└── main.ts            # composition root: wires adapters into use cases\n```\n\n## Common pitfalls\n\n- **Interface-per-class cargo cult.** Creating `IOrderService` for every class \"for clean\n  architecture.\" Ports exist at *architectural boundaries* (app ↔ infrastructure), not between\n  every two classes.\n- **Anemic use cases, fat adapters.** All logic leaking into controllers or repositories while\n  \"use cases\" just delegate. The application layer should own orchestration and business flow.\n- **Leaky abstractions.** Repository interfaces shaped like the ORM (`findBySql`, lazy-loading\n  entities) — the infrastructure dictating terms. Ports are designed by the application.\n- **Over-layering simple apps.** Four layers + DTOs + mappers for a CRUD admin panel. Apply the\n  discipline proportionally — the Dependency Rule matters most where logic is complex and\n  long-lived.\n- **DTO\u002Fmapper explosion.** Six near-identical types (entity, DTO, view model, …) with manual\n  mappers nobody maintains. Map at boundaries where shapes genuinely differ; don't multiply types\n  ritually.\n- **No enforcement.** The architecture documented in a wiki, violated in the code within a month.\n  Dependency-rule tests in CI or it didn't happen.\n- **Framework in the domain.** ORM decorators on entities, HTTP types in use cases — the \"details\"\n  leaking inward. Keep the center ignorant; adapt at the edges.\n","# Clean Architecture\n\n## Overview\n\nClean Architecture (and its cousin Hexagonal\u002FPorts-and-Adapters) is **a dependency discipline**:\nbusiness logic sits at the center, depending on nothing; infrastructure (databases, frameworks, UI)\nsits at the edges, depending inward through abstractions. The result: domain logic testable without\ndatabases or frameworks, and infrastructure replaceable without touching the domain.\n\nThe through-line: the Dependency Rule — source code dependencies point inward only. Frameworks are\ndetails.\n\n## When to use\n\n- Structuring a new application for long-term maintainability.\n- Untangling business logic from framework\u002Fdatabase coupling.\n- Making domain logic unit-testable without infrastructure.\n- Reviewing layering violations in a codebase.\n- Deciding where new code belongs in a layered app.\n\n## Core concepts\n\n- **The Dependency Rule.** Inner layers know nothing of outer layers. Domain → (nothing).\n  Application → domain. Infrastructure → application + domain (implements their interfaces).\n  A use case never imports a database driver; the database adapter implements the use case's\n  repository interface.\n- **Layers.** Entities (domain objects + business rules) → Use Cases \u002F Application services\n  (orchestrate entities toward user goals) → Interface Adapters (controllers, presenters,\n  repository implementations) → Frameworks & Drivers (DB, web framework, UI). Name them per your\n  stack, but keep the direction.\n- **Ports and adapters.** The application defines *ports* (interfaces: `OrderRepository`,\n  `PaymentGateway`); infrastructure provides *adapters* (PostgresOrderRepository,\n  StripePaymentGateway). The app never names a concrete infrastructure class — only the port.\n- **Dependency inversion in practice.** High-level modules define the abstractions they need;\n  low-level modules implement them. Composition root (main\u002Fstartup) wires concrete adapters.\n  This inverts the \"natural\" direction where app code calls the DB directly.\n- **Screaming architecture.** The top-level structure should say what the app *does* (orders,\n  billing, shipping) not what it's built with (controllers, models, utils). Package by feature\u002F\n  component first, layer within.\n- **Testability as a side effect.** When the domain depends on nothing, unit tests need no mocks\n  of infrastructure — pure, fast, deterministic. Adapters get thin integration tests against real\n  infrastructure.\n\n## Practical workflow\n\n1. **Identify the core domain.** What are the business rules that must survive a framework change?\n   That's the center. Everything else is a detail.\n2. **Define ports from the application's needs.** What does the use case need? (`findOrderById`,\n   `chargeCard`) — interfaces shaped by the caller, not by the database's convenience.\n3. **Write the domain + use cases first.** Pure logic, no framework imports, tested without\n   infrastructure. This is the valuable 80% — build it where it's cleanest.\n4. **Add adapters at the edges.** Controllers translate HTTP → use-case calls; repositories\n   translate domain ↔ persistence; gateways wrap external APIs. Adapters are thin and boring.\n5. **Wire at the composition root.** `main`\u002Fstartup creates concrete adapters and injects them.\n   Only here does the app know it's Postgres and not SQLite.\n6. **Enforce the rule.** Architecture tests (dependency checkers: no `import` from domain to\n   infrastructure) in CI. The rule erodes without enforcement — one convenient shortcut at a time.\n\nLayer sketch:\n\n```text\nsrc\u002F\n├── domain\u002F            # entities, value objects, domain services, domain events\n│   └── order\u002F         #   Order, Money, OrderPlaced — zero external imports\n├── application\u002F       # use cases + ports (interfaces)\n│   └── order\u002F         #   PlaceOrderUseCase, OrderRepository (port), PaymentGateway (port)\n├── adapters\u002F          # implementations of ports + delivery mechanisms\n│   ├── persistence\u002F   #   PostgresOrderRepository implements OrderRepository\n│   ├── web\u002F           #   OrderController → PlaceOrderUseCase\n│   └── payment\u002F       #   StripePaymentGateway implements PaymentGateway\n└── main.ts            # composition root: wires adapters into use cases\n```\n\n## Common pitfalls\n\n- **Interface-per-class cargo cult.** Creating `IOrderService` for every class \"for clean\n  architecture.\" Ports exist at *architectural boundaries* (app ↔ infrastructure), not between\n  every two classes.\n- **Anemic use cases, fat adapters.** All logic leaking into controllers or repositories while\n  \"use cases\" just delegate. The application layer should own orchestration and business flow.\n- **Leaky abstractions.** Repository interfaces shaped like the ORM (`findBySql`, lazy-loading\n  entities) — the infrastructure dictating terms. Ports are designed by the application.\n- **Over-layering simple apps.** Four layers + DTOs + mappers for a CRUD admin panel. Apply the\n  discipline proportionally — the Dependency Rule matters most where logic is complex and\n  long-lived.\n- **DTO\u002Fmapper explosion.** Six near-identical types (entity, DTO, view model, …) with manual\n  mappers nobody maintains. Map at boundaries where shapes genuinely differ; don't multiply types\n  ritually.\n- **No enforcement.** The architecture documented in a wiki, violated in the code within a month.\n  Dependency-rule tests in CI or it didn't happen.\n- **Framework in the domain.** ORM decorators on entities, HTTP types in use cases — the \"details\"\n  leaking inward. Keep the center ignorant; adapt at the edges.\n",{},"main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-clean-architecture",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-clean-architecture",{"tool":37,"command":38},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill ams-clean-architecture",{"tool":40,"command":41},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill ams-clean-architecture","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-clean-architecture\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",[],[]]