yao-agent
Agent management expert. ALWAYS invoke this skill when you need to list available agents,…
Background job management — start, monitor, wait, stop long-running commands. ALWAYS invoke this skill when the user asks to run background tasks, check job status, read job output, or manage long-running commands.
$ npx -y skills add YaoApp/yao --skill yao-job --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/yao-jobContext preview
The summary Claude sees to decide when to auto-load this skill.
Background job management — start, monitor, wait, stop long-running commands. ALWAYS invoke this skill when the user asks to run background tasks, check job status, read job output, or manage long-running commands.
name: yao-job description: "Background job management — start, monitor, wait, stop long-running commands. ALWAYS invoke this skill when the user asks to run background tasks, check job status, read job output, or manage long-running commands."
| Param | Required | Default | Description | |-------|----------|---------|-------------| | `command` | yes | — | Shell command to execute | | `description` | yes | — | Concise 5–10 word summary | | `background` | no | `false` | `true` returns immediately; `false` blocks until done | | `args` | no | — | Additional arguments (rarely needed; prefer inline in `command`) | | `working_dir` | no | workspace | Working directory | | `max_duration_ms` | no | — | Kill the job after this many milliseconds |
| Param | Default | Description | |-------|---------|-------------| | `status` | all | Filter: `running`, `stopping`, `completed`, `failed`, `cancelled`, `all` | | `limit` | 20 | Max items per page | | `offset` | 0 | Skip first N items |
| Param | Required | Description | |-------|----------|-------------| | `job_id` | yes | Job or daemon ID | | `offset` | no | Byte offset to read from (0 = beginning) |
**Output read behavior:**
| Param | Required | Default | Description | |-------|----------|---------|-------------| | `job_id` | yes | — | Job ID | | `timeout_ms` | no | 60000 | Timeout in milliseconds |
All responses are JSON. Job objects contain:
id, kind, session_id, status, description, background, command, command_argv, command_line, pid, pgid, user, started_at, finished_at, duration_ms, exit_code, signal, detail, seq
Returns the job object plus `output_tail` (≤4KB tail of stdout+stderr):
{ "id": "job_...", "status": "completed", "exit_code": 0, ..., "output_tail": "hello world\n" }{ "jobs": [...], "total": 130, "offset": 0, "limit": 20, "has_more": true }{ "job": { ... }, "timed_out": false }{ "job": { ... }, "detail": "already in terminal state (failed); no action taken" }Structured JSON with `code` and `message`:
{ "error": { "code": "invalid_argument", "message": "job_id is required" } }Codes: `invalid_argument`, `not_found`, `internal`.
1. **Use `background true`** (not bare `--background`) for commands expected to run longer than 30 seconds. 2. **Always provide a `description`**. 3. **Foreground is default** — the result and output come back in one call. 4. **Monitor background output** with `yao_job_output` to check progress. 5. **Use `yao_job_wait`** to block until a background job completes rather than polling.
When a background job finishes, the system delivers a `<BackgroundJobReceipt>` XML message. Upon receiving it:
1. Review the `status`, `exit_code`, `cause`, and `output_tail`. 2. If `status=failed`, investigate and take corrective action. 3. If `status=completed`, acknowledge and continue the task.
✨ All your agents and workspaces in one place, on every device you own. Track tasks on a board, accessible from desktop, mobile, browser, or API. Self-hosted.
Agent management expert. ALWAYS invoke this skill when you need to list available agents,…
Audio expert. ALWAYS invoke this skill when the user asks to transcribe, recognize, or…
Kanban board and task query expert. ALWAYS invoke this skill when the user asks about boards,…
Daemon process management — start, monitor, restart, stop long-running services. ALWAYS…
Typed decision expert. ALWAYS invoke this skill when you need structured classification,…