# Verify

> Run CLIP-based quality scoring on AI-generated image frames against configurable thresholds. Returns a GOOD / PASS / FAIL verdict with per-metric breakdown (prompt match, character similarity, palette match, composite). Use whenever the user generates an AI frame and needs objective quality feedback, says "verify", "check quality", "CLIP score", "does this pass", "score this frame", "is this good enough", or is iterating on an AI image pipeline. Trigger this skill as the quality gate between generation and the next step in any AI media loop.

- Skill: `luishiluy/verify` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add luishiluy/verify`
- Raw SKILL.md: https://api.skillmd.com/api/skills/luishiluy/verify/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: LuisHiluy (https://skillmd.com/u/luishiluy)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/luishiluy/verify

---


# Verify — AI Frame Quality Gate

Runs CLIP analysis against configurable thresholds to verify generated frames meet quality standards.

## Quick Reference

### Verify a specific item

```bash
python3 "${CLAUDE_SKILL_DIR}/scripts/verify-scene.py" <ITEM_ID>
```

### Verify an arbitrary image against a prompt

```bash
python3 "${CLAUDE_SKILL_DIR}/scripts/verify-scene.py" \
  --image /path/to/frame.png \
  --prompt "descriptive prompt" \
  --scene_id <ITEM_ID>
```

### Batch verify all items

```bash
python3 "${CLAUDE_SKILL_DIR}/scripts/verify-scene.py" --batch
```

### Get JSON output (for piping to other tools)

```bash
python3 "${CLAUDE_SKILL_DIR}/scripts/verify-scene.py" <ITEM_ID> --json
```

## Workflow: Generate → Verify → Iterate

1. Generate a frame (via any generator — NB2, Flow, Seedance, etc.)
2. Run verification: `python3 scripts/verify-scene.py <ITEM_ID>`
3. Read the verdict:
   - **GOOD** — all metrics above "good" thresholds → approve and move on
   - **PASS** — above fail thresholds but not all good → acceptable, iterate if time permits
   - **FAIL** — any metric below fail threshold → must iterate
4. If FAIL or iterating, check which metric failed, adjust prompt:
   - Low character score → strengthen character descriptors, add reference images
   - Low palette score → reinforce world palette keywords
   - Low prompt match → simplify prompt, front-load key descriptors

## Thresholds

Thresholds are configured in [reference/thresholds.md](reference/thresholds.md). Default suggestions:

| Metric | FAIL < | GOOD ≥ |
|---|---|---|
| prompt_match | 0.27 | 0.30 |
| character | 0.50 | 0.65 |
| palette | 0.55 | 0.70 |
| composite | 0.40 | 0.50 |

Derive your own thresholds by running a baseline pass on known-good frames, then setting FAIL at ~mean−1σ and GOOD at ~mean.

## Dependencies

```bash
pip install transformers torch pillow
```

Expected directory layout (configurable):
- Character refs in `references/approved/characters/`
- Palette refs in `references/approved/palettes/`
- Item prompts in `runs/prompts.json`

## Gotchas

- CLIP model loads ~500MB on first run. Subsequent calls in the same process are instant.
- CLIP text tokenizer truncates at 77 tokens (~300 chars). Front-load important descriptors in prompts.
- Scores are relative, not absolute. A 0.30 prompt match is genuinely good for this model. Don't expect 0.90+.
- Grid images score lower than cropped single frames. Always verify on cropped hero frames, not raw grids.
- Items with no expected character return N/A for the character metric — composite uses palette + prompt only.

