From vfm-agent-company
Software architecture design from Google Principal Engineers. Use when designing folder structures, implementing Clean Architecture or Hexagonal Architecture, applying Domain-Driven Design (DDD), enforcing SOLID principles, choosing design patterns (Repository, Factory, Strategy, Observer), refactoring complex modules, or planning system boundaries. Triggers on architecture, clean code, DDD, SOLID, design patterns, folder structure, refactoring, or code organization.
npx claudepluginhub duylinhdang1998/claude-template-agent --plugin vfm-agent-companyThis skill uses the workspace's default tool permissions.
**Purpose**: Design maintainable, scalable software systems using Clean Architecture, DDD, and SOLID principles
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Purpose: Design maintainable, scalable software systems using Clean Architecture, DDD, and SOLID principles
Agent: Google Software Architect Use When: Complex business logic, long-term maintainability critical, or code organization guidance needed
External (UI, DB, APIs)
↓
Interface Adapters (Controllers, Gateways)
↓
Use Cases (Business Workflows)
↓
Entities (Core Domain)
Dependency Rule: Dependencies point inward only
Purpose: Separate business logic from infrastructure
Layers:
Benefits:
Example Structure:
src/
├── domain/ # Entities, value objects
├── application/ # Use cases, ports
├── infrastructure/ # Database, external APIs
└── presentation/ # Controllers, UI
Purpose: Model complex business domains accurately
Key Concepts:
When to Use:
Example:
// Entity
class Order {
constructor(
private id: OrderId,
private items: OrderItem[],
private status: OrderStatus
) {}
place(): void {
if (this.items.length === 0) {
throw new Error('Cannot place empty order')
}
this.status = OrderStatus.PLACED
}
}
// Value Object
class Money {
constructor(
private amount: number,
private currency: string
) {}
add(other: Money): Money {
return new Money(this.amount + other.amount, this.currency)
}
}
Single Responsibility: One class, one reason to change Open/Closed: Open for extension, closed for modification Liskov Substitution: Subtypes must be substitutable Interface Segregation: Many specific > one general Dependency Inversion: Depend on abstractions
Creational:
Structural:
Behavioral:
┌─────────────────────────────────┐
│ Application Core │
│ (Business Logic, Use Cases) │
│ │
│ Ports (Interfaces): │
│ ├─ Input Ports (Commands) │
│ └─ Output Ports (Repositories) │
└──────────┬──────────────────────┘
│
┌──────┴──────┐
▼ ▼
Adapters Adapters
(HTTP, CLI) (Database, Email)
Benefits: Swap adapters without changing core
Commands (Write) Queries (Read)
↓ ↓
Write Model Read Model
↓ ↓
PostgreSQL Elasticsearch
When to Use: Different read/write patterns
Service A → Publishes Event → Event Bus → Service B Subscribes
Benefits: Loose coupling, scalability
src/
├── domain/
│ ├── entities/
│ │ ├── Order.ts
│ │ └── User.ts
│ ├── value-objects/
│ │ └── Money.ts
│ └── repositories/ # Interfaces
│ └── IOrderRepository.ts
│
├── application/
│ ├── use-cases/
│ │ ├── CreateOrder.ts
│ │ └── PlaceOrder.ts
│ └── ports/
│ ├── input/
│ └── output/
│
├── infrastructure/
│ ├── persistence/
│ │ ├── PostgresOrderRepository.ts
│ │ └── migrations/
│ └── external-services/
│ └── StripePaymentService.ts
│
└── presentation/
├── api/
│ ├── controllers/
│ │ └── OrderController.ts
│ └── dto/
└── web/
app/
├── domain/
│ ├── model/
│ │ ├── order.py # Aggregate
│ │ ├── order_item.py # Entity
│ │ └── money.py # Value Object
│ ├── events/
│ │ └── order_placed.py
│ └── repositories/
│ └── order_repository.py
│
├── application/
│ ├── commands/
│ │ └── create_order.py
│ └── handlers/
│ └── order_handler.py
│
└── infrastructure/
├── persistence/
│ └── sqlalchemy_order_repo.py
└── messaging/
❌ Anemic Domain Model: Entities with no behavior ❌ God Objects: One class doing everything ❌ Leaky Abstractions: Domain knowing about HTTP/DB ❌ Circular Dependencies: A depends on B depends on A ❌ Over-Engineering: Using DDD for simple CRUD
Philosophy: "Make it work, make it right, make it fast" - in that order.
Remember: Architecture serves the business, not the other way around.
Created: 2026-02-04 Maintained By: Google Software Architect