Xpersona
S

service-registry

CLAWHUB · Unverified

Registers external services with health checks, central config, and unified execution Skill: service-registry Owner: athola Summary: Registers external services with health checks, central config, and unified execution Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:15:39.791Z | user Release v1.9.19 v1.9.17 | 2026-07-30T05:36:31.334Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:53:16.681Z | user Release v1.9.16 v1.9.14 | 2026-06-30T18:02:08.600Z | user Release v1.9.14 v1.9.13 | 2026-06-

62
Rank
84
Safety
1.5k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.5K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-leyline-service-registry
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-leyline-service-registry/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

132,899 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: service-registry
description: |
  Registers external services with health checks, central config, and unified execution
version: 1.9.8
triggers:
  - services
  - registry
  - execution
  - health-checks
  - integration
  - integrating multiple external services needing coordination
metadata: {"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/leyline", "emoji": "\ud83e\udd9e", "requires": {"config": ["night-market.quota-management", "night-market.usage-logging"]}}}
source: claude-night-market
source_plugin: leyline
---

> **Night Market Skill** — ported from [claude-night-market/leyline](https://github.com/athola/claude-night-market/tree/master/plugins/leyline). For the full experience with agents, hooks, and commands, install the Claude Code plugin.


## Table of Contents

- [Overview](#overview)
- [When to Use](#when-to-use)
- [Core Concepts](#core-concepts)
- [Service Configuration](#service-configuration)
- [Execution Result](#execution-result)
- [Quick Start](#quick-start)
- [Register Services](#register-services)
- [Execute via Service](#execute-via-service)
- [Health Checks](#health-checks)
- [Service Selection](#service-selection)
- [Auto-Selection](#auto-selection)
- [Failover Pattern](#failover-pattern)
- [Integration Pattern](#integration-pattern)
- [Detailed Resources](#detailed-resources)
- [Exit Criteria](#exit-criteria)


# 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.

## When NOT To Use

- Single service integration without registry needs

## Core Concepts

### Service Configuration

```python
@dataclass
class ServiceConfig:
    name: str
    command: str
    auth_method: str  # "api_key", "oauth", "token"
    auth_env_var: str
    quota_limits: dict
    models: list[str] = field(default_factory=list)
```
**Verification:** Run the command with `--help` flag to verify availability.

### Execution Result

```python
@dataclass
class ExecutionResult:
    success: bool
    stdout: str
    stderr: str
    exit_code: int
    duration: float
    tokens_used: int
```
**Verification:** Run the command with `--help` flag to verify availability.

## Quick Start

### Register Services
```python
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}
))
```
**Verification:** Run the command with `--help` flag to verify availability.

### Execute via Service
```python
result = registry.execute(
    service="gemini",
    prompt="Analyze this code",
    files=["src/main.py"

_meta.json

{
  "ownerId": "kn7d107jg9jv602h9ytsegydq184a42s",
  "slug": "nm-leyline-service-registry",
  "version": "1.9.19",
  "publishedAt": 1787750139791
}

modules/execution-patterns.md

---
name: execution-patterns
description: Advanced execution patterns for service registry
estimated_tokens: 400
---

# Execution Patterns

## Command Building

### Template Expansion
```python
def build_command(
    config: ServiceConfig,
    prompt: str,
    files: list[str],
    model: str = None
) -> str:
    """Build command from template."""
    file_args = " ".join(f"@{f}" for f in files)
    model = model or config.default_model

    return config.command_template.format(
        command=config.command,
        prompt=prompt,
        files=file_args,
        model=model
    )
```

### Safe Execution
```python
import subprocess
import shlex

def execute_safely(command: str, timeout: int = 60) -> ExecutionResult:
    """Execute command with safety measures."""
    start = time.time()

    try:
        result = subprocess.run(
            shlex.split(command),
            capture_output=True,
            text=True,
            timeout=timeout
        )

        return ExecutionResult(
            success=(result.returncode == 0),
            stdout=result.stdout,
            stderr=result.stderr,
            exit_code=result.returncode,
            duration=time.time() - start,
            tokens_used=estimate_tokens(result.stdout)
        )
    except subprocess.TimeoutExpired:
        return ExecutionResult(
            success=False,
            stderr="Command timed out",
            exit_code=-1,
            duration=timeout
        )
```

## Retry Patterns

### Exponential Backoff
```python
def execute_with_retry(
    registry: ServiceRegistry,
    service: str,
    prompt: str,
    max_retries: int = 3
) -> ExecutionResult:
    """Execute with exponential backoff retry."""
    for attempt in range(max_retries):
        result = registry.execute(service, prompt)

        if result.success:
            return result

        if "rate limit" in result.stderr.lower():
            wait_time = 2 ** attempt  # 1, 2, 4 seconds
            time.sleep(wait_time)
        else:
            break  # Non-retryable error

    return result
```

### Circuit Breaker
```python
class CircuitBreaker:
    def __init__(self, failure_threshold: int = 5, reset_timeout: int = 60):
        self.failures = 0
        self.threshold = failure_threshold
        self.reset_timeout = reset_timeout
        self.last_failure = 0
        self.state = "closed"  # closed, open, half-open

    def can_execute(self) -> bool:
        if self.state == "closed":
            return True
        if self.state == "open":
            if time.time() - self.last_failure > self.reset_timeout:
                self.state = "half-open"
                return True
            return False
        return True  # half-open allows one attempt

    def record_result(self, success: bool):
        if success:
            self.failures = 0
            self.state = "closed"
        else:
            self.failures += 1
            self.last_failure = time.time()
            if self.failures >= s

modules/service-config.md

---
name: service-config
description: Service configuration patterns and options
estimated_tokens: 400
---

# Service Configuration

## Configuration Schema

### Full Configuration
```python
@dataclass
class ServiceConfig:
    # Identity
    name: str
    display_name: str = ""

    # Execution
    command: str  # CLI command or endpoint
    command_template: str = "{command} -p {prompt}"

    # Authentication
    auth_method: str  # api_key, oauth, token, none
    auth_env_var: str = ""
    auth_check_cmd: str = ""  # Command to verify auth

    # Quotas
    quota_limits: dict = field(default_factory=dict)
    # Example: {"rpm": 60, "tpm": 100000, "daily": 1000}

    # Models
    models: list[str] = field(default_factory=list)
    default_model: str = ""

    # Capabilities
    max_context: int = 100000
    supports_files: bool = True
    supports_streaming: bool = False

    # Health
    health_check_cmd: str = ""
    timeout_seconds: int = 60
```

## Service Examples

### Gemini Service
```python
GEMINI_CONFIG = ServiceConfig(
    name="gemini",
    display_name="Google Gemini",
    command="gemini",
    command_template="gemini -p '{prompt}' {files}",
    auth_method="api_key",
    auth_env_var="GEMINI_API_KEY",
    auth_check_cmd="gemini auth status",
    quota_limits={
        "rpm": 60,
        "tpm": 1000000,
        "daily": 1000
    },
    models=["gemini-2.5-flash-exp", "gemini-2.5-pro-exp"],
    default_model="gemini-2.5-flash-exp",
    max_context=1000000,
    health_check_cmd="gemini 'ping'",
    timeout_seconds=60
)
```

### Qwen Service
```python
QWEN_CONFIG = ServiceConfig(
    name="qwen",
    display_name="Alibaba Qwen",
    command="qwen",
    command_template="qwen -p '{prompt}' {files}",
    auth_method="api_key",
    auth_env_var="QWEN_API_KEY",
    quota_limits={
        "rpm": 120,
        "tpm": 2000000,
        "daily": 2000
    },
    models=["qwen-turbo", "qwen-max"],
    default_model="qwen-turbo",
    max_context=100000
)
```

## Configuration Loading

### From YAML
```yaml
# ~/.claude/leyline/services.yaml
services:
  gemini:
    command: gemini
    auth_method: api_key
    auth_env_var: GEMINI_API_KEY
    quota_limits:
      rpm: 60
      daily: 1000
```

### From Environment
```python
def load_from_env(service_name: str) -> ServiceConfig:
    prefix = service_name.upper()
    return ServiceConfig(
        name=service_name,
        command=os.getenv(f"{prefix}_COMMAND", service_name),
        auth_env_var=f"{prefix}_API_KEY",
        # ... other fields
    )
```

skill-card.md

## Description:

Registers external services with health checks, central config, and unified execution.

This skill is ready for commercial/non-commercial use.

## Publisher:

[athola](https://clawhub.ai/user/athola)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and engineers use this skill to register and coordinate multiple external services, run health checks, select services, and apply retry, failover, and parallel execution patterns.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Free-form command templates and broad service definitions can execute unintended commands or arguments.

Mitigation: Use trusted service definitions, allowlisted commands, explicit timeouts, and safer argument-array construction instead of free-form command templates.

Risk: Prompts and files may be sent to third-party services during service execution.

Mitigation: Require explicit user approval before sending sensitive prompts or files, and limit execution to trusted services.

Risk: Multiple external services can fail, rate-limit, or exceed expected quotas.

Mitigation: Configure quota limits, health checks, retry behavior, and failover handling before operational use.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-leyline-service-registry)
- [ClawDIS homepage](https://github.com/athola/claude-night-market/tree/master/plugins/leyline)
- [Service configuration patterns](modules/service-config.md)
- [Execution patterns](modules/execution-patterns.md)

## Skill Output:

**Output Type(s):** [guidance, code, shell commands, configuration]

**Output Format:** [Markdown with Python and YAML examples]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Includes service configuration schemas, execution-result patterns, health checks, retry/failover guidance, and command-execution examples.]

## Skill Version(s):

1.9.19 (source: ClawHub release metadata; artifact frontmatter states 1.9.8)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to service-registry and adjacent AI workflows.