prompt-to-design
Generate a polished PNG graphic from a text prompt and an aspect ratio. This is a CODE-BASED design generator (not a diffusion/photo model): it builds images from gradients, mesh fields, glow, grain, geometric shapes, and real typography. Use it whenever the user wants to create / generate / make an "image", poster, cover, wallpaper, banner, thumbnail, album art, story or reel cover, quote card, or any graphic from a description — optionally with words to render and a size or ratio (e.g. 1:1, 4:5, 9:16, 16:9, 2:3, 1:2, or WxH). It excels at designed, typographic, abstract, gradient, and geometric/Bauhaus/Swiss graphics and soft product-style visuals. It CANNOT produce photorealistic photos, real named people, brand logos, or copyrighted characters — for those, translate intent into a strong designed/stylized take instead.
hassancs91 · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add hassancs91/claude-image-generation --skill prompt-to-design技能说明
name: prompt-to-design description: >- Generate a polished PNG graphic from a text prompt and an aspect ratio. This is a CODE-BASED design generator (not a diffusion/photo model): it builds images from gradients, mesh fields, glow, grain, geometric shapes, and real typography. Use it whenever the user wants to create / generate / make an "image", poster, cover, wallpaper, banner, thumbnail, album art, story or reel cover, quote card, or any graphic from a description — optionally with words to render and a size or ratio (e.g. 1:1, 4:5, 9:16, 16:9, 2:3, 1:2, or WxH). It excels at designed, typographic, abstract, gradient, and geometric/Bauhaus/Swiss graphics and soft product-style visuals. It CANNOT produce photorealistic photos, real named people, brand logos, or copyrighted characters — for those, translate intent into a strong designed/stylized take instead.
prompt-to-design
Turn a free-form prompt + an aspect ratio into a finished PNG, built entirely from
code. The house style is the level of the four pieces in reference/: posters,
typographic covers, mesh/gradient atmospheres, geometric compositions, soft
product abstractions. Frictionless like an image generator, but bounded to
designed graphics.
What it is (and is not)
Everything is drawn with math and type — no image model. That means:
- Great at: posters & album art, quote / story / reel / carousel covers, wallpapers, gradient & mesh backgrounds, neon / synthwave, Bauhaus / Swiss geometric art, minimalist logos-as-shapes, patterns, soft "product" orbs, anything typographic. Crisp text, perfect alignment, editable, no AI artifacts.
- Cannot do: photorealism, a specific real person's face, detailed representational illustration (a recognizable animal, a fantasy castle), brand logos, or copyrighted characters.
Accept any prompt and always output a designed PNG. Silently route the prompt to the rendering approach that fits (see Style routing). Only if a prompt truly demands a photo (e.g. "photorealistic portrait of my friend") say so in one sentence and deliver the strongest stylized/typographic interpretation anyway — never refuse, never return a blob that ignores the prompt.
Inputs
- Prompt — free text. Extract: subject/scene, mood, any color cues, and any literal words to render (quotes, titles, handles), plus implied style.
- Aspect ratio — a preset or
WxH. If unspecified, default 1:1.
The pipeline (follow in order)
- Read the prompt. Identify subject, mood, palette hints, literal text, ratio.
- Route to a style (one of: typographic, geometric, gradient-atmospheric, soft-minimal, poster-scene) — see below. When ambiguous, pick the one that best serves the words + mood.
- Choose a palette (3–6 colors, deliberate). See Palette.
- Plan the composition in your head first: the ONE focal element, the hierarchy, where the negative space lives. Balance mass with space.
- Assign fonts by role (display / grotesque / geometric / serif / serif_book / mono / pixel / techno). See Typography.
- Write a Python script that imports the engine and composes the piece (pattern below). Prefer the library primitives; drop to numpy only for custom effects.
- Render to a PNG in the outputs directory.
- VERIFY (mandatory gate — see Verify). Fix issues, re-render.
- Present the PNG. (Do not show the user the internal design reasoning or any
.mdnotes — PNG only.)
Optionally, thinking through a one-paragraph "design philosophy" for the piece before coding measurably improves results — do it as internal reasoning, never as a user-facing file.
Environment & how to run
Requires Python with Pillow and numpy (install with
pip install pillow numpy --break-system-packages if missing). Fonts are bundled
in fonts/ — no system fonts needed.
Write a script that puts this skill's lib/ on the path, composes, and saves:
import sys
sys.path.insert(0, "SKILL_DIR/lib") # the lib/ folder next to this SKILL.md
from render import Design, NEON, NEON_CYAN, CREAM, INK, CHARCOAL, lerp_stops
d = Design("9:16") # preset, "WxH", or (w, h)
# ... compose with d.<method>(...) ...
d.save("/mnt/user-data/outputs/design.png", grain=6, saturation=1.1)
Replace SKILL_DIR with the absolute path to this skill. Then run with
python3 your_script.py and present the saved PNG.
Engine quick reference (render.Design)
Coordinates are fractions: x in [0,1] across width, y in [0,1] down height.
Sizes / radii / widths / font sizes are in final pixels; the engine
supersamples internally and downsamples for crisp edges.
Construct: Design(size="1:1", supersample=None, background=(255,255,255))
Backgrounds (set the whole canvas):
fill(color)linear_gradient(stops, angle=90)—stops=[(pos,(r,g,b)),...]; 90=top→bottom, 0=left→rightradial_gradient(stops, center=(0.5,0.5), radius=0.9)mesh_gradient(points)—points=[(fx,fy,(r,g,b),sigma_frac),...]smooth blended color fieldsoverlay_glow(center,color,radius,strength=0.4,mode="screen"|"add"|"blend")— soft glow onto current canvasvignette(strength=0.4, center=(0.5,0.5), radius=0.75, power=1.6)
Shapes (optional glow={"color":(r,g,b)} for neon):
disk(cx,cy,r,color,glow=)·ellipse(cx,cy,rx,ry,color)·ring(cx,cy,r,width,color)pie(cx,cy,r,a0,a1,color)— filled arc/sector; angles: 0=east, CW; top half=180→360, bottom=0→180arc(cx,cy,r,a0,a1,width,color)— open stroke arcrect(x0,y0,x1,y1,color,radius=0)—radius>0for rounded/pillsline(x0,y0,x1,y1,width,color)·polygon([(x,y),...],color)intersection(shapeA, shapeB, color)— knockout the overlap; shapes are("disk",cx,cy,r),("pie",cx,cy,r,a0,a1),("rect",x0,y0,x1,y1)
Soft orb: `gradient_sphere(cx,cy,r, colors, light=(-0.34,-0.34), shadow=True, specular=0.
阅读完整来源 ↗