multi-service-orchestration
Scannednpx machina-cli add skill a5c-ai/babysitter/multi-service-orchestration --openclawMulti-Service Orchestration
Overview
Multi-service management methodology adapted from the Everything Claude Code project. Handles service discovery, dependency resolution, PM2 management, cascade/parallel execution, and cross-service testing.
Service Discovery
- Scan for service directories (packages/, services/, apps/)
- Parse package.json for dependencies and scripts
- Build dependency graph
- Detect package managers per service
- Determine topological execution order
- Flag circular dependencies
Execution Modes
Cascade Mode
- Sequential execution following dependency order
- Wait for health check before starting dependents
- Stop on failure with detailed error report
- Support partial cascade (skip healthy services)
Parallel Mode
- Concurrent execution for independent services
- Optional worktree isolation per service
- Configurable concurrency limit
- Collect all results (continue on individual failures)
Auto Mode (Default)
- Analyze dependency graph
- Use cascade for services with sequential dependencies
- Use parallel for independent service groups
- Hybrid: cascade between groups, parallel within groups
PM2 Management
- Generate ecosystem.config.js from service manifest
- Configure per service: name, script, cwd, env, instances
- Start in topological order with health check gates
- Log rotation and restart policies
- Status monitoring: online, stopped, errored
Cross-Service Testing
- API contract verification (request/response schemas)
- Event bus message flow testing
- Shared state consistency checks
- Authentication across service boundaries
- Circuit breaker behavior validation
Health Monitoring
- Health check endpoint polling
- PM2 process status monitoring
- Resource usage tracking (CPU, memory)
- Log file error pattern detection
- Inter-service connectivity verification
When to Use
- Multi-package monorepo development
- Microservice orchestration
- Full-stack application management
- CI/CD pipeline for multi-service deployments
Agents Used
architect(service discovery and dependency mapping)build-resolver(individual service builds)e2e-runner(cross-service integration testing)
Source
git clone https://github.com/a5c-ai/babysitter/blob/main/plugins/babysitter/skills/babysit/process/methodologies/everything-claude-code/skills/multi-service-orchestration/SKILL.mdView on GitHub Overview
This methodology coordinates multiple services across a monorepo by adapting the Everything Claude Code approach. It handles service discovery, dependency graphing, and PM2 management, then orchestrates cascade or parallel execution while validating cross-service integration.
How This Skill Works
It scans service dirs (packages/, services/, apps/), parses each package.json to map dependencies and scripts, and builds a topological graph with circular-dependency checks. In cascade mode, services start sequentially only after health checks pass for dependents; in parallel mode, independent services run concurrently with optional per-service worktrees, and you can continue on partial failures. PM2 is configured via generated ecosystem.config.js per service manifest, with health gates and cross-service testing (API contracts, event flows, and state checks) before proceeding.
When to Use It
- You manage a multi-package monorepo with inter-service dependencies.
- You orchestrate microservices that require controlled startup order.
- You need faster pipelines by running independent services in parallel.
- You want to validate cross-service contracts and event flows after deployments.
- You're building a full-stack app requiring synchronized backend/frontend services and CI/CD for multi-service deployments.
Quick Start
- Step 1: Scan the repository to discover services (packages/, services/, apps/) and build a dependency graph using architect and build-resolver.
- Step 2: Choose an execution mode (cascade, parallel, or auto) and generate ecosystem.config.js for PM2.
- Step 3: Run the orchestrator and execute cross-service tests with e2e-runner, while monitoring health and logs.
Best Practices
- Map all services and dependencies into a single graph and run topological analysis.
- Prefer cascade mode for tightly coupled services with health-gate checks.
- Use parallel mode for independent groups to minimize total build time.
- Configure per-service PM2 settings (name, script, cwd, env, instances) and enable log rotation.
- Include automated cross-service tests (API contracts, event-bus flows) in downstream stages.
Example Use Cases
- A mono-repo with services in packages/, services/, apps/ where services must start in a defined order based on dependencies.
- Cascade execution with health checks gating the startup of dependents to prevent cascading failures.
- Parallel builds with worktree isolation for independent services to speed up CI.
- PM2 ecosystem.config.js generated per service manifest, with health checks and restart policies.
- e2e-runner validating API contracts, event bus message flows, and shared state after deploy.