Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions skills/.curated/codex-pet-generator/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Daniil Makeev (wyddy7)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
177 changes: 177 additions & 0 deletions skills/.curated/codex-pet-generator/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
---
name: "codex-pet-generator"
description: "Create Codex desktop pets from character references by defining row semantics, generating tiny-UI-readable loops, approving or rejecting rows, following slicing guidance, packing a 1536x1872 spritesheet with the bundled packer, validating it, and installing under ~/.codex/pets."
license: "MIT"
---

# Codex Pet Generator

Use this skill when the user wants to create, revise, validate, package, or install a custom Codex desktop pet.

## Core Principles

- Animation direction first, image generation second, deterministic packing third.
- Optimize for tiny UI readability, not for how pretty a large strip looks in isolation.
- Treat each row as one loopable state machine, not eight poster poses.
- Keep canon anchors: one approved scale reference, one seated-body reference, one standing-body reference, and one prop-language reference.
- Every generated row must be marked `approved` or `unapproved` before it can advance.

## Codex Format

Custom pets live at:

```text
~/.codex/pets/<pet-id>/
pet.json
spritesheet.png|webp
```

Required spritesheet:

- `1536x1872`
- `8x9` grid
- `192x208` per frame
- transparent final background
- PNG or WebP

Required `pet.json`:

```json
{
"id": "<pet-id>",
"displayName": "<Display Name>",
"description": "<one-line description>",
"spritesheetPath": "spritesheet.webp"
}
```

`spritesheetPath` is resolved relative to the `pet.json` file. Use the same `<pet-id>` as the parent directory name.

Row order is fixed:

1. `idle`
2. `running-right`
3. `running-left`
4. `waving`
5. `jumping`
6. `failed`
7. `waiting`
8. `running`
9. `review`

For row-by-row semantics, common failure modes, and tiny-UI design guidance, read [references/row-semantics.md](references/row-semantics.md) before prompting.

## Workflow

1. Gather references and write a character bible in plain language.
2. Define all 9 row semantics before generating anything.
3. Pick canon anchors:
- one approved overall scale reference
- one approved seated reference
- one approved standing reference
- one approved prop-language reference
4. Generate one row strip at a time, or individual frames. Do not generate a full 72-frame sheet as the final asset.
5. Review each row with the acceptance ladder in [references/acceptance-checklist.md](references/acceptance-checklist.md).
6. Mark every candidate `approved` or `unapproved`. Only approved rows advance.
7. Extract individual frames into per-row directories. The skill provides written slicing guidance in [references/packing-and-slicing.md](references/packing-and-slicing.md), but the actual extraction is manual — either export frames directly from the generator, or cut strips with your image tool of choice. The bundled packer assumes per-frame inputs and does not slice strips for you.
8. Pack with `scripts/pack_codex_pet.py`.
9. Validate with `scripts/validate_codex_pet.py`.
10. Install into `~/.codex/pets/<pet-id>`.
11. When iterating in the Codex UI, use a new pet id such as `<pet-id>-v2` to avoid cached spritesheets.

## Prompting Rules

Prompts should explicitly state:

- one row equals one loopable action
- frame `8` must hand off cleanly to frame `1`
- frames are sequential animation states, not unrelated poster poses
- same character, same camera, same scale across the row
- exactly two arms and exactly two legs
- no cropped body parts
- no props outside the row-specific action
- final target is a tiny desktop pet sprite, so readability beats nuance

If a row is hard to read:

- do not merely “polish” it
- redesign the motion around bolder state changes
- prefer binary readable mechanics such as `open/closed`, `upright/flat`, `connect/fail`, `tension/release`, or `in/out`

High-risk guidance:

- Standing rows are high-risk for vertical stretch. Always anchor them to an approved compact standing canon.
- Directional rows often collapse into generic running. Reject them if the intended action semantics vanish.
- Gestures often fail when they rely on finger nuance alone. If needed, redesign them into chunkier hand states.
- Failure rows often become generic sadness. Prefer unmistakable failure silhouettes or prop logic.
- Jump rows often become athletic. Heavy toy-like characters usually need compression, shock, or flop logic instead.

## Background and Alpha Rules

- Prefer generating with a removable flat background when possible.
- If you need chroma key, use flat `#00ff00`, no shadows, no gradients, and no green on the character.
- Remove the background locally before packing.
- Zero the RGB channels of fully transparent pixels before final install artifacts if your cleanup leaves preview garbage.

## Approval Gate

Do not carry ambiguous rows forward.

- `approved`: chosen final candidate for that row
- `unapproved`: rejected, superseded, or still exploratory

Only approved rows should be sliced, packed, validated, and installed.

The acceptance ladder and rejection patterns live in [references/acceptance-checklist.md](references/acceptance-checklist.md).

## Slicing and Packing Rules

Slicing is **manual** — the skill provides guidance, not an automated slicer. The packer takes per-frame inputs and assembles them into the final sheet using one uniform scale per row.

- Do not assume a generated row strip is cut into 8 equal visual columns.
- Do not slice approved strips into equal widths unless the spacing is known to be uniform.
- Prefer per-frame export or gap-aware manual slicing based on real empty space between poses.
- The packer uses one scale per row, not one scale per frame.
- Keep at least `8-12px` of padding from cell edges (packer default is `10`, hard cap is half-cell-minus-one).
- Keep exactly one directory per row index inside the rows root. Multiple matching directories (`01-idle-explore`, `01-idle-final`) cause the packer to abort instead of silently picking one — this protects the approval gate.

See [references/packing-and-slicing.md](references/packing-and-slicing.md) for manual slicing workflow guidance.

## Bundled Scripts

Pack approved rows into a final sheet:

```bash
python scripts/pack_codex_pet.py <rows-root> <output.webp>
```

Validate the final sheet:

```bash
python scripts/validate_codex_pet.py <spritesheet.webp>
```

If `pet.json` sits next to the spritesheet, the validator picks it up automatically and checks the install contract (`id`, `displayName`, `description`, `spritesheetPath`). To validate against a `pet.json` in a different location use `--pet-json <path>`. To skip pet.json entirely use `--no-pet-json`.

Both scripts require `Pillow`. Install with `pip install -r requirements.txt`. Run from the bundle root, or use absolute paths.

Interpretation rule:

- validator `errors` are hard blockers — wrong dimensions, empty frames, missing alpha, fully-opaque sheet, malformed `pet.json`
- validator `warnings` still require visual review — fully-opaque single frame, edge contact, width/height drift, `spritesheetPath` mismatch
- width or height drift warnings may reflect real performance changes, but edge-contact warnings usually mean crop risk

## Install Notes

- Install final assets under `~/.codex/pets/<pet-id>/`
- Keep `pet.json` and the spritesheet in the same folder
- Prefer a new id when testing revisions in the UI

If the UI looks broken, first suspect:

- bad row semantics
- bad slicing
- bad alpha cleanup
- bad packing

Do not assume the generator is the only failure point.
4 changes: 4 additions & 0 deletions skills/.curated/codex-pet-generator/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
interface:
display_name: "Codex Pet Generator"
short_description: "Build Codex pets with safe row workflows"
default_prompt: "Use $codex-pet-generator to turn these character refs into a validated Codex desktop pet."
124 changes: 124 additions & 0 deletions skills/.curated/codex-pet-generator/references/acceptance-checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# Acceptance Checklist

Use this file when reviewing generated candidates and deciding what advances to packing.

## Rule Zero

Do not debate polish until the row passes semantics.

If the row does not read correctly at tiny UI size, reject it before discussing detail cleanup.

## Acceptance Ladder

Review rows in this order:

1. Semantic read
2. Loop closure
3. Scale match
4. Anatomy
5. Prop clarity
6. Packing safety

## 1. Semantic Read

Ask:

- does this row clearly express the intended action?
- does it still read when mentally shrunk down?
- is the motion built around strong state changes instead of vague nuance?

Reject if:

- the row tells the wrong story
- the row feels like eight poster poses
- the row only works when viewed large

## 2. Loop Closure

Ask:

- does frame `8` hand off naturally to frame `1`?
- is this a cycle rather than a one-way process shot?

Reject if:

- the loop visibly snaps
- the motion is narrative instead of cyclical

## 3. Scale Match

Ask:

- does this still feel like the same physical figurine?
- does it match the approved scale canon for seated or standing rows?

Standing-row rule:

- standing rows are high-risk by default
- reject rows that grow taller, longer-legged, or more human-like than the approved compact canon

Reject if:

- perceived leg length increases
- overall toy height increases
- seated and standing rows no longer look like the same object

## 4. Anatomy

Ask:

- exactly two arms?
- exactly two legs?
- no duplicate hands, feet, or merged limbs?
- no cropped essential body parts?

Reject if:

- anatomy errors exist
- the “fix” would rely on cropping them away

## 5. Prop Clarity

Ask:

- does the prop help the action read?
- is the prop readable at tiny size?
- is the prop design simple enough?

Reject if:

- the prop blends into the costume
- the prop becomes a blob
- the row requires detail that will vanish in the app

## 6. Packing Safety

Ask:

- will this row survive slicing?
- do limbs, hair, or props extend into neighboring visual gaps?
- is the spacing uniform enough for simple slicing, or does it need gap-aware extraction?

Reject or rework if:

- important parts sit on would-be cut lines
- the strip depends on equal-width slicing when the spacing is visibly uneven

## Approved vs Unapproved

Every candidate must end up in one bucket:

- `approved`: final chosen candidate for that row
- `unapproved`: rejected, exploratory, superseded, or unresolved

Only approved rows should be packed.

## Common Reject Patterns

- tiny-UI unreadable gesture
- standing row stretch
- directional row collapsing into generic running
- jump row becoming too athletic or floaty
- failure row becoming generic sadness
- prop clutter overpowering the character
- frame spacing that will cut off limbs during slicing
Loading