用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mikailustuner/OmniRule --skill microservices-patterns命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Bun runtime: HTTP server, file I/O, SQLite, test runner, package manager, bundler — all-in-one JS toolchain.
Clerk: Drop-in auth UI, Organizations, User management, JWT templates, webhooks, Next.js middleware integration.
Gelişmiş masaüstü, tarayıcı ve işletim sistemi kontrol yeteneği. Görsel (koordinat tabanlı) fare/klavye otomasyonu, DOM manipülasyonu, pencere yönetimi, gelişmiş dosya, ağ ve süreç yönetimini kapsar.
基于 SOC 职业分类
正在显示 SKILL.md
| name | microservices-patterns |
| description | Microservices Patterns: Service decomposition, communication, data management, resilience. |
| triggers | {"keywords":["microservice","service mesh","API gateway","circuit breaker","service discovery","saga"]} |
| auto_load_when | Designing or debugging microservices |
| agent | architect |
| tools | ["Read","Write","Bash"] |
Focus: Service boundaries, communication, distributed systems
How to split services:
├── By business capability (orders, payments, users)
├── By subdomain (DDD bounded contexts)
├── By team ( Conway's Law)
└── By operational need (scale, deployment)
Avoid:
├── By technical layer (all services share DB)
├── Too fine-grained (micromanagement)
└── Too coarse (distributed monolith)
Synchronous (request/response):
├── REST - CRUD, simple queries
├── gRPC - performance, contracts
└── GraphQL - flexible queries
Asynchronous (fire-and-forget):
├── Message queues (Kafka, RabbitMQ)
├── Pub/Sub patterns
└── Event-driven
Database per service:
├── Each service owns its data
├── No shared databases
├── Polyglot persistence allowed
Patterns:
├── API composition (query across services)
├── CQRS (separate read/write models)
└── Saga pattern (distributed transactions)
How services find each other:
├── Client-side (Eureka, Consul)
├── Server-side (API Gateway)
└── DNS-based (Cloud providers)
Key: Dynamic registration
Circuit Breaker:
├── Fail fast after threshold
├── Fallback response
└── Auto-recovery
Retry with Backoff:
├── Exponential backoff
├── Jitter (randomization)
└── Dead letter queue
Bulkhead:
├── Isolate failures
├── Resource pools
└── Fail in isolation
What it does:
├── Routing
├── Authentication
├── Rate limiting
├── Request/response transformation
└── Protocol translation
Consider: Backend for Frontend (BFF)
The Three Pillars:
├── Logging - structured, correlated
├── Metrics - RED metrics (rate, errors, duration)
└── Tracing - request flow across services
Essential for debugging distributed systems
Use when:
├── Team size > 50 developers
├── Independent deployment needed
├── Different scaling requirements
└── Polyglot needed
Avoid when:
├── Team < 10
├── Tight deadline
├── Simple domain
└── No DevOps maturity
(End of file - 84 lines)
❌ Distributed monolith — services that must deploy together
✅ True loose coupling: each service deploys independently
❌ Synchronous request chains (service A → B → C → D)
✅ Async event-driven for non-critical paths; aggregate at gateway
❌ No idempotency on message consumers
✅ Every consumer deduplicates by message ID
❌ Schema changes without backward compatibility
✅ Additive changes only; use schema registry for events
❌ No distributed tracing across service calls
✅ Propagate trace-id header; instrument with OpenTelemetry
| Pattern | Problem solved | Trade-off |
|---|---|---|
| API Gateway | Single entry point + auth | Extra hop |
| Circuit breaker | Cascade failures | Stale data |
| Saga | Distributed transactions | Complexity |
| CQRS | Read/write optimization | Two models to maintain |
| Event sourcing | Audit trail + replay | Storage growth |
| Sidecar | Cross-cutting concerns | Resource overhead |
| Service mesh | mTLS + observability | Ops complexity |