Micro

From arbazkhan971/godmode · View interactive version

Micro is an AI agent skill from the GitHub repository arbazkhan971/godmode. Microservices design and management.

How to use this skill

Skill file

Activate When

Workflow

1. System Context

find . -name "docker-compose*" -o -name "*.proto" \
  | head -10
grep -r "microservices\|grpc\|moleculer" \
  package.json 2>/dev/null
Architecture: Monolith | Modular Monolith | Microservices
Team Structure: <teams, ownership>
Scale: <request volume, data volume>
Data Stores: <databases, caches, brokers>

2. Service Decomposition

Domain-driven bounded contexts. Each service owns

its data exclusively. Decompose by business capability

(not technical layer).

IF two services need strong consistency: they belong

together. IF greenfield: start with modular monolith.

3. Inter-Service Communication

Circuit breaker (5 failures -> open), timeout 3s,

retry 3x exponential, fallback.

low-latency, streaming, polyglot.

fan-out. Kafka (ordered), RabbitMQ (routing),

SQS/SNS (AWS), NATS (ultra-low latency).

DECISION: Need immediate response -> sync (REST/gRPC).

Fire-and-forget/fan-out -> async (events).

4. Service Mesh

~128Mi memory per sidecar.

learning curve.

5. Service Discovery

K8s DNS: <svc>.<ns>.svc.cluster.local.

LB: Round Robin (homogeneous), Least Request

(variable latency), Consistent Hash (sticky).

6. Saga Pattern

events, next reacts. Loose coupling, hard to trace.

compensates in reverse on failure. Easy to trace.

Every step MUST have compensating action (idempotent).

Persist saga state. Use correlation IDs. Set timeouts.

7. Resilience Patterns

Circuit Breaker (5 consecutive 5xx, 30s half-open),

Timeout (3s default), Retry (3x exponential+jitter),

Bulkhead (10 concurrent per svc), Rate Limit, Fallback.

IF service boundary violation detected: flag for review.

WHEN circular dependency found: split service.

8. Validation

Single bounded context per service, no shared DBs,

single team ownership, async where possible, circuit

breakers on sync calls, saga for distributed txns.

<!-- tier-3 -->

Quality Targets

Hard Rules

  1. NEVER share a database between services.
  2. NEVER decompose by technical layer.
  3. NEVER skip modular monolith for greenfield.
  4. EVERY sync call: circuit breaker + timeout 3s + retry.
  5. EVERY service: health check + independent deploy.
  6. NEVER use distributed transactions (2PC). Use sagas.
  7. EVERY event: event_id, type, version, timestamp,

source, correlation_id, data.

TSV Logging

Append .godmode/micro-results.tsv:

timestamp	services_count	communication	saga_pattern	mesh	status

Keep/Discard

KEEP if: contract tests pass AND circuit breakers work
  AND no cascading failures.
DISCARD if: contract broken OR cascading failure
  OR service discovery fails.

Stop Conditions

STOP when ALL of:
  - All boundaries defined with clear contracts
  - Circuit breakers on all inter-service calls
  - Contract tests passing in CI

Autonomous Operation

On failure: git reset --hard HEAD~1. Never pause.

Error Recovery

| Failure | Action |

|--|--|

| Cascading failure | Add circuit breakers, bulkhead |

| Saga fails mid-way | Compensate reverse, verify idempotency |

| Discovery not resolving | Check DNS, retry with backoff |

| Circular dependency | Extract shared or use events |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.