$npx -y skills add WU-HAOTIAN34/2dimg2motion --skill img2mo-learnLearn reusable 2D motion-generation knowledge from user-specified action resources with /img2mo-learn <resource>. Use when the user provides videos, extracted frame sequences, spritesheets, Spine assets, generated outputs, failed attempts, or reference motion folders and wants
| 1 | # Img2mo-learn |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Use this skill when the user invokes: |
| 6 | |
| 7 | ```text |
| 8 | /img2mo-learn <resource-path-or-folder> |
| 9 | img2mo-learn <resource-path-or-folder> |
| 10 | ``` |
| 11 | |
| 12 | The goal is to turn finished or reference motion assets into reusable project knowledge. Store learned knowledge in the project-level `img2mo-knowledge/` folder, never in the installed Codex skill directory during normal work. |
| 13 | |
| 14 | ## Input Resolution |
| 15 | |
| 16 | Resolve the argument after `img2mo-learn` as follows: |
| 17 | |
| 18 | 1. If it is an existing relative or absolute path, use it directly. |
| 19 | 2. If it is a bare name, first try `sample\<name>`, then `output\<name>`, then `motion\<name>`. |
| 20 | 3. If it is a folder, inspect likely assets in this order: `manifest.json`, `preview.gif`, `contact-sheet.*`, `spritesheet.*`, `fullframe/`, `frames/`, Spine `.json/.atlas/.skel`, then videos. |
| 21 | 4. If no matching resource exists, report the missing path and ask for the correct path. |
| 22 | |
| 23 | Supported resources: |
| 24 | |
| 25 | - video files such as `.mp4`, `.mov`, `.webm`; |
| 26 | - PNG frame folders, spritesheets, contact sheets, or GIF previews; |
| 27 | - project outputs from this skill such as `output/<action-id>/`; |
| 28 | - Spine-style assets such as `.json`, `.atlas`, `.skel`, texture folders; |
| 29 | - local reference-library folders under `motion/`. |
| 30 | |
| 31 | ## Knowledge Location |
| 32 | |
| 33 | Create this structure if missing: |
| 34 | |
| 35 | ```text |
| 36 | img2mo-knowledge/ |
| 37 | |-- index.md |
| 38 | |-- learnings.jsonl |
| 39 | |-- action-patterns.md |
| 40 | |-- style-patterns.md |
| 41 | |-- prompt-patterns.md |
| 42 | `-- failures.md |
| 43 | ``` |
| 44 | |
| 45 | Append one JSON object per learning session to `img2mo-knowledge/learnings.jsonl`. Keep Markdown files concise and curated; do not paste huge logs, full prompts, or complete frame listings. |
| 46 | |
| 47 | ## Learning Workflow |
| 48 | |
| 49 | 1. **Identify the resource type.** |
| 50 | - For video: read frame size, fps, duration, and frame count with `ffprobe` when available. |
| 51 | - For frame sequences: count frames, inspect canvas sizes, alpha/background, and contact sheet if present. |
| 52 | - For spritesheets: infer grid/cell count when possible; otherwise describe visible beats. |
| 53 | - For Spine assets: inspect animation names, bone/slot names, skins, attachments, timeline names, and texture organization without assuming rendered motion if frames are not available. |
| 54 | |
| 55 | 2. **Create review surfaces if useful.** |
| 56 | - For video or frame folders, create temporary or output-side contact sheets and preview GIFs if they do not exist. |
| 57 | - Do not alter the source resource. |
| 58 | - Do not store bulky extracted frames in `img2mo-knowledge/`; store outputs under `output/` or `tmp/` and reference their paths in JSON. |
| 59 | |
| 60 | 3. **Summarize motion timing.** |
| 61 | - Identify action type: attack, walk, idle, block, suffer, death, born, skill/cast, or other. |
| 62 | - Record frame count, fps, loop behavior, and major beats. |
| 63 | - For attacks, prefer beat labels such as `guard`, `anticipation`, `acceleration`, `contact`, `contact hold`, `follow-through`, `recovery`. |
| 64 | - Record which frame ranges are most useful as key poses. |
| 65 | |
| 66 | 4. **Summarize pose and topology lessons.** |
| 67 | - Record active limb/feature, weapon or prop owner, anchor limb/surface, facing direction, and stable baseline behavior. |
| 68 | - Note silhouette expansion, squash/stretch, center drift, foot/bottom baseline, and whether motion needs extra canvas margin. |
| 69 | |
| 70 | 5. **Summarize style lessons.** |
| 71 | - Record line weight, palette, shading, material treatment, outline softness, shape language, effects style, and background/keying considerations. |
| 72 | - Distinguish character style from detached effects. |
| 73 | |
| 74 | 6. **Summarize prompt lessons.** |
| 75 | - Write reusable prompt clauses that could improve later generation. |
| 76 | - Keep prompt clauses short and parameterized; avoid overfitting to one character name unless the lesson is character-specific. |
| 77 | |
| 78 | 7. **Summarize failures and constraints.** |
| 79 | - Record what should be rejected: hand swaps, scale popping, bad alpha, cut weapons, over-crowded sheets, text/watermark contamination, or mismatched style. |
| 80 | |
| 81 | 8. **Write project knowledge.** |
| 82 | - Append structured session data to `learnings.jsonl`. |
| 83 | - Update the relevant Markdown files with durable, reusable lessons. |
| 84 | - If the learning is only useful for one output, also write `output/<action-id>/retro.md`. |
| 85 | |
| 86 | ## JSONL Schema |
| 87 | |
| 88 | Each line in `img2mo-knowledge/learnings.jsonl` should be a compact JSON object: |
| 89 | |
| 90 | ```json |
| 91 | { |
| 92 | "id": "learn-YYYYMMDD-HHMMSS-short-name", |
| 93 | "date": "YYYY-MM-DD", |
| 94 | "source": "relative/or/absolute/path", |
| 95 | "resource_type": "video|frame_sequence|spritesheet|spine|output|reference_folder", |
| 96 | "action_type": "attac |