Canvas Poster Kit
БесплатноЗапускает вложенные скриптыНе проверенDesign single-image posters, banners and infographics as production-ready PNG files using the HTML <canvas> 2D API, with built-in multi-resolution export (1x…
от fsyj123573 установки в других каталогахОб этом скилле
Canvas Poster Kit
Design posters as HTML <canvas> drawings and export them at multiple resolutions from the same drawing code. Everything here was learned from shipping real posters across three production iterations (dark-tech conference poster → warm empathy poster → multi-resolution export refactor).
Why canvas (and when NOT to use it)
Canvas gives you pixel-perfect programmatic control: gradients, glow shadows, exact color zones, and a one-line PNG export (toDataURL). Choose it when the deliverable is a single static image.
- Data charts (bar/line/pie) → use a charting skill instead.
- Slide decks → use a PPT skill instead.
- Multi-page documents → use document tooling.
Workflow
- Brief — Clarify: topic, audience, text content, size/orientation, any reference image.
- Palette (topic-driven) — Match palette to topic semantics, not aesthetics alone. Dark-tech (
#000814bg + neon cyan) fits AI/tech; warm cream + coral fits empathy/kindness topics. Seereferences/design-patterns.md. - Reference image? — Extract colors programmatically (PIL resize → Counter → corner/strip sampling). Faithful extraction beats "similar vibe". Echo the reference's structural framework (strips, bands) in the layout.
- Build — Start from
assets/template.html(the multi-resolution engine). Replace the placeholderdraw*()sections with your content. Keep W/H as logical dimensions. - QA in browser — See
references/browser-qa.md: open via headless browser, eval render checks, verify PNG signature, PIL pixel-zone sampling. - Deliver + multi-res — The template ships with 1x / 2K / 4K download buttons out of the box.
Multi-resolution export (the core pattern)
Never rewrite drawing code for higher resolution. Scale the transform matrix instead:
function applyScale(scale) {
canvas.width = W * scale; // internal pixels grow
canvas.height = H * scale;
canvas.style.width = W + 'px'; // display size stays constant
canvas.style.height = H + 'px'; // → preview never jumps
ctx.setTransform(scale, 0, 0, scale, 0, 0); // all coordinates/fonts/shadows auto-scale
ctx.imageSmoothingEnabled = true;
ctx.imageSmoothingQuality = 'high';
}
function download(scale) {
requestAnimationFrame(() => { // let "Rendering…" status paint first
applyScale(scale);
render(); // your existing draw functions, unchanged
const link = document.createElement('a');
link.download = `poster_${scale}x.png`;
link.href = canvas.toDataURL('image/png');
link.click();
applyScale(1); render(); // restore preview
});
}
Why this works: setTransform(scale,0,0,scale,0,0) scales the entire drawing matrix, so every coordinate, fillText size, shadowBlur and lineWidth in existing code scales N× automatically. Full details, memory limits and failure modes: references/multi-resolution.md.
Visual QA
After generating, verify before delivering:
- Render check: eval
JSON.stringify({w: canvas.width, h: canvas.height})afterapplyScale(4); render()— expect{w: W*4, h: H*4}. - PNG check:
toDataURL()must start withdata:image/png;base64,iVBORw0K. - Pixel-zone check: run
scripts/qa_poster.pyto sample expected background/accent colors at known coordinates. - Text check: grep the HTML for every
fillTextstring the user asked to include; after text-removal edits, expect zero matches for removed strings (keep surrounding shape-drawing code intact — remove only thefillTextlines).
Surgical text edits
User asks to remove/change specific text? grep -n "<exact string>" index.html → locate the ctx.fillText(...) call → edit/remove that line only. Never touch gradients, lines, or shape code around it. Verify with grep: zero matches post-edit.
Pitfalls (learned the hard way)
- Internal px ≠ display px. After
applyScale(4),canvas.widthis 4× butcanvas.style.widthmust stay at logical size, or the page layout jumps. - 4K + shadowBlur is heavy. Defer renders behind
requestAnimationFrameor the UI freezes before the status message paints. - Icon semantics. Verify every glyph/icon against card meaning, not visual availability. A writing-hand icon on a "partnership" card is wrong even if it looks fine.
- Don't repeat last topic's palette when the user praises it — praise ≠ reuse request. Match palette to the new topic.
- Read-only dirs. Some upload dirs are read-only; write intermediate files to a writable subdir.
Environment self-check
Run before building:
- Node or a headless browser (for QA):
agent-browser/ Playwright /chromium --headless - Python 3 + PIL:
python3 -c "import PIL"(QA script dependency) - No build step, no dependencies — the poster is one self-contained
index.html
Установить Canvas Poster Kit в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Canvas Poster Kit?
Design single-image posters, banners and infographics as production-ready PNG files using the HTML <canvas> 2D API, with built-in multi-resolution export (1x / 2K / 4K+) via ctx.setTransform matrix scaling — no code rewrite needed. Use this skill whenever the user asks for a 海报 (poster), 单图视觉 deliverable, promotional graphic, event banner, or asks to export a canvas design at higher resolution / multiple sizes / 2K / 4K, even if they never say the word "canvas". Also covers: topic-driven palette selection, programmatic color extraction from reference images (PIL sampling, not eyeballing), surgical canvas text edits, and browser-based visual QA with pixel verification.
Как установить скилл Canvas Poster Kit?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Canvas Poster Kit запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic