yao-job
できること
このスキルは、時間のかかるコマンドを代わりに実行します。終了を待つか、バックグラウンドで動かし続けます。長い作業を見失わずに処理したい人向けです。
使う場面
- ✓コマンドに長い時間がかかり、バックグラウンドで実行したいとき。
- ✓バックグラウンドのジョブが終了したかを確認したいとき。
- ✓ジョブが長く動きすぎ、停止する必要があるとき。
スキルのリンク
https://github.com/YaoApp/yao/blob/main/tools/skills/yao-job/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このデータのエクスポートをバックグラウンドで実行し、終わったら教えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、コマンドを前面で実行して結果を待つか、IDを付けてバックグラウンドで開始します。その後、進捗を読み取ったり、制限時間付きで待ったり、依頼に応じてジョブを停止したりします。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Background Jobs
Tools
yao_job_start— Start a command.background false(default) blocks until done and returnsoutput_tail;background truereturnsjob_idimmediately.yao_job_list— List jobs. Supports--statusfilter and--limit/--offsetpagination.yao_job_get— Get full details for a job (or daemon by ID).yao_job_output— Read process output (works for both job and daemon IDs).yao_job_wait— Block until a background job finishes or timeout expires. Jobs only, not daemons.yao_job_stop— Kill a running job.
Parameters
yao_job_start
| 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 |
yao_job_list
| Param | Default | Description |
|---|---|---|
status |
all | Filter: running, stopping, completed, failed, cancelled, all |
limit |
20 | Max items per page |
offset |
0 | Skip first N items |
yao_job_output
| Param | Required | Description |
|---|---|---|
job_id |
yes | Job or daemon ID |
offset |
no | Byte offset to read from (0 = beginning) |
Output read behavior:
- Returns all available content from
offsetin a single read (nolimitparameter). - Ring buffer caps at 10 MB; older content beyond this is discarded.
- When content has been discarded,
lossy=truein the response. size= total bytes the process has produced;offset= earliest readable byte position.- Example: a 20 MB output has
size=20000000, offset≈10000000, lossy=true— the first ~10 MB was discarded.
yao_job_wait
| Param | Required | Default | Description |
|---|---|---|---|
job_id |
yes | — | Job ID |
timeout_ms |
no | 60000 | Timeout in milliseconds |
Response Fields
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
Foreground start (background=false)
Returns the job object plus output_tail (≤4KB tail of stdout+stderr):
{ "id": "job_...", "status": "completed", "exit_code": 0, ..., "output_tail": "hello world\n" }
List (paginated)
{ "jobs": [...], "total": 130, "offset": 0, "limit": 20, "has_more": true }
Wait
{ "job": { ... }, "timed_out": false }
Stop (already terminal)
{ "job": { ... }, "detail": "already in terminal state (failed); no action taken" }
Errors
Structured JSON with code and message:
{ "error": { "code": "invalid_argument", "message": "job_id is required" } }
Codes: invalid_argument, not_found, internal.
Usage Rules
- Use
background true(not bare--background) for commands expected to run longer than 30 seconds. - Always provide a
description. - Foreground is default — the result and output come back in one call.
- Monitor background output with
yao_job_outputto check progress. - Use
yao_job_waitto block until a background job completes rather than polling.
BackgroundJobReceipt
When a background job finishes, the system delivers a <BackgroundJobReceipt> XML message. Upon receiving it:
- Review the
status,exit_code,cause, andoutput_tail. - If
status=failed, investigate and take corrective action. - If
status=completed, acknowledge and continue the task.
よくある質問
ジョブは停止できますか?
はい。実行中のジョブはエージェントが停止できます。
ジョブがタイムアウトすることはありますか?
はい。最大の実行時間を設定でき、その時間を過ぎるとジョブは停止されます。
出力はどのように確認しますか?
エージェントはジョブの出力を読み、ジョブが終わると最後の数行を表示できます。
詳細
作者による元の説明
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.
repo: YaoApp/yao
人気
- GitHubのスター
- 8.3k
- ランキング
- #12476
- ライセンス
- —
- 更新日
- 2026/10/19
コメント
- …
このリポジトリの他のスキル
yao-agent
8.3kYaoホスト上のエージェントを一覧表示し、コードの確認、取得、デプロイ、モデルのコネクタ確認を支援します。
yao-audio
8.3kエージェントが、会議の録音などの音声ファイルを文字に起こすよう支援します。言語を指定しない場合は、自動で言語を判別します。
yao-board
8.3kYaoプラットフォーム上のカンバンボードとタスクの状況を、エージェントが確認できるよう支援します。推測ではなく、実際のプロジェクトの進捗を報告します。
yao-daemon
8.3k開発サーバーなど、長時間動くバックグラウンドのサービスを、エージェントが起動、確認、再起動、停止し、その出力を読めるよう支援します。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。