Image prompts
AuraScore 81/100

Self-Healing Image Generation Tool Chain for Autonomous Agents

Construct an autonomous evaluation and self-healing script for programmatic image prompt refinement and parameter tuning.

Ideal for production autonomous pipelines where generated images must pass visual verification criteria before continuing. It outputs an automated retry and prompt-rewriting script with heuristic bounds.

Template

Role: Principal Visual AI Automation & Quality Systems Engineer

Context

  • Vision Critique Evaluator: {{evaluator_vision_model}}
  • Retry Budget: {{max_retry_cycles}}
  • Acceptance Criteria: {{quality_thresholds}}
  • Generation Target: {{diffusion_api_endpoint}}
  • Heuristic Mutation Policy: {{prompt_mutation_rules}}

Task

Develop an autonomous self-healing Python script that dispatches image generation requests to {{diffusion_api_endpoint}}, submits outputs to {{evaluator_vision_model}} for structured visual critique against {{quality_thresholds}}, and programmatically mutates prompt tokens and parameters until criteria are met or {{max_retry_cycles}} is reached.

Method

  1. Define structured Pydantic schemas for the visual inspection verdict returned by {{evaluator_vision_model}}.
  2. Implement the API client for {{diffusion_api_endpoint}} capable of handling parameter overrides (prompt, negative prompt, cfg, steps).
  3. Construct the Vision QA prompt that forces {{evaluator_vision_model}} to score output against {{quality_thresholds}} with granular defect tags.
  4. Build the prompt mutation engine implementing {{prompt_mutation_rules}} (token weight boosting, negative token injection, composition shift).
  5. Orchestrate the evaluation-retry loop, tracking mutation history and preventing cyclical token thrashing.
  6. Implement final resolution logic: approve and output asset URLs on success, or trigger structured triage alerts if retry limits expire.

Constraints

  • The script MUST execute a closed-loop mutation cycle without requiring human intervention.
  • MUST NOT exceed {{max_retry_cycles}} under any circumstance to prevent infinite billing loops.
  • Vision critique MUST output strictly parseable JSON conforming to the verification schema.
  • Every prompt mutation MUST record a diff log explaining which tokens were added, removed, or re-weighted.

Output format

Provide a unified Python script organized as follows:

  1. Configuration Classes and Pydantic QA Evaluation Schemas.
  2. Vision Inspector and Prompt Mutator Engine.
  3. Generation Client for {{diffusion_api_endpoint}}.
  4. Autonomous Self-Healing Orchestrator Loop.
  5. Verification test suite simulating a failed generation that recovers on retry.

Self-review

  • Confirm that the mutation logic strictly follows {{prompt_mutation_rules}} on detected defects.
  • Verify that the retry loop hard-terminates when counter equals {{max_retry_cycles}}.
  • Ensure parsing handles partial or malformed vision evaluation responses safely.
AuraScore breakdown
81/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

design-visual
design-image-prompts
autonomous-agents-workflows
self-healing
vision-critique
tool-calling