Command Palette

Search for a command to run...

Назад к скиллам
скилл № 74268

run-job

Use this skill when the user wants to execute a planned Retriever processing run inline or in the background — including natural-language phrasings like "run…

БесплатноБез исполняемых скриптов
sdemyanovот sdemyanov★ 26 звёзд на GitHub

Установить run-job в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Operates under retriever:routing. If the user's intent actually fits a different tier — another retriever:* skill, a Tier 2 slash, a Tier 3 tools.py subcommand, or (last resort) direct DB access — stop and re-route against the ladder before continuing.

Run Job

Use this skill when the user wants to execute a planned Retriever processing run inline or in the background.

Purpose

The processing DB is the source of truth. This skill decides whether to:

  • run the work inline in the current conversation, or
  • spawn a subagent for background execution

The Python CLI does not own a --background flag.

Inputs

Expected user inputs:

  • a run_id, or enough context to identify one
  • optional preference to run inline or in the background

Decision Rule

  • Start with run-status --budget-seconds 35.
  • Use run.worker.recommended_execution_mode as the default:
    • inline means stay in the current conversation
    • background means spawn a subagent unless the user explicitly wants inline execution
  • Prefer a subagent when:
    • the user explicitly asks for background execution
    • or run.worker.recommended_execution_mode is background

When unsure, inspect run-status --budget-seconds 35 first.

For long unattended runs, use the supervision hints from run-status:

  • run.supervision.should_schedule_wakeup
  • run.supervision.wake_interval_seconds
  • run.supervision.suggested_worker_count
  • run.supervision.spawn_additional_worker_count
  • run.supervision.max_parallel_workers

If should_schedule_wakeup is true, keep a thread wake alive on the suggested interval (currently 60 seconds). Stop scheduling wakes when it becomes false.

Unattended Continuation

For unattended long runs, use a thread heartbeat automation attached to the current conversation.

When to create or update it:

  • the user explicitly asks to run in the background or keep going unattended
  • run.supervision.should_schedule_wakeup is true
  • the run still has pending work, active workers, or pending OCR / image-description finalization

How to configure it:

  • create or update a thread heartbeat on this thread
  • use the interval from run.supervision.wake_interval_seconds
  • default cadence is once per minute
  • keep the prompt short and durable:
    • resume Retriever run <run_id>
    • inspect run-status
    • if work remains, continue orchestration using this skill
    • if the run is done or canceled, stop the heartbeat and report a short summary

When to stop it:

  • run.supervision.should_schedule_wakeup is false
  • the run status is completed, failed, or canceled
  • there are no pending/running items and no pending finalization actions

Do not build a second supervisor inside Python. The heartbeat is the wake mechanism; the skill remains the orchestrator.

Bounded Claude Code Execution

Claude Code command calls may be interrupted around 45 seconds. Prefer the bounded facade:

python3 skills/tool-template/tools.py run-job-step <workspace> --run-id <RUN_ID> --budget-seconds 35

run-job-step performs exactly one safe orchestration step:

  • it finalizes OCR/image-description runs when the run is ready for finalization
  • otherwise it claims one prepared batch and returns the item contexts for the agent/provider to process
  • it uses the default stale-claim window, so abandoned inline claims can be picked up by another call after roughly 45 seconds
  • it returns next_recommended_commands for the next bounded action

If the result contains a non-empty batch, process those items and call complete-run-item or fail-run-item for each one. Then call run-job-step again if the run still needs work.

Execution Loop

Whether running inline or in a subagent, use the same small-batch loop.

The low-level orchestration command is:

  1. prepare-run-batch --run-id ... --claimed-by ... --budget-seconds 35 --launch-mode ... [--worker-task-id ...] [--max-batches ...] [--limit ...]

It returns:

  • current run status
  • worker hints
  • a claimed batch of run items with their execution contexts already loaded

Read worker.next_action:

  • process_batch: work the returned batch
  • finalize_ocr: call finalize-ocr-run
  • finalize_image_description: call finalize-image-description-run
  • handoff: stop this worker cleanly and let a fresh inline step or subagent continue
  • stop: stop the worker loop cleanly

If worker.stop_reason is canceled, exit immediately.

Batch Processing

For each item in batch:

  1. Read batch[i].context.execution.task_prompt
  2. Use the provided input payload to perform the capability work in-turn
  3. Use batch[i].context.execution.completion_template as the exact shape for completion
  4. Call complete-run-item ... or fail-run-item ...

Use these supporting commands during the loop:

  • heartbeat-run-items --run-id ... --claimed-by ... between long batches
  • finish-run-worker --run-id ... --claimed-by ... --worker-status ... before the worker exits
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл run-job?

Use this skill when the user wants to execute a planned Retriever processing run inline or in the background — including natural-language phrasings like "run OCR", "start the image-description job", "kick off the OCR worker", "process the queue", "execute run 42", "resume the stalled run", or "finish processing". It decides between inline execution and spawning a subagent, and drives the claim / complete / heartbeat loop against the processing DB.

Как установить скилл run-job?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл run-job запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить run-job с