算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
lov-algo-viz-creator【设计与创意】为算法、数据结构或信息流程生成「逐步演示」的可交互可视化。输入:算法名或 概念描述(如“把 KMP 做成可视化”)。输出:自包含单文件 HTML,支持播放/暂停/ 逐帧/变速与键盘演示,每步附中文解说与伪代码高亮。 触发语:做成可视化 / 算法图解 / 逐步演示 / step-by-step visualization / interactive algorithm demo。
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: lov-algo-viz-creator description: > 为算法、数据结构或信息流程生成「逐步演示」的可交互可视化。输入:算法名或 概念描述(如“把 KMP 做成可视化”)。输出:自包含单文件 HTML,支持播放/暂停/ 逐帧/变速与键盘演示,每步附中文解说与伪代码高亮。 触发语:做成可视化 / 算法图解 / 逐步演示 / step-by-step visualization / interactive algorithm demo。 license: MIT depends_on:
把一个算法、数据结构或信息流程,变成一份可直接双击打开、逐步播放的交互图解 (单文件 HTML)。每一帧对应一次可见的状态变化,配有中文解说、伪代码高亮和 播放控制,适合讲课、汇报与自学演示。
产出的 HTML 不依赖任何外部 CDN 或构建工具,离线可开,双击即演示。
lov-bp-deck、
lov-diagram 或 frontend-design。document-illustrator / baoyu-article-illustrator。TraceDefinition 数据模型写 TS 模块,复用应用的播放器,不使用本 Skill 的
单文件 HTML 产物。Every generated Skill is connected to the shared user-profile/v1 contract in
skill.yaml. Read the shared user, brand, workspace, preferences, and this
Skill's skills.<skill_id> namespace at the start of every run. Keep the source
portable: resolved personal values belong in the shared profile, never here.
When the user directly states a durable preference or brand fact, persist it
through scripts/profile_store.py and report the saved profile path. Put
Skill-specific values under records.<field>; use brand.<field> or
user.<field> for shared values. Do not persist inferred secrets or credentials.
See references/user-profile.md for the complete contract.
Read references/skill-composition.md before deciding whether to invoke or
extend any adjacent capability. The record distinguishes optional upstream and
downstream handoffs from embedded Kit modules. Do not silently depend on a
sibling Skill that is not shipped with this source.
You MUST follow these steps in order.
SKILL_DIR if the environment provides it.scripts/validate_viz.py(帧模型校验)scripts/build_viz.py(模型 → HTML)assets/template.html(演示引擎模板)references/step-model.md(帧模型规范与示例)When running scripts manually:
export SKILL_DIR="/path/to/lov-algo-viz-creator"
Resolve context.profile on every invocation. The precedence is current request,
project context, Skill-specific profile records, shared preferences, shared
brand/user profile, then safe defaults. A direct user statement about a durable
preference or brand fact should be saved with scripts/profile_store.py record
using --confirm, followed by a concise saved-path report.
./output/(按输出规范),用户指定路径则尊重用户。references/skill-composition.md.这是本 Skill 的核心。先把算法“翻译”成帧序列,再交给引擎渲染。
逐帧建模的六个原则(详见 references/step-model.md):
active 是当前正在操作的元素(每帧 1–3 个,聚焦);
settled 是已经确定/完成/访问过的元素(单调累积,不再变回)。观众靠这两组
颜色读进度。values:DP 表填的数值、最短距离、计数等“中间结果”放进
values(node 布局是 {节点id: 显示文本},bars 布局是数组快照)。note 用一句中文讲清楚“这一步在做什么 + 为什么”,
引用具体数值/字符(“B 与 D 匹配,继续比较下一位”),不堆术语、不说空话。code 写 4–8 行人类语言伪代码,codeLine 指向当前逻辑行,
让观众知道“此刻对应哪一步”。选择布局:
sequence:数组/序列/字符串(KMP、二分、斐波那契、Z 数组)network:图/树/流程/依赖(BFS、Dijkstra、拓扑、Trie、架构流程)matrix:二维 DP 表 / 距离矩阵(背包、LCS、Floyd–Warshall)bars:数值排序/比较类(冒泡、快速、堆排序)按以下顺序产出:
model.json(完整 schema 与示例见 references/step-model.md),
直接在算法上真实跑一遍,逐帧记录 active/settled/values,不要凭想象编帧。scripts/validate_viz.py model.json 校验(error 必须清零,warning 按
--strict 收敛)。scripts/build_viz.py model.json -o output/xxx.html 生成独立 HTML。validate_viz.py error=0。build_viz.py 有明确输出路径,双击可打开。python3(运行 validate_viz.py / build_viz.py)。