wait-and-monitor-operationslisted
Install: claude install-skill HaroldHormaechea/project-builder
# Wait-and-Monitor Operations
How to wait for any asynchronous outcome — CI, a deploy, a queue drain, a container coming up, a file landing on disk — without writing the kind of poll that errors every iteration and stalls silently until its fallback timeout.
The general pattern is in § "The general wait-and-monitor pattern" and § "Safe-poll wrapper". The bulk of the document is a concrete instantiation against the `gh` CLI for GitHub Actions, which is the most common case in this workspace; the field names + value vocabularies there are footgun-dense enough to warrant their own reference section.
## Why this skill exists
Polls fail silently. An `until` loop checks the *value* of a derived expression, never the *exit code* of the command that produced it; a polled command that errors every iteration produces empty output, the condition is permanently false, and the loop holds until its own timeout while the underlying system has long since finished. Verified failure mode 2026-05-30: `gh run list --status completed --created '>=...'` on a gh version that does not support either flag — 30-minute spin while CI had finished in two.
The defences below — pre-flight the EXACT polled command, cap iterations, check exit code per iteration, refuse to treat empty output as terminal — are what separates a poll that exits when the system is done from a poll that exits when it gives up.
On top of that general pattern, polling GitHub Actions correctly has its own surface-area trap: `gh