microservices
Skill1 starsChanged 11 months agoMITView on GitHub
Microservices architecture patterns. Auto-activates when designing distributed systems or service communication.
Files
Microservices Architecture
Service Design Principles
Single Responsibility
Each service owns one business capability:
- User Service - Authentication, profiles
- Order Service - Orders, checkout
- Inventory Service - Stock management
- Payment Service - Payments, refunds
Database per Service
┌──────────────┐ ┌──────────────┐
│ User Service │ │ Order Service│
└──────┬───────┘ └──────┬───────┘
│ │
┌───┴───┐ ┌───┴───┐
│User DB│ │Order DB│
└───────┘ └────────┘Communication Patterns
Synchronous (REST/gRPC)
// REST call
const user = await fetch(`${USER_SERVICE}/users/${userId}`);
// gRPC (faster, typed)
const user = await userClient.getUser({ userId });Asynchronous (Events)
// Publisher
await messageQueue.publish('order.created', {
orderId: order.id,
userId: order.userId,
items: order.items
});
// Subscriber (Inventory Service)
messageQueue.subscribe('order.created', async (event) => {
await reserveInventory(event.items);
});API Gateway
Client → API Gateway → Services
│
├── Authentication
├── Rate Limiting
├── Load Balancing
└── Request RoutingService Discovery
// Kubernetes - DNS-based
const userService = 'http://user-service.default.svc.cluster.local';
// Consul/Eureka - Registry-based
const userService = await serviceRegistry.getService('user-service');Resilience Patterns
Circuit Breaker
const breaker = new CircuitBreaker(fetchUser, {
failureThreshold: 5,
resetTimeout: 30000
});
const user = await breaker.fire(userId);Retry with Backoff
async function withRetry<T>(fn: () => Promise<T>, maxRetries = 3): Promise<T> {
for (let i = 0; i < maxRetries; i++) {
try {
return await fn();
} catch (error) {
if (i === maxRetries - 1) throw error;
await sleep(Math.pow(2, i) * 1000);
}
}
}Data Consistency
Saga Pattern
1. Create Order (Order Service)
2. Reserve Inventory (Inventory Service)
3. Process Payment (Payment Service)
4. Confirm Order (Order Service)
If step fails → Compensating transactionsOther versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- Mindrally/skills★ 275same name
- kid-sid/claude-spellbook★ 190same name
- cohen-liel/hivemind★ 108same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- G1Joshi/Agent-Skills★ 15same name
- pluginagentmarketplace/custom-plugin-backend★ 4same name
- turkeryildirim/ai-skills★ 4same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use api-design.
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.
MicrosoftSkillapi-design
Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
Also in 3 projects that use this
In this repository20 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- api-integrationSkill
- authenticationSkill
- caching-strategiesSkill
- ci-cd-pipelinesSkill
- clean-architectureSkill
- code-patternsSkill
- database-designSkill
- docker-composeSkill
- error-handlingSkill
- frontend-designSkill
- git-workflowSkill
- logging-monitoringSkill
- performance-tuningSkill
- project-setupSkill
- security-best-practicesSkill
- systematic-debuggingSkill
- tddSkill
- testing-strategiesSkill
- websockets-realtimeSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

