Skip to content
backnotprop avatar

Principle Separate Before Serializing Shared State

Separate independent state per actor before reaching for locks, since shared writes are the real hazard.

CCM score
63 of 100
skills.sh installs
13.2K
GitHub stars
5.5K
last updated
Nov 30, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the default of giving each concurrent actor its own file, key, branch, or state directory before any merge
  • Warns that two workers writing separate fields into one state.json still counts as shared mutation
  • Reserves structural serialization such as lockfiles, a single writer, sequential phases, or compare-and-swap for true invariants
  • Treats instructions alone as no concurrency control and checks any "we need a lock" claim first
  • Designed for agent workflows where several actors might write to the same file, branch, key, or object

Install

$ npx -y skills add backnotprop/pstack --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/backnotprop/pstack
Category
Writing & Content
First seen
Nov 30, 2026

More from backnotprop/pstack

All 44

Similar to Principle Separate Before Serializing Shared State

More Writing & Content