Index of every page on this site: llms.txt
All skills
victory-hugo avatar

/bioinformatics-log-resume

@0b19307
Run it yourself

为生物信息学多样本批处理脚本设计、实现或审查基于日志的断点续跑。用于 bash/shell 主控脚本需要支持中断后重跑、并行写日志防竞争、按样本写入 success.log 和 fail.log、并且明确禁止通过扫描输出目录或输出文件判断完成状态的场景。适用于给现有流水线补加断点续跑、重构样本循环、或检查实现是否只依赖日志判定完成。

  • 3 files
  • 6.5 KB
  • Updated 8 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/victory-hugo/s2-agent-skill/bioinformatics-log-resume

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈115 tokens for metadata: the name and description. ≈761 when used: this file. ≈784 more on demand in 2 files.

Description uses 2.4% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈195 characters, or 2.4%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Bioinformatics Log Resume

概述

使用这个 skill 为生物信息学多样本批处理脚本添加或审查断点续跑。该 skill 采用固定的日志驱动协议,只允许通过 log/ 下的日志文件判断样本是否已完成,禁止通过扫描输出目录、结果文件或中间文件来推断完成状态。

固定协议

始终遵循以下规则:

  • 在项目脚本启动时创建 log/ 目录。
  • 在 log/ 下固定使用 log/.resume.lock、log/success.log、log/fail.log。
  • 每个样本执行结束后立刻写日志,不能批量补写。
  • 只从 success.log 第一列的样本 ID 判断是否完成。
  • fail.log 只记录失败历史,不作为下次运行时的跳过依据。
  • 如果样本同时出现在 success.log 和 fail.log,以成功为准,下次运行跳过。
  • 并行场景必须对日志写入加锁,避免多个进程竞争写文件。
  • 明确禁止扫盘,不能通过输出目录、结果文件、flag 文件或文件大小判断样本是否已完成。

实施流程

按以下顺序组织实现:

  1. 识别样本循环的位置,以及样本 ID 的唯一来源。
  2. 确定项目根目录,设置 LOG_DIR、LOCK_FILE、SUCCESS_LOG、FAIL_LOG。
  3. 在主控脚本开始阶段执行 mkdir -p "$LOG_DIR" 并初始化日志文件。
  4. 在正式处理样本前,从 success.log 第一列读取已完成样本集合。
  5. 每次准备处理样本时,只检查该样本是否已在已完成集合中;如果在,则跳过。
  6. 样本成功完成后,在锁保护下向 success.log 追加 sample_id<TAB>timestamp。
  7. 样本失败后,在锁保护下向 fail.log 追加 sample_id。
  8. 审查并删除任何基于输出文件存在性、输出目录扫描或结果文件完整性的完成判定逻辑。

Shell 实现要求

  • 优先面向 bash 或兼容 shell 的主控脚本。
  • 默认使用 flock 操作 log/.resume.lock。
  • 成功日志使用 sample_id<TAB>timestamp 格式,时间戳推荐 date -Iseconds。
  • 失败日志默认只写样本 ID;如果需要附加错误信息,应另建独立诊断日志,不要改变 fail.log 作为失败样本列表的职责。
  • 失败样本默认在下次运行时继续重试,只要其样本 ID 不在 success.log 中。
  • 默认采用 continue-on-error 的逐样本处理方式,不因单一样本失败而直接让整个批处理退出;只有用户明确要求 fail-fast 时才改变该策略。

审查清单

交付前逐项核查:

  • 是否只依赖 success.log 判断完成状态。
  • 是否完全禁止扫盘判断完成。
  • 是否每个样本结束后立刻写日志。
  • 是否所有日志追加都受锁保护。
  • 是否失败样本默认会在后续运行中重试。
  • 是否存在样本 ID 重复匹配、模糊匹配或部分匹配问题。
  • 是否把日志目录错误地放在 output/ 内。

参考资料

  • 日志协议:读取 references/log-contract.md
  • Shell 模式与反例:读取 references/shell-patterns.md

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 0b19307. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 8 months ago

README badge

README badge for victory-hugo/s2-agent-skill/bioinformatics-log-resume