/quay:driversfrom quay
Starts promotion driver, worker driver, and web server for a quay project in one idempotent call. Use after /quay:init to avoid typing three CLI commands.
Ships in quay. 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.
Bring a quay project's promotion driver, worker driver, and web server into the running
state with a single in-session call — no hand-typed quay driver / quay serve CLI commands, no
tmux. This is step ④ of the quay enablement flow (SPEC-tmux-retirement-2026-09-03.md
§1.4/Layer 3b): ① install → ② start a session → ③ /quay:init → ④ this skill → ⑤ /quay:manager.
The start logic lives in ONE executable — ${CLAUDE_PLUGIN_ROOT}/scripts/dist/start-drivers.js
(tasks/gap-skill-start-drivers-webserver). This skill delegates to it rather than repeating the
idempotent-start loop inline: a second copy of the start logic is exactly the drift this repo keeps
removing (the same delegate pattern as /quay:init → quay-init.sh). Run the script; do not
hand-reimplement its behavior.
The three commands the script wraps (per quay driver --help / quay serve, 2026-09-04 实测):
quay driver start --kind promotion [--root <path>]
quay driver start --kind worker [--root <path>]
quay serve [--host <ip>] [--port <p>] # web UI — BOTH flags optional. Omitted ⇒ resolved through
# the ONE definition point (packages/quay/src/serve-binding.ts):
# .quay/config.yml `serve.host`/`serve.port`, else the single
# fallback — host 0.0.0.0, port 0 = kernel-assigned ephemeral
# (read back from .quay/server.json)
The script is idempotent — safe to call repeatedly:
quay driver status --kind <kind> --json reports alive: 1 ⇒ skip; otherwise
quay driver start. The driver kernel (driver-runtime.ts startKind) is itself idempotent
(already-running), so a race between two invocations cannot double-spawn — the status pre-check
is a fast path, not the only guard.<host>:<port> answers ⇒ skip; otherwise the script backgrounds
quay serve (detached, setsid-equivalent) and polls the probe until it answers. quay serve
has no supervisor (unlike the drivers), so backgrounding is the script's job.The script needs a quay workspace root (a directory whose .quay/config.yml exists). By default it
discovers the root by walking up from the current directory; in a fresh project this is the
directory you just ran /quay:init in. If the script is not run from inside the workspace, pass
--root <path> explicitly.
node ${CLAUDE_PLUGIN_ROOT}/scripts/dist/start-drivers.js
With an explicit workspace root (and, only when you must pin the binding, --host / --port):
node ${CLAUDE_PLUGIN_ROOT}/scripts/dist/start-drivers.js \
--root <path>
# ⛔ `--host` and `--port` are FORWARDED to the spawned `quay serve` ONLY WHEN GIVEN
# (gap-serve-binding-defaults-three-copies-to-one-definition-point): an omitted flag is NOT written into
# the child's cmdline. Omitted ⇒ the host resolves it through the ONE definition point
# (packages/quay/src/serve-binding.ts): `.quay/config.yml`'s `serve.host` / `serve.port`, else the single
# fallback — host 0.0.0.0, port 0 =「让内核分配临时端口」. Pass `--port` only to PIN an exact port (a
# deployment that must be addressable at a fixed number); a real collision then fails loudly rather than
# silently moving to another port.
On success the script prints, per component, whether it was already running or was started (e.g.
promotion: started, worker: already running (alive), serve: started (pid=…) on http://0.0.0.0:<the port the kernel bound>).
serve's verdict comes from the host process ITSELF, not from a probe this script runs: quay serve
holds a same-root admission lock, so it either binds (serve: started) or REFUSES because a live host
already owns this workspace root (serve: already running (pid=…) … (code fresh)). When a live host is
reported, GET /health on the port its carrier names decides whether it is kept (fresh), RELOADED
(stale — the old host is SIGTERM'd and its pid awaited), or LEFT ALONE and reported as
staleness: "not-evaluated".
The script's own report is the primary signal. To verify independently from the mechanism:
quay driver status --kind promotion --root <path> # "alive":1
quay driver status --kind worker --root <path> # "alive":1
curl -sf http://<host>:<port>/health || curl -sf http://<host>:<port>/
spawnAnchor (${CLAUDE_PLUGIN_ROOT}/scripts/dist/driver-runtime.js, the ONE place an anchor is started — start --kind,
self-refresh and takeover all go through it) wraps the anchor in
systemd-run --user --scope --collect -p MemoryAccounting=yes -p OOMPolicy=continue -p MemoryMax=<host-derived>
whenever systemd-run --user --scope works on the host. All six kind loops and every worker the worker
driver spawns inherit that scope — so a memory blowout inside a worker is bounded to the anchor group,
not to the machine (2026-09-25: a hand-made scope with no MemoryMax had the whole driver group
OOM-killed 36 times, load 4309).
MemoryMax is host-derived: floor(os.totalmem() × 0.25), page-aligned. ⛔ Never a literal like
16G — a literal that means "unlimited" on the machine that wrote it becomes a real limit on the
next host, silently (CLAUDE.md 硬规则 4 推论二). 0.25 is a starting value, not a goal: measure it
(below) before changing it.QUAY_DRIVER_SYSTEMD_RUN_LIMITS="MemoryMax=4G" (same key syntax as the suite's
QUAY_TEST_SYSTEMD_RUN_LIMITS). Explicitly empty (="") means "no MemoryMax property at all" —
"not limited" is expressed by not setting the property, ⛔ not by a value that is only unlimited
on this host.systemd-run unavailable (no systemd / no user bus / probe failed) ⇒ the anchor is started exactly
as before (unenveloped), and the fallback is reported with an independently-valued reading
envelope: "none" + a named reason — ⛔ it is never silently shaped like a working envelope
(硬规则 3b).systemd-run --scope execs in place, so the pid you spawn IS the
anchor pid; .quay/anchor.pid / *-driver.pid keep meaning what they meant.<root>/.quay/anchor.json carries an envelope field, rewritten by the anchor every reconcile pass:
"envelope": { "envelope": "scope", "unit": "quay-anchor-<root>-<ts>.scope",
"memoryMax": "66295676928", "source": "host-derived", "reason": null }
unit comes from /proc/self/cgroup and memoryMax from that cgroup's memory.max file — kernel
direct quantities, ⛔ not an echo of the parameter we passed (硬规则 4b), so plan-vs-kernel disagreement
is visible rather than papered over. source is the launcher's declaration
(host-derived / env-override / env-unlimited); it is the one field the kernel cannot answer.
Cross-check + the number to tune the 0.25 with:
R=<workspace root>; PID=$(cat $R/.quay/anchor.pid); U=$(sed -n 's|^0::.*/||p' /proc/$PID/cgroup)
cat /proc/$PID/cgroup # must end in .scope
systemctl --user show "$U" -p MemoryMax -p MemoryPeak # MemoryMax must not be `infinity`
python3 -c "import json;print(json.load(open('$R/.quay/anchor.json'))['envelope'])"
MemoryPeak (from systemctl --user show) is the peak RSS the scope actually reached — that is the
reading the 0.25 factor should eventually be set from; ⛔ do not set a threshold before measuring it.
The script forwards the CLI's own error verbatim and exits non-zero — it never replaces a real reason with a generic one (硬规则 3b: "read-unable" must not look like success).
| Symptom | Meaning | Fix |
|---|---|---|
… is halted (halted_by=…) — refusing to start; clear the halt first with: quay driver resume --kind <kind> | the driver's control state is halted=true (e.g. after quay driver drain) | run quay driver resume --kind <kind>, then re-run this skill |
… refusing to run from a git worktree (…) … Run from the main checkout instead | quay driver start is REJECTED from a worktree root (AC139-4 — the resident supervisor must be carried from the main checkout, not a short-lived worktree) | re-run this skill from the workspace main checkout, not a quay-worktrees/… path |
… no .quay/config.yml found … | the script is not running inside a quay workspace | cd into the workspace root, or pass --root <path> |
serve: process exited before answering the probe … see .quay/serve.log | the web server process died at startup (e.g. EADDRINUSE if the port is taken by a non-HTTP process) | read .quay/serve.log in the workspace root for the real error |
serve process) — this is the script's planActions decision, not a
side-effect of the CLI.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub yaleh/quay --plugin quay14 skills in this plugin
/cold-startCold-start the two-layer loop in a project `/quay:init` has already prepared: re-create the 20-minute outer cron, EXPLICITLY drive the inner session to start fast mode and dispatch the first task, then PROVE the loop is live by reading a real --task-start telemetry record in .workflow-events/. One slash command; the inner start is DRIVEN here, never assumed as a side effect./executeUse when driving a task at status `ready` toward `done` — implements the plan, self-audits against AC/DoD, and asserts the `ready -> done` gate via `quay task check`. Takes the epic branch (drive children to done, then integration-accept) when the task's derived role is `compound`. Invoke with a task id and, optionally, a provider id (default `native`)./extension-point-refactorRun a refactor slice with the extension-point criteria four-piece set — generate the AC/DoD skeleton (正臂 / 负臂 / 注入泄漏 / 红线基线) from the centre file and the extension point, fill the four arms with real counted assertions, judge them with the checker, then land the AC through the Provider ABI. Use when a task is a design slice/refactor (R1/R2) whose acceptance must say WHERE the next feature lands, not merely that the existing code was split./initInitialize a workspace as a quay project — write the six-file config surface (.quay/config.yml, .quay/profiles.yml, tasks/, .gitignore, .claude/launch.settings.json, .claude/settings.json) and print the explicit quay plugin install steps. Idempotent./loop-driverDrive a workspace's quay task board through a single `iterate` cycle (or iterate* until Stop): select a ready task, isolate it in a dependency-ready worktree, build+test it, gate it, record evidence, and land. Parameterised by `.quay/config.yml` (loop: section) — the same skill, different params, for any workspace. Runner-agnostic and workspace-portable./managerThe manager layer — the THIRD layer above outer/inner: cross-project planning, prioritization, and trend-watching. One per network/host, started by the human (or an OS anchor), NEVER by a project's cold start. Crystallizes the daily-review cadence (per orchestration/REVIEW-cadence.md), the three functions (planning / prioritization / trend), and the two verified rules (§1.5 ask-vs-act, §1.6 event triage, extracted from orchestration/manager-loop-tick.md). Installable — ships under plugin/, not quay-local. Use when a network runs more than one quay loop and someone must coordinate between them (the human's job otherwise).Other plugins' skills for the same job