CardForge · 卡片工坊
Overview
Turn a fragment of text — one sentence, one number, a few points, or a wish —
into a single, polished, shareable SVG card in seconds. No external scripts, no
image generation, no dependencies. The card renders inline via the visualizer
and can be saved as a .svg file for reuse.
The skill's value is visual conversion at conversation speed: the input is
cheap, the output is impressive, and the output itself is the shareable artifact.
When to use
Trigger when the user wants a visual artifact from short text, and no other
file-producing skill fits. Concretely:
- "把这句话做成卡片" / "这句话做漂亮点" → QuoteCard
- "这个数据做个图" / "KPI 做个卡" → DataCard
- "这几个要点做成清单图" / "做个清单卡" → ListCard
- "A 和 B 对比一下,做个图" / "做个对比卡" → VersusCard
- "做个生日/节日祝福图" → BlessCard
- "给我几个风格版本" → multi-theme batch (one card per theme)
Do not trigger for: full PPT decks (use pptx skills), multi-page reports
(use docx/html skills), or charts that need real axes/legends (use the chart
visualizer). CardForge is for single-canvas, hero-driven visuals.
Workflow
- Classify the hero. From the user's input, identify the single hero
element (a sentence / a number / a list / two options / a wish). Load
references/card-types.mdand match it to one of the five types. If unclear,
default to QuoteCard. - Pick the theme. If the user named a mood ("国潮", "科技感", "极简"),
use it. Otherwise infer from content: numbers/tech → Tech; ceremony/festival
→ China-Tide; nature/healing → Lush; bold/young → Night; literary/neutral →
Minimal. When unsure, Minimal is the safest default. - Write the SVG. Follow
references/design-system.mdexactly — theme
palette, signature element, typography stack, the 10 SVG hard rules. Start
from the type's skeleton inreferences/card-types.mdand swap in real
content. Every shape and every text gets an explicit fill. - Preview via the visualizer. Call
show_widgetwith the SVG as
widget_code. Use a loading message like["配色就绪","生成卡片中"]. Title
the widget by type+theme (e.g.金句卡_Minimal). - Offer save (optional). If the user may want the file, write the SVG to a
.svgfile under the workspace and callpresent_files. Do not save by
default — inline preview is the primary mode, files only on request or for a
batch.
Theme & Type quick index
Five themes (full palettes + signature SVG snippets in design-system.md):
- Minimal 极简白 — warm off-white, muted gold rule. Default for quotes.
- China-Tide 国潮红 — vermilion / rice paper, seal block. Default for blessings.
- Tech 科技蓝 — dark gradient, cyan glow. Default for data.
- Lush 文艺绿 — oat, deep moss, line sprig. Default for lists / healing.
- Night 暗夜紫 — dark violet, neon frame. Default for bold / youthful.
Five types (full layout + skeletons in card-types.md):
- QuoteCard — one sentence hero.
- DataCard — one mega number hero.
- ListCard — 3–5 parallel items.
- VersusCard — A vs B, mirror layout.
- BlessCard — a wish, signature motif large.
SVG hard rules (memory aid — full set in design-system.md §6)
- Root:
<svg xmlns viewBox>, never hardcode width/height. - Explicit
fillon every shape and text. No inheritance. text-anchor="middle"+ computed centerx(540 for Portrait).- Manual
<tspan>line breaks withdy— SVG text does not auto-wrap. - No external resources (no web fonts, no
<image href>, no<script>). <defs>for gradients; reference viafill="url(#id)".<title>+<desc>right after the opening<svg>tag.- Keep under 25KB. No base64 images.
Copy craft (makes or breaks a card)
- QuoteCard: trim to one strong clause. No period after CN heroes.
- DataCard: the user's real number, never rounded. Unit symbol correct.
- ListCard: parallel grammar across all items. Cap at 5.
- VersusCard: mirror rows — same metric, different value each side.
- BlessCard: address recipient by name; specific wish, not generic.
If the user gave more than the hero needs, edit down and say so. A card
with one hero beats a card with three.
Output conventions
- Inline preview is the default deliverable (
show_widget). - For a multi-theme batch: one
show_widgetper theme, with a short prose
bridge between each — never stack widgets back-to-back without text. - For file delivery (batch, or user asked): write
.svgto the workspace,
callpresent_files. Clean filenames:{type}_{theme}_{NN}.svg. - Always end the turn with a one-line note on which type+theme was used and
where the user can tweak (content / theme / size).
Reference files
references/design-system.md— the visual system. Load before writing SVG.references/card-types.md— the five layouts + copy rules + skeletons. Load
at step 1 to classify the hero.