Communitygithub.com

evalix098/tiktoklive

產生並後處理 2D 遊戲精靈與動畫表:像素藝術角色、NPC、生物、法術、投射物、特效、道具、召喚物,以及透明 PNG/GIF 匯出。適用於需要真實精靈表(非程式繪製佔位符)的瀏覽器遊戲,或與地圖美術風格匹配,或產生洋紅色背景表以進行色鍵去背。

tiktoklive 是什麼?

這項技能專為需要自包含 2D 精靈或動畫資源的開發者設計,特別是在 TanStack Start 與瀏覽器遊戲的 app-builder 沙盒環境中。它能產生像素藝術或高清 2D 精靈表,涵蓋角色、NPC、生物、法術、投射物、特效、道具與召喚物,並支援透明 PNG/GIF 匯出。技能支援多種平台(Canvas 2D、Phaser、DOM/<img>),並透過內建的圖像生成與處理腳本(基於 Pillow + numpy)實現高效工作流程。其核心優勢在於自動推斷資產參數(如類型、動作、視角、幀數)、手寫提示詞、強制保持角色在各幀中的居中與比例一致性,以及將寬特效分離至獨立精靈表以避免壓縮主體。技能還包含嚴格的檢查規則,防止單行原始生成導致水平偏移,並支援從多行網格確定性組裝遊戲引擎所需的圖集。

相容平台~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/evalix098/tiktoklive/tree/HEAD/.grok/skills/generate2dsprite

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Generate2dsprite

在 app-builder 沙盒(TanStack Start + 瀏覽器遊戲)中,使用此技能處理自包含的 2D 精靈或動畫資源。

當較大的遊戲或可玩原型需要精靈時,請使用此技能處理可見的精靈資源,並將執行時期/遊戲組合分開處理(匯出後接入 Phaser / Canvas / DOM)。請勿以程式繪製的佔位符取代要求的精靈資源。

App-builder / Grok 環境

項目值
技能目錄.grok/skills/generate2dsprite/
腳本python3 .grok/skills/generate2dsprite/scripts/<script>.py …
影像工具imagine_text_to_image / imagine_image_to_image(基於路徑;提示詞撰寫請參閱 imagine 技能)
檢查影像使用 read_file 讀取 PNG 路徑(非 Codex view_image)
生成影像路徑imagine_text_to_image 回傳沙盒中的 file_path;在處理前將該路徑複製到你的執行目錄
Python 依賴Pillow + numpy(影像環境已預先安裝)
輸出根目錄偏好 /workspace 下的 assets/sprites/<name>/,以便應用程式導入
引擎目標瀏覽器:Canvas 2D、Phaser 或 DOM/<img> — 除非使用者要求,否則非 Godot/Unity

相關技能:imagine(影像工具使用)、game-asset-core(+ game-animation-frames / game-character-consistency,用於品質控制與引擎就緒預設值)、generate2dmap(地圖/道具)、video2dsprite(透過 imagine_image_to_video 實現更密集的動作)、building-games(遊戲循環/整合)。

參數

從使用者請求中推斷出這些參數:

  • asset_type:player | npc | creature | character | spell | projectile | impact | prop | summon | fx
  • action:single | idle | cast | attack | shoot | jump | hurt | combat | walk | run | hover | charge | projectile | impact | explode | death
  • view:topdown | side | 3/4
  • sheet:auto | 2x2 | 2x3 | 2x4 | 3x3 | 3x4 | 4x4 | 5x5 | custom_grid | strip_1x3 | strip_1x4
  • frames:auto 或明確的幀數
  • bundle:single_asset | unit_bundle | spell_bundle | combat_bundle | line_bundle | hero_action_bundle | engine_atlas
  • effect_policy:all | largest
  • anchor:center | bottom | feet
  • margin:tight | normal | safe
  • art_style:pixel_art | clean_hd | pixel_inspired | retro_pixel | map_style | project-native
  • reference:none | attached_image | generated_image | local_file
  • layout_guide:none | optional | recommended
  • prompt:使用者的主題或視覺方向
  • role:僅當資源明顯是 NPC 角色時使用
  • name:可選的輸出縮寫名稱

當請求不明確時,請閱讀 references/modes.md。

代理規則

  • 自行決定資源計劃。當請求已暗示工作表大小、幀數或捆綁結構時,不要強迫使用者明確指定。
  • 不要僅僅為了滿足 4x4、5x5 或自訂引擎圖集,而將不相關的動作打包到一個原始生成的工作表中。一個原始生成的工作表應代表一個動作系列、一個連續序列、一個標準的方向性移動工作表,或一個道具/資源包。
  • 對於可控制的英雄、主要角色以及具有多種動作的高價值玩家資源,首先分別生成每個動作的網格工作表,對每個動作進行品質控制,然後僅在網格通過視覺審查後,再確定性地組裝引擎所需的圖集。
  • 對於可控制的英雄、主要角色以及高價值玩家身體動作,預設將攻擊/射擊/施法身體工作表設定為僅包含身體。不要在身體工作表中包含大型斬擊弧線、槍口閃光、投射物、衝擊爆發、分離的灰塵、長拖尾或寬大的分離特效。將這些作為獨立的 fx、projectile 或 impact 工作表生成,並在遊戲中分層渲染。
  • 僅當目標執行時期明確支援更寬的逐動作儲存格以及逐動作原點/錨點元資料時,才將寬大的攻擊特效包含在同一個原始身體工作表中。否則,寬大的特效邊界框將迫使身體在固定儲存格內縮小。
  • 自行撰寫美術提示詞。不要預設使用提示詞建構腳本。
  • 對每個原始影像使用內建的 imagine_text_to_image。
  • 不要使用 Three.js、Canvas、SVG、HTML/CSS 繪圖、PIL 形狀繪圖、程序化幾何圖形、佔位符基本圖元或程式渲染的螢幕截圖來建立原始精靈美術。執行時期程式碼可以顯示已完成的生成資源,腳本可以製作佈局指南或後處理生成的影像,但請求的精靈美術必須源自內建的 imagine_text_to_image。
  • 當使用者提供或暗示視覺參考時,將該參考的沙盒 file_path 傳遞給 imagine_image_to_image(該工具會讀取檔案)。同時使用 read_file 讀取本地參考,以便你能看到它;僅在提示詞中提及的路徑不是視覺輸入。
  • 當資源是 $generate2dmap 的地圖道具,或使用者/專案請求不同風格時,不要強制使用像素藝術。首先匹配地圖或參考的風格。
  • 僅將腳本用作確定性處理器:洋紅色去背、影格分割、元件過濾、縮放、對齊、品質控制元資料、透明工作表匯出以及 GIF 匯出。
  • 不要使用腳本來生成創意影像提示詞。如果存在舊的提示詞建構命令,僅將其視為歷史相容性,而非正常的技能工作流程。
  • 佈局指南僅允許作為影像生成的確定性幾何參考。它們可以顯示插槽數量、間距、置中與安全邊距,但絕不能定義創意美術方向。
  • 將腳本標誌視為由代理選擇的執行基本元素,而非使用者面向的硬編碼工作流程。
  • 如果生成的工作表觸及儲存格邊緣、比例發生偏移、或破壞投射物/衝擊循環,請使用更好的原始設定重新處理,或重新生成原始工作表。
  • 不要對角色、玩家、可控制英雄、生物、NPC、敵人、召喚物、動畫道具或任何需要主體/主題保持置中的資源,使用原始的單行工作表,如 1x4、1x6、1x8 或 1xN。單行原始生成太容易發生水平偏移和不一致的裁剪。
  • 對於動畫身體資源,預設使用多行網格:4 幀 -> 2x2,6 幀 -> 2x3,8 幀 -> 2x4,9 幀 -> 3x3,12 幀 -> 3x4 或 4x3,16 幀 -> 4x4。
  • 如果遊戲引擎需要最終的單行條帶或混合圖集,首先生成並品質控制多行網格的動作,然後確定性地組裝交付條帶/圖集。
  • 在每個動畫身體網格提示詞中,要求主體身體在每個儲存格中保持置中,完整身體位於中央 60% 到 70% 的安全區域內,各儲存格間比例一致,適用時保持穩定的腳底/底部錨點線,並且沒有肢體、武器、頭髮、斗篷、灰塵、槍口閃光或分離特效跨越儲存格邊緣。
  • 對於英雄攻擊身體提示詞,明確要求身體高度和身體比例與已接受的靜止/奔跑工作表匹配,穩定的腳底/底部錨點,武器保持足夠近以免擴大身體邊界框,並且沒有分離的斬擊弧線或螢幕空間攻擊特效。
  • 對於地圖道具包,在選擇網格前先對道具進行分類。方形 2x2、3x3 和 4x4 包僅適用於緊湊型道具。不要將平台、地板、橋樑、牆壁、梯子、大門、門、長形障礙物、寬/高道具、碰撞承載物體或圖塊集/條帶片段放入方形道具包中;應使用逐一生成、1x3/1x4 條帶、自訂寬儲存格或類似圖塊集的圖集。
  • 保持純色 #FF00FF 背景規則,除非使用者明確要求不同的處理工作流程。

工作流程

1. 推斷資源計劃

選擇最小的有用輸出。

範例:

  • 可控制英雄,四個方向 -> player + player_sheet
  • 側視可控制英雄,包含 idle/run/shoot/jump -> player + hero_action_bundle
    • idle 網格工作表,通常 4 幀用 2x2
    • run 網格工作表,通常根據所需幀數用 2x2 或 2x3
    • shoot 網格工作表,僅包含身體/武器,通常用 2x2
    • jump 網格工作表,通常用 2x2
    • 投射物 / 槍口閃光作為獨立資源(必要時)
    • 可選的引擎圖集,在逐動作品質控制後組裝
  • 側視可控制英雄,包含近戰攻擊 -> player + hero_action_bundle
    • 攻擊身體網格工作表,通常用 2x2 或 2x3,僅身體
    • 斬擊弧線 / 武器軌跡作為獨立的 fx 工作表(當攻擊需要寬大的視覺效果時)
    • 衝擊火花作為獨立的 impact 工作表(當命中需要反饋時)
  • 治療師世界 NPC -> npc + single_asset 或 unit_bundle
  • 大型 Boss 待機循環 -> creature + idle + 3x3
  • 巫師投擲魔法球 -> spell_bundle
    • 施法者施法工作表
    • 投射物循環
    • 衝擊爆發
  • 怪物系列請求 -> line_bundle
    • 規劃 1-3 種型態
    • 每種型態,製作請求實際需要的工作表

2. 手動撰寫提示詞

使用 references/prompt-rules.md。

在撰寫提示詞之前選擇 art_style:

  • 對於經典精靈、16 位元 RPG 角色以及明確要求像素藝術的請求,使用 pixel_art 或 retro_pixel。
  • 對於地圖道具或旨在匹配乾淨手繪 HD 地圖的資源,使用 clean_hd。
  • 僅當使用者想要像素相鄰的外觀但沒有復古的厚重感時,使用 pixel_inspired。
  • 當現有的地圖、遊戲或參考應定義風格時,使用 map_style 或 project-native。

如果涉及參考:

  • 將參考接入呼叫:將其沙盒 file_path 傳遞給 imagine_image_to_image — 或將路徑列表傳遞給 imagine_reference_to_image(用於 2 個以上參考;生成的影像已經有 file_path;本地檔案使用其沙盒路徑)。同時使用 read_file 讀取本地參考,以便你能看到它們。
  • 明確說明參考的角色:保留身份/風格、為相同主題建立動畫工作表、建立演化/變體、或推導出匹配的道具/特效。
  • 保留參考中的穩定身份標記:輪廓、調色板、臉部/眼部特徵、服裝標記、主要配件以及材質語言。
  • 僅允許請求的動作或演化發生變化。除非使用者要求,否則不要重新設計主題。
  • 仍然要求精確的工作表形狀、純色洋紅色背景、幀包含以及各幀間比例一致。

保留嚴格的部分:

  • 純色 #FF00FF 背景
  • 精確的工作表形狀
  • 各幀間相同的角色或資源身份
  • 各幀間相同的邊界框與像素比例
  • 明確的包含:任何東西都不能跨越儲存格邊緣

混合動作圖集護欄:

  • 不要要求 imagine_text_to_image 在一個原始工作表中生成不相關的動作行,例如對於可控制英雄或主要角色:「第 1 行 idle,第 2 行 run,第 3 行 shoot,第 4 行 jump」。
  • 不要要求 imagine_text_to_image 為可控制英雄、角色、生物、NPC、敵人、召喚物或動畫道具生成原始的單行動作條帶,例如 1x4 idle、1x4 run、1x4 shoot 或 1x4 jump。
  • 如果引擎需要組合的 4x4、5x5、自訂圖集或行條帶交付格式,請分別生成動作網格,分別處理和品質控制,然後確定性地組裝交付圖集。
  • 例外情況是標準的方向性移動工作表、一個連續的長動作序列、道具包、類似圖塊集的圖集以及低風險的緊湊型敵人戰鬥工作表。這些仍然需要一個連貫的提示詞和視覺品質控制。
  • 將投射物、槍口閃光、衝擊、灰塵軌跡以及分離的特效保留在單獨的工作表中,除非它們有意成為相同動作輪廓的一部分並保持緊密附著。
  • 對於可控制英雄和主要角色,「緊密附著」在效果的動作邊界框遠比 idle/run 寬或高時是不夠的。預設將寬大的斬擊弧線、槍口閃光、長武器軌跡、灰塵雲和衝擊爆發拆分到獨立的 FX 工作表中。

動畫身體網格護欄:

  • 1x4 和其他原始單行工作表不是動畫身體的有效預設值。這包括玩家、可控制英雄、生物、NPC、敵人、召喚物、動畫道具以及身體附著的戰鬥動作。
  • 對於 4 幀身體動作,使用 2x2。這是 idle、短攻擊、射擊身體、跳躍、受傷、懸浮以及緊湊側視行走/跑步動作的預設值。
  • 對於 6 幀身體動作(如施法、攻擊、召喚、奔跑、衝鋒或變身),使用 2x3。
  • 對於更長的身體動作,使用 2x4、3x3、3x4 或 4x4。優先使用緊湊網格而非長行。
  • 對於 4 方向俯視行走,4x4 可以保留為原始生成形狀,因為它是標準的方向性移動工作表,而非四個不相關的動作行。
  • 如果最終執行時期需要行條帶,請在品質控制後從已處理的多行網格幀中組裝。
  • 保持角色在每個儲存格中置中。身體中心線應保持在儲存格中心附近,可見時腳底/底部錨點應保持在相同的 Y 位置,且主題應僅佔據中央安全區域,並留有充足的洋紅色邊距。
  • 對於攻擊、射擊、施法、衝鋒和其他身體動作,身體高度應接近已接受的 idle/run 身體高度。如果使用固定儲存格執行時期,即使 edge_touch_frames 為空,當身體看起來比 idle/run 小約 10-15% 以上時,應拒絕身體動作輸出。

地圖道具包護欄:

  • 僅將方形 2x2、3x3 和 4x4 原始道具包用於緊湊型道具,例如岩石、灌木、桶子、板條箱、燈具、小標誌、花盆、碎片和小裝飾品。
  • 不要將方形道具包用於寬大或碰撞關鍵的地圖物體:地板、平台、壁架、地形塊、橋樑、牆壁延伸、梯子、道路、軌道、管道、長形尖刺陷阱、大門、門、建築物、大樹、檢查點、出口或建築墊。
  • 對於獨特、大型、重要、高、不規則或碰撞對齊的道具,使用逐一生成。
  • 對於可重複的平台/地板資源,使用 1x3 或 1x4 條帶,包含左蓋、中間重複、右蓋,以及可選的斜坡/角落/末端變體。
  • 對於多個相同類型的…

…(原文截斷,為避免遺漏,此處為已翻譯的完整內容)

Individual skills in this repo

This repo contains 17 individual skills — each has its own dedicated page.

evalix098/tiktoklive

Add user accounts and sign-in to this TanStack Start app. Use when the app needs authentication, sign-in, user accounts, protected routes, or per-user data. Triggers on "auth", "login", "log in", "sign in", "sign up", "account", "users", "authentication", "protected", "who is logged in", "current user", "per-user".

evalix098/tiktoklive

Build browser games and interactive/canvas/3D experiences in this TanStack Start + React app. Use for any game, simulation, or WebGL/Canvas experience — 2D or 3D, single-player. Covers the game loop & timing, 3D orientation/camera conventions, collision, performance, assets, audio, save, game feel, and per-genre playbooks. For WASD / vehicle / flight **input signs and inverted A/D**, open the **`controls`** skill — do not rely on this file or racing-kart alone. Triggers on "game", "minecraft", "fps", "platformer", "racing", "tetris", "snake", "shooter", "3d", "three.js", "canvas", "voxel", "physics".

evalix098/tiktoklive

Player-facing input signs for browser games: WASD, vehicles, flight, FPS mouse-look, and the #1 failure mode (inverted A/D). Mandatory control self-tests and a tiny test interface so you can verify A turns left before shipping. Load for ANY game with movement, steering, flying, driving, tanks, boats, mechs, drones, planes, karts, third-person follow cams — not only racing. Triggers on "controls", "WASD", "inverted", "steer", "flight", "airplane", "kart", "vehicle", "yaw", "roll", "pitch", "mouse look", "A/D".

evalix098/tiktoklive

Design and build polished, non-generic UI for this TanStack Start + React + Tailwind v4 + shadcn/Radix app. Use whenever you create or restyle any interface surface — pages, landing pages, dashboards, forms, modals, nav, and game overlays (start screens, HUD, menus). Covers design tokens, layout, typography, color, spacing, motion, and the anti-"AI-slop" rules that keep output from looking generic. Triggers on "design", "UI", "make it look good", "polish", "landing page", "theme", "style", "redesign", "ugly", "clean up".

evalix098/tiktoklive

Deep guide for game ANIMATION assets: motion cycles, action keyframes, effect sequences, and animation sprite sheets — built around a video-first pipeline. In this app-builder sandbox, execute via the video2dsprite / generate2dsprite skills (magenta + scripts), not ad-hoc ffmpeg. Use whenever generating anything that moves: walk/run cycles, attacks, idles, FX, flags, fire, animation sheets. Complements game-asset-core.

evalix098/tiktoklive

Core discipline for ANY game-asset generation with Imagine tools: the engine-ready defaults users don't state, spec checklists, style anchoring, read-back verification, honest defect flagging. Use whenever generating any game art (sprites, sheets, animations, tiles, UI, FX) — then ALSO load the matching specialist skill: game-animation-frames for anything that moves, game-tilesets for tiles/terrain, game-character-consistency for recurring characters, game-ui-icons for UI and icons.

evalix098/tiktoklive

Deep guide for CHARACTER IDENTITY across images: turnarounds (front/side/ back), state and damage variants, palette swaps, equipment changes, and same-character-in-context sets. Use whenever generating character turnarounds, character sheets, variants of an existing sprite, or any same-subject multi-image set. Complements game-asset-core.

evalix098/tiktoklive

Deep guide for game TILE assets: seamless tileable textures, terrain transition tilesets, autotiles, and ground/platform tiles. Use whenever generating tileable textures, tilesets, terrain transitions, or seamless patterns. Complements game-asset-core.

evalix098/tiktoklive

Deep guide for game UI assets: buttons with interaction states, panels, bars, wordmark logos, and icon sets. Use whenever generating game UI elements, HUD assets, inventory icons, icon sets, buttons, or title logos. Complements game-asset-core.

evalix098/tiktoklive

Generate production-oriented 2D game maps with `imagine_text_to_image`: RPG/top-down maps, side-scroller parallax stages, tilemaps, layered raster maps, prop packs, collision zones, and walkable areas. Use when building browser games that need real map art (not pure code-drawn tiles), layered props, or map collision metadata. Triggers on "map", "level", "stage", "tilemap", "overworld", "dungeon", "side scroller background", "prop pack", "2D map".

evalix098/tiktoklive

How to use the Imagine tools in Grok Build: imagine_text_to_image, imagine_image_to_image, imagine_reference_to_image, imagine_text_to_video, imagine_image_to_video, imagine_reference_to_video, and render_file for chat previews. When to build a visual with code instead of generating it, prompt-craft, reference-first handling of real people, factual grounding, and asset-consistency. Load this whenever generating or editing an image or video is on the table. Tool-usage-driven, not triggered by a user merely mentioning images.

evalix098/tiktoklive

Peer-to-peer realtime multiplayer over WebRTC data channels: every user of the deployed app connects directly to every other user (full mesh), the server only brokers the handshake at /api/rtc. Lowest possible latency, zero per-message server cost. Use for 2-8 player co-op/casual realtime: shared cursors, drawing, party games, casual action. Triggers: p2p, peer to peer, webrtc, low latency multiplayer, direct connection.

evalix098/tiktoklive

Use Neon Postgres (the database) in this TanStack Start app. Use when the app needs to store or query data, persist state, or keep per-user data. Triggers on "database", "Postgres", "Neon", "save data", "store data", "persist", "tables", "SQL", "query", "migrations".

evalix098/tiktoklive

Share-link previews and app identity for apps on *.grok.me: the injector-owned og:image card, the SVG favicon, and PWA icons for installable apps. Use when scaffolding, renaming, or restyling the app — and for share / unfurl / OG / Twitter card questions. A custom 1200×630 card from the app's own art is the default — games of every kind (DOM board/word games included), whimsical apps, creative tools, and brand-forward pages; only plain utilities keep the placeholder. Always run the brand-asset pass as a `task` subagent and never wait for it. Triggers on "share", "rename", "app name", "OG", "Open Graph", "twitter card", "unfurl", "og:image", "og:type", "x:game:image", "x-banner", "link preview", "social card", "thumbnail", "preview image", "favicon", "app icon", "PWA", "manifest", "installable", "home screen", "SEO", "meta description".

evalix098/tiktoklive

Official Three.js API and TSL (Three.js Shading Language) reference for LLM code generation. Load when writing or debugging three.js / WebGL / WebGPU / custom materials / shaders / GLTF / advanced three APIs beyond basic game loop/controls. Prefer building-games for game correctness (loop, WASD, camera, orientation); use this skill for full API/TSL depth. Triggers on "three.js", "threejs", "WebGPU", "TSL", "NodeMaterial", "shader", "GLTF", "MeshStandard", "OrbitControls", "WebGLRenderer".

evalix098/tiktoklive

Grok Build only. Turn a 2D character still into denser animation sprites via imagine_text_to_image base → imagine_image_to_video (6s/10s run-in-place) → ffmpeg frames → magenta chroma-key → dense sampled strips/grids/GIFs. Use when the user wants video-to-sprite, smoother run/walk cycles, or denser intermediate poses. Prefer generate2dsprite for crisp production pixel sheets. Triggers on "video to sprite", "imagine_image_to_video sprite", "dense walk cycle", "smooth run animation from video".

evalix098/tiktoklive

Call the xAI API (Grok) from this app's server code using the injected XAI_API_KEY: chat/LLM features, image and video generation (Imagine), and voice (text-to-speech). Use when the app needs any "AI" / "assistant" / "chatbot" / "Grok" functionality, runtime image/video generation, or speech. Triggers on "AI", "LLM", "chatbot", "assistant", "Grok", "xAI", "generate text", "summarize", "generate image", "AI video", "voice", "text to speech", "TTS", "OpenAI" (use xAI instead).

相關技能