CtrlK
BlogDocsLog inGet started
Tessl Logo

architecture-general

Architecture decisions: layering, design patterns, microservices trade-offs, and domain-driven design

47

Quality

48%

Does it follow best practices?

Impact

No eval scenarios have been run

SecuritybySnyk

Passed

No known issues

Optimize this skill with Tessl

npx tessl skill review --optimize ./skills/architecture-general/SKILL.md
SKILL.md
Quality
Evals
Security

Architecture — General

Layering

  • Separate concerns: presentation → application (use cases) → domain → infrastructure.
  • Dependencies flow inward only — domain has no external dependencies.
  • Never import infrastructure code from domain or application layers.
  • Thin controllers: route, validate, delegate to use case, return response.

Design Patterns

PatternWhen to use
RepositoryAbstract data access — business logic never queries DB directly
FactoryComplex object initialization with many dependencies
StrategyBehavior varies by context; avoid long if/else chains
Observer/EventDecouple components across bounded contexts
AdapterIntegrate third-party APIs without coupling domain to them

Microservices

  • Each service owns its data. No shared databases.
  • Define API contracts (OpenAPI/gRPC) before implementation.
  • Prefer async messaging (queues) for cross-service operations that don't need immediate consistency.
  • Design for failure: timeouts, circuit breakers, retries with exponential backoff.
  • Avoid distributed monoliths — if services always deploy together, they're a monolith.

Domain-Driven Design

  • Identify bounded contexts before defining APIs.
  • Use ubiquitous language — code names match business vocabulary.
  • Separate aggregates at transactional boundaries, not technical ones.
  • Value objects are immutable; entities have identity and mutable state.

Decisions to Document

  • What was decided.
  • Why — constraints and alternatives considered.
  • Consequences — trade-offs accepted.
  • Use Architecture Decision Records (ADRs) in docs/decisions/.

Trade-offs to Consider

  • Consistency vs. availability (CAP theorem).
  • Build vs. buy for infrastructure components.
  • Sync vs. async for cross-service calls.
  • Monolith-first vs. microservices for new systems — default to monolith.
Repository
ucdavis/ai-skills-registry
Last updated
Created

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.