用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Shopify/Klint --skill klint命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | klint |
| description | Build creative-coding sketches and digital art with Klint's immediate-mode Canvas 2D API in React or vanilla JavaScript. |
Use Klint for generative art, animated sketches, and interactive Canvas 2D work. Treat it as an immediate-mode creative-coding runtime: update sketch state, then draw the current frame through the enhanced KlintContext.
@shopify/klint and inspect its exported TypeScript types when unsure; do not guess p5.js-style names.preload, initialization in setup, and synchronous rendering in draw.<Klint> fills it. Use K.width and K.height for responsive composition.K.time or K.deltaTime, not an additional requestAnimationFrame.@shopify/klint/plugins/* imports and add them only when the artwork needs them.import {Klint, type KlintContext} from '@shopify/klint';
export function Artwork() {
const draw = (K: KlintContext) => {
K.background('#101018');
const x = K.width / 2 + Math.cos(K.time) * K.width * 0.2;
K.fillColor('#ff6b9d');
K.circle(x, K.height / 2, 24);
};
return (
<div style={{width: '100%', height: '100vh'}}>
<Klint draw={draw} />
</div>
);
}
For pointer, keyboard, gesture, window, or image helpers, call their factories during render and pass the bridge to the canvas:
const {context, KlintMouse} = useKlint();
const {mouse} = KlintMouse();
return <Klint context={context} draw={(K) => drawArtwork(K, mouse)} />;
Without React, import createKlint from @shopify/klint/native, await sketch.ready, and call sketch.destroy() when finished.
KlintMouse(), KlintImage(), or another hook factory inside draw, a condition, or an event handler. They use React hooks and must run unconditionally at component render time.useStorage/refs, read changing component values with useProps, and reserve React state for surrounding UI.draw synchronous. Load/decode assets in preload or React effects and cache expensive/static work.<Klint> to change them rather than expecting prop updates to rebuild the runtime.preload and setup idempotent, and clean up non-Klint listeners/resources in a React effect.background/clear when each frame should replace the previous one; omit or use transparency intentionally for trails.