microservices-design
Production-grade microservices design skill for service decomposition, service mesh, resilience patterns, and observability
What this skill does
# Microservices Design Skill
> **Purpose**: Atomic skill for microservices architecture with comprehensive resilience and observability patterns.
## Skill Identity
| Attribute | Value |
|-----------|-------|
| **Scope** | Decomposition, Resilience, Observability |
| **Responsibility** | Single: Service architecture patterns |
| **Invocation** | `Skill("microservices-design")` |
## Parameter Schema
### Input Validation
```yaml
parameters:
microservices_context:
type: object
required: true
properties:
project_type:
type: string
enum: [greenfield, monolith_extraction, optimization]
required: true
current_state:
type: object
properties:
services: { type: array, items: { type: string } }
pain_points: { type: array, items: { type: string } }
team_structure: { type: string }
requirements:
type: object
properties:
team_size: { type: integer, minimum: 1 }
deployment_frequency: { type: string, enum: [daily, weekly, monthly] }
availability_sla: { type: string, pattern: "^\\d{2}\\.\\d+%$" }
max_latency_ms: { type: integer, minimum: 1 }
constraints:
type: object
properties:
budget: { type: string }
timeline: { type: string }
technology_stack: { type: array, items: { type: string } }
validation_rules:
- name: "team_size_for_microservices"
rule: "team_size >= 2"
warning: "Microservices add overhead; consider monolith for small teams"
- name: "sla_feasibility"
rule: "availability_sla <= '99.99%' or has_multi_region"
warning: "99.99%+ SLA typically requires multi-region deployment"
```
### Output Schema
```yaml
output:
type: object
properties:
service_catalog:
type: array
items:
type: object
properties:
name: { type: string }
responsibility: { type: string }
api_type: { type: string }
dependencies: { type: array }
team_owner: { type: string }
database: { type: string }
architecture:
type: object
properties:
communication: { type: object }
service_mesh: { type: object }
api_gateway: { type: object }
resilience:
type: object
properties:
patterns: { type: array }
configuration: { type: object }
observability:
type: object
properties:
metrics: { type: array }
tracing: { type: object }
logging: { type: object }
alerting: { type: object }
```
## Core Patterns
### Service Decomposition
```
By Business Capability:
├── Align with business domains
├── Stable boundaries over time
├── Example: Order, Inventory, Payment
└── Team: One team per capability
By Subdomain (DDD):
├── Core: Competitive advantage (build)
├── Supporting: Necessary (build or buy)
├── Generic: Commodity (buy)
└── Bounded Context = Service
By Team (Inverse Conway):
├── Structure services around teams
├── 2-3 services per team (2-pizza)
├── Full ownership model
└── DevOps: You build it, you run it
Anti-Patterns:
├── Distributed Monolith: Tight coupling
├── Nano-services: Too granular
├── Shared Database: Hidden coupling
├── Sync Chains: Latency multiplication
```
### Resilience Patterns
```
Circuit Breaker:
├── States: Closed → Open → Half-Open
├── Config:
│ ├── failure_threshold: 50%
│ ├── slow_call_threshold: 50%
│ ├── wait_duration: 60s
│ └── half_open_calls: 3
├── Implementation: Resilience4j
└── Fallback: Cached data, default, queue
Retry with Backoff:
├── Exponential: delay * 2^attempt
├── Max attempts: 3-5
├── Jitter: ±20%
├── Idempotency: Required
└── Non-retryable: 4xx errors
Bulkhead:
├── Isolate failure domains
├── Thread pool per dependency
├── Semaphore for lightweight
└── Config: maxConcurrentCalls: 25
Timeout:
├── Connection: 1s
├── Read: 5s
├── Total: 10s
└── Cascading: outer > inner
```
### Service Mesh
```
Capabilities:
├── Traffic Management
│ ├── Load balancing
│ ├── Traffic splitting (canary)
│ ├── Circuit breaking
│ └── Retries/timeouts
├── Security
│ ├── mTLS
│ ├── Service identity (SPIFFE)
│ └── Authorization policies
├── Observability
│ ├── Distributed tracing
│ ├── Service metrics
│ └── Access logging
└── Options
├── Istio: Full-featured
├── Linkerd: Lightweight
├── Consul: HashiCorp
└── AWS App Mesh
```
### Observability (Three Pillars)
```
Metrics:
├── RED: Request, Error, Duration
├── USE: Utilization, Saturation, Errors
├── Key Metrics:
│ ├── http_requests_total{method, path, status}
│ ├── http_request_duration_seconds{quantile}
│ └── http_requests_in_flight
└── Tools: Prometheus, Datadog
Logs:
├── Structured JSON
├── Correlation ID propagation
├── Level: DEBUG, INFO, WARN, ERROR
├── Format:
│ {
│ "timestamp": "ISO8601",
│ "level": "INFO",
│ "service": "order-service",
│ "trace_id": "abc123",
│ "message": "Order created"
│ }
└── Tools: ELK, Loki
Traces:
├── Distributed tracing
├── Span context propagation
├── W3C Trace Context
└── Tools: Jaeger, Zipkin, X-Ray
```
## Retry Logic
### Service Call Retry
```yaml
retry_config:
http_calls:
max_attempts: 3
initial_delay_ms: 100
max_delay_ms: 5000
multiplier: 2.0
jitter_factor: 0.2
grpc_calls:
max_attempts: 5
initial_delay_ms: 50
max_delay_ms: 2000
multiplier: 1.5
retryable:
- UNAVAILABLE
- DEADLINE_EXCEEDED
- RESOURCE_EXHAUSTED
- 502, 503, 504
non_retryable:
- INVALID_ARGUMENT
- NOT_FOUND
- ALREADY_EXISTS
- 400, 401, 403, 404
idempotency:
header: "Idempotency-Key"
required_for: [POST, PATCH]
cache_ttl: 86400
```
## Logging & Observability
### Log Format
```yaml
log_schema:
level: { type: string }
timestamp: { type: string, format: ISO8601 }
skill: { type: string, value: "microservices-design" }
event:
type: string
enum:
- service_designed
- decomposition_planned
- resilience_configured
- mesh_deployed
- sla_defined
context:
type: object
properties:
service_name: { type: string }
pattern: { type: string }
decision: { type: string }
example:
level: INFO
event: resilience_configured
context:
service_name: payment-service
pattern: circuit_breaker
decision: "5 failures in 60s triggers open state"
```
### Metrics
```yaml
metrics:
- name: service_design_decisions
type: counter
labels: [service, decision_type]
- name: decomposition_services_count
type: gauge
labels: [domain]
- name: resilience_patterns_applied
type: counter
labels: [service, pattern]
- name: sla_target
type: gauge
labels: [service]
```
## Troubleshooting
### Common Issues
| Issue | Cause | Resolution |
|-------|-------|------------|
| High latency | Cascade calls | Parallelize, cache |
| Partial failures | No circuit breaker | Add resilience |
| Data inconsistency | Distributed tx | Saga pattern |
| Deployment failures | Coupling | API contracts |
| Debug difficulty | No tracing | Distributed tracing |
| Cascading failures | No bulkhead | Thread isolation |
### Debug Checklist
```
□ Trace ID in all logs?
□ Circuit breakers monitored?
□ Timeouts on all calls?
□ Health checks passing?
□ Service mesh healthy?
□ Dependency graph documented?
□ SLOs defined and measured?
□ Alerting configured?
```
## Unit Test Templates
### Decomposition Tests
```python
# test_microservices_design.py
def test_valid_microservices_context():
params = {
"microservices_context": {
"project_type": "monolith_extraction",
"current_state": {
"services": ["monolith"],
"pain_points": ["slow deployments", "scaling issues"]
},
"requirements": {
"team_size": 15,
"deployment_frequency": "daily",
"availabilitRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.