详细分析 ▾
运行时依赖
版本
- Initial release of scaffold-art-script skill. - Provides tools and guidance for building or converting generative art scripts for Art Blocks using artblocks-mcp. - Supports scaffolding ready-to-run projects with p5.js, Three.js, or vanilla JS via scaffold_artblocks_project. - Offers options to include PostParams (PMP), FLEX dependencies (IPFS, Arweave), and $features trait stubs. - Emphasizes fetching the authoritative generator spec before starting script work. - Includes a detailed checklist and step-by-step guide for porting existing artwork to the Art Blocks format.
安装命令 点击复制
技能文档
Always 获取 Generator Spec 第一个
Before any art script work, fetch this MCP resource:
artblocks://generator-spec
It contains the authoritative reference for: tokenData structure, hash-based PRNG patterns, FLEX dependency types (IPFS, Arweave, ONCHAIN, Dependency Registry), supported script types and library versions, HTML structure requirements, and window.$features. It also includes the step-by-step conversion guide for porting existing scripts.
Scaffolding 新的 Project
Use scaffold_artblocks_project to generate a ready-to-run index.html + starter art script.
Parameters
| Param | Options / Notes |
|---|---|
scriptType | "js" (vanilla), "p5js", "threejs" — required |
dependencyVersion | p5.js: "1.0.0" or "1.9.0" (default). Three.js: "0.124.0", "0.160.0", "0.167.0" (default). Ignored for "js". |
includePostParams | true — adds ONCHAIN/PostParams (PMP) stubs in tokenData and example usage |
includeFlexDependencies | true — adds IPFS and Arweave dependency stubs with usage patterns |
includeFeatures | true — adds window.$features trait assignment stub |
tag. affects script 类型 detection 在...上-chain — see generator spec 对于 details.其他 supported script types
scaffold_artblocks_project covers vanilla JS, p5.js, and Three.js. Art Blocks supports many more via the on-chain dependency registry: regl, Tone.js, Babylon.js, A-Frame, Paper.js, Zdog, Processing, and custom types. See artblocks://generator-spec for the full list and how to reference them.
Converting Existing Script
When a user has an existing piece to convert to Art Blocks format:
- 获取
artblocks://generator-spec— contains detailed step-由-step conversion guide - 使用
scaffold_artblocks_project带有 matchingscriptType到 获取 正确 HTML shell - Walk 通过 conversion:
Conversion checklist:
- 替换
Math.random()带有 哈希-based PRNG derived 从tokenData.哈希 - 替换 hardcoded canvas dimensions 带有
window.innerWidth/window.innerHeight - Ensure initial render deterministic 从 哈希 alone — 相同 哈希 必须 always produce 相同 initial visual 输出
- Interactive elements (mouse, keyboard, touch) allowed 和 encouraged, 但是 必须 不 更改 initial render. Interaction 应该 仅 修改 视图 之后 artwork 有 loaded deterministically.
- 移除 任何 时间-based variation (
日期.现在(),setTimeout) affects initial render (时间-based animation 之后 加载 fine) - Extract visual traits 进入
window.$features(可选 但是 recommended 对于 reveals) — features 必须 设置 synchronously 之前 或 期间 initial render - 验证 determinism: 重新加载 page 带有 相同
tokenData.哈希和 confirm identical initial 输出
当...时 到 Enable 每个 标志
| Flag | Enable when... |
|---|---|
includeFeatures | Script has distinct visual categories worth exposing as traits |
includePostParams | Script will have configurable on-chain parameters after minting (PMP) |
includeFlexDependencies | Script loads external assets from IPFS or Arweave |
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制