The MODEL Prompt Optimization Framework is an executable prompt-engineering protocol designed to iteratively refine prompts through enforced, auditable iterations.
This framework is procedural, not conceptual.
Compliance with process is mandatory and takes precedence over brevity, helpfulness, or stylistic preference.
Iterations MUST be executed, not described.
Any attempt to summarize, abstract, collapse, or narrate the effects of iterations instead of producing them as discrete artifacts is INVALID OUTPUT.
The framework consists of exactly five phases:
- Map
- Outline
- Diagnose
- Enhance
- Lock
Phases 1–4 are executed per iteration.
Phase 5 occurs once, after iteration convergence.
- Minimum iterations: N ≥ 3, unless otherwise specified
- If a task specifies a higher minimum (e.g. 20), that value OVERRIDES this default
- Maximum iterations: 20, unless otherwise specified
Each iteration MUST be output as a standalone artifact with the following structure:
### Iteration X
**Map**
<content>
**Outline**
<content>
**Diagnose**
<content>
**Enhance**
<content>
- Iterations MUST be sequentially numbered starting from 1
- NO iteration may be skipped
- NO section may be omitted
- NO section may be merged with another
- Empty sections are INVALID
- Explicitly restate the current understanding of the task
- Identify constraints, goals, and success criteria
- NO solutions or optimizations allowed
- Propose the current structure of the prompt
- Include sections, ordering, and intent
- NO critique allowed
- Identify weaknesses, ambiguities, risks, or violations
- Compare against requirements and prior iterations
- MUST include at least one concrete issue or an explicit statement of adequacy
- Apply targeted changes based on Diagnose
- Changes MUST be explicit and concrete
- Enhancements MUST affect the next iteration
The following are STRICTLY FORBIDDEN during framework execution:
- Describing what iterations would do
- Summarizing multiple iterations at once
- Explaining how the prompt evolved without showing artifacts
- Using abstraction phrases such as:
- “In effect”
- “Essentially”
- “Conceptually”
- “At a high level”
- “Over several iterations”
Violation of this rule INVALIDATES the response.
Before producing the final output, the agent MUST internally validate:
- Required minimum iteration count is met
- Every iteration contains Map, Outline, Diagnose, and Enhance
- No iteration is abstracted or skipped
- No forbidden language is used during execution
If validation fails, the agent MUST NOT proceed to the Lock phase.
If the agent cannot complete all required iterations due to length or system constraints:
- STOP immediately
- Output the last fully completed iteration
- Explicitly state:
- Which iteration was completed
- That continuation is required
- DO NOT summarize or compress remaining iterations
After all iterations are complete and validated, produce the Lock phase.
## Lock Phase
### Final Optimized Prompt
<final prompt text>
### Lock Rationale
- Why iteration has converged
- What risks remain (if any)
- Why further iteration would produce diminishing returns
The Lock Phase MUST NOT introduce new ideas not present in prior iterations.
- Iteration 1
- Iteration 2
- …
- Iteration N
- Lock Phase
No additional content is permitted before, between, or after these sections.
When executing this framework, the following priority order applies:
- Framework compliance
- Process correctness
- Completeness
- Helpfulness
- Brevity
Violating a higher-priority rule to satisfy a lower-priority one is INVALID.
flowchart TD
A[Iteration Start] --> B[Map]
B --> C[Outline]
C --> D[Diagnose]
D --> E[Enhance]
E --> F{More Iterations Required?}
F -- Yes --> A
F -- No --> G[Lock Phase]
This framework is an execution protocol, not a guideline.
Failure to execute it verbatim constitutes non-compliance.