principle-separate-before-serializing-shared-state

Installation
SKILL.md

Pi Context-Aware Execution

When this skill is invoked in Pi, treat the user's current request and any skill arguments as the task input. Do not treat this file as the task by itself.

Before applying the skill, establish only the context needed for the request:

  1. Identify the current working directory and relevant project scope.
  2. Read local guidance first when present: AGENTS.md, CLAUDE.md, TODO.md, or nearby task/spec files.
  3. Inspect the current codebase with targeted searches (prefer rg) and read relevant files before making claims or proposing changes.
  4. Ground findings and recommendations in project evidence: cite file paths, commands, tests, docs, or external sources as applicable.
  5. Ask a concise clarification only when the arguments and codebase context are insufficient to proceed safely.

Operate conservatively: avoid broad scans, large reads, subagents, or parallel fanout unless the user's requested depth clearly requires them.

Separate Before Serializing Shared State

When concurrent actors might share mutable state, first ask whether they truly need the same mutable object. If not, eliminate the sharing. When sharing is real, enforce serialization structurally: lockfiles, sequential phases, exclusive ownership. Instructions and conventions are not concurrency control.

Why: Concurrent writes to shared state create race conditions that are intermittent, hard to reproduce, and expensive to debug. Telling agents or goroutines to "take turns" does not work.

Installs
1
GitHub Stars
7
First Seen
Jun 22, 2026
principle-separate-before-serializing-shared-state — v1truv1us/ai-eng-system