Closed-Loop Vision Agent Prompt Mutation and Repair Matrix
Generate an automated heuristic matrix for vision agents to detect visual errors and re-prompt diffusion tools.
Deploy this template to equip vision-language critique agents with deterministic prompt repair matrices. It translates detected image artifacts into targeted prompt deletions, additions, and weight adjustments.
Role: Senior Vision-Language Evaluator and Automated Workflow Reliability Lead.
Context
- Critique Agent Engine: {{critique_agent_engine}}
- Image Generation Tool: {{image_generation_tool}}
- Target Defect Categories: {{defect_taxonomy}}
- Prompt Modification Operators: {{mutation_operators}}
- Max Correction Budget: {{max_iteration_budget}}
- Quality Acceptance Threshold: {{acceptance_threshold}}
Task
Develop an actionable prompt mutation and parameter repair matrix that enables an autonomous vision-critique agent to diagnose generation flaws and execute targeted prompt modifications across self-correcting tool-calling loops.
Method
- Classify image generation flaws categorized in {{defect_taxonomy}} into prompt-addressable root causes.
- Define visual verification probes for {{critique_agent_engine}} to reliably isolate artifacts.
- Establish syntax modifications using {{mutation_operators}} (token weighting, keyword deletion, semantic substitution).
- Formulate precise negative prompt counter-measures for each error category.
- Determine parameter adjustments (CFG reduction, sampler change, seed reset) for {{image_generation_tool}}.
- Structure step-by-step repair recipes that do not overwrite intact stylistic components of the original prompt.
- Establish iteration stopping rules based on {{max_iteration_budget}} and {{acceptance_threshold}}.
Constraints
- MUST specify the exact regex or token replacement rule for each identified visual artifact.
- MUST NOT recommend total prompt rewrites; repairs must be localized and deterministic.
- Parameter adjustments MUST remain within valid limits for {{image_generation_tool}}.
- Negative counter-measures MUST NOT contain mutually contradictory tokens that collapse image saturation or detail.
Output format
1. Vision Critique Evaluation Framework
Metric definition and scoring rubric for {{acceptance_threshold}} (max 100 words).
2. Autonomous Prompt Repair Matrix
A markdown table with the following mandatory columns: | Defect Code | Visual Defect Description | Critique Detection Signature | Prompt Token Mutation Rule | Negative Prompt Injection | Parameter Adjustment | Confidence Escalation Action | (Provide exactly 6 distinct defect mitigation rows covering composition, anatomy, text/lettering, texture, lighting, and semantic drift).
3. Termination & Escalation Logic
Deterministic decision tree in markdown list format detailing behavior when {{max_iteration_budget}} is reached.
Self-review
- Are the prompt mutation rules directly executable by an automated script or agent tool?
- Does the matrix address all failure types listed in {{defect_taxonomy}}?
- Are parameter shifts calibrated specifically to the constraints of {{image_generation_tool}}?
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.