CommunityImagegithub.com

Companion Avatar

Create a multi-state animated AI companion avatar (idle / working / waving loops as Animated WebP) plus full PWA / iOS / Android app icons for any app, with identity locked from one AI master image.

What is Companion Avatar?

Companion Avatar is a specialized AI agent skill for generating multi-state animated AI companion avatars and full-stack app icons. It solves common AI video generation problems like facial drift, frame jumps, and background inconsistency by using a locked master image and Python-based 2.5D physical mesh deformation to ensure 100% identity consistency across all states (idle, working, waving). The skill outputs seamless Animated WebP loops at 20fps with zero frame breaks, plus all necessary app icons for PWAs, iOS, and Android Adaptive. It supports platforms like Claude Code, Cursor, and Codex, and works by first generating a frontal master image, then deriving two additional poses via image-to-image grounding, and finally running a build script to synthesize the animated WebP and icon set. Key technical benefits include eliminating `<video>` compatibility issues in webviews (especially with speech recognition and low-power mode) and providing a fixed, reproducible asset pipeline for branding and companion character creation in any project.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/JoshLabs-App/joshlabs-skills/tree/HEAD/skills/companion-avatar

Installed? Explore more Image skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Companion Avatar — Multi-State Dynamic AI Companion Avatar & Desktop Icon Universal Skill

Turn any concept, brand vibe, or material preference into 100% identity-locked, zero frame-jump, five-platform-zero-audio-conflict dynamic AI companions (including idle breathing/head-tilt/blink, working headphone-typing + dual status capsules, waving wake-up greeting/completion celebration — all in seamless dynamic WebP, plus full Web PWA / iOS / Android Adaptive desktop icons).

Why not use <video> or direct AI video generation?

  1. Zero facial drift and zero frame jumps: AI video generation often suffers from hair flickering, facial deformation, impure gray backgrounds, and broken start/end frames. This skill uses "AI-locked high-res master + NumPy 2π periodic bilinear mesh skeletal deformation" to guarantee 100% same character and absolute start-end closure.
  2. Five-platform zero conflicts (especially compatible with STT & power-saving mode): In iOS WKWebView and Android WebView, <video> can pop up playback buttons in low-power mode, and when the microphone is active for speech recognition (STT), it can be interrupted by AVAudioSession. Animated WebP (image/webp) uses the system's native image compositor, providing 0ms offline first-frame output, low power consumption, and full decoupling from voice input.

Standard Four-Step Workflow

Step 1: Determine Material Style & Character Proposal (output master proposal first when comparing multiple options)

Read the Material & Style Preset Prompt Library and the machine-readable directory index presets/manifest.json. You can directly reuse the 6 officially curated out-of-the-box packages (I / J / G / D / B / A, each includes three-state 20fps dynamic WebP, full-stack desktop icons, and 1024×1024 original high-res master *-source-idle-1024.jpg) from ./presets/, or generate new character proposals using one of the 13 uncanny-valley-proof high-quality materials:

  • I · Frosted White Jade with Purple Aura Orb (I-frosted-jade-spirit): Warm matte white jade shell with dreamy purple crystal/lavender glow inside (strictly no yellow light), minimalist and restrained.
  • J · Caramel Malt Curly Teddy Bear Cub (J-curly-teddy-cub): Handcrafted micro-curly plush texture, classic high-contrast warm-toned design with pure white background.
  • G · Cream Orange & White Lucky Fold-Ear Kitten (G-silky-plush-kitten): Ultra-soft rabbit plush patchwork craft, a charming little shopkeeper.
  • D · Nordic White Porcelain with Light Maple Wood Robot (D-nordic-porcelain-bot): Matte white porcelain shell + natural light maple wood ear cap + micro-expressive dark face mask.
  • B · Trendy Matte Silky Soft Vinyl Shiba Inu (B-matte-vinyl-shiba): Trendy matte skin-feel soft vinyl, loyal and energetic.
  • A · Handmade Coarse Wool Felt Owl (A-needle-felt-owl): Handcrafted needle-felted wool texture, scholarly and steady.

Hard constraint: All master prompts must require pure #FFFFFF background, above-chest centered composition, ample safe white margins on top and sides so it perfectly crops into an 82dp circular avatar window and won't cut edges when slightly rotated/tilted.

Step 2: Image-to-Image Grounding from Frontal Master

  1. First generate the idle frontal half-body master, visually verify pure white background, rounded proportions, no text/watermarks.
  2. Use this frontal master as reference input to derive two same-identity poses:
    • working (reply/thinking/calculating state): 3/4 side view facing right, wearing same-color padded over-ear headphones, both paws/hands resting on a mini silver laptop without logos, with ample pure white margins to fully include the device and character inside the inscribed circle.
    • waving (optional, wake-up greeting/completion celebration state): Same frontal proportions, eyes become curved smile arcs ◠ ◠, one paw/hand raised to the side for waving (if not separately generated, the packaging script can also auto-synthesize a closed-eyes smile bounce loop based on idle).

Step 3: Run the Universal Packager to Produce Dynamic WebP & Full-Stack Icons

Call the built-in script build_companion_pack.py (requires python3, Pillow, numpy, cwebp, img2webp on the local machine):

python3 scripts/build_companion_pack.py \
  --idle /path/to/idle_base.jpg \
  --working /path/to/working_base.jpg \
  --waving /path/to/waving_base.jpg \
  --out /path/to/output_dir \
  --prefix bibi \
  --app-icons

The script automatically:

  1. Purifies near-white background to uniform #FFFFFF and fills the circular safe margin;
  2. Auto-detects light face/dark dot eyes or dark mask/luminous pixel eyes, synthesizing natural blink frames without ghosting;
  3. Generates three 280×280 @ 20fps seamless loop animations: <prefix>-idle.webp (breathing + curious head tilt + blink), <prefix>-working.webp (alternating paw typing on keyboard + focused slight nod + screen glow reflection + blink), <prefix>-waving.webp (waving sway + light bounce);
  4. If --app-icons is passed, simultaneously outputs icon-1024.png (iOS RGB without alpha channel), icon-512.png, icon-192.png (PWA), and ic_launcher_fg.png (Android Adaptive 108dp safe zone foreground);
  5. Outputs <prefix>-qa-sheet.png for frame-by-frame visual inspection (must open with read_file to visually verify blink and edge zero artifacts).

Step 4: Integrate Frontend 240ms Three-State Crossfade Circular Window & Dual Status Capsule

Refer to Frontend Three-State Crossfade & Dual Capsule Template to integrate into the host project:

  • All colors must reference the host tokens.css (adhering to global style hard-coded gate, zero wild #hex);
  • All state transition timers in JS must call timer?.unref?.() to avoid blocking Node from exiting in non-browser integration tests.

Presets ship only the animated WebPs, avatar PNGs and QA sheets. The full app icon set and 1024 source images are not included to save space; regenerate with --app-icons when needed. Presets ship only the animated WebPs, avatar PNGs and QA sheets. Run the builder with --app-icons to regenerate the full icon set.

Related Skills