/edulab:edu-math-bookfrom edulab
Transforms any high school math problem into an interactive 'open workbook' webpage with left-page problem statement, right-page pencil-sketch graphics, animated step-by-step reasoning, and parameter sliders. Supports solid geometry, plane graphs, and formula-only problems.
Ships in edulab. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
一个 HTML(默认单文件;开场开启时同目录附带 girl.mov / girl.webm / cmbg.mp3 / tex/textures.js)。
壳(书桌、书本、道具、预测纸片、dock、钢笔手写、镜头、可选开场)全部在 template/ 里,每道题只写一个 lesson.js。
python3 + sympy:核对答案(python3 -c "import sympy")。node + playwright / playwright-core:scripts/check.mjs 截图自检。脚本会依次在 cwd、本技能目录、兄弟技能
edu-math-video/lesson 里找。pip install / npm install。references/renderers.md):| 题型 | renderer |
|---|---|
| 立体几何(棱柱、棱锥、正方体、旋转体、截面、线面角/二面角/距离/体积) | solid |
| 函数与导数、三角函数图像、解析几何/圆锥曲线、平面几何、向量(平面)、线性规划、统计图 | plane |
| 数列、不等式证明、排列组合与概率计算、复数、二项式、纯代数推导 | none |
写一个临时脚本(放 cwd 或 /tmp)算出:最终答案、每一步要写的中间量、图形需要的坐标与关键点。
预测题的 4 个选项里要有 1 个正确答案和 3 个"典型错误"(漏条件、端点取错、公式记反…)。
lesson.js 里只放结果和可视化用的数值函数(model(a)、曲线 f(x,a)),并在文件头注释写一句"sympy 已核:…"。
references/lesson-schema.md;教学设计(关键句、推理链、预测题、配色)见 references/pedagogy.md。| 范例 | 演示什么 |
|---|---|
examples/solid_prism.js | 直三棱柱:中位线 → 线面平行;滑块改边长让线面角 = 45°;线面距离 |
examples/solid_pyramid.js | 三棱锥:二面角定高求体积;带教室开场(intro.board 黑板文字) |
examples/plane_function.js | 三次函数单调性/极值/零点个数;导函数虚线、增减段着色、区域、滑块平移 |
examples/none_sequence.js | 数列构造等比求通项 + 分组求和;右页公式板,KaTeX 推理链 |
$AB$ 是几何符号(斜体,草稿纸上可悬停联动图形,A1 自动变 A₁);\( … \) 是 KaTeX 公式。
含 KaTeX 的字符串用 String.raw\…`` 写,免得反斜杠被吃掉。📍 成品写到用户当前工作目录(除非用户指定),不要写进技能目录。
python3 <skill>/scripts/generate.py lesson.js out/index.html # 开场跟随 lesson 的 intro 字段(默认关)
python3 <skill>/scripts/generate.py lesson.js out/index.html --intro # 强制带教室开场(会拷素材到 out/)
python3 <skill>/scripts/generate.py lesson.js out/index.html --no-intro
开场版建议用一个独立子目录输出(它会往 html 同目录拷 4 个素材文件)。
引擎已做了防抖(面可见性滞回、轮廓精确解、未变化帧不写 DOM、渲染异常保留上一帧),但下面这些只能靠 lesson 自己守:
model(a) 必须是纯函数:同一个 a 永远返回同样的点;禁止 Math.random()、Date、performance.now()、
读写外部可变状态。随机出题在写 lesson 之前定好数,写成常量。model 里按阈值切换分支(a > 1.5 ? … : …)、不要在滑块范围内出现
除零 / Math.sqrt(负数) / tan(90°);param.min/max 要收在几何体存在的范围内。model 要轻:每帧会被两张图各调一次。常量(如 SQ3、预解出来的系数)放在 model 外面;
不要在里面做迭代求解、循环采样。extraEdges 补棱。spec.view 不要让某个侧面正好与视线平行(棱会在实线/虚线之间来回跳);
check.mjs 报 [flicker] 时把该步 view 转 10–20°。read/show、anim 也必须是纯函数;anim 用 pingpong 之类的连续函数,不要跳变。labelDir,否则标签方向不稳定。node <skill>/scripts/check.mjs out/index.html # 截图到 out/_check/,打印 problems
problems 必须为空,逐条修到没有为止:
[lesson] …:静态检查——缺字段、model() 不确定/有跳变/返回非有限值/太慢、面不共面/退化/不凸/不闭合、
引用了不存在的点、KaTeX 语法错误、字符串里出现控制字符(String.raw 漏写)、spec.a 超出滑块范围。[flicker] #demoP-S …:截图后让镜头视差晃动一圈,统计棱的实线/虚线翻转;有翻转就改该步 spec.view。[render] … / pageerror:渲染时抛异常(滑块步骤会把参数从 min 扫到 max 一遍)。[slow] …:帧率过低(fps 字段可看每一步帧率)。01_home.png(左页是否溢出、图形是否清楚)、02_flap.png(掀开的答案)、pN_sM.png(每一步:
图形高亮是否对准、标签是否互相压住、草稿纸是否写得下、立起来的图是否出画)。有问题改 lesson.js 重新生成。
常见调整:labelDir 挪标签、spec.view 换角度、figure.scale 缩放、plane.view 改坐标范围、推理链拆成两步。_check/ 是自检截图,交付时可以删掉。告诉用户文件路径、怎么打开(直接双击;开场版需要和素材文件放在一起),并简述每一问的演示步骤。
深链:index.html#demo2-3 直接打开第 2 问第 3 步。
左页:悬停设问 → 右页图形预览该问;点设问/“开始演示”进入演示。先选一个预测选项,再掀纸片看答案。 演示:← → 翻步,Esc 收起;草稿纸上彩色字母悬停 → 立体图上对应点/线/面闪烁;有滑块的步骤可拖动参数。 立体图可拖动旋转(书页上的平面图双击复位)。
<script>:不能出现 </script。引擎在独立作用域里,lesson 顶层随便起名,
只是不能重新声明 core.js 提供的辅助名(add sub mul dot mid len dist unit lerp cross centroidOf clamp01 ease pingpong rad deg SQ2 SQ3 SQ5 SQ6 foot footPlane angleAt fix slide travel tex geo fmt COL)——直接用它们即可。assets/intro/girl.webm (opens in a new tab)assets/intro/tex/textures.js (opens in a new tab)examples/none_sequence.js (opens in a new tab)examples/plane_function.js (opens in a new tab)examples/solid_prism.js (opens in a new tab)examples/solid_pyramid.js (opens in a new tab)references/lesson-schema.md (opens in a new tab)references/pedagogy.md (opens in a new tab)references/renderers.md (opens in a new tab)scripts/check.mjs (opens in a new tab)scripts/generate.py (opens in a new tab)template/book.css (opens in a new tab)template/book.html (opens in a new tab)template/core.js (opens in a new tab)template/intro_gl.js (opens in a new tab)template/props.js (opens in a new tab)template/renderers.js (opens in a new tab)template/scene.js (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub wy51ai/edulab --plugin edulab7 skills in this plugin
/edu-analytic-geometry把一道解析几何题解成一个自包含的交互教学网页:左栏题面 + 动态控制台(一个 可变参数滑块驱动实时重算的几何量 + 理论范围/定值指示),中栏 KaTeX 分步解析,右栏 2D Canvas 动态几何画板(椭圆/双曲线/抛物线/圆 + 动直线/动点 + 向量 + 标注 + 画笔涂鸦)。 支持三入口——给定文字题、随机出题、上传题目图片识别后解题。覆盖求标准方程、弦长、向量 数量积范围/定值、三角形面积最值、定点、定值(斜率之积)、轨迹、离心率等题型,统一"设含参 直线 x=my+c + 联立 + 韦达 + 换元/常数分离",并由 sympy 精确计算驱动(答案、坐标、步骤 数值、交互引擎的理论范围同源一致)。其它 agent 也可调用本技能生成此类网页。形态与 edu-solid-geometry 平行,但用 Canvas-2D + KaTeX(非 Three.js)。 触发词:解析几何, 圆锥曲线, 椭圆, 双曲线, 抛物线, 直线与圆锥曲线, 焦点弦, 弦长, 数量积取值范围, 向量数量积, 定点问题, 定值问题, 斜率之积, 三角形面积最值, 轨迹方程, 离心率, 解这道解析几何题, 随机出一道圆锥曲线题, 这张图里的解析几何题; analytic geometry, conic sections, ellipse, hyperbola, parabola, chord length, dot product range, fixed point, fixed value, locus, eccentricity, interactive analytic geometry solution page./edu-chem-reaction把一个化学反应做成自包含的微观 3D 交互演示网页:左/上为 Three.js 可交互分子动画 (拖滑块看断键·成键·原子重组,分步高亮),右为 KaTeX 反应方程 + 分步讲解 + 原子守恒计数 + 可选能量-反应进程曲线。支持三入口——给定文字反应/方程、随机出题、上传图片识别后演示。 覆盖燃烧、化合/分解/置换/复分解、氧化还原(电子转移可视化)、有机机理(酯化等含催化剂·过渡态)。 统一由 sympy 精确驱动:自动配平方程、校验原子守恒与原子映射、推导键的断/成,答案与几何同源一致。 内置两套引擎并自动选择:morph(原子变形,展示原子守恒)与 mechanism(机理关键帧,展示催化/过渡态)。 混合几何:默认自建 VSEPR 分子库,环境装有 RDKit 则可用其由 SMILES 生成构象(绝不自动安装)。 其他 agent 也可调用本技能生成此类网页。形态与 edu-solid-geometry / edu-analytic-geometry 平行, 但用 Three.js + KaTeX 演示分子反应。 触发词:化学反应, 微观演示, 分子动画, 燃烧, 甲烷燃烧, 氢气燃烧, 电解水, 氧化还原, 电子转移, 酯化反应, 反应机理, 断键成键, 原子守恒, 质量守恒, 化学方程式配平, 解这个化学反应, 随机出一个化学反应, 这张图里的化学反应; chemistry reaction, microscopic/molecular animation, combustion, electrolysis, redox electron transfer, esterification mechanism, bond breaking and forming, atom conservation, balance equation, interactive chemistry reaction page./edu-chem-videoUse when asked to make an explainer / walkthrough video (讲解视频、解题视频、例题精讲、微课) for a chemistry problem (化学题: 氧化还原配平 双线桥 电子守恒, 物质的量计算, 化学平衡 三段式 平衡常数 转化率 反应速率, 离子反应, 电化学, 溶液 滴定, 工业流程), from a problem screenshot or text, with Chinese voice-over (GLM-TTS / 智谱 TTS), bilingual zh+en subtitles and chalkboard-style canvas animation built around the chemical equation — delivered as a browser preview (index.html) first, MP4 export only if the user wants it./edu-math-videoUse when asked to make an explainer / walkthrough video (讲解视频、解题视频、板书视频、例题精讲、微课) for a math problem (数学题, geometry, algebra, functions, motion/行程 problems), from a problem screenshot or text, with Chinese voice-over — delivered as a browser preview (HTML) first, MP4 export only if the user wants it. Five visual templates — hand-drawn canvas animation (bilingual zh+en subtitles) or one of four board styles (粉笔黑板 chalk / 几何实验室 lab / 白板 whiteboard / 方格本 notebook, auto-rotating 3D figures) — and a choice of TTS engine (智谱 GLM-TTS, 豆包 Doubao, MiniMax, or free edge-tts / macOS say)./edu-physics-videoUse when asked to make an explainer / walkthrough video (讲解视频、解题视频、例题精讲、微课) for a physics problem (物理题: mechanics/力学 受力分析 牛顿定律 斜面 传送带 板块 平抛 圆周 能量 动量, optics/光学 折射, electromagnetism/电磁 带电粒子), from a problem screenshot or text, with Chinese voice-over (GLM-TTS / 智谱 TTS), bilingual zh+en subtitles and blueprint-style canvas animation where the motion follows the real solution — delivered as a browser preview (index.html) first, MP4 export only if the user wants it./edu-solid-geometry把一道立体几何题解成一个自包含的交互教学网页:左侧 MathJax 分步解析, 右侧 Three.js 可交互 3D 模型(分步高亮 + 镜头切换)。支持三种入口——给定文字题目、 随机出题、上传题目图片识别后解题。覆盖正方体/长方体、棱锥/棱柱、圆柱/圆锥上的线面角、 二面角、异面直线夹角、点到平面距离、体积等题型,统一用"建系+向量法",并由 sympy 精确 计算驱动(答案、3D 坐标、步骤数值同源一致)。其他 agent 也可调用本技能生成此类网页。 触发词:立体几何, 线面角, 二面角, 异面直线, 点到平面距离, 正四棱锥, 正方体求角, 解这道几何题, 随机出一道立体几何题, 这张图里的立体几何题; solid geometry, line-plane angle, dihedral angle, angle between skew lines, distance to plane, interactive geometry solution page.Other plugins' skills for the same job