MCPcopy
hub / github.com/garrytan/gstack / briefToPrompt

Function briefToPrompt

design/src/brief.ts:18–41  ·  view source on GitHub ↗
(brief: DesignBrief)

Source from the content-addressed store, hash-verified

16 * Convert a structured brief to a prompt string for image generation.
17 */
18export function briefToPrompt(brief: DesignBrief): string {
19 const lines: string[] = [
20 `Generate a pixel-perfect UI mockup of a ${brief.screenType} for: ${brief.goal}.`,
21 `Target audience: ${brief.audience}.`,
22 `Visual style: ${brief.style}.`,
23 `Required elements: ${brief.elements.join(", ")}.`,
24 ];
25
26 if (brief.constraints) {
27 lines.push(`Constraints: ${brief.constraints}.`);
28 }
29
30 if (brief.reference) {
31 lines.push(`Design reference: ${brief.reference}`);
32 }
33
34 lines.push(
35 "The mockup should look like a real production UI, not a wireframe or concept art.",
36 "All text must be readable. Layout must be clean and intentional.",
37 "1536x1024 pixels."
38 );
39
40 return lines.join(" ");
41}
42
43/**
44 * Parse a brief from either a plain text string or a JSON file path.

Callers 1

parseBriefFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected