用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Morrison-Lab/ai-config --skill wait-for-results命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | wait-for-results |
| description | Wait for pipeline/CI results. |
| user-invocable | true |
| allowed-tools | ["Bash","Skill","Read","Write","Edit"] |
Block on one or more long-running jobs until they finish, then run the follow-up step the work needs (combine, build, deploy, report). Because the wait may outlive the session, this skill leads with a handoff so state is never lost.
Invoke the handoff skill immediately, before waiting. This snapshots the
branch/HEAD/unpushed commits/job IDs/pick-up steps into a project memory and
posts a paused-state note on any active PR/MR. The point: if the session ends
or context resets while you're waiting, the next session resumes cleanly with
zero lost state.
Refresh the handoff (re-run it) if the situation materially changes during the wait — a job fails, the plan changes, or new commits land.
Pin down, concretely:
squeue empty, expected output-file count reached,
gh run watch exits, a sentinel file appears.combine-slurm-results.R), and
what counts as failure (missing chunks, non-zero exit, error in logs).Pick the waiting mechanism by whether the wait must survive the session ending or a context reset:
ScheduleWakeup (primary for cross-session survival). Schedule a
re-invocation with a cadence matched to the job and a long fallback
heartbeat. This is the only mechanism that wakes the model back up after
the current session has ended, so prefer it whenever the wait may outlive the
session.Either way, match the cadence to how fast the state actually changes; don't burn cycles polling every few seconds for a multi-hour job.
# Same-session example: wait for a SLURM array, then verify chunk count
for i in $(seq 1 240); do
sleep 60
if [ -z "$(squeue -u "$USER" --name=<job-name> 2>/dev/null | tail -n +2)" ]; then
echo "JOBS DONE (check $i); outputs: $(ls <output-glob> 2>/dev/null | wc -l)"
break
fi
done
# Fallback: the loop has a silent 4-hour ceiling (240 × 60s). If it exhausted
# without breaking, the jobs are still running — make that observable.
if [ "$i" -eq 240 ] && [ -n "$(squeue -u "$USER" --name=<job-name> 2>/dev/null | tail -n +2)" ]; then
echo "TIMEOUT: jobs still running after 240 checks — run a fresh handoff and check manually."
fi
logs/, clean exit. If the jobs failed or came up short,
stop and report rather than running the follow-up on bad inputs.handoff — run first (Step 1) and refreshed at the end; this skill includes
it so the wait is crash-safe.memories/preferences.md (the "always leave handoff notes proactively"
bullet) — the policy that makes Step 1 mandatory.claim-pr — the paused note posted via handoff lives inside an existing
claim.