service-discovery
Skill39 starsChanged 8 months agoMITView on GitHub
Service Discovery implements dynamic service registry, health check monitoring, and intelligent load balancing patterns inspired by Nacos for cloud-native applications.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- itallstartedwithaidea/claude-googleadsagentword for word, first seen May 21, 2026
Other versions1 project uses a version of this.
Word for word · 1
- itallstartedwithaidea/claude-googleadsagent★ 2100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
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.
In this repository74 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- continuous-learningSkill
- entity-memory-managementSkill
- knowledge-base-injectionSkill
- long-horizon-workflowsSkill
- mcp-server-creationSkill
- memory-persistenceSkill
- multi-model-routingSkill
- parallel-agent-orchestrationSkill
- proactive-intelligenceSkill
- token-optimizationSkill
- adversarial-resilienceSkill
- agent-instinct-systemSkill
- anthropic-tool-masterySkill
- cognitive-scaffoldingSkill
- context-engineeringSkill
- multi-harness-portabilitySkill
- prompt-architectureSkill
- self-healing-agentsSkill
- session-archaeologySkill
- verification-loopsSkill
- ad-copy-generationSkill
- audience-targetingSkill
- budget-optimizationSkill
- competitor-analysisSkill
- conversion-trackingSkill
- google-ads-auditSkill
- keyword-researchSkill
- landing-page-auditSkill
- pmax-optimizationSkill
- quality-score-optimizationSkill
- remarketing-strategySkill
- shopping-adsSkill
- ci-cd-pipelinesSkill
- cloudflare-workersSkill
- configuration-managementSkill
- edge-renderingSkill
- observabilitySkill
- ml-model-integrationSkill
- programmatic-videoSkill
- web-asset-generationSkill
- ai-chat-studioSkill
- assistant-presetsSkill
- batch-processingSkill
- knowledge-base-ragSkill
- low-code-generationSkill
- workflow-orchestrationSkill
- bioinformaticsSkill
- cheminformaticsSkill
- data-analysisSkill
- database-lookupSkill
- geospatial-analysisSkill
- machine-learningSkill
- research-methodologySkill
- scientific-writingSkill
- agent-security-scanningSkill
- codeql-semgrepSkill
- sandbox-hardeningSkill
- secret-protectionSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
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
- Distinctive: line 121
Use heartbeat TTL (30s default) to automatically prune unresponsive instances
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Service Discovery
Part of Agent Skills™ by googleadsagent.ai™
Description
Service Discovery implements dynamic service registry, health check monitoring, and intelligent load balancing patterns inspired by Nacos for cloud-native applications. Services register themselves on startup, announce their capabilities and health status, and are discovered by consumers without hardcoded addresses. The registry becomes the single source of truth for the service topology.
In microservice and edge-distributed architectures, services are ephemeral. Instances scale up and down, deploy across regions, and fail independently. Hardcoded service URLs create brittle coupling that breaks under any topology change. Service discovery replaces static configuration with a living registry that reflects the actual state of the system at any moment.
This skill covers three complementary patterns: self-registration (services announce themselves), health checking (the registry verifies liveness), and client-side discovery (consumers query the registry and select instances). Together, these patterns enable zero-downtime deployments, automatic failover, and region-aware routing without manual configuration changes.
Use When
- Building microservice architectures with dynamic scaling
- Implementing health-check-driven load balancing
- Replacing hardcoded service URLs with dynamic discovery
- Supporting blue-green or canary deployments
- Building multi-region applications with region-aware routing
- Integrating multiple Workers or services that need to find each other
How It Works
sequenceDiagram
participant S as Service Instance
participant R as Service Registry
participant C as Consumer
participant H as Health Checker
S->>R: Register(name, address, metadata)
R->>R: Store in registry
loop Every 10s
H->>S: Health check (HTTP/TCP)
S->>H: 200 OK / Healthy
H->>R: Update health status
end
C->>R: Discover("payment-service")
R->>C: [instance-1:8080, instance-2:8080]
C->>C: Select instance (round-robin/weighted)
C->>S: Send request to selected instanceServices register on startup and deregister on shutdown. The health checker continuously verifies liveness. Consumers query the registry and apply a load-balancing strategy to select an instance.
Implementation
interface ServiceInstance {
id: string;
name: string;
address: string;
port: number;
metadata: Record<string, string>;
health: "healthy" | "degraded" | "unhealthy";
lastHeartbeat: number;
}
class ServiceRegistry {
private instances = new Map<string, ServiceInstance[]>();
register(instance: ServiceInstance): void {
const existing = this.instances.get(instance.name) ?? [];
existing.push({ ...instance, lastHeartbeat: Date.now() });
this.instances.set(instance.name, existing);
}
deregister(serviceName: string, instanceId: string): void {
const existing = this.instances.get(serviceName) ?? [];
this.instances.set(
serviceName,
existing.filter(i => i.id !== instanceId)
);
}
discover(serviceName: string): ServiceInstance[] {
const instances = this.instances.get(serviceName) ?? [];
return instances.filter(i => i.health === "healthy");
}
heartbeat(serviceName: string, instanceId: string): void {
const instances = this.instances.get(serviceName) ?? [];
const instance = instances.find(i => i.id === instanceId);
if (instance) instance.lastHeartbeat = Date.now();
}
pruneStale(maxAgeMs: number = 30_000): void {
const cutoff = Date.now() - maxAgeMs;
for (const [name, instances] of this.instances) {
this.instances.set(
name,
instances.filter(i => i.lastHeartbeat > cutoff)
);
}
}
}
function loadBalance(instances: ServiceInstance[]): ServiceInstance {
const weights = instances.map(i =>
i.health === "healthy" ? 100 : i.health === "degraded" ? 25 : 0
);
const totalWeight = weights.reduce((sum, w) => sum + w, 0);
let random = Math.random() * totalWeight;
for (let i = 0; i < instances.length; i++) {
random -= weights[i];
if (random <= 0) return instances[i];
}
return instances[0];
}Best Practices
- Implement graceful deregistration on service shutdown signals (SIGTERM)
- Use heartbeat TTL (30s default) to automatically prune unresponsive instances
- Include metadata in registrations (version, region, capabilities) for smart routing
- Implement circuit breakers on the consumer side to handle discovery failures
- Cache discovery results locally with short TTL to reduce registry load
- Monitor registry size and health check latency as infrastructure metrics
Platform Compatibility
| Platform | Support | Notes |
| Cursor | Full | Config + code generation |
| VS Code | Full | Microservice tooling |
| Windsurf | Full | Cloud-native support |
| Claude Code | Full | Architecture guidance |
| Cline | Full | Service scaffolding |
| aider | Partial | Code-level support only |
Related Skills
- Cloudflare Workers
- Configuration Management
- Observability
- Sandbox Hardening
Keywords
service-discovery nacos health-check load-balancing microservices registry cloud-native dynamic-routing
© 2026 googleadsagent.ai™ | Agent Skills™ | MIT License
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
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.

