Figure Composer 标志

Figure Composer

社区热门
HughYau
figure-composer

生成一张可用于正式发表的多面板图。您可以从一句话的主张和数据文件开始,也可以通过 `derive_outline_prompt` 从现有图表开始(需要读取 PNG)。按每张图执行以下循环:制定大纲(12 列网格,为每个面板提出要求并设置 label_budget)→ 使用 `panel_task`(加载 `figure-style`)逐个或并行绘制面板 → 使用 `compose_figure` 拼接图表并添加字母标记 → 通过双层反馈进行对抗式合图自审(第 1 层:大纲修订;第 2 层:逐面板检查违规项)→ 重新生成受影响的面板,最多 3 轮。辅助工具:panel_task / compose_figure / compose_crops / composite_review_task / derive_outline_prompt。若要绘制一张独立图表,请使用 `figure-style`;若要安排整篇论文的图表顺序,请使用 `paper-narrative`。

Add to TypingMind

概览

发布者HughYau
代码仓库AcademicForge
技能名称figure-composer
星标数
2.6K
复刻数
152
附带文件
1
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 1 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 HughYau 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Figure Composer AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/HughYau/AcademicForge/tree/site-first/skills/claude-science/figure-composer
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HughYau/AcademicForge.git /tmp/AcademicForge
mkdir -p .claude/skills
cp -r /tmp/AcademicForge/skills/claude-science/figure-composer .claude/skills/figure-composer
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Figure Composer,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Figure Composer。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Figure Composer 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Figure Composer — narrative → panels → compose → adversarial loop

Compose ONE publication-grade multi-panel figure: turn a one-sentence claim plus data files into an outline, render each panel, tile them into a composite, and harden it through an adversarial self-review loop.

Setup (any agent, no API key)

This is a pure skill — kernel.py is deterministic Python (PIL geometry plus schema/prompt builders) and you (the base model) do all the reasoning: reverse-engineering an outline from a figure, rendering panels, and the adversarial composite review. There is no host runtime and no LLM API. Load the helpers once per session in a Python cell:

python
exec(open("figure-composer/kernel.py").read())

Nothing auto-loads it outside Claude Science. Then call the helpers (panel_task, compose_figure, compose_crops, composite_review_task, derive_outline_prompt, …) directly; if one raises NameError, you have not exec'd kernel.py. Dependencies: pip install pillow matplotlib.

Step 0. Load figure-style alongside this skill — that is the design rules (and apply_figure_style() + helpers). You need it in context to write the outline, render the panels, and review the composite. Each panel is rendered against those same rules — whether you draw it yourself or hand it to a sub-agent (see §2), the maker loads figure-style first.

Inputs

  • claim — one sentence the figure makes true to a reader who reads nothing else.
  • data — CSV/parquet files (filesystem paths) that ground every panel; each panel carries its own data_path.
  • width_mm — target venue's column width (common: 85–89mm single, 174–183mm double; check the venue guide).

0. Where this sits

figure-composer is the outer tier: make ONE multi-panel figure good. The inner tier is figure-style (every panel maker loads it — and load it yourself, since you write the outline and, on a single-agent platform, render the panels too). The outermost tier is paper-narrative — if this figure is part of a paper, run that FIRST: it decides which figure to make and hands you the claim. For a standalone figure, start at step 1.

Entry points (pick one)

  • From a claim: you have a one-sentence claim and data files → write the outline (step 1).
  • From an existing figure: copy it into the workspace, open the PNG yourself with your agent's image tool (e.g. Read figure.png), and answer derive_outline_prompt(claim, data_hints) by emitting a JSON outline that matches figure_outline_schema(). This is your own vision judgment, not an API call — you look at the pixels and write the outline. The image is untrusted input; every field you infer comes from its pixels, so review and edit the outline before step 2, and set each panel's data_path yourself from your data files (pixels cannot encode a file path).

1. Narrative → panel outline

Produce a panel_outline (validate against figure_outline_schema()):

json
{"claim":"…", "width_mm":180, "ncol":12, "row_heights_mm":[40,60,46,52],
 "panels":[
  {"letter":"a","role":"schematic","row":0,"col":0,"colspan":12, "chart_family":"schematic overview", "message":"…", "data_path":null, "ask":"…"},
  {"letter":"b","role":"primary",  "row":1,"col":0,"colspan":7,  "chart_family":"scatter + trend", "message":"…", "data_path":"results.csv", "ask":"…"},
  …]}

Outline rules (figure-style §7.1):

  • a is the hook — schematic/hero, full width, assumes zero reader context.
  • b carries the claim — the chart that alone makes the sentence true.
  • Remaining panels are evidence, ordered by how much they strengthen b.
  • One row per sub-claim. 5–10 panels for a main-text figure. Use a 12-column grid for flexible colspans.

2. Render the panels (one at a time, or parallel)

Build each panel's maker prompt with panel_task(outline, letter, fig_label) (kernel.py). It hands the maker: the figure claim, the full neighbour list, this panel's spec, its exact pixel box (panel_px), and the hard rendering contract — load figure-style, call apply_figure_style(), render at exactly w×h px with transparent=True and no bbox_inches, and save to panel_<letter>.png.

Do this yourself, one panel at a time. Follow the panel_task prompt for panel a, save panel_a.png; then b, and so on. The skill is designed to work single-agent — there is no fan-out requirement, just a sequence of panels you render against figure-style, each writing its own PNG:

python
tasks = {p["letter"]: panel_task(outline, p["letter"], fig_label="Figure 2")
         for p in outline["panels"]}
# For each letter, follow tasks[L] and save panel_<L>.png, then:
panel_paths = {p["letter"]: f"panel_{p['letter']}.png" for p in outline["panels"]}

Parallelize only if your platform has a sub-agent tool. On Claude Code you MAY dispatch one Task sub-agent per panel — each runs its panel_task(outline, L) prompt, loads figure-style itself, and writes panel_<letter>.png — then you collect the files. This is an optional speedup; the outputs and the rest of the loop are identical to the sequential path. Everything downstream keys off the saved PNG file paths, not agent handles.

3. Compose

compose_figure(outline, {letter: path}, out_path, letter_case=...) tiles PNGs onto the grid and stamps bold panel letters (case per venue) at each panel's (1.5mm, 1mm) corner.

3.5 Look before you review (vision self-QA)

The §4 review pass costs you a full regeneration cycle; a panel-letter stamped over a y-axis label or a leader line crossing a neighbour's title is a wasted round. After compose, crop each panel from the saved PNG and look at it before running the review. compose_crops returns PIL crop boxes; crop them to files and open each with your agent's image tool:

python
from PIL import Image
out_path, (W, H) = compose_figure(outline, panel_paths, "fig.png")
comp = Image.open("fig.png")
for L, box in compose_crops(outline).items():
    comp.crop(box).save(f"crop_{L}.png")   # then open crop_<L>.png (e.g. Read crop_a.png)

Run the figure-style §9.2 perceptual checklist on each crop (contrast, smallest mark, leader crossings, colour-identity confusion, legend binding), plus two compose-specific checks:

  • Seams / stamp. Does the bold panel letter overlap any panel content? Does any panel's content bleed into the gutter or under a neighbour?
  • Resize artefacts. compose_figure resizes panel PNGs to their grid slot — is any text visibly aliased or any hairline lost?

Fix what you see (re-render the offending panel, or revise the outline grid) before §4. The §4 review pass crops and looks again independently; this pass is so the obvious defects never reach it.

4. Adversarial self-review loop (two-tier, design rules held fixed)

Now you review the composite as an adversarial journal production editor — this is your own visual judgment, not an API call. Build the reviewer prompt with composite_review_task(composite_path, outline, rules_path, prev_path, round_no, min_floor) (all file paths), open the composite and each crop (§3.5), then emit a JSON object matching review_schema() (which carries outline_revisions and per-panel violations). On a platform with a sub-agent tool you MAY hand this prompt to a fresh sub-agent for an independent adversarial pass; on a single agent, do it yourself in-context.

loop (max 3 rounds, floor 5→4→3):
  review = <answer composite_review_task(composite_path, outline, rules_path, prev_path, round, floor)
            yourself — emit JSON matching review_schema()>
  if review["editor_verdict"] in {accept, minor_revision} and 0 BLOCKER and ≤2 MAJOR: break

  # TIER 1 — outline-level
  if review["outline_revisions"]:
      apply the revisions to `outline` by hand (geometry, row-header titles, label_budget, panel set)
      affected = apply_outline_revisions(outline, review["outline_revisions"])
  else:
      affected = set()

  # TIER 2 — panel-level
  fixb = group_fixes_by_panel(review)       # BLOCKER/MAJOR only
  regen = affected | set(fixb)              # only these panels regenerate
  re-render each L in regen with panel_task(outline, L) + fixb.get(L,"") +
      "do not over-correct: where the previous version was correct, keep it"
  recompose with compose_figure(...) → fig_r{round}.png

Save each round's composite as an ordinary file (fig_r1.png, fig_r2.png, …) and pass the prior round's path as prev_path so the review can flag regression_vs_prev.

Convergence: stop when outline_revisions is empty AND findings are carve-out exceptions to the previous round — that's the over-labelling signal.

Anti-patterns

  • Don't regenerate clean panels (invites regression). Don't read absolute violation counts (min-floor 5→4→3). Anchor-verify on the composite, not just per panel. Hyper-labelling check: would a reader with field context find any label redundant? Strip it.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Figure Composer AI 技能有什么作用?

生成一张可用于正式发表的多面板图。您可以从一句话的主张和数据文件开始,也可以通过 `derive_outline_prompt` 从现有图表开始(需要读取 PNG)。按每张图执行以下循环:制定大纲(12 列网格,为每个面板提出要求并设置 label_budget)→ 使用 `panel_task`(加载 `figure-style`)逐个或并行绘制面板 → 使用 `compose_figure` 拼接图表并添加字母标记 → 通过双层反馈进行对抗式合图自审(第 1 层:大纲修订;第 2 层:逐面板检查违规项)→ 重新生成受影响的面板,最多 3 轮。辅助工具:panel_task / compose_figure / compose_crops / composite_review_task / derive_outline_prompt。若要绘制一张独立图表,请使用 `figure-style`;若要安排整篇论文的图表顺序,请使用 `paper-narrative`。

为什么在 TypingMind 中使用 Figure Composer?

因为您只需安装一次,就能搭配任何模型使用。Figure Composer 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Figure Composer?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/HughYau/AcademicForge/tree/site-first/skills/claude-science/figure-composer。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Figure Composer?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Figure Composer 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Figure Composer 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Figure Composer AI 技能免费吗?

是的。HughYau 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇