Skill: teoslayer/pilot-digital-twin-setup (version 1.0.0)

--- name: pilot-digital-twin-setup description: > Deploy a digital twin platform with 4 agents. Use this skill when: 1. User wants to set up a digital twin for physical asset monitoring and predictive maintenance 2. User is configuring agents for sensor ingestion, physics simulation, or anomaly detection 3. User asks about predictive maintenance, asset health monitoring, or real-vs-predicted comparison Do NOT use this skill when: - User wants basic metrics collection (use pilot-metrics instead) - User only needs event filtering without a twin model (use pilot-event-filter instead) - User wants a single alert notification (use pilot-alert instead) tags: - pilot-protocol - setup - digital-twin - iot - predictive-maintenance license: AGPL-3.0 metadata: author: vulture-labs version: "1.0" openclaw: requires: bins: - pilotctl - clawhub homepage: https://pilotprotocol.network allowed-tools: - Bash --- # Digital Twin Setup Deploy 4 agents: sensor-bridge, model-engine, anomaly-detector, and action-planner. ## Roles | Role | Hostname | Skills | Purpose | |------|----------|--------|---------| | sensor-bridge | `<prefix>-sensor-bridge` | pilot-stream-data, pilot-metrics, pilot-gossip | Ingests real-time telemetry from physical assets | | model-engine | `<prefix>-model-engine` | pilot-dataset, pilot-task-router, pilot-consensus | Maintains physics model, runs simulations | | anomaly-detector | `<prefix>-anomaly-detector` | pilot-event-filter, pilot-alert, pilot-audit-log | Detects drift between real and predicted behavior | | action-planner | `<prefix>-action-planner` | pilot-webhook-bridge, pilot-cron, pilot-slack-bridge | Schedules maintenance, notifies field teams | ## Setup Procedure **Step 1:** Ask the user which role this agent should play and what prefix to use. **Step 2:** Install the skills for the chosen role: ```bash # For sensor-bridge: clawhub install pilot-stream-data pilot-metrics pilot-gossip # For model-engine: clawhub install pilot-dataset pilot-task-router pilot-consensus # For anomaly-detector: clawhub install pilot-event-filter pilot-alert pilot-audit-log # For action-planner: clawhub install pilot-webhook-bridge pilot-cron pilot-slack-bridge ``` **Step 3:** Set the hostname and write the manifest to `~/.pilot/setups/digital-twin.json`. **Step 4:** Tell the user to initiate handshakes with the peers for their role. ## Manifest Templates Per Role ### sensor-bridge ```json { "setup": "digital-twin", "role": "sensor-bridge", "role_name": "Sensor Bridge", "hostname": "<prefix>-sensor-bridge", "skills": { "pilot-stream-data": "Ingest real-time sensor telemetry from physical assets.", "pilot-metrics": "Track sensor health, sampling rates, and data quality.", "pilot-gossip": "Discover and sync with peer sensor bridges." }, "data_flows": [{ "direction": "send", "peer": "<prefix>-model-engine", "port": 1002, "topic": "telemetry", "description": "Unified telemetry stream from physical assets" }], "handshakes_needed": ["<prefix>-model-engine"] } ``` ### model-engine ```json { "setup": "digital-twin", "role": "model-engine", "role_name": "Model Engine", "hostname": "<prefix>-model-engine", "skills": { "pilot-dataset": "Store physics model parameters and simulation state.", "pilot-task-router": "Route simulation tasks across asset models.", "pilot-consensus": "Reconcile model state across redundant engines." }, "data_flows": [ { "direction": "receive", "peer": "<prefix>-sensor-bridge", "port": 1002, "topic": "telemetry", "description": "Real-time sensor data" }, { "direction": "send", "peer": "<prefix>-anomaly-detector", "port": 1002, "topic": "prediction", "description": "Expected behavior baselines and drift metrics" } ], "handshakes_needed": ["<prefix>-sensor-bridge", "<prefix>-anomaly-detector"] } ``` ### anomaly-detector ```json { "setup": "digital-twin", "role": "anomaly-detector", "role_name": "Anomaly Detector", "hostname": "<prefix>-anomaly-detector", "skills": { "pilot-event-filter": "Filter predictions by drift threshold and severity.", "pilot-alert": "Emit anomaly alerts for critical deviations.", "pilot-audit-log": "Log all detected anomalies with evidence snapshots." }, "data_flows": [ { "direction": "receive", "peer": "<prefix>-model-engine", "port": 1002, "topic": "prediction", "description": "Model predictions to compare" }, { "direction": "send", "peer": "<prefix>-action-planner", "port": 1002, "topic": "anomaly-alert", "description": "Anomaly alerts with severity and root cause" } ], "handshakes_needed": ["<prefix>-model-engine", "<prefix>-action-planner"] } ``` ### action-planner ```json { "setup": "digital-twin", "role": "action-planner", "role_name": "Action Planner", "hostname": "<prefix>-action-planner", "skills": { "pilot-webhook-bridge": "Push maintenance orders to field team systems.", "pilot-cron": "Schedule maintenance windows during low-impact periods.", "pilot-slack-bridge": "Notify operations teams of recommended interventions." }, "data_flows": [ { "direction": "receive", "peer": "<prefix>-anomaly-detector", "port": 1002, "topic": "anomaly-alert", "description": "Anomaly alerts to act on" }, { "direction": "send", "peer": "external", "port": 443, "topic": "maintenance-order", "description": "Work orders to field management systems" } ], "handshakes_needed": ["<prefix>-anomaly-detector"] } ``` ## Data Flows - `sensor-bridge -> model-engine` : real-time telemetry from physical assets (port 1002) - `model-engine -> anomaly-detector` : predictions and expected behavior baselines (port 1002) - `anomaly-detector -> action-planner` : anomaly alerts with severity and root cause (port 1002) - `action-planner -> external` : maintenance orders to field team systems (port 443) ## Workflow Example ```bash # On sensor-bridge -- stream telemetry: pilotctl --json publish <prefix>-model-engine telemetry '{"asset_id":"PUMP-A7","sensors":{"temperature_c":87.3,"vibration_mm_s":4.2}}' # On model-engine -- send prediction: pilotctl --json publish <prefix>-anomaly-detector prediction '{"asset_id":"PUMP-A7","drift_pct":{"temperature":6.3,"vibration":50.0}}' # On anomaly-detector -- alert planner: pilotctl --json publish <prefix>-action-planner anomaly-alert '{"asset_id":"PUMP-A7","severity":"warning","anomaly_type":"bearing_degradation"}' ``` ## Dependencies Requires `pilot-protocol` skill, `pilotctl` binary, `clawhub` binary, and a running daemon.

path: README.md
content: # Digital Twin

A digital twin platform that mirrors physical assets in real time, predicts failures before they occur, detects anomalous behavior, and schedules proactive maintenance. The sensor bridge ingests live telemetry, the model engine maintains a physics-based simulation, the anomaly detector compares real versus predicted behavior, and the action planner recommends and schedules interventions.

**Difficulty:** Advanced | **Agents:** 4

## Roles

### sensor-bridge (Sensor Bridge)
Ingests real-time telemetry from physical assets -- temperature, vibration, pressure, and flow rates. Normalizes sensor data across protocols, handles sampling rate mismatches, and forwards unified telemetry streams to the model engine.

**Skills:** pilot-stream-data, pilot-metrics, pilot-gossip

### model-engine (Model Engine)
Maintains a physics-based digital twin model of each monitored asset, runs simulations against incoming telemetry, predicts component degradation curves, and generates expected behavior baselines for anomaly comparison.

**Skills:** pilot-dataset, pilot-task-router, pilot-consensus

### anomaly-detector (Anomaly Detector)
Compares real-time sensor readings against model predictions, detects statistical drift and degradation patterns, classifies anomalies by severity and root cause, and triggers alerts when thresholds are exceeded.

**Skills:** pilot-event-filter, pilot-alert, pilot-audit-log

### action-planner (Action Planner)
Recommends maintenance actions based on anomaly severity and degradation forecasts, schedules maintenance windows to minimize downtime, notifies field teams via webhooks and messaging integrations, and tracks intervention outcomes.

**Skills:** pilot-webhook-bridge, pilot-cron, pilot-slack-bridge

## Data Flow

```
sensor-bridge    --> model-engine     : Real-time telemetry from physical assets (port 1002)
model-engine     --> anomaly-detector : Predictions and expected behavior baselines (port 1002)
anomaly-detector --> action-planner   : Anomaly alerts with severity and root cause (port 1002)
action-planner   --> external         : Maintenance orders to field team systems (port 443)
```

## Setup

Replace `<your-prefix>` with a unique name for your deployment (e.g. `acme`).

### 1. Install skills on each server

```bash
# On sensor bridge node
clawhub install pilot-stream-data pilot-metrics pilot-gossip
pilotctl set-hostname <your-prefix>-sensor-bridge

# On model engine node
clawhub install pilot-dataset pilot-task-router pilot-consensus
pilotctl set-hostname <your-prefix>-model-engine

# On anomaly detector node
clawhub install pilot-event-filter pilot-alert pilot-audit-log
pilotctl set-hostname <your-prefix>-anomaly-detector

# On action planner node
clawhub install pilot-webhook-bridge pilot-cron pilot-slack-bridge
pilotctl set-hostname <your-prefix>-action-planner
```

### 2. Establish trust

Agents are private by default. Each pair that communicates must exchange handshakes. When both sides send a handshake, trust is auto-approved -- no manual step needed.

```bash
# sensor-bridge <-> model-engine (telemetry)
# On sensor-bridge:
pilotctl handshake <your-prefix>-model-engine "setup: digital-twin"
# On model-engine:
pilotctl handshake <your-prefix>-sensor-bridge "setup: digital-twin"

# model-engine <-> anomaly-detector (predictions)
# On model-engine:
pilotctl handshake <your-prefix>-anomaly-detector "setup: digital-twin"
# On anomaly-detector:
pilotctl handshake <your-prefix>-model-engine "setup: digital-twin"

# anomaly-detector <-> action-planner (anomaly alerts)
# On anomaly-detector:
pilotctl handshake <your-prefix>-action-planner "setup: digital-twin"
# On action-planner:
pilotctl handshake <your-prefix>-anomaly-detector "setup: digital-twin"
```

### 3. Verify

```bash
pilotctl trust
```

## Try It

After setup is complete, run these commands to see data flowing between your agents:

```bash
# On <your-prefix>-sensor-bridge -- stream telemetry to model engine:
pilotctl publish <your-prefix>-model-engine telemetry '{"asset_id":"PUMP-A7","timestamp":"2026-04-10T14:30:00Z","sensors":{"temperature_c":87.3,"vibration_mm_s":4.2,"pressure_bar":6.8,"flow_rate_lpm":142.5},"sampling_hz":10}'

# On <your-prefix>-model-engine -- send prediction to anomaly detector:
pilotctl publish <your-prefix>-anomaly-detector prediction '{"asset_id":"PUMP-A7","timestamp":"2026-04-10T14:30:00Z","expected":{"temperature_c":82.1,"vibration_mm_s":2.8,"pressure_bar":7.0,"flow_rate_lpm":150.0},"actual":{"temperature_c":87.3,"vibration_mm_s":4.2,"pressure_bar":6.8,"flow_rate_lpm":142.5},"drift_pct":{"temperature":6.3,"vibration":50.0,"pressure":2.9,"flow_rate":5.0}}'

# On <your-prefix>-anomaly-detector -- alert action planner:
pilotctl publish <your-prefix>-action-planner anomaly-alert '{"asset_id":"PUMP-A7","severity":"warning","anomaly_type":"bearing_degradation","confidence":0.89,"indicators":["vibration_50pct_above_baseline","temperature_rising_trend"],"estimated_failure_days":14}'

# On <your-prefix>-action-planner -- subscribe to anomaly alerts:
pilotctl subscribe <your-prefix>-anomaly-detector anomaly-alert
```


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)