.agent/.skills/job-lifecycle/SKILL.md — job naming, lifecycle, and discovery
Job identity
A job is exactly one tmux window.
Window name format:
job:<tag>:<utc_ts>:<job_id>
- •
<utc_ts>: UTCYYYYMMDDThhmmssZ - •
<job_id>: shortuuid (also used for log filename)
Tag sanitization
- •lowercase
- •allow
[a-z0-9._-] - •invalid runs →
- - •trim
-and_edges - •error if empty after sanitization
Lifecycle defaults
Use remain-on-exit (window option):
- •default:
failed(success removes, failure remains) - •
--keep:on - •
--rm:off - •
--keep-on-fail/--no-keep-on-failcontrol whether default isfailedvsoff(unless--keep).
Creating the window deterministically
Prefer:
- •
tmux new-window -d -t <session> -n <window_name> - •capture
window_id+pane_id - •set
remain-on-exit - •attach logging (pipe-pane) if requested
- •
tmux send-keysto start the command
This ensures options/log piping are attached before execution begins.
Discovery (ls-jobs)
- •List windows, filter
window_name.startswith("job:") - •Parse
tag/ts/job_idfrom window_name - •For each job window, query the first pane for
pane_dead,pane_dead_status,pane_dead_time. - •Derive
state:- •
runningifpane_dead == 0 - •
exitedifpane_dead == 1
- •