Skip to content
Skill Authoring
Skill

/principle-separate-before-serializing-shared-state

Apply when concurrent actors might write to the same file, branch, key, or state object. Eliminate the sharing first; serialize structurally only when one shared writer is a real invariant.

From plugin
pstack
4.6k61 skills2 agents

Claude Code

$ npx -y skills add backnotprop/pstack --skill principle-separate-before-serializing-shared-state --agent claude-code

SKILL.md

principle-separate-before-serializing-shared-state.SKILL.md
name: principle-separate-before-serializing-shared-state
description: "Apply when concurrent actors might write to the same file, branch, key, or state object. Eliminate the sharing first; serialize structurally only when one shared writer is a real invariant."
disable-model-invocation: true

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.

@backnotprop
Ships withpstack

i'm poteto. i'm not a president or ceo, but i've worked with millions of lines of code at Meta, Netflix, and Cursor. i'm also on the react core team where i help build and maintain react compiler. there's a growing sense that ai writes too much slop code.

4.6k61 skills2 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
4.6k
Star history of backnotprop/pstack on GitHub, a chart by star-history.com

Other skills on pstack.

setup-benny

setup-benny

Configure Benny and prepare its triage and repro automations. Use when installing Benny or changing its Slack, tracker,…

@backnotprop@backnotpropInstall Skill
triage-issue-reports

triage-issue-reports

Triage Slack issue reports with one thread-only verdict, evidence review, cause-aware routing, tracker dedupe, and fail-closed…

@backnotprop@backnotpropInstall Skill
architect

architect

Sketch types, signatures, and module structure before code, then stay in the loop while implementation fills in. Use for…

@backnotprop@backnotpropInstall Skill
arena

arena

Spawn N parallel candidates at the same task, pick a base, graft the strongest parts of the losers into it. Use for /arena,…

@backnotprop@backnotpropInstall Skill
automate-me

automate-me

Use for \"automate me\", \"create/update/refresh my -mode skill\", \"turn/capture my preferences or working style into a skill\",…

@backnotprop@backnotpropInstall Skill

More skills from other plugins.

gstack-openclaw-ceo-review

gstack-openclaw-ceo-re…

Use when asked to review a plan, challenge a proposal, run a CEO review, poke holes in an approach, think bigger about scope, or…

gstack2w138k
@garrytan@garrytanInstall Skill
book-to-skill

book-to-skill

Converts books and documents (PDF, EPUB, DOCX, HTML, Markdown, plain text, RTF, MOBI/AZW with Calibre) into structured agent…

@virgiliojr94@virgiliojr94Install Skill
distilly

distilly

Set up the owner profile so a personal agent knows who it works for (first-run setup, \"get to know me\"), or distill colleague,…

@titanwings@titanwingsInstall Skill

Questions about principle-separate-before-serializing-shared-state.

Which coding agents can use principle-separate-before-serializing-shared-state?
principle-separate-before-serializing-shared-state installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.