Principle:AMAP ML SkillClaw Service Orchestration
| Knowledge Sources | |
|---|---|
| Domains | Service_Orchestration, Lifecycle_Management |
| Last Updated | 2026-10-22 00:00 GMT |
Overview
A service orchestration pattern that coordinates the lifecycle of multiple cooperating components — proxy server, skill manager, quality scorer, background worker, and CLI agent configuration — through a single launcher entry point.
Description
Service orchestration addresses the problem of initializing, starting, and stopping multiple interdependent components in the correct order. The SkillClaw pattern uses a `SkillClawLauncher` that: reads config, creates the `SkillManager` (if skills enabled), creates the `PRMScorer` (if PRM configured), optionally auto-pulls shared skills, starts the FastAPI proxy server, auto-configures the target CLI agent, and optionally starts a background `ValidationWorker`. Components are initialized in dependency order and stopped in reverse order. A PID file and signal handlers manage the process lifecycle.
Usage
Use this principle when designing systems that need:
- Ordered initialization of interdependent components
- Graceful shutdown of multiple services
- Optional components that activate based on configuration
- Background task management alongside a primary server
Theoretical Basis
The orchestrator pattern centralizes lifecycle management, ensuring:
- Dependency ordering: Config → SkillManager → PRMScorer → Server → Agent config → ValidationWorker
- Graceful degradation: Missing optional components (PRM, skills, validation) don't prevent startup
- Clean shutdown: Reverse-order stop with signal handlers
# Abstract algorithm (NOT real implementation)
async def orchestrate(config):
components = []
if config.use_skills:
components.append(SkillManager(config))
if config.use_prm:
components.append(PRMScorer(config))
server = APIServer(config, components)
server.start()
components.append(server)
configure_agent(config)
if config.validation_enabled:
worker = ValidationWorker(config)
components.append(worker)
await wait_for_stop_signal()
for component in reversed(components):
component.stop()