{
  "schemaVersion": "1.0",
  "item": {
    "slug": "architecture-patterns",
    "name": "Architecture Patterns",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/wpank/architecture-patterns",
    "canonicalUrl": "https://clawhub.ai/wpank/architecture-patterns",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/architecture-patterns",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=architecture-patterns",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "data/patterns.csv",
      "templates/clean-architecture/README.md",
      "templates/clean-architecture/src/domain/interfaces/repository.interface.ts",
      "templates/clean-architecture/src/domain/entities/user.entity.ts"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/architecture-patterns"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/architecture-patterns",
    "agentPageUrl": "https://openagent3.xyz/skills/architecture-patterns/agent",
    "manifestUrl": "https://openagent3.xyz/skills/architecture-patterns/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/architecture-patterns/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "WHAT",
        "body": "Backend architecture patterns for building maintainable, testable systems: Clean Architecture, Hexagonal Architecture, and Domain-Driven Design."
      },
      {
        "title": "WHEN",
        "body": "Designing new backend systems from scratch\nRefactoring monoliths for better maintainability\nEstablishing architecture standards for teams\nCreating testable, mockable codebases\nPlanning microservices decomposition"
      },
      {
        "title": "KEYWORDS",
        "body": "clean architecture, hexagonal, ports and adapters, DDD, domain-driven design, layers, entities, use cases, repositories, aggregates, bounded contexts"
      },
      {
        "title": "Decision Framework: Which Pattern?",
        "body": "SituationRecommended PatternSimple CRUD appNone (over-engineering)Medium complexity, team standardizationClean ArchitectureMultiple external integrations that change frequentlyHexagonal (Ports & Adapters)Complex business domain with many rulesDomain-Driven DesignLarge system with multiple teamsDDD + Bounded Contexts"
      },
      {
        "title": "Clean Architecture Layers",
        "body": "┌──────────────────────────────────────┐\n│      Frameworks & Drivers (UI, DB)   │  ← Outer: Can change\n├──────────────────────────────────────┤\n│      Interface Adapters              │  ← Controllers, Gateways\n├──────────────────────────────────────┤\n│      Use Cases                       │  ← Application Logic\n├──────────────────────────────────────┤\n│      Entities                        │  ← Core Business Rules\n└──────────────────────────────────────┘\n\nDependency Rule: Dependencies point INWARD only. Inner layers never import outer layers."
      },
      {
        "title": "Hexagonal Architecture",
        "body": "┌─────────────┐\n    ┌────│   Adapter   │────┐    (REST API)\n    │    └─────────────┘    │\n    ▼                       ▼\n┌──────┐              ┌──────────┐\n│ Port │◄────────────►│  Domain  │\n└──────┘              └──────────┘\n    ▲                       ▲\n    │    ┌─────────────┐    │\n    └────│   Adapter   │────┘    (Database)\n         └─────────────┘\n\nPorts: Interfaces defining what the domain needs\nAdapters: Implementations (swappable for testing)"
      },
      {
        "title": "Directory Structure",
        "body": "app/\n├── domain/           # Entities & business rules (innermost)\n│   ├── entities/\n│   │   └── user.py\n│   ├── value_objects/\n│   │   └── email.py\n│   └── interfaces/   # Ports\n│       └── user_repository.py\n├── use_cases/        # Application business rules\n│   └── create_user.py\n├── adapters/         # Interface implementations\n│   ├── repositories/\n│   │   └── postgres_user_repository.py\n│   └── controllers/\n│       └── user_controller.py\n└── infrastructure/   # Framework & external concerns\n    ├── database.py\n    └── config.py"
      },
      {
        "title": "Entity (Domain Layer)",
        "body": "from dataclasses import dataclass\nfrom datetime import datetime\n\n@dataclass\nclass User:\n    \"\"\"Core entity - NO framework dependencies.\"\"\"\n    id: str\n    email: str\n    name: str\n    created_at: datetime\n    is_active: bool = True\n\n    def deactivate(self):\n        \"\"\"Business rule in entity.\"\"\"\n        self.is_active = False\n\n    def can_place_order(self) -> bool:\n        return self.is_active"
      },
      {
        "title": "Port (Interface)",
        "body": "from abc import ABC, abstractmethod\nfrom typing import Optional\n\nclass IUserRepository(ABC):\n    \"\"\"Port: defines contract, no implementation.\"\"\"\n    \n    @abstractmethod\n    async def find_by_id(self, user_id: str) -> Optional[User]:\n        pass\n    \n    @abstractmethod\n    async def save(self, user: User) -> User:\n        pass"
      },
      {
        "title": "Use Case (Application Layer)",
        "body": "@dataclass\nclass CreateUserRequest:\n    email: str\n    name: str\n\n@dataclass  \nclass CreateUserResponse:\n    user: Optional[User]\n    success: bool\n    error: Optional[str] = None\n\nclass CreateUserUseCase:\n    \"\"\"Use case: orchestrates business logic.\"\"\"\n    \n    def __init__(self, user_repository: IUserRepository):\n        self.user_repository = user_repository  # Injected dependency\n    \n    async def execute(self, request: CreateUserRequest) -> CreateUserResponse:\n        # Business validation\n        existing = await self.user_repository.find_by_email(request.email)\n        if existing:\n            return CreateUserResponse(user=None, success=False, error=\"Email exists\")\n        \n        # Create entity\n        user = User(\n            id=str(uuid.uuid4()),\n            email=request.email,\n            name=request.name,\n            created_at=datetime.now()\n        )\n        \n        saved = await self.user_repository.save(user)\n        return CreateUserResponse(user=saved, success=True)"
      },
      {
        "title": "Adapter (Implementation)",
        "body": "class PostgresUserRepository(IUserRepository):\n    \"\"\"Adapter: PostgreSQL implementation of the port.\"\"\"\n    \n    def __init__(self, pool: asyncpg.Pool):\n        self.pool = pool\n    \n    async def find_by_id(self, user_id: str) -> Optional[User]:\n        async with self.pool.acquire() as conn:\n            row = await conn.fetchrow(\n                \"SELECT * FROM users WHERE id = $1\", user_id\n            )\n            return self._to_entity(row) if row else None\n    \n    async def save(self, user: User) -> User:\n        async with self.pool.acquire() as conn:\n            await conn.execute(\n                \"\"\"INSERT INTO users (id, email, name, created_at, is_active)\n                   VALUES ($1, $2, $3, $4, $5)\n                   ON CONFLICT (id) DO UPDATE SET email=$2, name=$3, is_active=$5\"\"\",\n                user.id, user.email, user.name, user.created_at, user.is_active\n            )\n            return user"
      },
      {
        "title": "Pattern 2: Hexagonal (Ports & Adapters)",
        "body": "Best when you have multiple external integrations that may change.\n\n# Domain Service (Core)\nclass OrderService:\n    def __init__(\n        self,\n        order_repo: OrderRepositoryPort,      # Port\n        payment: PaymentGatewayPort,          # Port\n        notifications: NotificationPort       # Port\n    ):\n        self.orders = order_repo\n        self.payments = payment\n        self.notifications = notifications\n    \n    async def place_order(self, order: Order) -> OrderResult:\n        # Pure business logic - no infrastructure details\n        if not order.is_valid():\n            return OrderResult(success=False, error=\"Invalid order\")\n        \n        payment = await self.payments.charge(order.total, order.customer_id)\n        if not payment.success:\n            return OrderResult(success=False, error=\"Payment failed\")\n        \n        order.mark_as_paid()\n        saved = await self.orders.save(order)\n        await self.notifications.send(order.customer_email, \"Order confirmed\")\n        \n        return OrderResult(success=True, order=saved)\n\n# Adapters (swap these for testing or changing providers)\nclass StripePaymentAdapter(PaymentGatewayPort):\n    async def charge(self, amount: Money, customer: str) -> PaymentResult:\n        # Real Stripe implementation\n        ...\n\nclass MockPaymentAdapter(PaymentGatewayPort):\n    async def charge(self, amount: Money, customer: str) -> PaymentResult:\n        return PaymentResult(success=True, transaction_id=\"mock-123\")"
      },
      {
        "title": "Pattern 3: Domain-Driven Design",
        "body": "For complex business domains with many rules."
      },
      {
        "title": "Value Objects (Immutable)",
        "body": "@dataclass(frozen=True)\nclass Email:\n    \"\"\"Value object: validated, immutable.\"\"\"\n    value: str\n    \n    def __post_init__(self):\n        if \"@\" not in self.value:\n            raise ValueError(\"Invalid email\")\n\n@dataclass(frozen=True)\nclass Money:\n    amount: int  # cents\n    currency: str\n    \n    def add(self, other: \"Money\") -> \"Money\":\n        if self.currency != other.currency:\n            raise ValueError(\"Currency mismatch\")\n        return Money(self.amount + other.amount, self.currency)"
      },
      {
        "title": "Aggregates (Consistency Boundaries)",
        "body": "class Order:\n    \"\"\"Aggregate root: enforces invariants.\"\"\"\n    \n    def __init__(self, id: str, customer: Customer):\n        self.id = id\n        self.customer = customer\n        self.items: List[OrderItem] = []\n        self.status = OrderStatus.PENDING\n        self._events: List[DomainEvent] = []\n    \n    def add_item(self, product: Product, quantity: int):\n        \"\"\"Business logic in aggregate.\"\"\"\n        if quantity > product.max_quantity:\n            raise ValueError(f\"Max {product.max_quantity} allowed\")\n        \n        item = OrderItem(product, quantity)\n        self.items.append(item)\n        self._events.append(ItemAddedEvent(self.id, item))\n    \n    def submit(self):\n        \"\"\"State transition with invariant enforcement.\"\"\"\n        if not self.items:\n            raise ValueError(\"Cannot submit empty order\")\n        if self.status != OrderStatus.PENDING:\n            raise ValueError(\"Order already submitted\")\n        \n        self.status = OrderStatus.SUBMITTED\n        self._events.append(OrderSubmittedEvent(self.id))"
      },
      {
        "title": "Repository Pattern",
        "body": "class OrderRepository:\n    \"\"\"Persist/retrieve aggregates, publish domain events.\"\"\"\n    \n    async def save(self, order: Order):\n        await self._persist(order)\n        await self._publish_events(order._events)\n        order._events.clear()"
      },
      {
        "title": "Testing Benefits",
        "body": "All patterns enable the same testing approach:\n\n# Test with mock adapter\nasync def test_create_user():\n    mock_repo = MockUserRepository()\n    use_case = CreateUserUseCase(user_repository=mock_repo)\n    \n    result = await use_case.execute(CreateUserRequest(\n        email=\"test@example.com\",\n        name=\"Test User\"\n    ))\n    \n    assert result.success\n    assert result.user.email == \"test@example.com\""
      },
      {
        "title": "NEVER",
        "body": "Anemic Domain Models: Entities with only data, no behavior (put logic IN entities)\nFramework Coupling: Business logic importing Flask, FastAPI, Django ORM\nFat Controllers: Business logic in HTTP handlers\nLeaky Abstractions: Repository returning ORM objects instead of domain entities\nSkipping Layers: Controller directly accessing database\nOver-Engineering: Using Clean Architecture for simple CRUD apps\nCircular Dependencies: Use cases importing controllers"
      }
    ],
    "body": "Architecture Patterns\nWHAT\n\nBackend architecture patterns for building maintainable, testable systems: Clean Architecture, Hexagonal Architecture, and Domain-Driven Design.\n\nWHEN\nDesigning new backend systems from scratch\nRefactoring monoliths for better maintainability\nEstablishing architecture standards for teams\nCreating testable, mockable codebases\nPlanning microservices decomposition\nKEYWORDS\n\nclean architecture, hexagonal, ports and adapters, DDD, domain-driven design, layers, entities, use cases, repositories, aggregates, bounded contexts\n\nDecision Framework: Which Pattern?\nSituation\tRecommended Pattern\nSimple CRUD app\tNone (over-engineering)\nMedium complexity, team standardization\tClean Architecture\nMultiple external integrations that change frequently\tHexagonal (Ports & Adapters)\nComplex business domain with many rules\tDomain-Driven Design\nLarge system with multiple teams\tDDD + Bounded Contexts\nQuick Reference\nClean Architecture Layers\n┌──────────────────────────────────────┐\n│      Frameworks & Drivers (UI, DB)   │  ← Outer: Can change\n├──────────────────────────────────────┤\n│      Interface Adapters              │  ← Controllers, Gateways\n├──────────────────────────────────────┤\n│      Use Cases                       │  ← Application Logic\n├──────────────────────────────────────┤\n│      Entities                        │  ← Core Business Rules\n└──────────────────────────────────────┘\n\n\nDependency Rule: Dependencies point INWARD only. Inner layers never import outer layers.\n\nHexagonal Architecture\n         ┌─────────────┐\n    ┌────│   Adapter   │────┐    (REST API)\n    │    └─────────────┘    │\n    ▼                       ▼\n┌──────┐              ┌──────────┐\n│ Port │◄────────────►│  Domain  │\n└──────┘              └──────────┘\n    ▲                       ▲\n    │    ┌─────────────┐    │\n    └────│   Adapter   │────┘    (Database)\n         └─────────────┘\n\n\nPorts: Interfaces defining what the domain needs Adapters: Implementations (swappable for testing)\n\nDirectory Structure\napp/\n├── domain/           # Entities & business rules (innermost)\n│   ├── entities/\n│   │   └── user.py\n│   ├── value_objects/\n│   │   └── email.py\n│   └── interfaces/   # Ports\n│       └── user_repository.py\n├── use_cases/        # Application business rules\n│   └── create_user.py\n├── adapters/         # Interface implementations\n│   ├── repositories/\n│   │   └── postgres_user_repository.py\n│   └── controllers/\n│       └── user_controller.py\n└── infrastructure/   # Framework & external concerns\n    ├── database.py\n    └── config.py\n\nPattern 1: Clean Architecture\nEntity (Domain Layer)\nfrom dataclasses import dataclass\nfrom datetime import datetime\n\n@dataclass\nclass User:\n    \"\"\"Core entity - NO framework dependencies.\"\"\"\n    id: str\n    email: str\n    name: str\n    created_at: datetime\n    is_active: bool = True\n\n    def deactivate(self):\n        \"\"\"Business rule in entity.\"\"\"\n        self.is_active = False\n\n    def can_place_order(self) -> bool:\n        return self.is_active\n\nPort (Interface)\nfrom abc import ABC, abstractmethod\nfrom typing import Optional\n\nclass IUserRepository(ABC):\n    \"\"\"Port: defines contract, no implementation.\"\"\"\n    \n    @abstractmethod\n    async def find_by_id(self, user_id: str) -> Optional[User]:\n        pass\n    \n    @abstractmethod\n    async def save(self, user: User) -> User:\n        pass\n\nUse Case (Application Layer)\n@dataclass\nclass CreateUserRequest:\n    email: str\n    name: str\n\n@dataclass  \nclass CreateUserResponse:\n    user: Optional[User]\n    success: bool\n    error: Optional[str] = None\n\nclass CreateUserUseCase:\n    \"\"\"Use case: orchestrates business logic.\"\"\"\n    \n    def __init__(self, user_repository: IUserRepository):\n        self.user_repository = user_repository  # Injected dependency\n    \n    async def execute(self, request: CreateUserRequest) -> CreateUserResponse:\n        # Business validation\n        existing = await self.user_repository.find_by_email(request.email)\n        if existing:\n            return CreateUserResponse(user=None, success=False, error=\"Email exists\")\n        \n        # Create entity\n        user = User(\n            id=str(uuid.uuid4()),\n            email=request.email,\n            name=request.name,\n            created_at=datetime.now()\n        )\n        \n        saved = await self.user_repository.save(user)\n        return CreateUserResponse(user=saved, success=True)\n\nAdapter (Implementation)\nclass PostgresUserRepository(IUserRepository):\n    \"\"\"Adapter: PostgreSQL implementation of the port.\"\"\"\n    \n    def __init__(self, pool: asyncpg.Pool):\n        self.pool = pool\n    \n    async def find_by_id(self, user_id: str) -> Optional[User]:\n        async with self.pool.acquire() as conn:\n            row = await conn.fetchrow(\n                \"SELECT * FROM users WHERE id = $1\", user_id\n            )\n            return self._to_entity(row) if row else None\n    \n    async def save(self, user: User) -> User:\n        async with self.pool.acquire() as conn:\n            await conn.execute(\n                \"\"\"INSERT INTO users (id, email, name, created_at, is_active)\n                   VALUES ($1, $2, $3, $4, $5)\n                   ON CONFLICT (id) DO UPDATE SET email=$2, name=$3, is_active=$5\"\"\",\n                user.id, user.email, user.name, user.created_at, user.is_active\n            )\n            return user\n\nPattern 2: Hexagonal (Ports & Adapters)\n\nBest when you have multiple external integrations that may change.\n\n# Domain Service (Core)\nclass OrderService:\n    def __init__(\n        self,\n        order_repo: OrderRepositoryPort,      # Port\n        payment: PaymentGatewayPort,          # Port\n        notifications: NotificationPort       # Port\n    ):\n        self.orders = order_repo\n        self.payments = payment\n        self.notifications = notifications\n    \n    async def place_order(self, order: Order) -> OrderResult:\n        # Pure business logic - no infrastructure details\n        if not order.is_valid():\n            return OrderResult(success=False, error=\"Invalid order\")\n        \n        payment = await self.payments.charge(order.total, order.customer_id)\n        if not payment.success:\n            return OrderResult(success=False, error=\"Payment failed\")\n        \n        order.mark_as_paid()\n        saved = await self.orders.save(order)\n        await self.notifications.send(order.customer_email, \"Order confirmed\")\n        \n        return OrderResult(success=True, order=saved)\n\n# Adapters (swap these for testing or changing providers)\nclass StripePaymentAdapter(PaymentGatewayPort):\n    async def charge(self, amount: Money, customer: str) -> PaymentResult:\n        # Real Stripe implementation\n        ...\n\nclass MockPaymentAdapter(PaymentGatewayPort):\n    async def charge(self, amount: Money, customer: str) -> PaymentResult:\n        return PaymentResult(success=True, transaction_id=\"mock-123\")\n\nPattern 3: Domain-Driven Design\n\nFor complex business domains with many rules.\n\nValue Objects (Immutable)\n@dataclass(frozen=True)\nclass Email:\n    \"\"\"Value object: validated, immutable.\"\"\"\n    value: str\n    \n    def __post_init__(self):\n        if \"@\" not in self.value:\n            raise ValueError(\"Invalid email\")\n\n@dataclass(frozen=True)\nclass Money:\n    amount: int  # cents\n    currency: str\n    \n    def add(self, other: \"Money\") -> \"Money\":\n        if self.currency != other.currency:\n            raise ValueError(\"Currency mismatch\")\n        return Money(self.amount + other.amount, self.currency)\n\nAggregates (Consistency Boundaries)\nclass Order:\n    \"\"\"Aggregate root: enforces invariants.\"\"\"\n    \n    def __init__(self, id: str, customer: Customer):\n        self.id = id\n        self.customer = customer\n        self.items: List[OrderItem] = []\n        self.status = OrderStatus.PENDING\n        self._events: List[DomainEvent] = []\n    \n    def add_item(self, product: Product, quantity: int):\n        \"\"\"Business logic in aggregate.\"\"\"\n        if quantity > product.max_quantity:\n            raise ValueError(f\"Max {product.max_quantity} allowed\")\n        \n        item = OrderItem(product, quantity)\n        self.items.append(item)\n        self._events.append(ItemAddedEvent(self.id, item))\n    \n    def submit(self):\n        \"\"\"State transition with invariant enforcement.\"\"\"\n        if not self.items:\n            raise ValueError(\"Cannot submit empty order\")\n        if self.status != OrderStatus.PENDING:\n            raise ValueError(\"Order already submitted\")\n        \n        self.status = OrderStatus.SUBMITTED\n        self._events.append(OrderSubmittedEvent(self.id))\n\nRepository Pattern\nclass OrderRepository:\n    \"\"\"Persist/retrieve aggregates, publish domain events.\"\"\"\n    \n    async def save(self, order: Order):\n        await self._persist(order)\n        await self._publish_events(order._events)\n        order._events.clear()\n\nTesting Benefits\n\nAll patterns enable the same testing approach:\n\n# Test with mock adapter\nasync def test_create_user():\n    mock_repo = MockUserRepository()\n    use_case = CreateUserUseCase(user_repository=mock_repo)\n    \n    result = await use_case.execute(CreateUserRequest(\n        email=\"test@example.com\",\n        name=\"Test User\"\n    ))\n    \n    assert result.success\n    assert result.user.email == \"test@example.com\"\n\nNEVER\nAnemic Domain Models: Entities with only data, no behavior (put logic IN entities)\nFramework Coupling: Business logic importing Flask, FastAPI, Django ORM\nFat Controllers: Business logic in HTTP handlers\nLeaky Abstractions: Repository returning ORM objects instead of domain entities\nSkipping Layers: Controller directly accessing database\nOver-Engineering: Using Clean Architecture for simple CRUD apps\nCircular Dependencies: Use cases importing controllers"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/wpank/architecture-patterns",
    "publisherUrl": "https://clawhub.ai/wpank/architecture-patterns",
    "owner": "wpank",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/architecture-patterns",
    "downloadUrl": "https://openagent3.xyz/downloads/architecture-patterns",
    "agentUrl": "https://openagent3.xyz/skills/architecture-patterns/agent",
    "manifestUrl": "https://openagent3.xyz/skills/architecture-patterns/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/architecture-patterns/agent.md"
  }
}