microservices-knowledge
Microservices Architecture knowledge base. Provides service decomposition, communication patterns, API gateway, service discovery, and data management guidelines for architecture audits and generation.
Best use case
microservices-knowledge is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Microservices Architecture knowledge base. Provides service decomposition, communication patterns, API gateway, service discovery, and data management guidelines for architecture audits and generation.
Teams using microservices-knowledge should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/microservices-knowledge/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How microservices-knowledge Compares
| Feature / Agent | microservices-knowledge | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Microservices Architecture knowledge base. Provides service decomposition, communication patterns, API gateway, service discovery, and data management guidelines for architecture audits and generation.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Microservices Architecture Knowledge Base Quick reference for microservices architecture patterns and PHP implementation guidelines. ## Core Principles ### Architecture Overview ``` ┌──────────────────────────────────────────────────────────────────────────┐ │ MICROSERVICES ARCHITECTURE │ ├──────────────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────┐ ┌──────────────────┐ ┌──────────────────┐ │ │ │ Client │────▶│ API Gateway │────▶│ Service A │ │ │ │ │ │ (Routing/Auth) │ │ (Own Database) │ │ │ └──────────┘ └──────────────────┘ └──────────────────┘ │ │ │ │ │ │ │ │ async │ │ ┌──────▼──────┐ ┌─────▼──────────┐ │ │ │ Service B │ │ Message Broker │ │ │ │ (Own DB) │◀─────────│ (Events/Cmds) │ │ │ └─────────────┘ └────────────────┘ │ │ │ ├──────────────────────────────────────────────────────────────────────────┤ │ │ │ Decomposition Strategies: │ │ • By Business Capability - Align with bounded contexts │ │ • By Subdomain (DDD) - Core, Supporting, Generic │ │ • Strangler Fig - Incremental migration from monolith │ │ │ │ Communication: │ │ • Synchronous - REST, gRPC, GraphQL (request-response) │ │ • Asynchronous - Message queues, event streaming │ │ │ └──────────────────────────────────────────────────────────────────────────┘ ``` ## Service Communication Patterns | Pattern | Type | Use When | Trade-off | |---------|------|----------|-----------| | REST | Sync | CRUD, simple queries | Easy but coupling | | gRPC | Sync | Internal service-to-service, performance-critical | Fast but schema coupling | | GraphQL | Sync | Client-driven queries, BFF | Flexible but complex | | Message Queue | Async | Reliable delivery, work distribution | Decoupled but eventual consistency | | Event Streaming | Async | Real-time, event sourcing, audit trails | Scalable but complex ordering | | Request-Reply | Async | Async request needing response | Decoupled but higher latency | ## API Gateway Patterns | Pattern | Description | When to Use | |---------|-------------|-------------| | Simple Proxy | Routes requests to services | Small number of services | | Gateway Aggregation | Combines multiple service calls | Reduce client round-trips | | BFF (Backend for Frontend) | Gateway per client type | Mobile vs Web vs API clients | | Gateway Offloading | Auth, rate limiting, TLS | Cross-cutting concerns | ## Service Discovery | Approach | How It Works | Example | |----------|-------------|---------| | Client-side | Client queries registry, selects instance | Netflix Eureka | | Server-side | Load balancer queries registry | AWS ALB, Kubernetes | | DNS-based | DNS SRV records resolve to instances | Consul DNS, CoreDNS | | Platform-native | Container orchestrator handles routing | Kubernetes Services | ## Data Management | Pattern | Description | Consistency | |---------|-------------|-------------| | Database per Service | Each service owns its data | Strong (within service) | | Shared Database | Services share one database | Strong (anti-pattern!) | | Saga | Distributed transaction via events | Eventual | | CQRS | Separate read/write models | Eventual | | Event Sourcing | Events as source of truth | Eventual | | API Composition | Query multiple services, merge results | Eventual | ## When to Use Microservices vs Monolith | Factor | Monolith | Microservices | |--------|----------|---------------| | Team size | < 10 developers | > 10, multiple teams | | Domain complexity | Simple/moderate | Complex, many bounded contexts | | Scalability needs | Uniform scaling | Independent scaling per component | | Deployment frequency | Infrequent, coordinated | Frequent, independent | | Technology diversity | Single stack | Polyglot needed | | Organizational maturity | Starting out | DevOps culture, CI/CD mature | ## Detection Patterns ```bash # Service boundary indicators Grep: "HttpClient|GuzzleHttp|curl_init" --glob "**/Infrastructure/**/*.php" Grep: "grpc|protobuf" --glob "**/*.php" # API Gateway patterns Grep: "X-Forwarded|X-Request-ID|X-Correlation" --glob "**/*.php" Glob: **/Gateway/**/*.php # Service discovery Grep: "ServiceDiscovery|ServiceRegistry|consul|etcd" --glob "**/*.php" Grep: "KUBERNETES_SERVICE|SERVICE_HOST" --glob "**/*.env*" # Database per service Grep: "DATABASE_URL|DB_CONNECTION" --glob "**/*.env*" Grep: "DATABASE_HOST|DB_HOST" --glob "**/docker-compose*.yml" # Inter-service communication Grep: "AMQPChannel|RabbitMQ|Kafka|SQS" --glob "**/Infrastructure/**/*.php" Grep: "EventPublisher|MessageBus" --glob "**/*.php" ``` ## Advanced Patterns ### Strangler Fig Pattern Incrementally migrate from monolith to microservices: ``` Phase 1: Proxy all traffic through gateway Phase 2: Extract one feature to service, route via gateway Phase 3: Repeat until monolith is empty shell Phase 4: Decommission monolith ┌─────────┐ ┌──────────┐ ┌──────────────┐ │ Client │────▶│ Gateway │────▶│ New Service │ (extracted) │ │ │ (Router) │ └──────────────┘ │ │ │ │────▶┌──────────────┐ │ │ │ │ │ Monolith │ (shrinking) └─────────┘ └──────────┘ └──────────────┘ ``` **Migration Decision:** | Factor | Extract First | Keep in Monolith | |--------|--------------|------------------| | Change frequency | High | Low | | Team ownership | Dedicated team | Shared | | Scaling needs | Independent scaling | Uniform | | Technology fit | Different stack needed | Same stack fine | ### API Gateway Aggregation Patterns | Pattern | When | Example | |---------|------|---------| | Simple proxy | 1:1 route mapping | `/users` → User Service | | Aggregation | Client needs data from N services | Order + Customer + Payment | | BFF | Different clients need different data | Mobile vs Web vs API | | Offloading | Cross-cutting concerns | Auth, rate limiting, TLS | ### Database-Per-Service Trade-offs | Aspect | Shared DB | DB per Service | |--------|-----------|----------------| | Consistency | ACID transactions | Saga/eventual | | Querying | JOIN across domains | API composition | | Independence | Coupled deployments | Independent | | Complexity | Low | High | | Schema changes | Coordinated | Independent | ## References For detailed information, load these reference files: - `references/patterns.md` — Service mesh, API gateway implementations, service discovery details, data consistency, Strangler Fig, database-per-service - `references/antipatterns.md` — Distributed monolith, shared database, missing boundaries, chatty communication
Related Skills
yii-knowledge
Yii framework knowledge base. Provides Yii3 modular architecture, DDD integration, PSR-7/PSR-15 compliance, persistence, DI, security (RBAC, auth), event system (PSR-14), queue/jobs, infrastructure components (cache, rate limiter, HTTP client), testing, and antipatterns for Yii PHP projects.
testing-knowledge
Testing knowledge base for PHP 8.4 projects. Provides testing pyramid, AAA pattern, naming conventions, isolation principles, DDD testing guidelines, and PHPUnit patterns.
task-progress-knowledge
TaskCreate pattern guidelines for progress tracking in coordinator agents
symfony-knowledge
Symfony framework knowledge base. Provides architecture, DDD integration, persistence, DI, security, messenger, workflow, events, infrastructure components, testing, and antipatterns for Symfony PHP projects.
stability-patterns-knowledge
Stability Patterns knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for Circuit Breaker, Retry, Rate Limiter, Bulkhead, and resilience audits.
solid-knowledge
SOLID principles knowledge base for PHP 8.4 projects. Provides quick reference for SRP, OCP, LSP, ISP, DIP with detection patterns, PHP examples, and antipattern identification. Use for architecture audits and code quality reviews.
scalability-knowledge
Scalability knowledge base. Provides vertical vs horizontal scaling, stateless design, session management, connection pooling, capacity planning, and PHP-FPM tuning for scalability audits.
saga-pattern-knowledge
Saga Pattern knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for saga orchestration, choreography, and distributed transaction audits.
replication-sharding-knowledge
Replication and Sharding knowledge base. Provides read/write splitting at application level, connection wrapper patterns, replica lag handling, and query routing for database scaling audits.
psr-coding-style-knowledge
PSR-1 and PSR-12 coding standards knowledge base for PHP 8.4 projects. Provides quick reference for basic coding standard and extended coding style with detection patterns, examples, and antipattern identification. Use for code style audits and compliance reviews.
psr-autoloading-knowledge
PSR-4 autoloading standard knowledge base for PHP 8.4 projects. Provides quick reference for namespace-to-path mapping, composer.json configuration, directory structure, and common mistakes. Use for autoloading audits and project structure reviews.
outbox-pattern-knowledge
Outbox Pattern knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for transactional outbox, polling publisher, and reliable messaging audits.