cursor avatar

Principle Separate Before Serializing Shared State

Eliminate shared write targets first, and serialize structurally only when a shared writer is a true invariant.

CCM score
58 of 100
skills.sh installs
5.7K
GitHub stars
19.4K
last updated
Nov 25, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers concurrent writers touching the same file, branch, key, or state object, and default separation of each actor's state before any locking
  • Explains that two workers writing separate fields into one state.json still counts as shared mutation
  • Guides serializing access only when a shared write target is a real invariant, using a lockfile, single writer, sequential phases, or compare-and-swap
  • Warns that instructions alone are not concurrency control and that reaching for a lock should be checked first

Install

$ npx -y skills add cursor/plugins --skill principle-separate-before-serializing-shared-state -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Separate Before Serializing Shared State

When concurrent actors might write the same file, branch, key, or object, first ask whether they need one shared object or are publishing independent facts. Default to giving each actor its own file, key, branch, or state directory, and merge only where the state is read. Two workers writing their own field into one state.json is still shared mutation.

Only when one shared write target is a real invariant, serialize access structurally (a lockfile, a single writer, sequential phases, compare-and-swap). Instructions are not concurrency control, and "we need a lock" is a smell to check first.

Details

Repository
github.com/cursor/plugins
Category
Writing & Content
First seen
Nov 25, 2026

More from cursor/plugins

All 93

Similar to Principle Separate Before Serializing Shared State

More Writing & Content