/principle:principle-separate-before-serializing-shared-statefrom principle
Guides separation of independent concurrent writers before serializing access to truly shared mutable state. Helps design safe concurrency for retries, crashes, and read-modify-write patterns.
Ships in principle. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Separate independent writers first; serialise only where one shared invariant is real.
Identify each writer, mutable target and invariant, including retries and crashes. For each concurrent actor, ask what another actor can invalidate. Ask whether writers publish independent facts or maintain one canonical truth.
Separate independent facts into owned files, keys, branches or state objects, then combine at the read/report boundary. Different fields in one read-modify-write file still share a write target. Define how readers handle missing, stale or partial publications.
Keep truly atomic invariants together: splitting capacity and reservations across independent copies can oversell. Enforce shared ownership structurally with a transaction, compare-and-swap, exclusive writer or appropriate lock. Define contention, recovery and retry behaviour; instructions and PID-only claims are not concurrency control.
Distinct from: principle-make-operations-idempotent (an operation repeats or resumes after interruption), principle-derive-from-one-owner (the same fact is computed or stored twice), principle-narrow-state-lifetime (mutable state outlives the work that needs it).
Done: overlapping writes, interruption and retries were exercised, and both independent progress and preservation of the shared invariant hold before the race is called fixed.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
concurrency, shared-state, race-conditions, locking, atomic-operations
npx claudepluginhub mintuz/skills --plugin principle54 skills in this plugin
/principle-attack-the-premiseWHEN repeated fixes sharing an assumption fail the same check; NOT for a first unexplained failure or a settled mechanical edit; tests the shared premise before another fix./principle-build-the-leverWHEN repetitive work or a difficult check benefits from a rerunnable tool; NOT when an existing command or a direct small edit already suffices; builds the smallest useful lever./principle-capture-the-baselineWHEN about to change something whose result you will verify or compare; NOT for read-only investigation or syncing a git base; records pre-change evidence so the check reads old value versus new value./principle-clean-up-what-you-startedWHEN tearing down after a run, verification or failed attempt; NOT for making reruns converge or reverting unrelated edits; releases only resources this run created and keeps the evidence./principle-define-doneWHEN starting a multi-step deliverable, phase or plan, or deciding whether one is finished; NOT for single-step answers or choosing which checks to run; sets a checkable completion criterion first and reports every unmet gate./principle-derive-from-one-ownerWHEN the same fact or decision is computed or stored in more than one place; NOT for modelling legal states or collapsing pass-through layers; gives it one owner that other sites derive from or receive.Other plugins' skills for the same job