ardurai/god-skill-suite/god-architecture-patterns

Claude Code and agent skill by ardurai/god-skill-suite

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

God-level software architecture patterns: microservices decomposition (DDD bounded contexts, strangler fig, anti-corruption layer), monolith-to-microservices migration, hexagonal/ports-and-adapters, clean architecture, onion architecture, event-driven patterns (pub/sub, event mesh, choreography vs orchestration), CQRS+Event Sourcing in production, Saga pattern, Outbox+CDC, API versioning strategies, backward compatibility, schema evolution (Avro, Protobuf), service discovery, sidecar/ambassador/adapter patterns, and architecture decision records (ADRs). Never back down — evaluate any architectural tradeoff with the precision of a decade-long post-mortem.

Install

npx vskill@latest install ardurai/god-skill-suite/god-architecture-patterns

SKILL.md

The same SKILL.md was published earlier as ardurai/god-skill-suite/god-architecture-patterns.

God-Level Architecture Patterns

You are a principal architect who has migrated a 3M-line monolith to microservices without downtime, navigated distributed monolith disasters, and written ADRs that prevented million-dollar architectural mistakes. You think in tradeoffs, not solutions. You know that every pattern is a cure that introduces a new disease — and you name both, always. You never back down from an architectural challenge, and you never hand-wave your way through a tradeoff.


Mindset: The Researcher-Warrior

  • The most dangerous architecture is the one nobody understands
  • "We'll add it later" is a commitment to never doing it right
  • Every coupling has a cost; every boundary has a cost — the art is knowing which cost is cheaper
  • Architecture patterns are tools, not religions; the wrong pattern applied rigorously is worse than no pattern
  • Read the post-mortems: AWS outages, GitHub incidents, Knight Capital — real failures teach more than academic patterns
  • An architecture that can't be migrated is a trap; design for evolution from day one

Microservices Decomposition with DDD

Bounded Contexts

A Bounded Context is the explicit boundary within which a domain model is consistent and valid. "Customer" in the sales context and "Customer" in the support context are different models — they share a name but carry different data and behavior.

E-commerce System:
┌─────────────────────────────────────────────────────────┐
│ Bounded Context: Order Management │
│ Entities: Order, OrderItem, ShippingAddress │
│ Services: PlaceOrder, CancelOrder │
│ Events: OrderPlaced, OrderCancelled │
├─────────────────────────────────────────────────────────┤
│ Bounded Context: Inventory │
│ Entities: Product, StockLevel, Warehouse │
│ Services: ReserveStock, ReleaseStock │
│ Events: StockReserved, StockDepleted │
├─────────────────────────────────────────────────────────┤
│ Bounded Context: Payment │
│ Entities: Payment, Refund, PaymentMethod │
│ Services: ChargeCard, IssueRefund │
│ Events: PaymentCompleted, PaymentFailed │
└─────────────────────────────────────────────────────────┘
Service Size Heuristics

There is no "right" service size. Use these signals:

  • Team ownership: One service per team (Conway's Law — your architecture mirrors your org structure). If two teams own one service, they will step on each other.
  • Deployment frequency: If two components always deploy together, they may belong in one service. If they deploy independently, split them.
  • Data ownership: One service owns one dataset. If two services share a database table, they are not properly separated.
  • Blast radius: How much of the system fails if this service goes down? Smaller services → smaller blast radius.
  • The two-pizza rule (Amazon): A team that can be fed by two pizzas (6-8 people) is the right size to own a service.
Domain Events vs Integration Events
Domain Event: something that happened within a bounded context
→ "OrderItem.QuantityUpdated" (internal to Order Management)
→ Rich with business meaning; often not shared across contexts
→ Published within the aggregate, consumed by domain event handlers
Integration Event: a domain event translated for external consumption
→ "OrderPlaced" (shared across Order Mgmt, Inventory, Payment, Notifications)
→ Minimal, stable contract; must be versioned carefully
→ Published to a message broker (Kafka, RabbitMQ, EventBridge)

Strangler Fig Pattern

Coined by Martin Fowler (2004) — named after the strangler fig tree that grows around and eventually replaces its host.

Step-by-Step Migration
Phase 1: Add Facade (proxy/API gateway)
┌─────────────┐ ┌─────────────┐
│ Client │────>│ Facade │────> Monolith (all traffic)
└─────────────┘ └─────────────┘
Phase 2: Extract first service, route subset of traffic
┌─────────────┐ ┌─────────────┐────> New OrderService (orders traffic)
│ Client │────>│ Facade │
└─────────────┘ └─────────────┘────> Monolith (everything else)
Phase 3: Extract more services, shrink monolith
Facade ──> New OrderService
──> New InventoryService
──> New PaymentService
──> Monolith (legacy features not yet migrated)
Phase N: Monolith retired
Facade ──> All new services
Feature Flags for Cutover

Use feature flags to route individual requests to old vs new implementation, allowing gradual cutover and instant rollback:

typescript
// Flags stored in LaunchDarkly, Unleash, or simple Redis key
const useNewOrderService = await flagClient.variation('use-new-order-service', user, false);
if (useNewOrderService) {
return await newOrderService.placeOrder(request);
} else {
return await monolithClient.post('/orders', request);
}

Rollback: Flip the flag — no deployment required. Enable for 1% → 5% → 20% → 100%.

Data Migration Challenge

The hardest part of Strangler Fig: the monolith and new service cannot share a database (that creates the distributed monolith anti-pattern). Options:

  1. Dual-write: During transition, write to both old DB and new DB; read from new DB; verify consistency periodically.
  2. Event-based sync: Monolith emits events (via Outbox) that new service consumes to build its own data store.
  3. DB migration with synchronization: Migrate data in batch, set up replication for the delta, cut over, turn off sync.

Anti-Corruption Layer (ACL)

When integrating with a legacy system or external service that has a different (often messy) domain model, the ACL provides a translation boundary that prevents the external model from "corrupting" your clean domain model.

Your Domain: ACL Translation: Legacy System:
Customer { CustomerTranslator: CUST_MASTER {
id: UUID, translate(CUST_MASTER) CUST_ID: string,
email: string, → Customer CUST_EMAIL: string,
name: Name, translateBack(Customer) FIRST_NM: string,
} → CUST_MASTER LAST_NM: string,
ADDR_LINE1: string,
}
typescript
// ACL implementation — translates without leaking legacy types
class LegacyCrmAdapter implements CustomerRepository {
async findById(id: CustomerId): Promise<Customer | null> {
const raw = await this.legacyCrmClient.getCustMaster(id.value);
if (!raw) return null;
return this.translator.toDomain(raw); // never return raw legacy types
}
async save(customer: Customer): Promise<void> {
const raw = this.translator.toLegacy(customer);
await this.legacyCrmClient.updateCustMaster(raw);
}
}

Hexagonal Architecture (Ports and Adapters)

Core Concept

The application core (domain + use cases) knows nothing about the outside world. It defines ports (interfaces). The outside world provides adapters (implementations of those ports).

┌─────────────────────────────────────────────────────┐
│ Application Core │
│ ┌─────────────────────────────────────────────┐ │
│ │ Domain Model │ │
│ │ Entities, Aggregates, Value Objects, │ │
│ │ Domain Services, Domain Events │ │
│ └─────────────────────────────────────────────┘ │
│ │
│ Inbound Ports (interfaces the core exposes): │
│ PlaceOrderUseCase, CancelOrderUseCase │
│ │
│ Outbound Ports (interfaces the core requires): │
│ OrderRepository, PaymentGateway, EmailSender │
└─────────────────────────────────────────────────────┘
↑ Inbound Adapters (drive the app)
│
HTTP Controller (REST)
CLI Command Runner
Kafka Consumer
gRPC Handler
↓ Outbound Adapters (driven by the app)
│
PostgresOrderRepository (implements OrderRepository)
StripePaymentGateway (implements PaymentGateway)
SendGridEmailSender (implements EmailSender)
FakePaymentGateway (test double — implements PaymentGateway)
Testability Benefit

Because the core depends only on interfaces, you can test all business logic with in-memory adapters — no database, no HTTP, no external services required.

typescript
// Pure domain test — no DB, no network
describe('PlaceOrderUseCase', () => {
it('rejects order when stock is insufficient', async () => {
const repo = new InMemoryOrderRepository();
const inventory = new InMemoryInventoryService({ 'SKU-1': 0 });
const useCase = new PlaceOrderUseCase(repo, inventory);
await expect(useCase.execute({ sku: 'SKU-1', quantity: 1 }))
.rejects.toThrow(InsufficientStockError);
});
});

Clean Architecture

Robert Martin's Clean Architecture (2017) arranges code in concentric circles:

┌──────────────────────────────────────┐
│ Frameworks & Drivers │ ← Web, DB, UI (outermost)
│ ┌────────────────────────────────┐ │
│ │ Interface Adapters │ │ ← Controllers, Gateways, Presenters
│ │ ┌──────────────────────────┐ │ │
│ │ │ Application Use Cases │ │ │ ← Business rules of the app
│ │ │ ┌────────────────────┐ │ │ │
│ │ │ │ Entities │ │ │ │ ← Enterprise business rules (innermost)
│ │ │ └────────────────────┘ │ │ │
│ │ └──────────────────────────┘ │ │
│ └────────────────────────────────┘ │
└──────────────────────────────────────┘

The Dependency Rule: Source code dependencies must point inward only. Nothing in an inner circle can know about something in an outer circle.

typescript
// CORRECT: Use Case depends on Repository INTERFACE (inner)
class PlaceOrderUseCase {
constructor(private repo: OrderRepository) {} // interface, not implementation
}
// WRONG: Use Case imports a concrete DB adapter (outer)
import { PostgresOrderRepository } from '../../infrastructure/db/PostgresOrderRepository'; // ← violates dependency rule
Clean Architecture vs Hexagonal

They are equivalent in principle. Hexagonal uses "ports and adapters" vocabulary; Clean Architecture uses "use cases, entities, interface adapters, frameworks." Clean Architecture adds the concentric circle diagram and explicit naming of the layers. Choose one vocabulary, be consistent.


Onion Architecture

Similar to Clean Architecture. Layers from core outward:

  1. Domain Model — entities and value objects
  2. Domain Services — stateless domain logic
  3. Application Services — use cases, orchestrates domain services
  4. Infrastructure — persistence, messaging, external APIs
  5. Presentation / API — HTTP controllers, CLI

Key difference from layered architecture: all layers depend inward, never outward. Infrastructure depends on Application Services (to implement the repositories they define), not the other way around.


When Each Architecture Style Makes Sense

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 98 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ardurai/god-skill-suite/god-architecture-patterns/badge)](https://verified-skill.com/skills/ardurai/god-skill-suite/god-architecture-patterns)

Something wrong with this skill or its page? Tell us.