SuperAPI AI Directory

paper-explain-figures

Writing & research

View repository

Updated 10-15 22:14

About this skill

paper-explain-figures

For one or more paper Figures provided by the user:

  • Convert the Figure to .jpg(for visual understanding; if conversion fails, keep the original image and explicitly state so)
  • Automatically retrieve near the Figure the "source code that generated this figure" (it may not be found; if not found, then NULL)
  • Synthesize the three types of information to output a highly readable report:
    • Understanding 1: Visual understanding (read the figure directly from the jpg/original image)
    • Understanding 2: Source code understanding (code takes precedence; the code determines the true meaning of the figure)
    • Understanding 3: User manual interpretation (helps infer the user's focus; may be incorrect)

Input

The user will input one or more pieces of information:

  • One or more figure files'absolute paths
  • Optional: manual interpretation of the figure (global or assigned per figure)
  • Optional: the user explicitly provides the absolute path of the source code file (preferentially used as a "candidate entry point")

Process

Input

Provide the necessary input according to the user's request and the configuration file; missing information should be clearly listed and steps relying on that input should stop.

Execution steps

  • For bugs caused by design flaws in this skill, first use bensz-collect-bugs to record them in the standard format to ~/.bensz-skills/bugs/, do not directly modify the skill source code already installed locally on the user's machine; if there is a workaround, record the bug first, then continue completing the task.
  • Only when the user explicitly requests public reporting such as "report bensz skills bugs" should you use the local gh to upload the newly added bug to huangwb8/bensz-bugs; do not pull / clone the entire repository.

File location: xxx Source code: xx.R lines xxx-xxx

Core meaning of the figure

...

Variable definitions

Element Definition
... ...

Interpretation key points

  1. ...
  2. ...

Explanation

...

Scientific value

...


为保证“每张图的解读相互独立”,本 skill 采用 worker 脚本在 shell 中启动独立进程执行:

- `codex exec "..."`(推荐:更容易做本地文件读取 + 视觉理解)
- `claude -p "..."`(可选)

并发上限默认 **3**(可在 `paper-explain-figures/config.yaml` 调整)。

在当前目录运行(推荐,产物会落到当前目录与 `.bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/paper-explain-figures/`):

```bash
python3 paper-explain-figures/scripts/paper_explain_figures.py \
  --fig /abs/path/to/figure1.png \
  --fig /abs/path/to/figure2.pdf \
  --note "你对这些图的关注点/背景解释(可选)"

If the skill has been installed at the system level (the path varies by platform; the following is only an example):

python3 ~/.codex/skills/paper-explain-figures/scripts/paper_explain_figures.py --fig /abs/path/to/figure.png

Common parameters (as needed):

# 启用并行(默认串行,减少 API 限流/封禁风险)
python3 paper-explain-figures/scripts/paper_explain_figures.py --fig /abs/path/to/figure.png --parallel

# 并发上限(默认 3;也可改 config.yaml:defaults.max_parallel)
python3 paper-explain-figures/scripts/paper_explain_figures.py --fig /abs/path/to/figure.png --parallel --max-parallel 3

# 指定 runner(codex/claude/local)
python3 paper-explain-figures/scripts/paper_explain_figures.py --fig /abs/path/to/figure.png --runner codex

⚠️ Security note:--runner shell has been disabled because it cannot provide a strict guarantee that intermediate files will never leak outside ".bensz-api/task-{yyyymmdd-hhmm}-{short description}/paper-explain-figures".

Execute in the trigger directory:

rm -rf .bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/paper-explain-figures

Output

  • Final report: by default output to the current working directory paper-explain-figures_report.md
  • All intermediate files and logs: stored in .bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/paper-explain-figures/(saved in separate directories by run/job)

Each figure is separated in the same Markdown file by ## -level headings:

# Figures

### 输出管理

本 Skill 的新任务中间文件统一写入 `./.bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/{skill名}/input|output|log/`。同一任务复用一个任务根目录;多 Skill 协作才创建 `shared/`。正式交付物不写入该目录,历史隐藏目录只允许显式兼容读取、迁移或清理。

### 校验

完成后执行 Skill 已有的静态检查、脚本验证或人工复核,并记录通过标准。

### 失败与恢复

保留错误证据和已完成产物;仅在输入、环境或外部依赖恢复后从最近的失败步骤重试。

## 约束

- **目录管理硬约束**:所有中间产物必须托管在当前工作目录下的隐藏目录 **`.bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/paper-explain-figures/`**(该目录名在脚本中硬编码;不允许改到别处)。
- **运行时隔离硬约束**:runner / 图片转换器产生的 HOME、TMP、XDG cache/state/config 等运行时辅助文件,也必须重定向并收纳到 `.bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/paper-explain-figures/` 内。
- **只读约束**:全程只读访问用户的 Figure 与源代码文件;严禁修改它们(包括格式化/重写/覆盖)。

### 公共硬约束

- 任务需要落盘时,使用唯一的 `./.bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/` 根目录;共享材料放入 `shared/`,Skill 专属材料放入该 Skill 的 `input/`、`output/`、`log/`。
- 正式交付物、源代码和正式计划按项目约定保存,不写入任务工作区;未经授权不覆盖、删除、迁移或远程写入。
- 项目维护变更检查 BAC 可用性并记录需求、AI 产出、工具结果、文件改动和验证摘要;BAC 只做过程审计,不替代署名、责任或合规判断。
- 不记录 API Key、访问令牌、密码、Cookie、环境/凭据文件、私有 Prompt、身份信息、本地用户名、主机名或不必要的大体积原始数据。
- 文件路径必须规范化并限制在授权项目范围内;外部 URL、子进程和网络访问遵循最小权限,防止路径遍历、SSRF 和命令注入。
- Skill 版本唯一记录在自身 `config.yaml:skill_info.version`;公开 API、协议、目录或配置变更同步文档与 `CHANGELOG.md`。
- 仅将 Skill 或 Bensz 基础设施本身的设计缺陷交给 `bensz-collect-bugs`;先脱敏写入 `~/.bensz-skills/bugs/`,当前任务不中断,只有用户明确要求才公开上报,禁止直接修改用户已安装的 Skill 源码。
<!-- End of canonical common constraints. -->

### Skill 专属约束

不得超出本 Skill description 和上方流程所声明的范围;不将未验证的信息伪装成确定结论。