lock-at-the-chokepoint
Skill27 starsChanged 19 days agoApache-2.0View on GitHub
Serialise shared operations at the single module-level chokepoint every caller passes through, never in per-instance state — and cap fan-out there too. A check-then-act idempotency guard protects sequential retries but loses the race under concurrency. Triggers when adding a lock, in-flight guard, dedupe check, or rate cap where multiple callers, component instances, or loops can invoke the same shared operation, and when writing any internal retry or resume loop over a batch. Does not fire on recording the status of an external send — outbound-side-effect-idempotency owns send-then-record.
In this repository56 other files it gives its agents.
- ai-surface-disciplineSkill
- blast-radius-grepSkill
- checkpoint-logSkill
- commission-the-rosterSkill
- committee-reviewSkill
- confirm-before-pushSkill
- constant-time-secret-compareSkill
- context-economySkill
- contract-reviewSkill
- cross-agent-reviewSkill
- date-parse-utc-safeSkill
- db-migration-verificationSkill
- deliverable-integritySkill
- dependency-upgrade-verificationSkill
- earn-every-lineSkill
- email-delivery-verificationSkill
- enforce-invariants-in-buildSkill
- env-change-verificationSkill
- findings-are-evidenceSkill
- fixtures-from-realitySkill
- flag-deferred-itemsSkill
- guard-the-spend-pathsSkill
- handoverSkill
- honest-failure-surfacingSkill
- legal-citation-integritySkill
- legal-notice-handlingSkill
- live-data-surgerySkill
- live-state-firstSkill
- mass-red-triageSkill
- measure-per-routeSkill
- no-silent-data-dropSkill
- one-real-rideSkill
- outbound-side-effect-idempotencySkill
- parallel-work-reconSkill
- pin-to-what-was-seenSkill
- plan-firstSkill
- price-the-spendSkill
- prove-it-can-failSkill
- reproduce-the-real-buildSkill
- rerun-before-verdictSkill
- safe-smokesSkill
- secrets-in-outputSkill
- server-side-authoritySkill
- skill-library-builderSkill
- spawn-from-declared-stateSkill
- statute-to-obligations-registerSkill
- substantiate-outward-claimsSkill
- team-loopSkill
- tool-layer-bytesSkill
- trace-one-recordSkill
- unordered-eventsSkill
- unslop-codeSkill
- unslop-textSkill
- unslop-uiSkill
- verified-citationsSkill
- verify-the-effectSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
A check-then-act guard is not a lock: Read-then-write ("is it already done?
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Lock at the chokepoint
Three incidents that cost real money: a per-hook syncing ref plus per-screen network
listeners produced overlapping sync passes and every photo was analysed twice at doubled AI
cost; ~30 concurrent vision calls fired unawaited and blew the provider's per-minute org
limit; the server-side "already analysed?" check lost the race against its twin.
The rules
- Serialise at the shared module-level function every caller passes through — a module-level in-flight promise, not per-instance state. Guards in hooks, screens, or components multiply with their instances and each copy believes it is alone.
- A check-then-act guard is not a lock. Read-then-write ("is it already done? no → do it") protects sequential retries only; two simultaneous callers both pass the check. Prevent the duplicate at the source, or use an atomic claim (see outbound-side-effect-idempotency for the external-send variant).
- Cap fan-out at the single upstream chokepoint rather than trusting callers not to burst. One concurrency gate in the shared client wrapper throttles the whole app under a provider limit; per-call politeness does not survive a loop.
- Retry and resume loops: skip items already completed; classify failures transient (retry N, then give up) versus permanent (give up now); and give an unrecoverable item an escape hatch so it cannot wedge the queue — surfacing it as given up per honest-failure-surfacing, never retrying silently forever. A photo whose local file was gone once blocked an entire inspection's sync indefinitely.
What this skill does not do
It does not govern external send-then-record paths (outbound-side-effect-idempotency) or per-IP abuse caps on public endpoints (guard-the-spend-paths). It governs internal concurrency and fan-out.
Why
Concurrency bugs of this class bill you twice and rate-limit you once, and they are invisible in sequential testing — the duplicate cost only appears when two instances run at once. Evidence: ASH LESSONS_LEARNED 2026-06-04 (evening and later entries), 2026-05-27, and the CLAUDE.md Opus rate-limit lesson.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

