棱镜闪卡工坊(Prism Card Forge)
把用户的一句话描述或一张参考图,变成一张可编辑的 Blender 卡牌与一个可交互
的 Three.js 网页。忠实保留用户指定的主体、风格、文字排版与用途。本技能只含
文本与代码:生成的素材属于用户的输出项目,绝不写回技能目录。
品牌特征:棱镜(Prism)——一束白光经棱镜色散成七彩,正是全息镭射卡
"不同视角折射出流动虹彩"的视觉本源。每一张卡都是一次"光的锻造":
分层绘制、Blender 立体构建、实时折射着色,让平面的画在手中"活"起来。
本技能参考 Holo Card Studio(MIT 开源项目,见 LICENSE.md),用非 Codex 的新
模型重新实现:出图由本助手内置图像工具完成,不再依赖 Codex 内置画图;图层
流水线额外处理了该工具“无真实 alpha、图面右下带水印”的特性(抠图、去水印、
画布居中)。
什么时候用 & 怎么用(先读这一节)
什么时候选这个技能: 只要你想要"一张会发光、能拖拽转动、带音效的 3D
收藏卡网页"——全息镭射卡、棱镜卡、盲盒抽卡、角色卡/纪念卡/应援卡、带随机
种子玩法的 collectible card——直接开口即可,无需记任何命令:
- 「给我做一张机械猫全息收藏卡,赛博朋克风,标题写 NEON CAT,稀有度 SSR」
- 「按这张参考图 @image 做一张会闪的 3D 收藏卡网页」
- 「随机抽一张全息卡给我,要带宠物和音效,种子用 8888」
也可以指名道姓:「用棱镜闪卡工坊做……」。交付物固定为一个本地预览网址
(可拖拽/翻面/调镭射/听声效)、一张渲染图、可编辑的 card.blend 工程和
一条可复现的种子链接。
首次使用会发生什么: 安装技能本身不装任何东西。首次运行自动准备环境:
Blender(约 380 MB)优先从清华 TUNA 镜像下载,失败自动回落官方源,
支持断点续传——中断/超时后重跑同一条命令即可续传,不必从头下载;
Three.js 依赖由流水线自动 npm install。装好的 Blender 复用于之后的每次
使用,不会重复下载。全程约需几分钟(视网速),其余步骤全自动。
最快路径(agent 会自动执行,列出仅供了解):
python <skill>/scripts/randomize_card.py --project <project> # 掷一张随机卡(可选)
python <skill>/scripts/ensure_blender.py <project> # 先后台跑:装 Blender
python <skill>/scripts/run_pipeline.py --project <project> # 建卡+渲染+组装网页
node <project>/web/server.mjs # 打开 http://127.0.0.1:4173
文档地图(按需查,无需通读):
| 你想做什么 / 遇到什么 | 读哪份 |
|---|---|
| 出图提示词、图层规范、宠物配饰玩法 | references/art-direction.md |
| 改网页视觉 / 布局 | references/design.md |
| 改声音 / 声纹 | references/audio.md |
| 理解随机种子、复现与分享 | references/randomness.md |
| 怎么跑验收测试 | references/verification.md |
| 出错了 | references/troubleshooting.md(先看这里) |
Runtime environment (auto vs. on-demand)
Installing this skill installs nothing by itself. On first use the agent
prepares the environment while running the sequence below:
- Blender (~380 MB) — automatic.
ensure_blender.pyfirst reuses any
system Blender, otherwise downloads an official SHA-256-verified portable
build into<project>/tools— Tsinghua TUNA mirror first with automatic
fallback to download.blender.org, resumable.partdownload and 3 retry
rounds; a timed-out run just needs the same command re-run. Start it in
the background early (step 2). - Node dependencies — mostly automatic. The pipeline itself runs
npm install --ignore-scriptsin<project>/web/(three.js). For the
browser acceptance step the agent must installplaywright-coreonce
(npm install playwright-core --no-audit --no-fund) and drive the system
Edge/Chrome channel — no Chromium download. - Python + Pillow — on-demand. The helper scripts
import PIL; when that
fails the agent creates an isolated venv andpip install pillowonce
(python -m venv <env> && <env>/pip install pillow). Node/npm and a Python
3.10+ interpreter must exist on the host; the agent may install them if
completely absent.
Never claim completion when a prerequisite is missing; prepare it, then retry.
Working sequence
- Establish project and card spec. Create
<project>/withassets/,
copyreferences/config.example.jsonto<project>/card-config.jsonand
fill title / subtitle / technique / tagline / edition / collection /
description from the user's request. Infer harmless missing details and
state them. Readreferences/art-direction.mdfor layered-image guidance —
including the 宠物/配饰/动作/镜头 section that injects variety into the
artwork itself. Do not assume every card is anime or based on the example
images. Then roll the card's identity:
python <skill>/scripts/randomize_card.py --project <project>
(optionally--seed, or pin traits like--pet mecha-cat --rarity SR) —
it writes aseedintocard-config.jsonso every card is unique yet
reproducible; quote the printed seed in the delivery. Users who ask for an
exact look can skip this and setseed/variantby hand (see
references/randomness.md). - Reserve the heavy downloads first. Start Blender install in the
background:python <skill>/scripts/ensure_blender.py <project>. It places
an official SHA-256-verified portable Blender under<project>/tools
(~380 MB on Windows; download runs while artwork is generated). Inspect
errors; the bundled script already carries the User-Agent fix for
download.blender.org403s. - Generate the artwork layers with WorkBuddy's image tool
(text-to-image, 1024×1536; image-to-image for line art):
- background →assets/raw/background.png(opaque; calm top/bottom 15%).
- subject →assets/raw/subject.png(on a plain near-white backdrop).
- Then runpython <skill>/scripts/prepare_layers.py --project <project>
to produce the real-alphaassets/subject.png, the watermark-patched
assets/background.png, and the white-flattenedassets/raw/subject_flat.png.
Inspect the cutout visually and numerically; a painted checkerboard or an
RGB-only file is NOT transparency.
- line art → image-to-image fromassets/raw/subject_flat.pngwith
high input fidelity and an explicit "same pose, position, proportions,
do not move" instruction; save toassets/lineart.png.
- text →python <skill>/scripts/generate_typography.py <project>
(real fonts on transparent PNG; Windows defaults to KaiTi, override via
config.font). - Write metadata and validate. Confirm
card-config.json; run
python <skill>/scripts/validate_assets.py <project>; visually inspect
transparency, registration of the line art against the subject, and that
the typography zones are unobstructed. Regenerate drifting line art before
continuing. - Run the pipeline.
python <skill>/scripts/run_pipeline.py --project <project>
— builds the editable Blender scene (card.blend), renders
renders/hero.png, exportsweb/assets/card.glb, copies the Three.js
template into<project>/web/and runsnpm installthere. Python with
Pillow plus Node/npm must be available. Do not claim completion or repeat a
failing blocker; inspect the log instead. - Serve and verify in a real browser. Keep alive:
node <project>/web/server.mjs(port 4173). Follow
references/verification.md; runscripts/verify_card.mjs,
scripts/verify_workshop.mjsandscripts/verify_audio.mjs
(playwright-core with the system Edge/Chrome channel, no Chromium download)
and prove with pixel differences that dragging, flipping, the foil slider,
重掷, camera presets, pet and accessory cycling actually change the render —
that the same?seed=reproduces an identical card AND soundprint — and
that the sonic engine unlocks on gesture, follows the card back and really
schedules voices. Test around 390px width without overflow. A ready flag
alone does not prove shaders compiled. - Deliver. Working URL (server kept alive), source project, editable
card.blend,renders/hero.png, plus the card's seed link
(…?seed=<n>,复制种子链接一键可得) so the user can re-open or share the
exact same card. State that custom Blender shader graphs are rebuilt with
GLSL in Three.js; glTF does not carry the node graph, so minor render
differences are expected. Publish a website or repo only when asked.
随机工坊(shipped UI, do not strip)
The web template ships a randomness panel driven by a seeded PRNG
(assets/web-template/variants.js): 7 palettes × 4 back compositions × 8
sigils × 4 rarities (weighted, with serial ranges) × 6 procedural pets × 5
accessory sets × 5 camera presets × 4 motions × continuous foil/dust/pattern
parameters — all generated on canvas/shaders, zero image credits. Page
controls: 🎲 重掷一张 (new seed, URL-synced), 复制种子链接 (share/reopen the
exact card), camera chips, motion chips, accessory/pet cyclers, dust slider.
Keyboard/drag/flip behaviour and the holographic shader direction stay
unchanged; window.__holo gains variant/seed/reroll/setCamera/playMotion/
cycleAccessory/cyclePet for automation.
声光剧场(shipped UI, do not strip)
assets/web-template/audio.js is a procedural Web Audio engine: zero audio
files, zero binaries (SkillHub rejects them anyway; never add any). One seed
derives a full soundprint (deriveSoundprint: scale × timbre × rhythm × root
× wetness); the card back composition drives a continuous scene bed
(徽记=圣殿 / 星图=星穹 / 纹章=轮转 / 回路=脉冲 / 静默), the signature chord
announces the card, and all interactions speak: flip, rarity reveal, reroll
scan, camera, motions, accessory, six synthesized pet voices (pitch follows
petScale, pan follows petSide, idle chirps while accompanied), a foil slider
that brightens a shimmer band, and a drag "light-blade" friction gain. Default
silent — audio unlocks on the first user gesture (报头「声场」power button);
the preference is remembered but still needs one gesture next visit. Page
controls: spectrum hairline canvas (#spectrum-canvas), soundprint code,
scene chips, pet-voice cycler, SFX chips, volume. window.__holo.audio
(exposes snapshot()/events/stats) and window.__holo.sound serve automation;
references/audio.md is the design law — keep every sound routed through
_log so acceptance can prove it.
Non-obvious invariants (keep intact)
- All image planes are created in XY with an object rotation of X=90°; keep
that rotation unapplied. Editing the mesh to fake the rotation breaks the
intended local axes. - Default core controls: subject scale 1.25 / depth 0.4, background depth
−0.25, text scale 1 / depth 0. The shared group inputs are缩放and
深度, output视差效果. - UV centering plus normal transforms alone cannot make full view-dependent
parallax: also transform the view direction into the card plane, divide by a
bounded normal component and offset UV by signed depth (the bundled engine
does this; preserve it). - Browser contract uses the material names
web_front,web_edge,
web_back,web_gold. In the viewer, use the canonical card root frame for
uView, not the exported front mesh's local frame, and restore the exported
V coordinate exactly once. Test both turn directions to catch smearing or
inverted parallax.
Resources
scripts/— bundled engine (upstream MIT, carries the Blender-listing
User-Agent fix):ensure_blender.py(official, SHA-256-verified portable
Blender),build_card.py/export_web.py(editable scene + GLB export),
generate_typography.py/validate_assets.py(deterministic helpers),
run_pipeline.py(one-shot pipeline). WorkBuddy glue:prepare_layers.py
(matting, watermark removal, canvas centering),randomize_card.py(roll a
seeded variant into card-config.json),verify_card.mjs/
verify_workshop.mjs/verify_audio.mjs(browser acceptance).assets/web-template/— responsive Three.js viewer + seeded variant engine
(variants.js) + procedural sonic engine (audio.js; no source artwork, no
audio files). Visual system: 「光谱标本档案」— paper archive + dark specimen
vitrine + single indigo accent + spectral hairlines.references/design.md— design system: direction, colour/font tokens,
composition rules, motion, DOM contract and redesign checklist. Read before
touching the web UI.references/audio.md— sonic design system: three-layer structure, seed →
soundprint derivation, scene/back mapping, synth recipes, autoplay rules and
mix discipline. Read before touching any sound.references/art-direction.md— layered prompts, WorkBuddy image-tool
semantics (no alpha, watermark, line-art registration) and the
宠物/配饰/动作/镜头 variety guidance.references/randomness.md— seeded variant design: what is rolled, seed
semantics, reproduction/sharing,window.__holoautomation hooks.references/config.example.json— card-config schema example (incl.
optionalseed/variant).references/verification.md— acceptance checklist + browser tooling.references/troubleshooting.md— install/alpha/watermark/ESM pitfalls.LICENSE.md— upstream MIT licence (attribution retained).
Never bundle generated cards, downloaded Blender, node_modules, caches, audio
files (all sound is synthesized at runtime), or image-bearing .blend/.glb
files into this skill when distributing it.