/** * What a drawing is made of: the ask Claude is given, the reply read back * into SVGs, and the wall every SVG passes before it is kept. Pure * functions, no I/O — `src/draw.ts` runs Claude, `src/actions.ts` keeps * the rows. * * Every SVG is drawn in three placeholder colours, INK, GLOW and PAPER. A * palette swaps ink and glow for its own two and paper for its ground, so * one drawing reads in any theme; tone between them comes from opacity and * local gradients, never a fourth colour. * The colours themselves are data: `design/palettes.json`. */ import colours from "../design/palettes.json"; export const KINDS = { mark: "logo mark", icon: "app icon", badge: "badge", spot: "spot illustration", } as const; export type Kind = keyof typeof KINDS; export const isKind = (value: unknown): value is Kind => typeof value === "string" && Object.hasOwn(KINDS, value); /** The placeholder colours every SVG is drawn in. */ export const INK: string = colours.placeholder.ink; export const GLOW: string = colours.placeholder.glow; /** The ground's colour, for highlights and cut-outs drawn on top. */ export const PAPER: string = colours.placeholder.paper; /** Palettes a drawing can be shown and saved in. */ export const PALETTES: Readonly< Record > = colours.palettes; export type Palette = keyof typeof colours.palettes; export const isPalette = (value: unknown): value is Palette => typeof value === "string" && Object.hasOwn(PALETTES, value); export const COUNT = 4; export const PROMPT_MAX = 400; /** The most a kept SVG may weigh, in characters. */ export const SVG_MAX = 48_000; /** What Claude is asked, for one prompt. */ export function ask(prompt: string, kind: Kind): string { return `You are a senior identity designer who crafts polished, detailed vector marks — the finish of a studio logo, not clip art. Draw ${COUNT} distinct ${KINDS[kind]} concepts for this brief: ${prompt} Rules for every SVG: - Root element exactly: - First child: with a two-to-four word name for the concept. - Colours: ONLY ${INK} (main ink), ${GLOW} (accent glow) and ${PAPER} (paper — the background colour, for highlights, cut-outs and inner detail drawn on top), plus "none". Write them as hex in fill, stroke and stop-color. No other colours, no colour functions, no CSS, no