{"slug":"scenario-refine-loop","title":"scenario-refine-loop","summary":"Use when a Scenario output must be checked and improved rather than accepted first roll: iterating a generation until it matches the brief, fixing a batch that came back off-brief, retrying failed shots methodically, wiring an automated generate, review, revise loop, or deciding ","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-10-17T09:10:52.506346Z","repo":{"url":"https://github.com/scenario-labs/skills","stars":1035,"forks":129,"license":"MIT","updatedAt":"2026-10-17T05:01:44Z"},"bodyHtml":"<hr>\n<h2>name: scenario-refine-loop\ndescription: \"Use when a Scenario output must be checked and improved rather than accepted first roll: iterating a generation until it matches the brief, fixing a batch that came back off-brief, retrying failed shots methodically, wiring an automated generate, review, revise loop, or deciding whether to re-prompt, swap references, inpaint, post-process, or change model. Keywords: refine, iterate, critique, review loop, QA, self-correction, verify, acceptance criteria, retry, drift.\"\nlicense: MIT</h2>\n<h1>Scenario Refine Loop</h1>\n<h2>Overview</h2>\n<p>Agents fail generation QA in two symmetric ways: accepting the first roll, or rewording the whole prompt and re-rolling until the budget dies. Both skip the same two artifacts, a written rubric and a diagnosis. The loop that converges: rubric before generating, a small batch, a recorded verdict per asset, the cheapest targeted fix per failure, a hard round cap. Connection and the core loop: see the <code>scenario</code> skill. Critic tool contracts: <code>scenario-asset-analysis</code>. Baseline discipline: <code>scenario-consistency</code>. If a sibling skill named here is missing from your available skills, ask the user to install it (<code>npx skills add scenario-labs/skills --skill &lt;name&gt;</code>); unattended, proceed from tool schemas and flag the gap.</p>\n<h2>Quick reference</h2>\n<table>\n<thead>\n<tr>\n<th>Step</th>\n<th>Do</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>1. Rubric</td>\n<td>Before generating, turn the brief into pass/fail lines a viewer can check (\"subject centered on a plain field\"), never taste words</td>\n</tr>\n<tr>\n<td>2. Generate</td>\n<td>The smallest batch that tests the recipe, at the cheapest size or quality tier the schema offers on which every rubric line can still be judged; <code>dry_run</code> when cost matters</td>\n</tr>\n<tr>\n<td>3. Critique</td>\n<td><code>asset_analyze</code>: up to 10 images per call, one instruction embedding the rubric and a fixed per-image output shape</td>\n</tr>\n<tr>\n<td>4. Fix</td>\n<td>Route every fail line to the cheapest fix that addresses it (table below)</td>\n</tr>\n<tr>\n<td>5. Stop</td>\n<td>A clean round ships; three rounds without one, or one line failing twice under different fixes, means report, not respin</td>\n</tr>\n</tbody>\n</table>\n<p>A tier change is a new generation, not the keeper enlarged: re-run only the keeper's recipe at delivery tier and re-critique it, or keep what passed and upscale it with a fidelity upscaler found by <code>search</code> <code>target=\"models\"</code>, <code>filters={\"tags\": [\"image-upscale\"]}</code>, <code>public=true</code> (fidelity versus creative picks and sizing in <code>scenario-image-editing</code>, video upscaling in <code>scenario-video</code>).</p>\n<p>When the bar is the configured brand brief rather than a task rubric, and the team's Quality Gate add-on is enabled, critique images with <code>asset_quality_gate_run</code> instead: its <code>reasons</code> and <code>suggestions</code> feed the fix table directly (<code>scenario-quality-gate</code>; where the gate is missing it degrades to this <code>asset_analyze</code> path).</p>\n<p>Fix routing, cheapest first:</p>\n<table>\n<thead>\n<tr>\n<th>The verdict says</th>\n<th>Fix</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>One local defect on a keeper</td>\n<td>Masked inpaint of that region; on a schema with no <code>mask</code> field, an instruction edit of the keeper naming that one change (<code>scenario-image</code>)</td>\n</tr>\n<tr>\n<td>A uniform finish off (grade, tint, crop)</td>\n<td>A deterministic tool pass (<code>scenario-image-editing</code>), not a re-roll</td>\n</tr>\n<tr>\n<td>Wrong content, composition, or rendered palette</td>\n<td>Edit the delta clause, re-run from the approved baseline</td>\n</tr>\n<tr>\n<td>Identity or style drift</td>\n<td>Tighten the enumeration, add or re-role references (<code>scenario-consistency</code>)</td>\n</tr>\n<tr>\n<td>Every line failing</td>\n<td>Change the model: re-discover with <code>recommend</code> (capability-shaped; <code>search</code> is for a name, a private model, or a tag-filtered lane such as <code>image-upscale</code>), keep the prompt</td>\n</tr>\n</tbody>\n</table>\n<p>Change one variable per round. A round that swaps prompt, references, and model at once cannot attribute the improvement, so the next failure restarts from zero.</p>\n<h2>The two rules that keep the loop honest</h2>\n<ul>\n<li><strong>Verdicts cite the rubric, not taste.</strong> Instruct the critic to answer per image, in order: <code>&lt;index&gt;: pass|fail, &lt;the failed line&gt;</code>. \"Could be better\" is not a verdict; a loop chasing better instead of the brief sands off exactly what made the direction distinctive and converges on generic output.</li>\n<li><strong>Regenerate from the baseline, never from the last attempt.</strong> Fixes re-run from the approved reference and prompt; chaining output to output compounds drift (<code>scenario-consistency</code> explains why).</li>\n</ul>\n<h2>Worked example: four icons against a brief</h2>\n<ol>\n<li>Rubric from the brief, five lines: single object, centered, plain field, palette #2A9D8F and #E9C46A only, no text.</li>\n<li>Generate four, one <code>model_run</code> each per <code>scenario-image</code>, then <code>jobs_wait</code>.</li>\n<li>One <code>asset_analyze</code> call with all four ids in <code>images</code> and the rubric-plus-shape instruction; answers land as text assets, <code>asset_download</code> them to read the verdicts.</li>\n<li>Two fail. Icon 2 is off palette, which is rendered content rather than a finish: edit the delta clause by pinning the hex codes in the prompt and re-run from the baseline. Icon 4 has one smeared edge: masked inpaint of that corner. Icons 1 and 3 ship untouched.</li>\n<li><code>jobs_wait</code> the fix runs, then re-critique only the two new assets with the byte-identical instruction. Clean round: stop, file the keepers in a collection (<code>scenario-asset-analysis</code>).</li>\n</ol>\n<h2>Common mistakes</h2>\n<ul>\n<li>Judging by glancing at <code>asset_display</code> in chat: unrecorded impressions do not accumulate; verdicts do.</li>\n<li>Asking <code>asset_analyze</code> to improve or fix the image: it returns text only; every fix is a new run.</li>\n<li>Re-rolling the whole batch because one item failed: route per item.</li>\n<li>Writing the rubric after seeing the batch: it inherits the batch's flaws as the standard.</li>\n<li>Running the loop uncapped: failed jobs are reimbursed, unsatisfying ones are not. Gate rounds on the costs the runs themselves report (<code>dry_run</code> prices the next round ahead); <code>usage</code> totals lag and answer the report after the run, not the mid-run gate.</li>\n<li>Retrying a criterion a third time on the same model: two misses under two different fixes is evidence about the model, not bad luck.</li>\n</ul>\n","files":[{"path":"SKILL.md","sizeBytes":7348,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-10-17T09:11:58.429204Z","sha256":"DEE3668614A2B00CB98F165CB5C4942FC7DBB72198BC30CBB2B5CD1C35ACAD28","sizeBytes":2950},"review":null,"source":{"repositoryUrl":"https://github.com/scenario-labs/skills","path":"skills/scenario-refine-loop","license":"MIT","commit":"dc592af7139ffacfe8fdae7dc7efa80f4dd09be3","subtreeSha":"5ABC45CD2BA7B75CF79071E0E544C9354B3C1927F6D796E4A2C57302DECEA6B7","lastSyncedAt":"2026-10-17T09:10:46.286688Z"},"reviewedAt":"2026-10-17T09:13:43.150842Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/scenario-labs/skills/tree/main/skills/scenario-refine-loop"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install scenario-labs-skills@llmmart"},{"target":"git","command":"git clone https://github.com/scenario-labs/skills.git"}]}