Aller au contenu
Skillpedia
Déploiement et cloud (DevOps)8.3k · #12476

yao-job

Ce qu’il fait

Cette compétence exécute pour vous des commandes longues, soit en attendant leur fin, soit en les laissant tourner en arrière-plan. Elle s'adresse aux personnes qui ont besoin de traiter des tâches longues sans les perdre de vue.

Quand l’utiliser

  • ✓Quand une commande va prendre beaucoup de temps et que vous voulez la lancer en arrière-plan.
  • ✓Quand vous voulez savoir si une tâche en arrière-plan est terminée.
  • ✓Quand une tâche tourne trop longtemps et doit être arrêtée.

Lien du skill

https://github.com/YaoApp/yao/blob/main/tools/skills/yao-job/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/YaoApp/yao/blob/main/tools/skills/yao-job/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Lance cette exportation de données en arrière-plan et dis-moi quand elle sera terminée.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent démarre la commande soit au premier plan, en attendant le résultat, soit en arrière-plan avec un identifiant. Il lit ensuite la progression, attend pendant une durée limitée ou arrête la tâche si vous le demandez.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

Background Jobs

Tools

  • yao_job_start — Start a command. background false (default) blocks until done and returns output_tail; background true returns job_id immediately.
  • yao_job_list — List jobs. Supports --status filter and --limit/--offset pagination.
  • 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 offset in a single read (no limit parameter).
  • Ring buffer caps at 10 MB; older content beyond this is discarded.
  • When content has been discarded, lossy=true in 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

  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.

BackgroundJobReceipt

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.
Questions fréquentes

Peut-on arrêter une tâche ?

Oui. L'agent peut arrêter une tâche en cours.

Une tâche peut-elle expirer ?

Oui. Vous pouvez fixer une durée maximale, au-delà de laquelle la tâche est arrêtée.

Comment voir la sortie ?

L'agent lit la sortie de la tâche et peut afficher les dernières lignes à la fin.

Détails

Description originale de l’auteur

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

Popularité

Étoiles GitHub
8.3k
Position au classement
#12476
Licence
—
Mis à jour
19/10/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires