Communitygithub.com

suhongshuo6-cell/ai-character-landing-skill

当用户要为 AI 助手/虚拟角色做可展示的单页落地站(GitHub Pages、强动效、真人对话接入、脸/视频 Hero)时使用。

ai-character-landing-skill 是什么?

ai-character-landing-skill is a Claude Code agent skill that 当用户要为 AI 助手/虚拟角色做可展示的单页落地站(GitHub Pages、强动效、真人对话接入、脸/视频 Hero)时使用。.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add suhongshuo6-cell/ai-character-landing-skill

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

AI Character Landing Page

Create a showcase single-page landing site for any AI assistant / virtual character: GitHub Pages deployable, strong animations, native chat integration, face or video hero. This skill is a universal recipe, not tied to any specific brand or repository.

When to Use

  • User says: make a character landing page / AI personality site / virtual human showcase / single page with a face as hero / GitHub Pages demo with chat
  • Requires: Vite SPA + animations + (optional) Three / video loop + native chat + Pages deployment
  • Do not use for: generic corporate website templates, pure documentation sites, multi-route dashboards, or directly modifying a repository the user has marked as "backup, do not touch"

Hard Rules (Non-Negotiable)

  1. New repository, never overwrite a backup

    • Each new character / version → create a new public repository (e.g., character-landing, character-landing-face).
    • If the user specifies a repository as "backup / do not touch", forbid pushing, modifying workflows, Pages settings, or secrets.
    • Old repository Actions secrets will not automatically copy to the new repository; they must be re-added after creation.
  2. Design first

    • Start with a one-page design brief (mood, color palette, section pacing, Hero format: static face / video loop / 3D), then write code.
    • Adjacent sections must have different layout rhythms (close-up / two-column / horizontal scroll / full-width narrative / spec sheet / closing… rotate).
  3. Generic, keyless, no private paths

    • The recipe and example code must not contain real API keys, absolute local paths, or personal email addresses.
    • Keys go only into .env.local (gitignored) or GitHub Actions secrets; public Pages will expose all VITE_* variables, which is acceptable for assignment demos but must be noted in the README with a recommendation to rotate.
  4. Single page

    • Only one route: /. Details via drawers, overlays, or anchor-scroll; no secondary pages.

Tech Stack (Default)

LayerChoice
BuildVite + TypeScript (strict)
AnimationGSAP + ScrollTrigger + Lenis
3D (optional)Three.js (image rig / simple plate preferred over heavy models)
StylingCSS variables + minimal modules; frosted glass must control contrast
DeploymentGitHub Pages (base: './' or base: '/<repo>/')
ChatNative UI (forbidden to embed official chat via iframe) → Dify app-key → (optional) Vendor API → fakeBrain

Node ≥ 20. Always use pnpm view / npm view to confirm the stable version; do not hardcode version numbers from memory.


Workflow

Phase 0 — Clarification & Repository

  1. Character name, personality, compliance (adult virtual character; no reproduction of real people's likeness; no sexualization).
  2. Hero format: static face / Jimeng (Jimeng) video loop / lightweight 3D.
  3. Whether to connect real chat (Dify app-key / vendor Ark-like API / only fake intelligence).
  4. gh repo create <owner>/<new-name> --public --clone (or equivalent); confirm it is not pointing to a backup repository.
  5. Write .gitignore: node_modules/, dist/, .env.local, .preview-out/.

Phase 1 — Skeleton

<repo>/
  index.html
  package.json
  vite.config.ts          # base adapted for Pages
  .env.example            # placeholder names only, no real values
  public/img/…            # character assets
  src/main.ts
  src/sections/…
  src/ui/askbar.ts        # native chat bar
  src/lib/difyClient.ts
  src/lib/fakeBrain.ts
  src/three/…             # optional
  src/styles/
  .github/workflows/deploy.yml
  README.md
  • Lenis + single scroll progress p ∈ [0,1] (or section anchors) drives animations; follow elements use springs, not cheap lerp.
  • Character layer position: fixed (or equivalent); content layer transparently wraps around.

Phase 2 — Hero: Face Forbidden Zone + Gaze

Face Forbidden Zone

  • Center of the first screen is reserved for the face / video; forbid placing dual dialog boxes, heavy HUDs, or large titles over facial features.
  • Text and CTAs in safe margins (top/bottom/corners); ability bubbles can float at the edges, but must not cover eyes or mouth.
  • Face interaction / pointer feedback only in the face proxy area; lock conflict during scrolling (single pointer, single logic).

Scroll-freeze gaze

  • Pointer movement → eye tracking (spring + deadzone + occasional saccade).
  • Freeze gaze target when the user scrolls (or heavily reduce weight) to prevent eyeball jitter during scrolling.
  • Speaking / listening / thinking states can override gaze; return to center when released.
  • prefers-reduced-motion: disable tracking and large animations.

Phase 3 — Video Loop (Jimeng)

  • Use Jimeng (or similar) to generate a short loop: same character, stable composition, prefer watermarked-free; export and convert to webp/mp4.
  • <video muted playsinline loop autoplay>; include a static poster frame.
  • On mobile, may degrade to static image; be mindful of file size and LCP.
  • In the recipe, only write "use video generation tool to create idle loop"; do not include specific account details or local paths.

Phase 4 — Native Chat (No iframe)

Forbidden to embed official web chat via iframe. Build native askbar:

  1. Input field + message list + streaming typing.
  2. Recommended chain order: Dify (app-key) → optional vendor API → fakeBrain.
  3. Without a key, fakeBrain must be fully playable (intent library + product knowledge + multi-turn memory).
  4. When speaking, dispatch custom events (e.g., character:speaking) to drive mouth / halo; reset upon completion.

Dify app-key path

  • Environment variable example names: VITE_DIFY_API_KEY, VITE_DIFY_BASE_URL (default official https://api.dify.ai/v1).
  • Local: .env.local; Pages: Actions secret injected at build time.
  • Use app type key for chat-messages SSE; handle conversation_id for continuing conversations.
  • On failure, automatically fall back to fakeBrain; CORS / network errors must not cause a blank screen.

Phase 5 — Visual Quality

Frosted contrast

  • Cards with backdrop-filter: blur(...) must ensure text contrast (light text on sufficiently dark semi-transparent background, or vice versa).
  • Meta / title bars in ability areas tend to "float and become unreadable" — use solid colors or higher opacity backing, not pure transparent blur.
  • Avoid high-frequency flashing animations (infinite back-and-forth color/opacity/shadow); looping animation cycles should be ≥ 4s.

Dual-dialog bug

  • Common accident: Hero retains one set of chat UI, and the scrolling stage has another → face blocked, two input fields, state mismatch.
  • Keep only one chat root node on the entire page; Hero should only use short greeting bubbles (read-only) or no bubbles at all.
  • When migrating the askbar, delete the old mount point and search for duplicate id / duplicate listeners.

Phase 6 — GitHub Pages

// vite.config.ts
export default defineConfig({
  base: './', // or '/<repo-name>/'
})
  • All resource URLs must use import.meta.env.BASE_URL + 'img/...'; never hardcode /img/... (sub-paths will 404).
  • Workflow: actions/configure-pages + upload-pages-artifact + deploy-pages; permissions: pages: write, id-token: write.
  • First time: in repository Settings → Pages, allow Actions deployment (or use enablement within workflow).
  • Never modify backup repository's Pages settings or secrets.

Phase 7 — Verification & Delivery

Go through each item in examples/checklist.md. Deliverables: repository URL, Pages URL, README (installation, face/video swap guide, environment variables, degradation notes), known issues table.


Verification Checklist (Summary)

Full details in examples/checklist.md. Minimum requirements:

  • Character face/video visible within 0.5s on the first screen; no dialog blocks the face in the forbidden zone.
  • Gaze does not jitter during scrolling; face interaction / follow-up feels correct.
  • Only one chat entry on the entire page; fake intelligence provides a complete experience.
  • Dify/API failure automatically degrades; no blank screen without a key.
  • Text in frosted glass areas is readable.
  • pnpm build / npm run build succeeds; Pages resources have no 404 errors (BASE_URL).
  • No modifications to any "backup, do not touch" repository.
  • No keys or private paths committed to git.

Common Failures Table

SymptomCauseAction
Images/video 404 on PagesHardcoded absolute path /img/...Use import.meta.env.BASE_URL; check base
Two input fields on the first screenDual dialog residueDelete old mount point; keep only one askbar root
Face blocked by bubbles/HUDFace Forbidden Zone not setMove UI to safe margins; shorten greeting or move to chatStage
Eyeball twitch during scrollingScroll did not freeze gazeFreeze / reduce gaze target weight during scroll
Frosted glass text gray and unreadableInsufficient contrastIncrease background alpha or add solid color backing
Real chat works locally but fails on PagesSecret not injected or CORS issueInject VITE_* via Actions; production should use backend proxy
Connected Dify but still getting fake responsesWrong key type or BASE_URLUse app key; verify /v1/chat-messages
Broke old demo while editingPushed to backup repositoryStop; restore from backup; work on a new repository
Video not looping / not playing on iOSMissing muted playsinlineAdd attributes; include a static poster frame
Chinese title scrambled in animationScramble-type effect on Chinese textDisable scramble for Chinese characters

Chat & Compliance Reminder

  • The character must be an original adult virtual character; no reproduction of identifiable features of real people.
  • No sexualization, sexual innuendo, or close-ups of private areas.
  • Tribute pages must include a prominent disclaimer: unofficial, not affiliated with the original company.
  • Do not commit production keys to public repositories; VITE_ Demo keys for assignments must note the risk in the README and recommend rotation after submission.

Trigger Example

When a user says "Make a landing page for AI bot X with a face as hero, with chat, and deploy on GitHub Pages" → activate this skill, starting from Phase 0.

相关技能