Hatch Pet

Hatch Pet

by:

@OpenSourceBuffGuy

🎨 Image, Video & Audio

Walks an agent through creating, validating and packaging an animated Codex pet from character art or brand cues into a full spritesheet atlas.

Skill files14 files

agents/

references/

scripts/

SKILL.md540 lines
1
---
2
name: hatch-pet
3
description: Create, repair, validate, visually QA, and package Codex-compatible animated pets and pet spritesheets from character art, generated images, company or prospect brand cues, or visual references. Use when a user wants a lightweight-worker Codex pet workflow, a non-pixel custom pet style, a prospect or company mascot pet, or a full 8x9 animated pet atlas with transparent unused cells, QA contact sheets, and pet.json packaging. This skill composes the installed $imagegen system skill for visual generation and uses bundled scripts for deterministic spritesheet assembly.
4
---
5
6
# Hatch Pet
7
8
## Overview
9
10
Create a Codex-compatible animated pet from a concept, brand cue, company/prospect name, one or more reference images, or any combination of those inputs. This workflow keeps the deterministic hatch-pet pipeline for atlas geometry, validation, visual QA, and packaging, while using concise state-specific prompts and allowing any pet-safe visual style.
11
12
User-facing inputs are optional. If the user omits a pet name, infer one from the concept, brand, company, or reference filenames; if that is not possible, choose a short friendly name. If the user omits a description, infer one from the concept or references. If the user omits reference images, generate the base pet from text first, then use that base as the canonical reference for every animation row.
13
14
## Generation Delegation
15
16
Use `$imagegen` for all normal visual generation.
17
18
Before generating base art, row strips, or repair rows, load and follow the installed image generation skill:
19
20
```text
21
${CODEX_HOME:-$HOME/.codex}/skills/.system/imagegen/SKILL.md
22
```
23
24
Do not call the Image API, image CLI, or any other image-generation path directly. Let `$imagegen` choose its own built-in-first path and fallback rules. If `$imagegen` says a fallback requires confirmation, ask the user before continuing.
25
26
When invoking `$imagegen`, pass the generated pet prompt as the authoritative visual spec. Pet prompts should stay concise, state-specific, sprite-production oriented, and grounded in the listed input images. Keep longer policy and QA rules in this skill and the deterministic review scripts rather than expanding them into every image prompt. Do not wrap prompts in the generic `$imagegen` shared prompt schema.
27
28
Use this skill's scripts for deterministic image work only: preparing layout guides and prompts, mirroring approved `running-left`, extracting frames, validating rows, composing the final atlas, and creating contact-sheet plus motion-preview QA media. Parent-owned shell/`jq` steps handle manifest updates, packaging, and cleanup.
29
30
## Storage Controls
31
32
The built-in `$imagegen` path stores generated PNG bytes in the rollout that invokes it, even when it also writes a file under `${CODEX_HOME:-$HOME/.codex}/generated_images`. Deleting files later reduces filesystem use, but it does not shrink an already-written rollout. Keep image generation isolated and bounded:
33
34
- Use one lightweight generation worker per visual job. Do not batch multiple base/row jobs into the same worker.
35
- Workers must return only `selected_source=...` and `qa_note=...`; they must not include Markdown image previews, base64, or extra visual attachments in their final response.
36
- The parent must not open every generated PNG visually. Use worker QA for each job and inspect only the final contact sheet.
37
- After copying the selected generated output into `decoded/`, remove the selected original from `${CODEX_HOME:-$HOME/.codex}/generated_images` when it lives there, then remove its now-empty generation directory if possible.
38
- For storage-sensitive full runs, ask the user whether to use the `$imagegen` CLI fallback when available. That path requires local API credentials and explicit user confirmation, but it can avoid built-in image payloads being embedded in rollout events.
39
40
## Brand Discovery
41
42
If the user provides a brand, company, product, or prospect name rather than a concrete avatar description or reference image, run a lightweight discovery subagent before preparing the pet run. The discovery worker must use web search and prefer official sources such as the brand site, product pages, docs, about pages, press pages, or brand pages. Use reputable secondary sources only when official pages are too thin. Keep the search narrow: enough to extract visual and personality cues, not a market-research brief.
43
44
Skip discovery when the user already provides a concrete mascot/avatar description or reference images, unless the user explicitly asks for brand research.
45
46
Discovery worker responsibilities:
47
48
- search the web for 2-4 relevant sources, preferring official pages
49
- write an adaptive markdown brief rather than a rigid field dump
50
- cover identity/category, audience/use context, visual system, personality/tone, product/domain motifs, mascot translation cues, avoidances, and evidence/confidence
51
- mark mascot guidance that is inferred from sources as inference
52
- avoid copying logos, readable marks, UI screenshots, slogans, or text
53
- end with a compact `Generation handoff` section containing only `brand_name`, `brand_brief`, `avatar_seed`, `avoid`, and `brand_sources`
54
- do not generate images, prepare run folders, or edit unrelated files
55
56
Use this discovery worker prompt:
57
58
```text
59
Research a brand for hatch-pet mascot creation.
60
61
Brand/product/prospect: <brand name>
62
User context: <short user request>
63
Output file: <absolute path to brand-discovery.md>
64
65
Use web search. Prefer official brand, product, docs, about, press, or brand pages. Use reputable secondary sources only if official sources are too thin. Write an adaptive markdown brief to the output file. Headings may flex by brand, but the brief must cover:
66
- identity/category: canonical name, product type, what it does
67
- audience/use context: who it serves and where it appears
68
- visual system: palette, shapes, line quality, materials, typography feel, iconography, patterns
69
- personality/tone: emotional traits, energy, formality, playfulness
70
- product/domain motifs: objects, workflows, verbs, metaphors, environments
71
- mascot translation cues: candidate forms, signature traits, props, what must read at pet size
72
- avoidances: logos/text, trademark-sensitive elements, misleading cues, competitor confusion, poor mascot fits
73
- evidence/confidence: source URLs plus notes where evidence is weak or inferred
74
75
Do not copy logos, readable marks, UI screenshots, slogans, or text. Clearly label mascot guidance that is inferred rather than directly sourced.
76
77
End the brief with a `Generation handoff` section containing exactly:
78
- brand_name=<canonical brand/product name>
79
- brand_brief=<one sentence, max 45 words, covering palette/tone/domain motifs/personality>
80
- avatar_seed=<short mascot-safe visual idea, no logo copying>
81
- avoid=<short comma-separated list>
82
- brand_sources=<comma-separated source URLs>
83
84
Return exactly:
85
brand_discovery_file=<absolute output file path>
86
brand_name=<canonical brand/product name>
87
brand_brief=<same compact sentence from Generation handoff>
88
avatar_seed=<same short seed from Generation handoff>
89
avoid=<same short avoid list from Generation handoff>
90
brand_sources=<same comma-separated URLs from Generation handoff>
91
```
92
93
The parent should save the markdown brief before preparing the run, then pass it to `prepare_pet_run.py` as `--brand-discovery-file` together with `--brand-name`, `--brand-brief`, repeated `--brand-source`, and a concise `--pet-notes` value based on `avatar_seed` when the user did not provide a better avatar description. Keep the full brief for review; only the compact handoff fields should shape prompts. If web search is unavailable and the user gave only a bare brand name, ask for brand cues before generating.
94
95
For a normal pet run, expect up to 10 visual generation jobs: 1 base pet plus 9 row-strip jobs. The Codex app contract currently uses all 9 states: `idle`, `running-right`, `running-left`, `waving`, `jumping`, `failed`, `waiting`, `running`, and `review`. The only deterministic visual derivation is `running-left`, which may be produced by mirroring `running-right` only after `running-right` has been generated, visually inspected, and explicitly approved as safe to mirror. If mirroring is not appropriate, generate `running-left` as a normal grounded `$imagegen` row.
96
97
After selecting a visual output, the parent agent copies that exact image into the job's `decoded/` path and marks the job complete in `imagegen-jobs.json`. Do not write helper scripts that populate row outputs. The deterministic Python scripts may only process already-generated visual outputs.
98
99
Only the base job may be prompt-only. Every row-strip job generated through `$imagegen` must use the input images listed in `imagegen-jobs.json`, including the canonical base reference created after the selected base output is copied. Treat any row generation without attached grounding images as invalid.
100
101
## Pet-Safe Styles
102
103
Default style is `auto`: infer the pet's style from the user's prompt and references, then preserve that style across every row. If the user names a style, honor it. Supported style presets include `pixel`, `plush`, `clay`, `sticker`, `flat-vector`, `3d-toy`, `painterly`, `brand-inspired`, and `auto`.
104
105
Any style is acceptable when it remains pet-safe:
106
107
- compact whole-body silhouette readable inside a `192x208` cell
108
- consistent face, proportions, material, palette, and props across all rows
109
- clean removable chroma-key background
110
- details large enough to read at pet size
111
- no text, labels, UI, or readable logos unless the user explicitly provides approved reference art and asks for them
112
113
Non-pixel styles are first-class. Plush, clay, sticker, vector, 3D toy, painterly mascot, ink, and brand-inspired looks should be accepted when they satisfy the atlas and readability constraints.
114
115
## Transparency And Effects
116
117
Pet rows are processed into transparent `192x208` cells, so every generated pixel must either belong to the pet sprite or be cleanly removable chroma-key background. Prefer pose, expression, and silhouette changes over decorative effects.
118
119
The deterministic raster pipeline owns the transparency invariant: pixels that become fully transparent are normalized so they do not retain hidden RGB residue, and atlas validation should fail if exported files violate that invariant. Do not paper over colored halos or transparent-pixel residue by accepting visually inconsistent outputs.
120
121
Allowed effects must satisfy all of these conditions:
122
123
- The effect is state-relevant and helps explain the animation.
124
- The effect is physically attached to, touching, or overlapping the pet silhouette, not floating nearby.
125
- The effect is inside the same frame slot as the pet and does not create a separate sprite component.
126
- The effect is opaque, hard-edged enough for clean extraction, and uses non-chroma-key colors.
127
- The effect is small enough to remain readable at `192x208` without clutter.
128
129
Avoid these by default because they usually break transparent-background cleanup or component extraction:
130
131
- wave marks, motion arcs, speed lines, action streaks, afterimages, blur, or smears
132
- detached stars, loose sparkles, floating punctuation, floating icons, falling tear drops, separated smoke clouds, or loose dust
133
- cast shadows, contact shadows, drop shadows, oval floor shadows, floor patches, landing marks, impact bursts, glow, halo, aura, or soft transparent effects
134
- text, labels, frame numbers, visible grids, guide marks, speech bubbles, thought bubbles, UI panels, code snippets, checkerboard transparency, white backgrounds, black backgrounds, or scenery
135
- chroma-key-adjacent colors in the pet, prop, effects, highlights, or shadows
136
- stray pixels, disconnected outline bits, speckle/noise, cropped body parts, overlapping poses, or any pose that crosses into a neighboring frame slot
137
138
State-specific guidance:
139
140
- `idle`: keep this calm and low-distraction. Use only subtle breathing, a tiny blink, a slight head or body bob, a very small material sway, or another quiet persona-preserving motion. The loop must still contain visible micro-variation; do not accept six effectively identical copies. Do not show waving, walking, running, jumping, talking, working, reviewing, emotional reactions, large gestures, item interactions, or new props.
141
- `waving`: show the wave through paw, hand, wing, or limb pose only. Do not draw wave marks, motion arcs, lines, sparkles, symbols, or floating effects around the gesture.
142
- `jumping`: show vertical motion through body position only. Do not draw shadows, dust, landing marks, impact bursts, bounce pads, or floor cues.
143
- `failed`: tears, attached smoke puffs, or attached stars are allowed if they obey the allowed-effects rules; do not use red X marks, floating symbols, detached smoke, detached stars, or separate tear droplets.
144
- `waiting`: show that Codex needs approval, help, or user input through an expectant asking pose. Keep it distinct from ordinary idle and review.
145
- `running`: show active task work, processing, thinking, scanning, typing, or focused effort. Do not show literal foot-running, jogging, sprinting, treadmill motion, raised knees, long steps, pumping arms, directional travel, speed lines, dust clouds, floor shadows, motion trails, or detached motion effects.
146
- `review`: show focus through lean, blink, eyes, head tilt, or paw/hand position. Do not add magnifying glasses, papers, code, UI, punctuation, symbols, or other new props unless they already exist in the base pet identity.
147
- `running-right` and `running-left`: show directional drag movement through body, limb, and prop movement only. `running-right` must face and travel right; `running-left` must face and travel left. Their cadence must visibly alternate across the loop rather than repeating one nearly static stride. Do not draw speed lines, dust clouds, floor shadows, motion trails, or detached motion effects.
148
149
## Visible Progress Plan
150
151
For every pet run, keep a visible checklist so the user can see where the work is up to. Create the checklist before starting, keep one step active at a time, and update it as each step finishes.
152
153
Use this checklist for a normal pet run, replacing `<Pet>` with the pet's name or `your pet`:
154
155
1. Getting `<Pet>` ready.
156
2. Imagining `<Pet>`'s main look.
157
3. Picturing `<Pet>`'s poses.
158
4. Hatching `<Pet>`.
159
160
What each step means:
161
162
- `Getting <Pet> ready.` Choose or confirm the pet name, description, source images, style preset, style notes, and working folder. For bare brand/product/company requests, first run the brand discovery worker and capture the compact brand brief, source URLs, and avatar seed.
163
- `Imagining <Pet>'s main look.` Generate the pet's main reference image. This becomes the visual source of truth.
164
- `Picturing <Pet>'s poses.` Generate pose rows through lightweight workers, starting with `idle` and `running-right` to confirm identity and gait. Only mirror `running-left` if `running-right` clearly works when flipped.
165
- `Hatching <Pet>.` Turn the approved poses into final pet files, review the contact sheet, previews, and validation results, fix any broken parts, save `pet.json` and `spritesheet.webp`, then report the output paths.
166
167
Only mark a step complete when the real file, image, or decision exists. If this is a repair run, start from the first relevant step instead of restarting the whole checklist.
168
169
## Default Workflow
170
171
1. Prepare a pet run folder and imagegen job manifest:
172
173
```bash
174
SKILL_DIR="${CODEX_HOME:-$HOME/.codex}/skills/hatch-pet"
175
python "$SKILL_DIR/scripts/prepare_pet_run.py" \
176
--pet-name "<Name>" \
177
--description "<one sentence>" \
178
--reference /absolute/path/to/reference.png \
179
--output-dir /absolute/path/to/run \
180
--pet-notes "<stable pet description>" \
181
--brand-discovery-file /absolute/path/to/brand-discovery.md \
182
--brand-name "<optional researched brand name>" \
183
--brand-brief "<optional compact researched brand cue sentence>" \
184
--brand-source "https://example.com/source" \
185
--style-preset auto \
186
--style-notes "<optional freeform style notes>" \
187
--force
188
```
189
190
All arguments above are optional except any flags needed to express user constraints. For text-only requests, pass the concept through `--pet-notes` and omit `--reference`; `prepare_pet_run.py` will infer a name, description, chroma key, and output directory as needed.
191
For brand-only requests, run the discovery worker first, save the markdown brief, then pass the brief path through `--brand-discovery-file`, `avatar_seed` through `--pet-notes`, `brand_name` through `--brand-name`, `brand_brief` through `--brand-brief`, and each source URL through repeated `--brand-source`.
192
193
2. Inspect `imagegen-jobs.json` for the next ready `$imagegen` jobs. A job is ready when its `status` is not `complete` and every id in `depends_on` is already complete. Prefer reading the manifest directly with `jq` or the editor instead of adding helper scripts for status display:
194
195
```bash
196
jq '.jobs[] | {id, kind, status, depends_on, prompt_file, retry_prompt_file, input_images, output_path, derivation_policy}' /absolute/path/to/run/imagegen-jobs.json
197
```
198
199
3. Generate visual jobs with lightweight workers by default:
200
201
- Generate and copy `base` first, using a lightweight base worker.
202
- Generate and copy `idle` and `running-right` next as the identity and gait check, using one lightweight worker per row.
203
- Inspect `running-right`; mirror `running-left` only when visual identity, prop placement, markings, lighting, and direction semantics remain correct.
204
- Generate `running-left` normally with a lightweight worker when mirroring would change meaning or identity.
205
- Generate the remaining rows with lightweight workers, using every input image listed for each job.
206
207
For each ready visual job, invoke `$imagegen` with the prompt file listed in `imagegen-jobs.json`, every listed input image with its role label, and the default built-in `image_gen` path unless `$imagegen` itself routes otherwise. The parent agent must keep its own image handling minimal: do not open every generated base or row in the parent rollout. Workers return only the selected source path and a one-sentence QA note; the parent records the selected source path in the manifest.
208
209
`prepare_pet_run.py` creates 9 row-specific layout guide images under `references/layout-guides/`, one per animation state. Row jobs attach the matching guide as a layout-only input so the model can follow the correct frame count, spacing, centering, and safe padding. Treat these guides as invisible construction references: the generated row strip must not include visible boxes, borders, center marks, labels, guide colors, or the guide background.
210
211
When generating row strips, keep the identity lock in the row prompt authoritative. Preserve the same style, face, markings, palette, materials, prop design, body proportions, and silhouette from the canonical base. Row jobs attach the layout guide and canonical base by default; the decoded base is kept in the run folder for deterministic processing rather than sent as a redundant generation input.
212
213
If `$imagegen` returns a transport-level `Bad Request` for a row, retry that same row once with its generated `retry_prompt_file`. The retry prompt preserves the row id, frame count, chroma key, canonical-base identity, and state action. Keep the canonical base attached. If the retry still fails, stop and report the failing row and prompt paths instead of switching to any other generation path.
214
215
4. After selecting a generated output for a job, copy it into the decoded output path and mark the job complete. For `base`, also create the canonical identity reference:
216
217
```bash
218
RUN_DIR=/absolute/path/to/run
219
JOB_ID=<job-id>
220
SOURCE=/absolute/path/to/generated-output.png
221
OUTPUT_REL=$(jq -r --arg id "$JOB_ID" '.jobs[] | select(.id == $id) | .output_path' "$RUN_DIR/imagegen-jobs.json")
222
mkdir -p "$(dirname "$RUN_DIR/$OUTPUT_REL")"
223
cp "$SOURCE" "$RUN_DIR/$OUTPUT_REL"
224
```
225
226
```bash
227
if [ "$JOB_ID" = "base" ]; then mkdir -p "$RUN_DIR/references"; cp "$RUN_DIR/$OUTPUT_REL" "$RUN_DIR/references/canonical-base.png"; fi
228
```
229
230
```bash
231
UPDATED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)
232
TMP_MANIFEST=$(mktemp)
233
jq --arg id "$JOB_ID" --arg source "$SOURCE" --arg at "$UPDATED_AT" '(.jobs[] | select(.id == $id)) += {status: "complete", source_path: $source, completed_at: $at}' "$RUN_DIR/imagegen-jobs.json" > "$TMP_MANIFEST"
234
mv "$TMP_MANIFEST" "$RUN_DIR/imagegen-jobs.json"
235
```
236
237
If the copied source is under `${CODEX_HOME:-$HOME/.codex}/generated_images`, delete the original generated file after the decoded copy exists:
238
239
```bash
240
GENERATED_ROOT="${CODEX_HOME:-$HOME/.codex}/generated_images"
241
case "$SOURCE" in
242
"$GENERATED_ROOT"/*)
243
rm -f "$SOURCE"
244
rmdir "$(dirname "$SOURCE")" 2>/dev/null || true
245
;;
246
esac
247
```
248
249
5. Derive `running-left` only when it is visually safe:
250
251
```bash
252
python "$SKILL_DIR/scripts/derive_running_left_from_running_right.py" \
253
--run-dir /absolute/path/to/run \
254
--confirm-appropriate-mirror \
255
--decision-note "<why mirroring preserves this pet's identity>"
256
```
257
258
That script mirrors each generated frame slot in place so the leftward row preserves the rightward row's temporal order. Do not replace it with a whole-strip mirror that reverses animation timing.
259
260
6. When all jobs are complete, run the image-processing scripts directly:
261
262
```bash
263
RUN_DIR=/absolute/path/to/run
264
mkdir -p "$RUN_DIR/final" "$RUN_DIR/qa"
265
```
266
267
```bash
268
python "$SKILL_DIR/scripts/extract_strip_frames.py" \
269
--decoded-dir "$RUN_DIR/decoded" \
270
--output-dir "$RUN_DIR/frames" \
271
--states all \
272
--method auto
273
```
274
275
```bash
276
python "$SKILL_DIR/scripts/inspect_frames.py" \
277
--frames-root "$RUN_DIR/frames" \
278
--json-out "$RUN_DIR/qa/review.json" \
279
--require-components
280
```
281
282
```bash
283
python "$SKILL_DIR/scripts/compose_atlas.py" \
284
--frames-root "$RUN_DIR/frames" \
285
--output "$RUN_DIR/final/spritesheet.png" \
286
--webp-output "$RUN_DIR/final/spritesheet.webp"
287
```
288
289
```bash
290
python "$SKILL_DIR/scripts/validate_atlas.py" \
291
"$RUN_DIR/final/spritesheet.webp" \
292
--json-out "$RUN_DIR/final/validation.json"
293
```
294
295
```bash
296
python "$SKILL_DIR/scripts/make_contact_sheet.py" \
297
"$RUN_DIR/final/spritesheet.webp" \
298
--output "$RUN_DIR/qa/contact-sheet.png"
299
```
300
301
```bash
302
python "$SKILL_DIR/scripts/render_animation_previews.py" \
303
--frames-root "$RUN_DIR/frames" \
304
--output-dir "$RUN_DIR/qa/previews"
305
```
306
307
If the preview GIFs show size popping or baseline jumps caused by per-frame fit-to-cell extraction, and the original row strip itself had stable scale and placement, rerun frame extraction with the explicit row-stability mode and then re-run inspection, atlas composition, validation, contact sheet generation, and previews:
308
309
```bash
310
python "$SKILL_DIR/scripts/extract_strip_frames.py" \
311
--decoded-dir "$RUN_DIR/decoded" \
312
--output-dir "$RUN_DIR/frames" \
313
--states all \
314
--method stable-slots
315
```
316
317
```bash
318
python "$SKILL_DIR/scripts/inspect_frames.py" \
319
--frames-root "$RUN_DIR/frames" \
320
--json-out "$RUN_DIR/qa/review.json" \
321
--require-components \
322
--allow-stable-slots
323
```
324
325
Use `stable-slots` as a deliberate QA-driven correction, not the default. It should reduce extraction-induced motion pops without hiding clipped wide poses or bad source strips.
326
327
Expected output before cleanup:
328
329
```text
330
run/
331
pet_request.json
332
imagegen-jobs.json
333
prompts/
334
decoded/
335
frames/frames-manifest.json
336
final/spritesheet.webp
337
final/validation.json
338
qa/contact-sheet.png
339
qa/previews/*.gif
340
qa/review.json
341
qa/run-summary.json
342
```
343
344
Package output is written outside the run directory by default. If `CODEX_HOME` is set, use it; otherwise use `$HOME/.codex`.
345
346
```text
347
${CODEX_HOME:-$HOME/.codex}/pets/<pet-name>/
348
pet.json
349
spritesheet.webp
350
```
351
352
Package with shell and `jq`:
353
354
```bash
355
RUN_DIR=/absolute/path/to/run
356
PET_ID=$(jq -r '.pet_id' "$RUN_DIR/pet_request.json")
357
DISPLAY_NAME=$(jq -r '.display_name' "$RUN_DIR/pet_request.json")
358
DESCRIPTION=$(jq -r '.description' "$RUN_DIR/pet_request.json")
359
PET_DIR="${CODEX_HOME:-$HOME/.codex}/pets/$PET_ID"
360
mkdir -p "$PET_DIR"
361
cp "$RUN_DIR/final/spritesheet.webp" "$PET_DIR/spritesheet.webp"
362
jq -n --arg id "$PET_ID" --arg displayName "$DISPLAY_NAME" --arg description "$DESCRIPTION" '{id: $id, displayName: $displayName, description: $description, spritesheetPath: "spritesheet.webp"}' > "$PET_DIR/pet.json"
363
```
364
365
Write `qa/run-summary.json` after packaging:
366
367
```bash
368
jq -n --arg run_dir "$RUN_DIR" --arg spritesheet "$RUN_DIR/final/spritesheet.webp" --arg validation "$RUN_DIR/final/validation.json" --arg contact_sheet "$RUN_DIR/qa/contact-sheet.png" --arg review "$RUN_DIR/qa/review.json" --arg package "$PET_DIR" '{ok: true, run_dir: $run_dir, spritesheet: $spritesheet, validation: $validation, contact_sheet: $contact_sheet, review: $review, package: $package}' > "$RUN_DIR/qa/run-summary.json"
369
```
370
371
After deterministic image processing, inspect `qa/contact-sheet.png` and `qa/previews/*.gif` with a lightweight visual QA worker before accepting the pet. Deterministic validation is necessary but not sufficient. Block acceptance if any row changes species/body type, face, markings, palette, material, prop design, style, prop side unexpectedly, or overall silhouette. Motion previews must also reject unintended size popping, reversed or stagnant directional cadence, wrong facing direction, and idle loops that are technically different but visually inert.
372
373
After model visual QA accepts the contact sheet, remove intermediate run artifacts:
374
375
Keep `pet_request.json`, `final/spritesheet.webp`, `final/validation.json`, `qa/contact-sheet.png`, `qa/previews/`, `qa/review.json`, and `qa/run-summary.json`. Remove generated prompt files, layout guides, decoded row strips, extracted frames, `final/spritesheet.png`, and the imagegen job manifest. Skip cleanup when the user wants debug artifacts or the run still needs repair.
376
377
## Lightweight Visual Workers
378
379
Use lightweight subagents for image-heavy work by default. This bounds each `$imagegen` rollout to one selected image, keeps contact-sheet vision payloads out of the parent thread, and reduces cost while preserving the full 9-state app contract.
380
381
## Subagent Delegation
382
383
Unless explicitly forbidden by the user, use subagents for this run. If the user has not allowed the use of subagents, or the intent on subagent use is vague, then ask the user for permission to spawn subagents for parallel lanes of work.
384
385
Parent responsibilities:
386
387
- run the brand discovery worker before preparation when the user provides a bare brand/product/company/prospect name
388
- prepare the run and inspect `imagegen-jobs.json`
389
- assign the base job, row jobs, and final contact-sheet QA to lightweight workers
390
- copy selected worker outputs into their decoded paths and mark jobs complete in `imagegen-jobs.json`
391
- create `references/canonical-base.png` from the selected base output
392
- run the approved `running-left` mirror derivation when appropriate
393
- run deterministic image processing, packaging, repair regeneration, and cleanup
394
395
Base worker responsibilities:
396
397
- handle only the `base` job
398
- read `prompts/base-pet.md` and use any listed reference images
399
- use `$imagegen` only
400
- honor any compact brand inspiration line in the prompt as broad visual/personality guidance, without copying logos, readable marks, UI screenshots, slogans, or text
401
- return only `selected_source=/absolute/path/to/selected-output.png` and `qa_note=<one sentence>`
402
403
Row worker responsibilities:
404
405
- handle exactly one row job
406
- read the row prompt and use all listed input images
407
- use `$imagegen` only; do not draw, edit, tile, or synthesize sprites locally
408
- perform a quick visual sanity check for frame count, identity, chroma background, spacing, clipping, and detached effects
409
- enforce the row prompt's transparency and effects rules, including no detached effects, no wave marks for `waving`, no speed lines or dust for directional running rows, no literal foot-running for the non-directional `running` row, and only attached opaque sprite-like tears/smoke/stars when allowed by the state prompt
410
- return only `selected_source=/absolute/path/to/selected-output.png` and `qa_note=<one sentence>`
411
412
Final visual QA worker responsibilities:
413
414
- inspect `qa/contact-sheet.png` plus the row GIFs under `qa/previews/`, with `qa/review.json` and `final/validation.json` as text context when useful
415
- verify all 9 rows match the Codex app state contract and the same pet identity
416
- return a compact result: `visual_qa=pass` or `visual_qa=fail`, plus row-specific repair notes when failing
417
- do not edit files, queue repairs, package, or clean up
418
419
Model choice for workers:
420
421
- Prefer a smaller capable model for brand discovery, since it returns a compact research brief rather than doing orchestration.
422
- Prefer a smaller capable model for visual workers, such as `gpt-5.4-mini` with medium reasoning, when model override is available.
423
- Use the parent/default model only for orchestration or when a smaller worker model is unavailable.
424
- Keep at most two generation workers active at once unless the user explicitly asks for higher parallelism. Run final visual QA as a single worker after deterministic image processing. Close workers after their result has been consumed.
425
426
Use this base worker prompt:
427
428
```text
429
Generate the hatch-pet base image.
430
431
Run dir: <absolute run dir>
432
Job id: base
433
Prompt file: <absolute base prompt file>
434
Input images:
435
- <absolute path> — <role>
436
437
Use $imagegen only. Read the base prompt and attach every listed input image. If the prompt contains brand inspiration, use it only as broad mascot-safe guidance; do not copy logos, readable marks, UI screenshots, slogans, or text. Before returning, visually check that the result is one centered full-body pet on a flat chroma background, with no text, scenery, shadows, or detached effects.
438
439
Do not edit manifests, copy into decoded, mark jobs complete, generate rows, run image-processing scripts, repair, package, or open unrelated files.
440
Do not include Markdown image previews, base64, or extra attachments in the final response.
441
442
Return exactly:
443
selected_source=/absolute/path/to/selected-output.png
444
qa_note=<one sentence>
445
```
446
447
Use this row worker prompt:
448
449
```text
450
Generate one hatch-pet row.
451
452
Run dir: <absolute run dir>
453
Row id: <row-id>
454
Prompt file: <absolute prompt file>
455
Retry prompt file: <absolute retry prompt file>
456
Input images:
457
- <absolute path> — <role>
458
- <absolute path> — <role>
459
460
Use $imagegen only. Read the row prompt and attach every listed input image. If imagegen returns Bad Request, retry once with the retry prompt and the same input images.
461
462
Before returning, visually check: exact frame count, same pet identity as canonical base, flat chroma background, complete separated unclipped poses, and no detached effects or guide marks. The prompt's transparency and effects rules are mandatory: no detached effects, no wave marks for `waving`, no speed lines or dust for directional running rows, no literal foot-running for the non-directional `running` row, and only attached opaque sprite-like tears/smoke/stars when allowed by the state prompt.
463
464
Do not edit manifests, copy into decoded, mark jobs complete, mirror rows, run image-processing scripts, repair, package, or open unrelated files.
465
Do not include Markdown image previews, base64, or extra attachments in the final response.
466
467
Return exactly:
468
selected_source=/absolute/path/to/selected-output.png
469
qa_note=<one sentence>
470
```
471
472
Use this final visual QA worker prompt:
473
474
```text
475
Visually QA one finalized hatch-pet contact sheet.
476
477
Run dir: <absolute run dir>
478
Contact sheet: <absolute run dir>/qa/contact-sheet.png
479
Preview dir: <absolute run dir>/qa/previews
480
Review JSON: <absolute run dir>/qa/review.json
481
Validation JSON: <absolute run dir>/final/validation.json
482
483
Inspect the contact sheet and the preview GIFs visually. Confirm the same pet identity, style, palette, silhouette, face, proportions, and props across all rows:
484
0 idle, 1 running-right, 2 running-left, 3 waving, 4 jumping, 5 failed, 6 waiting, 7 running, 8 review.
485
486
Fail rows with identity drift, missing/blank frames, copied guide marks, white/nontransparent backgrounds, cropped bodies, slot overlap, detached effects, shadows/glows/smears/dust, chroma-key artifacts, motion that does not match the row state, unintended size popping, wrong facing direction, reversed or non-alternating gait, or idle loops that are effectively static.
487
488
Do not edit files, queue repairs, package, clean up, or inspect unrelated files.
489
490
Return exactly:
491
visual_qa=pass|fail
492
qa_note=<one sentence summary>
493
repair_rows=<comma-separated row ids, or none>
494
repair_notes=<short row-specific notes, or none>
495
```
496
497
## Repair Workflow
498
499
If frame inspection or final visual QA fails, read `qa/review.json`, regenerate the smallest failing scope, copy the replacement row into the same decoded output path, and keep that job marked complete with the new `source_path` and `completed_at`. Repair the failed row, not the whole sheet.
500
501
For identity repairs, use the canonical base image, original references, contact sheet, and exact row failure note as grounding context. Give the row worker the existing row prompt plus a compact repair note from `qa/review.json`; preserve the canonical pet identity and chosen style.
502
503
For extraction-induced motion popping, do not regenerate imagery first. If the source strip already preserves row-level scale and baseline, rerun the deterministic pipeline with `--method stable-slots`, inspect with `--allow-stable-slots`, then re-check the preview GIFs. Regenerate the row only when the original strip itself is clipped, unstable, or semantically wrong.
504
505
## Rules
506
507
- Keep `$imagegen` as the primary generation layer.
508
- For brand/product/company/prospect requests without a concrete avatar description or reference image, run brand discovery before base generation and pass only the compact brief into the run.
509
- Use `$imagegen` as the only visual generation layer. Do not invoke image APIs, image CLIs, local raster generators, or one-off generation scripts from this skill.
510
- Keep reference images attached/visible for `$imagegen` whenever the chosen path supports references.
511
- Attach the row's `references/layout-guides/<state>.png` image to every row-strip job as a layout-only guide, and do not accept outputs that copy guide pixels.
512
- Use lightweight visual workers for base generation, row-strip visual generation, and final contact-sheet QA by default; the parent owns manifest updates, deterministic image scripts, packaging, and cleanup.
513
- Generate every normal visual job with `$imagegen`: base plus all row strips that are not explicitly approved `running-left` mirror derivations.
514
- Treat only the base job as eligible for prompt-only generation; every row job must attach its listed grounding images.
515
- Generate `running-right` before deciding whether `running-left` can be mirrored.
516
- When `running-left` is mirrored, preserve frame order and timing semantics; derive it through the deterministic script instead of mirroring an entire strip wholesale.
517
- Do not derive or reuse `waiting`, `running`, `failed`, `review`, `jumping`, or `waving` from another state; each has distinct app semantics and must be generated as its own row.
518
- Never substitute locally drawn, tiled, transformed, or code-generated row strips for missing `$imagegen` outputs.
519
- Only mark a visual job complete after its selected output has been copied into the decoded output path.
520
- Do not rely on generated images for exact atlas geometry; use this skill's deterministic image scripts.
521
- Use the chroma key stored in `pet_request.json`; do not force a fixed green screen.
522
- Keep the pet's silhouette, face, materials, palette, style, and props consistent across all rows.
523
- Treat visual identity or style drift as a blocker even when `qa/review.json` and `final/validation.json` have no errors.
524
- Treat a contact sheet that shows cropped references, repeated tiles, white cell backgrounds, or non-sprite fragments as failed.
525
- Treat preview GIFs that show extraction-induced size popping, reversed directional timing, wrong facing direction, or inert idle loops as failed.
526
- Treat forbidden detached effects, chroma-key-adjacent artifacts, shadows, glows, smears, dust, landing marks, wave marks, speed lines, or motion trails as failed rows.
527
- Treat `qa/review.json` errors as blockers. Warnings require visual review.
528
529
## Acceptance Criteria
530
531
- Final atlas is PNG or WebP, `1536x1872`, transparent-capable, and based on `192x208` cells.
532
- Used cells are non-empty and unused cells are fully transparent.
533
- Atlas follows the row/frame counts in `references/animation-rows.md`.
534
- Contact sheet and per-row motion previews have been produced and inspected by a lightweight visual QA worker.
535
- `qa/review.json` has no errors.
536
- Row-by-row review confirms the animation cycles are complete enough for the Codex app.
537
- Motion previews do not show unintended size popping, reversed directional cadence, or wrong row semantics.
538
- Non-pixel styles are accepted when readable at pet size and consistent across rows.
539
- `${CODEX_HOME:-$HOME/.codex}/pets/<pet-name>/pet.json` and `${CODEX_HOME:-$HOME/.codex}/pets/<pet-name>/spritesheet.webp` are staged together for custom pets.
540

© OpenAI · Apache 2.0 · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 11,981 prompts

More by @OpenSourceBuffGuy

See all
Neon Fluid Cyber Diagnostic Poster prompt image

Neon Fluid Cyber Diagnostic Poster

Defines a JSON poster style of a monochrome industrial machine photo with liquid neon glow, cropped giant type, magnifier circles, circuit annotations and photocopy grain.

image-prompt, json-prompt, placeholders, poster, typography, structured-output, long-form, advanced, for-designers, for-artists, futuristic, cyberpunk, editorial, photorealistic, neon, film-grain, text-rendering, limited-palette, diagram, dramatic-lighting, graphic-design, style-reference, dark-fantasy

Power Platform MCP Connector Development prompt image

Power Platform MCP Connector Development

Sets rules for building Power Platform custom connectors that expose MCP servers to Copilot Studio, covering JSON-RPC, schema limits, OAuth security and C# scripts.

rule-file, best-practices, api, mcp, developer-tools, authentication, power-apps, dotnet, csharp, for-developers, structured-output, advanced, backend, guardrails, documentation, copilot-studio

Algorithm Efficiency Expert prompt image

Algorithm Efficiency Expert

Acts as an algorithm optimisation expert that analyses time and space complexity, finds bottlenecks and recommends faster algorithms and data structures.

system-prompt, act-as, performance-optimization, algorithms, computer-science, code-review, refactoring, coding, for-developers, expert-advice, code, comparison, step-by-step-guide, xml-tags, structured-output, advanced, best-practices, debugging, coach

Reviews

Loading reviews…

Discussion

Loading comments…