CommunityImagegithub.com

image-prompt-builder

Translate vague image requests into structured, executable image generation prompts, outputting platform-specific syntax and invoking image generation tools to create images.

What is image-prompt-builder?

Image Prompt Builder is an AI agent skill designed to bridge the gap between ambiguous user descriptions (e.g., 'draw something sophisticated' or 'make it like a Studio Ghibli style') and precise, structured prompts for image generation models. It is primarily used by developers and power users working with AI image generation tools such as Midjourney, DALL·E, Stable Diffusion, or similar platforms. The skill operates through a systematic pipeline: first, it disambiguates user input by classifying descriptive words into style, technique, movement, and subject categories, then maps them to orthogonal dimensions like realism level (1–5), technique (9 types), lighting, and color. It builds prompts using an 8-beat skeleton covering subject, action, environment, composition, lighting, color, style, and closing parameters. The skill also handles preset templates, character consistency for series generation, reference image instructions, and post-generation failure diagnosis—changing only one segment at a time to isolate issues. It supports bilingual output (Chinese structured version + English phrase version) when no platform is specified, and adheres to strict writing rules to avoid vague terms and ensure composability. This skill is essential for producing high-quality, reproducible images from abstract requests.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/131517gyz/image-prompt-builder/tree/HEAD

Installed? Explore more Image skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Image Prompt Builder Skill (image-prompt-builder)

What This Skill Solves

Convert vague image requests ("draw a sophisticated image" or "make it like Miyazaki's style") into structured, dimensionally orthogonal, platform-adaptive prompts, then invoke image generation tools to create images.

Core method: First classify words → Then define dimensions → Fill in the 8-beat skeleton → Output in platform syntax → Self-check for failures.

Execution Pipeline

Execute in order. Detailed rules for each step are in the corresponding files under references/.

Step 1: Disambiguate the User's Words

Read references/concept-taxonomy.md.

Categorize every adjective from the user's description into four buckets: Style (what it looks like), Technique (how it's drawn), Movement (who and when), and Subject (what is drawn). When encountering vague words like "sophisticated" or "aesthetic" → Intercept, refer to the Chinese banned words list in section 4 of negative-prompts.md, and ask for specific criteria. Why this step first: Filling "Impressionism" directly as a style vs. mapping it to realism + technique + lighting can improve image quality by an order of magnitude.

Step 2: Determine Dimension Values

Take values in the following order, checking the corresponding dictionary for each dimension:

  1. Realism (levels 1–5) → references/realism-spectrum.md
  2. Technique (9 types) → references/technique-catalog.md
  3. Subject → references/prompt-formula.md section 3
  4. Lighting/Atmosphere → references/prompt-formula.md section 4
  5. Movement Mapping (if user mentions art history movements) → references/edge-cases.md

For dimensions the user didn't mention → Use default values from each dictionary's decision tree; do not leave them blank. Default realism: level 4 (semi-realistic). Default technique: digital impasto.

Step 3: Select the Invocation Mode

Determine which scenario applies:

ScenarioPath to Follow
Single image, clear requestNormal process, Step 4
User says "use XX template"Read references/preset-templates.md, load the preset, then allow overrides
Series generation (multiple images of same character)Read references/character-consistency.md first to build the character card
With reference image / image-to-imageRead references/reference-image.md to write instructions
Simple request ("just draw a cat")Go to references/storyboard-8-beats.md section 6 (simplified version), write only 3 beats

Priority: When the user has explicitly given certain dimensions (e.g., "semi-realistic + impasto + Chinese-style"), explicit values override preset defaults—use the preset to fill in remaining dimensions, but do not let the preset change dimensions the user provided. The preset only provides default values for dimensions the user did not specify.

Step 4: Write the Prompt Using the 8-Beat Skeleton

Read references/storyboard-8-beats.md and fill in the 8 beats:

  1. Subject Anchor (age/body type/hairstyle/clothing/defining details)
  2. Action and State (posture/hand placement/gaze/emotion)
  3. Environment and Scene (location/time of day/weather/foreground-midground-background)
  4. Composition and Camera (shot type/angle/focal length/rule of thirds/negative space)
  5. Lighting (light source/direction/hardness/color temperature/light-to-dark ratio)
  6. Color and Material (primary color/secondary color/saturation/material)
  7. Style and Medium (Fill in with dimension values from Step 2—do not improvise)
  8. Closing (aspect ratio/negative prompt/white space/parameters) — Take negative prompts from references/negative-prompts.md, stack by subject, rewrite according to platform syntax

Find existing skeletons by subject → references/case-library.md. After taking a skeleton, modify words using the replacement matrix, do not rewrite the entire prompt.

Step 5: Output in Platform Syntax

Read references/model-syntax.md.

  • If the user specifies a platform → Output in that platform's syntax.
  • If not → Output two versions: Chinese structured version + English phrase version.

Output Dead Template: All prompts must be written into a Markdown file following the structure in references/prompt-formula.md section 6.

Step 6: Failure Diagnosis

After generating the image, check item by item against the failure attribution table in references/model-syntax.md. If a failure is found → Change only one segment at a time, then regenerate. Avoid changing multiple segments simultaneously, as it makes attribution impossible.

Step 7: Save and Generate

  • Prompt: Write as date_topic_prompt.md, containing the Chinese structured version + English phrase version + generation suggestions.
  • Image: Call the image generation tool to generate and save in the same directory.
  • In the conversation, briefly explain which dimension values were used and any compromises (e.g., "Changed watercolor to impasto to achieve photorealistic level").

Resource Index

FilePurposeWhen to Read
concept-taxonomy.mdWord disambiguation, category determinationMandatory for Step 1
realism-spectrum.md5-level realism spectrum, mixed style zonesStep 2
technique-catalog.md9 technique types, combination matrixStep 2
prompt-formula.mdSubject/lighting dictionary, formula, dead templateSteps 2 and 5
negative-prompts.mdNegative prompt library, per-platform syntax, Chinese banned wordsInterception in Step 1, closing in Step 4, output in Step 5
edge-cases.mdAnti-argument coordinate theory, movement mapping, ambiguity resolutionSteps 1 and 2 when encountering movement words or mixed styles
preset-templates.md5 preset shortcutsStep 3 when a preset matches
storyboard-8-beats.md8-beat execution skeleton, 3 hard rules, simplified versionMandatory for Step 4
case-library.md6 subject-type skeletons, replacement matrixStep 4 to find skeletons
character-consistency.mdCharacter card, multi-image reuseStep 3 for series generation
reference-image.mdMulti-image division, local repainting, style transferStep 3 with reference images
model-syntax.mdPlatform syntax, failure attributionSteps 5 and 6
few-shot-examples.mdDecision-level demonstrationsRefer when encountering typical scenarios

Writing Discipline

  • Use the dead template for output format. Provide Input→Output examples at key points.
  • Vague words must not enter the slots—ask for specific criteria by offering 2–3 options; do not just say "be more specific."
  • Only keep one medium per area—mixing photography and illustration causes inconsistency. Zonal mixing (e.g., Miyazaki-style cel-shaded characters + impasto background) is allowed but must be specified in the prompt.
  • Negative instructions should be expressed positively in the prompt (e.g., "no straw on the cup rim" → "strawless cup rim"; "full feet visible").
  • Infer when possible, and only ask for clarification once.

Related Skills