figure
它能做什么
这个技能让 AI 智能体制作一幅展示流程的动画图,例如请求如何在系统中流转。适合希望在 README、拉取请求或博客文章中放入清晰图示的开发者。
适用场景
- ✓当代码改动或新功能需要一张图来说明其工作方式的时候。
- ✓当你想展示一个请求或后台任务如何流转的时候。
- ✓当你需要一个能跟随阅读者浅色或深色主题的动画图示的时候。
技能链接
https://github.com/vectorize-io/hindsight/blob/main/.claude/skills/figure/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我做一个动画示意图,展示用户请求如何在我的应用中流转,用于 README。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体把示意图写成描述方框、箭头和标签的 JSON,然后由一个命令将其渲染为单个 SVG 文件。该文件可在任何显示 Markdown 的地方播放,无需脚本或上传。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Figure
One animated SVG, no scripts, no upload: it renders and plays anywhere markdown does — GitHub README, PR and issue comments, blog posts, Notion. Sharp at any size, and it follows the reader's light or dark theme.
Figures are Giotto diagrams: one JSON document, the same
format the docs site's interactive figures use (hindsight-docs/figures/*.json).
You write the diagram JSON — never SVG. One command renders it. No build, no browser.
1. Write the diagram
Do not save it as a file in the repo. It is an input, not a deliverable — pipe it in (step 2), and the rendered SVG keeps a copy of it for you.
{
"title": "Retain",
"speed": 2000,
"elements": [
{ "id": "root", "type": "group", "children": ["agent", "api", "bank"], "layout": { "direction": "row", "gap": 48 } },
{ "id": "agent", "type": "rectangle", "content": [{ "type": "title", "text": "Your AI Agent" }] },
{ "id": "api", "type": "group", "label": { "title": "Hindsight API" }, "children": ["retain"], "layout": { "direction": "column", "gap": 24 } },
{ "id": "retain", "type": "rectangle", "content": [{ "type": "title", "text": "Retain" }, { "type": "subtitle", "text": "LLM extraction" }] },
{ "id": "bank", "type": "group", "label": { "title": "Memory Bank" }, "children": ["facts", "obs"], "layout": { "direction": "column", "gap": 28 } },
{ "id": "facts", "type": "cylinder", "content": [{ "type": "title", "text": "Facts" }, { "type": "subtitle", "text": "world · experience" }] },
{ "id": "obs", "type": "cylinder", "content": [{ "type": "title", "text": "Observations" }] },
{ "id": "call", "type": "arrow", "route": "curved", "start": { "id": "agent" }, "end": { "id": "retain" }, "label": { "text": "retain()" } },
{ "id": "store", "type": "arrow", "route": "curved", "start": { "id": "retain" }, "end": { "id": "facts" }, "label": { "text": "extract" } },
{ "id": "consolidate", "type": "arrow", "route": "curved", "start": { "id": "facts" }, "end": { "id": "obs" }, "label": { "text": "consolidate" }, "quiet": true }
],
"scenes": [
{
"label": "retain()",
"beats": [
{ "edges": { "edge": "call", "data": "“Alice joined Google in March”" }, "say": "Your agent sends what happened." },
{
"edges": "store",
"show": { "facts": [{ "tag": "world", "tone": "blue", "text": "Alice joined Google", "meta": "Mar 2026", "mark": "new" }] },
"say": "An LLM pulls out the facts."
},
{
"edges": "consolidate",
"ms": 2600,
"show": { "obs": [{ "text": "Alice works at Google", "meta": "2 sources" }] },
"say": "The worker merges them into one belief."
}
]
}
]
}
Elements — a flat list. A group lists its children by id and lays them out
(layout: { direction: "row" | "column", gap, align }); a label: { title } draws a frame around
it. Children line up at the top/left unless the layout says otherwise: use align: "center" in rows
and align: "stretch" in columns (equal-width boxes), as the docs figures do. rectangle boxes are the things that do something; cylinder is data at rest; diamond is a
decision. A box's content is blocks: title, subtitle, text, list, chips, code. Give every
element a stable id.
Arrows — { type: "arrow", start: { id }, end: { id }, label?: { text }, route: "curved", around?, quiet? };
the ends name a box or a group. around: "above" | "below" arcs over the boxes in between;
quiet: true draws the arrow only while a scene uses it (for long arrows that would cut across).
Scenes and beats — each scene is one story the figure tells; the SVG plays them in a loop. A beat
is one moment: edges (an arrow id, { edge, back, data } for a reverse hop or a data chip, or an
array to run several at once), say (the caption), show (fills the card inside a box until the
scene ends), light (highlight boxes for that beat; on the scene, for the whole scene), ms (how
long the beat lasts).
Card rows — { tag?, tone?, text, meta?, mark?, mono? }. tone is blue | purple | green | orange | red | gray. Use tag for the kind of thing (world, user, page), meta for a detail,
and mark for what happened to it (new, ✓, cited, ↻). **bold** and `code` work in
any text.
The full format is the FORMAT text in node_modules/giotto/lib/edit.js. The 13 fig
常见问题
我需要自己写 SVG 代码吗?
不需要。你用 JSON 描述示意图,渲染命令会生成 SVG。
这张图可以在哪里显示?
该技能说明,它可以在 GitHub README、拉取请求和 issue 评论、博客文章以及 Notion 中播放。
渲染需要浏览器吗?
不需要。该技能说明,渲染示意图无需构建步骤或浏览器。
详情
作者的原始描述
Draw an animated figure (boxes, arrows, moving data) as one self-contained SVG for a GitHub README, PR, issue or blog post. Use when a change or an explanation needs a diagram — how a request flows, what a background job does, what a feature changed — or when the user asks for a diagram, figure, animation or "show it visually". The docs site's own pages use the interactive player instead (see step 4).
repo: vectorize-io/hindsight
热度
- GitHub 星标
- 58k
- 排名
- #3258
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
Hindsight Memory
58k教你的智能体把长期记忆保存并查找在 Hindsight 应用中,而不是使用它自带的记忆工具。
hindsight-memory
58k帮你的智能体在回答前回忆相关的过往背景,在学到持久事实时将其保存,并基于记忆进行推理。
hindsight-coding-agent
58k介绍用于编程会话的 Hindsight 记忆插件,包括每个仓库的记忆库、自动会话背景,以及如何更改其设置。
hindsight-recall
58k帮你的智能体在你询问早先工作时,搜索长期记忆中的过往决定、项目背景和偏好。