Skip to content
Kitbay
Skill

enforce-rules-for-pinia-synced

MITUpdated on Nov 13, 202651,383GitHub stars

A contributor skill in the AIRI repository covering Vue state stores built with Pinia whose state is shared between Electron windows by the pinia-plugin-synced package.

What the skill teaches

A contributor skill in the AIRI repository covering Vue state stores built with Pinia whose state is shared between Electron windows by the pinia-plugin-synced package. It explains that the plugin copies snapshots and routes actions through a leader window rather than sharing Vue refs, so only stores that truly need cross-window ownership should sync, and only small, cloneable source-of-truth state. Watchers must not write synced state directly; they may call an idempotent, awaited synced action instead. Side-effecting actions belong to the leader and must be async, persistence needs one explicit owner, every renderer must set its leadership mode, and a multi-window test should show that remote snapshots do not trigger local writes.

Capabilities

  • Decide which Pinia state to sync
  • Avoid watcher writes to synced state
  • Assign leader-owned actions and persistence
  • Test multi-window state sync