/volcano:volcano-locksfrom volcano
Use for Volcano project locks, distributed leases, leader election, renewable lock guards, fencing tokens, lock contention, and safe backend worker coordination.
Ships in volcano. 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.
Use project locks when backend workers in one project must elect one holder for
work such as a migration or scheduled rollup. Pair this skill with volcano-sdk
and volcano-platform.
Locks require a service key with locks.manage or full access. Never expose the
key or lease token in browser code.
Use the project's language:
| Project signal | SDK pattern |
|---|---|
package.json, .ts, .js | JavaScript/TypeScript callback and result envelope |
pyproject.toml, requirements.txt, .py | Python context manager and typed exceptions |
Gemfile, .gemspec, .rb | Ruby block and typed exceptions |
Prefer the automatic lease helper for work that can outlive one lease period. It renews the lease and releases it when the callback, context, or block exits.
const result = await volcano.locks.withLock(
'daily-rollup',
{ ttl: 30 },
async ({ signal, lease }) => runRollup({ signal, fencingToken: lease.fencingToken }),
);
if (result.error) throw result.error;
if (!result.acquired) return { skipped: true };
The callback must stop when signal is aborted. Contention returns
{ acquired: false, error: null }.
with client.locks.with_lock("daily-rollup", ttl=30) as guard:
run_rollup(fencing_token=guard.lease.fencing_token)
if guard.lost:
raise RuntimeError("Lock ownership was lost")
client.locks.with_lock("daily-rollup", ttl: 30) do |guard|
run_rollup(fencing_token: guard.lease.fencing_token)
raise "Lock ownership was lost" if guard.lost?
end
Python and Ruby raise typed SDK exceptions for acquisition or renewal failures. Stop protected work when the guard reports ownership loss.
const acquired = await volcano.locks.acquire('migration', { ttl: 30 });
if (acquired.error) throw acquired.error;
if (!acquired.acquired || !acquired.lease) return;
try {
const renewed = await volcano.locks.renew('migration', acquired.lease, { ttl: 30 });
if (renewed.error) throw renewed.error;
} finally {
const released = await volcano.locks.release('migration', acquired.lease);
if (released.error) console.error(released.error);
}
| JavaScript/TypeScript | Python | Ruby |
|---|---|---|
acquire, renew, release, get, forceRelease | acquire, renew, release, get, force_release | acquire, renew, release, get, force_release |
| returns result envelopes | returns values or raises typed exceptions | returns values or raises typed exceptions |
Use direct methods only when the automatic lease lifecycle does not fit. Python
and Ruby renew return a new immutable lease, so retain the returned value.
Keep the lease private because its token proves ownership.
A delayed holder can continue working after its lease expires. Pass
lease.fencingToken to the protected storage operation and reject values lower
than the highest token already accepted.
UPDATE rollup_state
SET cursor = $1, fencing_token = $2
WHERE id = $3 AND fencing_token <= $2;
The lease alone does not block a stale write. The storage check does.
const { state, error } = await volcano.locks.get('migration');
if (error) throw error;
if (state?.held) console.log(state.expiresAt, state.fencingToken);
const released = await volcano.locks.forceRelease('migration');
if (released.error) throw released.error;
Use forceRelease only after stopping the old holder and confirming the
protected resource checks fencing tokens. The old holder can run until its next
renewal fails.
., _, :, and -, up to 128 characters.retryAfter in seconds.acquired: true.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kong/volcano-agentic-plugins --plugin volcano18 skills in this plugin
/install-volcanoInstall, upgrade, or set up the Volcano CLI. Use this whenever a task needs the volcano CLI and `which volcano` hasn't been confirmed yet, even if the user never says "install" (e.g. "build me a todo API using volcano")./volcano-authUse for Volcano authentication and identity work including user accounts, email or password sign-up and sign-in, OAuth, sessions, anonymous users, password recovery, and private or per-user data./volcano-databaseUse whenever a Volcano app stores or persists data, including CRUD, records, per-user data, migrations, RLS, todos, chat messages, polls, analytics, counters, click tracking, CMS content, feature flags, and leaderboards.Other plugins' skills for the same job