| name | service-registry |
| description | Registry pattern for managing external service connections, configurations,
and health checks.
Triggers: service registry, service discovery, health checks, service configuration,
multi-service integration, unified execution, service management
Use when: managing multiple external services, implementing health checks,
centralizing service configuration, unified service execution
DO NOT use when: single service integration without registry needs.
Consult this skill when implementing service registry patterns.
|
| category | infrastructure |
| tags | ["services","registry","execution","health-checks","integration"] |
| dependencies | ["quota-management","usage-logging"] |
| tools | ["service-executor"] |
| provides | {"infrastructure":["service-registry","health-monitoring","execution-engine"],"patterns":["service-discovery","unified-execution","configuration-management"]} |
| usage_patterns | ["multi-service-integration","service-health-checks","unified-execution","configuration-management"] |
| complexity | intermediate |
| estimated_tokens | 550 |
| progressive_loading | true |
| modules | ["modules/service-config.md","modules/execution-patterns.md"] |
Service Registry
Overview
A registry pattern for managing connections to external services. Handles configuration, health checking, and execution across multiple service integrations.
When to Use
- Managing multiple external services.
- Need consistent execution interface.
- Want health monitoring across services.
- Building service failover logic.
Core Concepts
Service Configuration
@dataclass
class ServiceConfig:
name: str
command: str
auth_method: str
auth_env_var: str
quota_limits: dict
models: list[str] = field(default_factory=list)
Execution Result
@dataclass
class ExecutionResult:
success: bool
stdout: str
stderr: str
exit_code: int
duration: float
tokens_used: int
Quick Start
Register Services
from leyline.service_registry import ServiceRegistry
registry = ServiceRegistry()
registry.register("gemini", ServiceConfig(
name="gemini",
command="gemini",
auth_method="api_key",
auth_env_var="GEMINI_API_KEY",
quota_limits={"rpm": 60, "daily": 1000}
))
Execute via Service
result = registry.execute(
service=,
prompt=,
files=[],
model=
)
result.success:
(result.stdout)