agentleFS
Jonathan0823Jonathan0823/opencode-config/skills/microservices-patterns/SKILL.md

microservices-patterns

Skill8 starsChanged 10 months agoMITView on GitHub

Microservices architecture patterns including service discovery, circuit breakers, event-driven architecture, API gateways, and distributed systems. Use when designing microservices, implementing inter-service communication, or managing distributed systems.

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use postmortem-writing, sql-optimization-patterns and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • xfstudioSkill

    postmortem-writing

    Write effective blameless postmortems with root cause analysis, timelines, and action items. Use when conducting incident reviews, writing postmortem documents, or improving incident response processes.

    Also in 3 projects that use this

  • xfstudioSkill

    sql-optimization-patterns

    Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.

    Also in 5 projects that use this

  • InfopibeSkill

    article-writing

    Write articles, guides, blog posts, tutorials, newsletter issues, and other long-form content in a distinctive voice derived from supplied examples or brand guidance. Use when the user wants polished written content longer than a paragraph, especially when voice consistency, structure, and credibility matter.

    Also in 3 projects that use this

  • devsforgeSkill

    backend-patterns

    Expert knowledge in API design, authentication, caching, and backend best practices. Use for backend development tasks.

    Also in 4 projects that use this

  • the-onewho-knocksSkill

    frontend-patterns

    Frontend development patterns for React, Next.js, state management, performance optimization, and UI best practices.

    Also in 4 projects that use this

  • indranilbanerjeeSkill

    content-engine

    Draft marketing content in brand voice — blog posts, ad copy, email sequences, social posts, landing pages, and brand-voice guides — through a gated pipeline (research, outline, draft, fact-check, humanize, voice check, SEO checklist) with numbered working files and a five-gate quality scorecard before copy is publish-ready. Triggers on \"/digital-marketing-pro:content-engine\", \"write a blog post about X\", \"draft ad copy for this campaign\", \"create an email sequence\", \"landing page copy for our product\". Takes /digital-marketing-pro:content-brief as preferred upstream; hands off to /digital-marketing-pro:publish-blog, /digital-marketing-pro:content-repurpose, and /digital-marketing-pro:check. Reads the brand profile, guidelines, platform specs, and compliance rules.

    Also in 3 projects that use this

  • +4 more from xfstudio

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use for: Queries, simple operations

    line 33
  2. Distinctive:

    Use for: Commands, long operations, event sourcing

    line 39
  3. Distinctive:

    Use this skill when:

    line 144

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Microservices Patterns Skill

Overview

This skill provides comprehensive microservices architecture patterns including service discovery, circuit breakers, event-driven architecture, saga patterns, API gateways, and distributed data management.

Quick Start

Microservices Checklist

  • Service boundaries clearly defined
  • Database per service
  • API Gateway for external communication
  • Async messaging between services
  • Circuit breakers for resilience
  • Distributed tracing implemented
  • Centralized logging
  • Health checks and monitoring

Communication Patterns

Synchronous (REST/gRPC):

  • Simple request/response
  • Tight coupling
  • Blocking
  • Use for: Queries, simple operations

Asynchronous (Message Queue):

  • Event-driven
  • Loose coupling
  • Non-blocking
  • Use for: Commands, long operations, event sourcing

Core Patterns

API Gateway

# Kong Gateway configuration
services:
  - name: user-service
    url: http://user-service:8080
    routes:
      - name: user-routes
        paths:
          - /api/users
    plugins:
      - name: rate-limiting
        config:
          minute: 100
      - name: jwt
      - name: cors

Circuit Breaker

from circuitbreaker import circuit
import requests

@circuit(failure_threshold=5, recovery_timeout=30, expected_exception=requests.RequestException)
def call_external_service():
    response = requests.get('http://external-service/api')
    return response.json()

# Usage
try:
    result = call_external_service()
except circuitbreaker.CircuitBreakerError:
    # Circuit is open, use fallback
    result = fallback_data()

Service Discovery

# Consul service registration
service:
  name: order-service
  tags:
    - orders
    - v1
  port: 8080
  check:
    http: http://localhost:8080/health
    interval: 10s

Saga Pattern

# Choreography-based saga
class OrderSaga:
    def __init__(self, event_bus):
        self.event_bus = event_bus
    
    def start_order(self, order_data):
        # Step 1: Create order (pending)
        order = create_pending_order(order_data)
        
        # Step 2: Reserve inventory
        self.event_bus.publish('InventoryReservationRequested', {
            'order_id': order.id,
            'items': order.items
        })
    
    def on_inventory_reserved(self, event):
        # Step 3: Process payment
        self.event_bus.publish('PaymentRequested', {
            'order_id': event.order_id,
            'amount': event.total
        })
    
    def on_payment_completed(self, event):
        # Step 4: Complete order
        complete_order(event.order_id)
        self.event_bus.publish('OrderCompleted', {
            'order_id': event.order_id
        })
    
    def on_inventory_failed(self, event):
        # Compensate: Cancel order
        cancel_order(event.order_id)

Detailed References

See comprehensive guides in references/:

  • Service Communication - REST, gRPC, GraphQL, message queues
  • Resilience Patterns - Circuit breakers, retries, bulkhead, timeouts
  • Event-Driven Architecture - Event sourcing, CQRS, saga patterns
  • Data Management - Database per service, distributed transactions, eventual consistency

When to Use This Skill

Use this skill when:

  • Decomposing monolith into microservices
  • Designing service boundaries and APIs
  • Implementing inter-service communication
  • Managing distributed data consistency
  • Building resilient service architectures
  • Setting up service discovery and load balancing
  • Implementing API gateways
  • Handling distributed transactions

Related Skills

  • @kubernetes-patterns - Container orchestration for microservices
  • @docker-patterns - Containerization
  • @api-rest-design - API design for services
  • @observability-monitoring - Distributed tracing and monitoring
  • @security-best-practices - Service-to-service security
  • @performance-optimization - Service performance

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.