/prompt-to-asset:brand-consistencyfrom prompt-to-asset
Enforces brand visual coherence across multi-asset sets by building a BrandBundle (palette, typography, style refs), enforcing palette per AI model, and validating style similarity with CSD and ΔE2000.
Ships in prompt-to-asset. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Engaged when a user is generating more than one asset for the same brand, or when an existing brand.json / brand.md is in play. Wraps asset_brand_bundle_parse, asset_generate_*, and validation.
palette:
- { name: primary, hex: "#0A1F44", usage: mark }
- { name: accent, hex: "#FF6B6B", usage: highlight }
- { name: neutral, hex: "#FAFAFA", usage: background }
typography:
primary: { family: "Geist Sans", fallback: "geometric sans-serif, bold" }
secondary: { family: "Geist Mono", fallback: "monospace" }
style_refs: ["assets/brand/ref-1.png", "assets/brand/ref-2.png"]
lora: "assets/brand/brand.safetensors" # optional Flux/SDXL
sref_code: "--sref 1234567890" # optional Midjourney
style_id: "uuid-of-recraft-style" # optional Recraft
do_not: ["drop shadows", "gradients", "photorealism"]
logo_mark: "assets/brand/mark.svg" # canonical mark for composition
Call asset_brand_bundle_parse({ source }) to build this from a brand.md, brand.json, DTCG tokens.json, or AdCP spec.
| Provider | Mechanism | ΔE2000 typical |
|---|---|---|
| Recraft V3/V4 | controls.colors: ["#hex", …] (hard enforcement) | 1–5 |
| Flux.2 | JSON color_palette: ["#hex", …] | 3–7 |
| Ideogram 3 | style_reference_images (palette swatch PNG) or style_codes | 5–10 |
| Midjourney | prose color words + --sref <id> --sw 250–400 | 5–12 |
| gpt-image-1 | hex codes in prose, reinforced 2–3× | 5–15 |
| SDXL / Flux.1 | hex in prose + IP-Adapter palette swatch | 5–15 |
| Imagen / Gemini | prose + post-process recolor | 10–20 (post-fix required) |
Fallback that always works: K-means remap in LAB space + ΔE2000 validation. asset_validate flags drift; post-process recolors nearest palette entries.
.png or .svg that defines the brand look. Required for consistency across >3 assets.style_refs[] so subsequent generations see richer brand context.--sref <image> (loose) vs --cref <image> (character lock) vs --mref <image> (object lock). Use --sw 250 for tight style, --sw 100 for loose brand.style_id is a persistent UUID bound to a trained brand style.ip_adapter_weight: 0.7–0.9 for style, lower for just color.lora_scale: 0.7–1.0.ROI breaks even at ~20 assets. For smaller sets, IP-Adapter or --sref is cheaper.
1. Collect 20+ accepted assets (logo, icons, illustrations) in the brand style.
2. Call trainBrandLora MCP tool (Replicate/Modal endpoint, ~$50–$200, ~2 hours).
3. Store the returned .safetensors path in BrandBundle.lora.
4. Set trigger word (e.g. "acme_brand") + lora_scale: 0.8–1.0 in subsequent Flux/SDXL generations.
5. Re-validate style similarity — should jump to CSD ≥0.85 vs references.
Same brand expresses differently per asset. Honor the brand, but respect the medium:
| Asset type | Palette strictness | Composition | Transparency | Legibility target |
|---|---|---|---|---|
logo | primary + 1 accent | centered, 80% safe zone | required RGBA | 32×32 minimum |
app_icon | primary bg + 1–2 glyph colors | single central glyph, ~15% padding | opaque 1024² | 27×27 |
favicon | 2–3 colors max | monogram/mark | SVG + ICO multi-res | 16×16 |
og_image | full palette, brand typography | hero layout, headline area | opaque | 1200×630 at 1:1 scale |
illustration | full palette | scene composition | often transparent | hero or empty-state |
icon_pack | monocolor (currentColor) OR 2-tone | 24×24 grid, uniform stroke | SVG + alpha | consistent weight |
BrandBundle.do_not[] should never be forwarded as literal "no X" to Flux/Ideogram/Recraft. Translate per dialect:
do_not: ["drop shadows"] → affirmative: "flat design, crisp edges"
do_not: ["gradients"] → affirmative: "solid fills, flat colors"
do_not: ["photorealism"] → affirmative: "flat vector illustration style"
do_not: ["rounded corners"] → affirmative: "sharp geometric corners"
SDXL and Midjourney get literal negatives. Everyone else gets positive anchors.
Composite, don't generate. Web fonts via Satori for OG images; SVG <text> with font stack for favicons (if required); brand-font text in Figma/Illustrator for logo wordmarks.
typography.primary.fallback is what the model sees in the prompt ("geometric sans-serif, bold") — not the font file name. Diffusion samplers cannot read Geist.typography: { font_class: "geometric sans-serif", weight: "bold" } can be passed in the JSON schema.After each generation, run in addition to normal tier-0/1:
tier_1 (set-aware):
- palette ΔE2000 vs brand palette ≤ 10
- CSD style similarity vs canonical anchor ≥ 0.72
- stroke-width histogram consistent within set (σ ≤ 20%)
tier_2 (VLM-as-judge, if enabled):
- "does this asset look like it comes from the same brand as [ref]?"
- score 1–5; require ≥ 4 for acceptance
When to stop regenerating:
do_not[] literally to Flux (errors or weakens generation)style_id on Recraft when brand lock is available (loses 50% of the value)style_refs[] after accepted assets (lose compounding consistency)docs/research/15-style-consistency-brand/15a-consistent-character-and-mascot.md — character/mascot consistencydocs/research/15-style-consistency-brand/15b-style-transfer-sref-b-lora.md — --sref, IP-Adapter, LoRAdocs/research/15-style-consistency-brand/15e-full-asset-set-consistency.md — full-set propagationdocs/research/24-skills-for-p2a/05-brand-consistency-skill.md — full design specWhat SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (mohamedabdallah-14/prompt-to-asset) — no native marketplace selected
npx claudepluginhub p/mohamedabdallah-14-prompt-to-asset13 skills in this plugin
/app-iconGenerate an app icon from a single 1024² master and fan out to iOS (AppIcon.appiconset with squircle-ready 1024 opaque), Android (adaptive foreground + background + Android 13 monochrome), PWA (192/512 + 512 maskable with 80% safe zone), and visionOS (3-layer parallax)./asset-enhancerClassify a software-asset brief (logo, app icon, favicon, OG image, illustration, splash, icon pack, transparent mark), route to the right image model, rewrite the prompt in the target model's dialect, pick an execution mode (inline_svg / external_prompt_only / api) based on what's actually available, and run the pipeline. Use whenever the user asks for any visual asset for a software product./asset-validation-debugDiagnose and repair asset-generation failures. Maps tier-0/1/2 validation codes (checkerboard, missing alpha, safe-zone violation, palette drift, garbled wordmark, low contrast) to concrete repair primitives (matte, inpaint, route change, seed sweep, composite). Applies a retry budget so Claude does not loop on hopeless regenerations./faviconGenerate a full favicon bundle — favicon.ico (16/32/48 multi-res), icon.svg with prefers-color-scheme dark support, apple-touch-icon.png 180×180 opaque, and PWA 192/512/512-maskable — from a brand mark or a mark prompt./illustrationGenerate an in-product illustration (empty state, onboarding, hero, spot art) that obeys a brand bundle. Uses IP-Adapter / LoRA / Recraft style_id / Flux.2 brand refs for consistency across a set; validates palette ΔE2000 and style adherence./logoGenerate a production-grade logo (primary brand mark). Returns RGBA PNG master + SVG vector + monochrome variant. Route by text-length and per-model ceiling. Strong-text models render multi-word and even paragraph-length wordmarks reliably; weak-text models composite SVG type post-render.Other plugins' skills for the same job