Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -18% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -13% | 0% |
| case-18 | ✗→✓ | ▲ Improved | -36% | 0% |
| case-02 | ✓→✓ | = Same ✓ | -14% | 0% |
| case-03 | ✓→✓ | = Same ✓ | -26% | 0% |
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.
Pattern:
lastX field into one state.json is still shared mutation; indexer-state.json + metrics-state.json is not.Other measured skills in the registry, with their headline benchmark lift.