synaptiai/agent-capability-standard/digital-twin-sync-loop
Claude Code and agent skill by synaptiai/agent-capability-standard
- community
Checking that the SKILL.md file is still in the repository.
Run the digital twin sync loop to synchronize real-world signals with a digital model. Use when updating digital twins, detecting drift, managing real-time state synchronization, or maintaining model-reality alignment.
Install
npx vskill@latest install synaptiai/agent-capability-standard/digital-twin-sync-loopSKILL.md
Intent
Run the composed workflow digital_twin_sync_loop (reference/workflow_catalog.yaml) to synchronize a digital twin with incoming signals and keep it grounded, safe, and auditable: detect drift, decide and execute safe actions, and record provenance.
This workflow is designed to model both real and digital systems using the canonical world-state schema:
reference/world_state_schema.yaml
Success criteria:
- Twin snapshot updated and grounded
- Drift assessed with risk score
- Any actions are approved/checkpointed/verified
- Audit trail produced
- Rollback runs only when verification fails
Compatible schemas:
reference/world_state_schema.yamlreference/event_schema.yamlreference/workflow_catalog.yaml
Inputs
| Parameter | Required | Type | Description | |
|---|---|---|---|---|
user_input | No | object | domain and constraints. The catalog accepts both but no step binds them: the policy check uses the fixed constraints least_privilege and change_policy, and no drift threshold gates any step | |
previous_world_state | No | object | The twin snapshot before this sync (reference/world_state_schema.yaml#/world_state). Merged with the new events and diffed against the updated snapshot; without it there is no baseline (run /digital-twin-bootstrap instead) |
Preconditions (hard gates)
- Policy constraints must pass (
/constrain):mutateruns only if${constrain_out.compliant} == true - Checkpoint before mutation (
/checkpoint):mutatestops if${checkpoint_out.checkpoint_id} == null - Any external side effects require explicit approval (do not
sendwithout approval);mutateandexecuterequire approval
Procedure
0) Ensure baseline exists: If no twin snapshot exists, run /digital-twin-bootstrap instead: it builds the world model and then runs this loop
Then execute the sync loop:
1) Invoke `/receive` and store output as receive_out
- Ingest new signals/events from sources (logs/APIs/messages); retry up to 3 times
2) Invoke `/search` for receive_out.source and store output as search_out
- Parallel enrichment (
parallel_group: context_gathering): search for the existing twin snapshot or relevant context
3) Invoke `/transform` on receive_out.data to canonical_event and store output as transform_out
- Normalize raw signals into canonical events (
reference/transform_mapping_rawlog_to_observation.yaml; the step'soutputis one event ofreference/event_schema.yaml#/event)
4) Invoke `/integrate` with transform_out.output and previous_world_state, and store output as integrate_out
- Merge canonical events with the existing twin snapshot; resolve conflicts with
prefer_authoritative_sources
5) Invoke `/detect` (domain: entity) on integrate_out.merged and store output as detect_entity_out
- Detect entities in integrated data
6) Invoke `/classify` on detect_entity_out.matches and store output as classify_out
- Classify and resolve entity identities
7) Invoke `/state` with integrate_out.merged.observations, scoped to integrate_out.merged.meta.world_id, and store output as state_out
- Produce the updated canonical world-state snapshot with uncertainty + provenance: the output wraps the snapshot (
reference/world_state_schema.yaml#/world_state) in itsstatefield, so later steps readstate_out.state
8) Invoke `/compare` (domain: state_diff) on previous_world_state and state_out.state, and store output as compare_state_out
- Compute the diff between the previous and the updated snapshot
9) Invoke `/transition` from state_out.state and store output as transition_out
- Apply transition rules triggered by new observations; compute next states
10) Invoke `/detect` (domain: anomaly) for drift on the observed state (state_out.state), the expected effects (transition_out.effects) and the diff (compare_state_out), and store output as detect_anomaly_out
- Detect drift/anomalies between expected and observed state
11) Invoke `/measure` (domain: risk) on detect_anomaly_out and store output as measure_risk_out
- Estimate risk impact/probability from drift and transitions
12) Invoke `/predict` (domain: risk) for near_term_risk, conditioned on the risk score (measure_risk_out.value, .uncertainty), the drift (detect_anomaly_out.detected, .matches) and the transition rules (transition_out.rules), and store output as predict_out
- Forecast near-term risk trajectory and triggers
13) Invoke `/plan` with the forecast (predict_out), the state diff (compare_state_out), the entity labels (classify_out.labels) and the search context (search_out.results) as context, and store output as plan_out
- Plan safe action(s) to reduce the detected drift and risk, with verification criteria and rollback plan
14) Invoke `/constrain` on plan_out.steps (least_privilege, change_policy) and store output as constrain_out
- Enforce policy and least privilege for planned actions
15) Invoke `/checkpoint` on twin_state and store output as checkpoint_out
- Create the checkpoint marker before any mutation/side-effect step
16) Invoke `/mutate` on twin_state, applying plan_out.steps, if constrain_out.compliant is true, and store output as mutate_out
- Execute mutations from the action plan (if approved); stop if no checkpoint was created
- If the mutation fails or times out (R401/R402), roll back to
checkpoint_outand end the run with that error
17) Invoke `/execute` with run_verification_suite if a mutation was applied (mutate_out is not null), and store output as execute_out
- Run verification tests and commands; skip this step when nothing was mutated
- If the verification suite fails or times out (R401/R402), roll back to
checkpoint_outso the unverified mutation does not stay in place, and end the run with that error (no audit is recorded)
18) Invoke `/verify` on execute_out (drift_resolved, no_policy_violation) if a mutation was applied, and store output as verify_out
- Verify outcome: PASS/FAIL with evidence; skip this step when nothing was mutated. On FAIL, carry on: step 19 rolls back, once, and
auditrecords the verdict and the rollback - If verification cannot run (R401/R402 after its retries), roll back to
checkpoint_outand end the run with that error
19) Invoke `/rollback` to checkpoint_out.checkpoint_id if a mutation was applied (mutate_out is not null) and verify_out.passed is false, and store output as rollback_out
- The step is skipped when nothing was mutated or verification passes
- The step does not take a checkpoint of its own (
requires_checkpoint: false): it restores the one taken at step 15
20) Invoke `/audit` and store output as audit_out
- Record provenance, tool usage, diffs, decision rationale, and whether the twin was rolled back (
rollback_out.restored; null when the rollback was skipped)
21) Invoke `/explain` and store output as explain_out
- Produce a decision-ready sync report: drift, actions, verification, next steps
Output Contract
Return a structured object:
Field Definitions
| Field | Type | Description | |
|---|---|---|---|
workflow_id | string | Unique identifier for this sync execution | |
status | enum | Final workflow status | |
steps | object | Each step's output, keyed by its store_as; a skipped step is null | |
verification | enum | Final PASS/FAIL | |
audit_log_pointer | string | Where the audit trail was written | |
next_sync | object | Recommended timing for next synchronization | |
confidence | number | 0.0-1.0 based on evidence quality | |
evidence_anchors | array | All evidence references collected | |
assumptions | array | Explicit assumptions made during sync |
Examples
Example 1: IoT Sensor Sync with Drift Correction
Input:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/digital-twin-sync-loop/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/synaptiai/agent-capability-standard/digital-twin-sync-loop)