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★ 26 звёзд на GitHub
Установить run-job в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Operates under
retriever:routing. If the user's intent actually fits a different tier — anotherretriever:*skill, a Tier 2 slash, a Tier 3tools.pysubcommand, 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_modeas the default:inlinemeans stay in the current conversationbackgroundmeans 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_modeisbackground
When unsure, inspect run-status --budget-seconds 35 first.
For long unattended runs, use the supervision hints from run-status:
run.supervision.should_schedule_wakeuprun.supervision.wake_interval_secondsrun.supervision.suggested_worker_countrun.supervision.spawn_additional_worker_countrun.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_wakeupis 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
- resume Retriever run
When to stop it:
run.supervision.should_schedule_wakeupis false- the run status is
completed,failed, orcanceled - 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_commandsfor 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:
prepare-run-batch --run-id ... --claimed-by ... --budget-seconds 35 --launch-mode ... [--worker-task-id ...] [--max-batches ...] [--limit ...]
It returns:
- current
runstatus workerhints- a claimed
batchof run items with their execution contexts already loaded
Read worker.next_action:
process_batch: work the returned batchfinalize_ocr: callfinalize-ocr-runfinalize_image_description: callfinalize-image-description-runhandoff: stop this worker cleanly and let a fresh inline step or subagent continuestop: stop the worker loop cleanly
If worker.stop_reason is canceled, exit immediately.
Batch Processing
For each item in batch:
- Read
batch[i].context.execution.task_prompt - Use the provided input payload to perform the capability work in-turn
- Use
batch[i].context.execution.completion_templateas the exact shape for completion - Call
complete-run-item ...orfail-run-item ...
Use these supporting commands during the loop:
heartbeat-run-items --run-id ... --claimed-by ...between long batchesfinish-run-worker --run-id ... --claimed-by ... --worker-status ...before the worker exits
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
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), без исполняемых скриптов.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…