# gary149/h3-game-sprites architecture

> Architecture diagram of the GitHub repository gary149/h3-game-sprites, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gary149/h3-game-sprites
- Repository: https://github.com/gary149/h3-game-sprites

## Overview

h3-game-sprites is an Agent Skill and a small set of standalone scripts for converting generated video into game-ready sprite assets. The documented workflow starts with character and move imagery, then extracts and keys video frames, selects pose frames (including optional loop detection), and packs them into an atlas with shared scale and anchors. The skill also documents prompt guidance and rendered-result checks. Script relationships are shown where their excerpts or README support them; the skill guidance is documented but its full contents were not sampled.

Main entry points: [`skills/h3-game-sprites/scripts/gen_still.py`](https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/gen_still.py) (Still generation), [`skills/h3-game-sprites/scripts/build_atlas.py`](https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/build_atlas.py) (Atlas packing), [`skills/h3-game-sprites/SKILL.md`](https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/SKILL.md) (Pose and clip briefs), [`skills/h3-game-sprites/scripts/sprite_cut.py`](https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/sprite_cut.py) (Frame extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_creation["Image creation"]
  node_still_gen["Still generation<br/>[gen_still.py]"]
  node_character_stills["Character stills"]
  node_move_clips["Move clips"]
end

subgraph group_processing["Frame processing"]
  node_frame_extract["Frame extraction<br/>[sprite_cut.py]"]
  node_chroma_key["Chroma key and metrics<br/>[sprite_cut.py]"]
  node_frame_select["Keyframe selection<br/>[sprite_cut.py]"]
  node_loop_detect["Loop detection<br/>[sprite_cut.py]"]
  node_sprite_outputs["Sprite strips and reports<br/>[sprite_cut.py]"]
  node_keyed_frames["Keyed frames and reports"]
end

subgraph group_export["Atlas export"]
  node_atlas_pack["Atlas packing<br/>[build_atlas.py]"]
  node_atlas_json["Atlas metadata"]
end

subgraph group_guidance["Skill guidance"]
  node_skill_recipe["Pose and clip briefs<br/>[SKILL.md]"]
  node_render_guidance["Scale and draw guidance<br/>[SKILL.md]"]
  node_render_check["Rendered-result checks<br/>[SKILL.md]"]
end

node_artist(("User or agent"))
node_image_model{{"Image model"}}
node_video_model{{"Video model"}}

node_artist -->|"requests still"| node_still_gen
node_still_gen -->|"requests image"| node_image_model
node_still_gen -->|"writes stills"| node_character_stills
node_artist -->|"follows guidance"| node_skill_recipe
node_skill_recipe -->|"specifies still"| node_character_stills
node_skill_recipe -->|"briefs moves"| node_video_model
node_character_stills -.->|"guides generation"| node_video_model
node_video_model -->|"generates clips"| node_move_clips
node_artist -->|"runs on clip"| node_frame_extract
node_frame_extract -->|"supplies frames"| node_chroma_key
node_chroma_key -->|"writes keyed frames"| node_keyed_frames
node_keyed_frames -->|"provides motion data"| node_frame_select
node_frame_select -->|"writes selected outputs"| node_sprite_outputs
node_keyed_frames -->|"provides comparison frames"| node_loop_detect
node_loop_detect -->|"writes cycle selection"| node_sprite_outputs
node_artist -->|"runs on sprites"| node_atlas_pack
node_atlas_pack -->|"reads frames and reports"| node_keyed_frames
node_atlas_pack -->|"writes atlas"| node_atlas_json
node_atlas_json -->|"uses draw offsets"| node_render_guidance
node_render_guidance -->|"informs validation"| node_render_check

click node_still_gen "https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/gen_still.py"
click node_skill_recipe "https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/SKILL.md"
click node_frame_extract "https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/sprite_cut.py"
click node_chroma_key "https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/sprite_cut.py"
click node_frame_select "https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/sprite_cut.py"
click node_loop_detect "https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/sprite_cut.py"
click node_sprite_outputs "https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/sprite_cut.py"
click node_atlas_pack "https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/build_atlas.py"
click node_render_guidance "https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/SKILL.md"
click node_render_check "https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/SKILL.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_still_gen,node_character_stills,node_move_clips,node_artist toneBlue
class node_frame_extract,node_chroma_key,node_frame_select,node_loop_detect,node_sprite_outputs,node_keyed_frames toneAmber
class node_atlas_pack,node_atlas_json toneMint
class node_skill_recipe,node_render_guidance,node_render_check toneRose
class node_image_model,node_video_model toneIndigo
```

## Components

### Image creation

- [Still generation](https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/gen_still.py): `skills/h3-game-sprites/scripts/gen_still.py`
- **Character stills**
- **Move clips**

### Frame processing

- [Frame extraction](https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/sprite_cut.py): `skills/h3-game-sprites/scripts/sprite_cut.py`
- [Chroma key and metrics](https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/sprite_cut.py): `skills/h3-game-sprites/scripts/sprite_cut.py`
- [Keyframe selection](https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/sprite_cut.py): `skills/h3-game-sprites/scripts/sprite_cut.py`
- [Loop detection](https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/sprite_cut.py): `skills/h3-game-sprites/scripts/sprite_cut.py`
- [Sprite strips and reports](https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/sprite_cut.py): `skills/h3-game-sprites/scripts/sprite_cut.py`
- **Keyed frames and reports**

### Atlas export

- [Atlas packing](https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/scripts/build_atlas.py): `skills/h3-game-sprites/scripts/build_atlas.py`
- **Atlas metadata**

### Skill guidance

- [Pose and clip briefs](https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/SKILL.md): `skills/h3-game-sprites/SKILL.md`
- [Scale and draw guidance](https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/SKILL.md): `skills/h3-game-sprites/SKILL.md`
- [Rendered-result checks](https://github.com/gary149/h3-game-sprites/blob/main/skills/h3-game-sprites/SKILL.md): `skills/h3-game-sprites/SKILL.md`

### Other components

- **User or agent**
- **Image model**
- **Video model**

## Connections

- User or agent → Still generation: requests still (evidence: `README.md`)
- Still generation → Image model: requests image (evidence: `skills/h3-game-sprites/scripts/gen_still.py`)
- Still generation → Character stills: writes stills (evidence: `skills/h3-game-sprites/scripts/gen_still.py`)
- User or agent → Pose and clip briefs: follows guidance (evidence: `README.md`)
- Pose and clip briefs → Character stills: specifies still (evidence: `README.md`)
- Pose and clip briefs → Video model: briefs moves (evidence: `README.md`)
- Character stills → Video model: guides generation (evidence: `README.md`)
- Video model → Move clips: generates clips (evidence: `README.md`)
- User or agent → Frame extraction: runs on clip (evidence: `README.md`)
- Frame extraction → Chroma key and metrics: supplies frames (evidence: `skills/h3-game-sprites/scripts/sprite_cut.py`)
- Chroma key and metrics → Keyed frames and reports: writes keyed frames (evidence: `skills/h3-game-sprites/scripts/sprite_cut.py`)
- Keyed frames and reports → Keyframe selection: provides motion data (evidence: `skills/h3-game-sprites/scripts/sprite_cut.py`)
- Keyframe selection → Sprite strips and reports: writes selected outputs (evidence: `skills/h3-game-sprites/scripts/sprite_cut.py`)
- Keyed frames and reports → Loop detection: provides comparison frames (evidence: `skills/h3-game-sprites/scripts/sprite_cut.py`)
- Loop detection → Sprite strips and reports: writes cycle selection (evidence: `skills/h3-game-sprites/scripts/sprite_cut.py`)
- User or agent → Atlas packing: runs on sprites (evidence: `README.md`)
- Atlas packing → Keyed frames and reports: reads frames and reports (evidence: `skills/h3-game-sprites/scripts/build_atlas.py`)
- Atlas packing → Atlas metadata: writes atlas (evidence: `skills/h3-game-sprites/scripts/build_atlas.py`)
- Atlas metadata → Scale and draw guidance: uses draw offsets
- Scale and draw guidance → Rendered-result checks: informs validation (evidence: `README.md`)
