Skip to content
Back to search

hbg-life-simulation

SkillWorks with Claude CodeGitHub

Create Chinese HBG “模拟人生 / 人生副本” narrative videos with a consistent comic IP, a rapid multi-life opening, continuous natural-speed narration, synchronized short captions, dense static manga storyboards, audible fixed-level BGM, alternating zoom/pan motion in HyperFrames, and a consent-gated localhost-only account-backed Images API through CLIProxyAPI as the preferred image channel. Use for 模拟人生、人生副本、统一主角漫画、快闪职业开头、旁白配图、静态漫画分镜、zoom 推拉、左右平移、Edge TTS、字幕压制、本地反代自己的 Codex 账号、CLIProxyAPI,或把长篇中文人生故事组装成视频。

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/mr-funny--hbg-life-simulation/badge.svg)](/listings/mr-funny--hbg-life-simulation)

HTML

<a href="/listings/mr-funny--hbg-life-simulation"><img src="/api/listings/mr-funny--hbg-life-simulation/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 249 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ---
  2. name: hbg-life-simulation
  3. description: Create Chinese HBG “模拟人生 / 人生副本” narrative videos with a consistent comic IP, a rapid multi-life opening, continuous natural-speed narration, synchronized short captions, dense static manga storyboards, audible fixed-level BGM, alternating zoom/pan motion in HyperFrames, and a consent-gated localhost-only account-backed Images API through CLIProxyAPI as the preferred image channel. Use for 模拟人生、人生副本、统一主角漫画、快闪职业开头、旁白配图、静态漫画分镜、zoom 推拉、左右平移、Edge TTS、字幕压制、本地反代自己的 Codex 账号、CLIProxyAPI,或把长篇中文人生故事组装成视频。
  4. ---
  5. # HBG Life Simulation
  6. Build a repeatable Chinese narrative-video pipeline: preserve the story, lock character identity, create an HBG opening, align narration, generate sufficiently dense comic frames, add restrained camera motion, mix audible BGM, and deliver a verified MP4.
  7. ## Required skill order
  8. 1. Read `/imagegen` before generating or editing raster art.
  9. 2. Read `/hyperframes`, then the required HyperFrames domain skills before authoring or rendering.
  10. 3. Read `/media-use` for narration, captions, BGM, or SFX.
  11. 4. Read `/code-video-visual-qa` before the final visual pass.
  12. ## Required project artifacts
  13. Keep these files in every project:
  14. - `SCRIPT_SOURCE.md`: verbatim user copy.
  15. - `PROJECT_SPEC.json`: story-specific title, chapters, corrections, narration settings, opening assets, flash lives, and audio paths; never hard-code these values in builders.
  16. - `SCRIPT.md`: narration-ready copy; record meaningful corrections at the top.
  17. - `CHARACTERS.md`: immutable identity, clothing, age, and relationship rules.
  18. - `STORYBOARD_BASE.json`: semantic beats with narration-relative `cueTime`.
  19. - `STORYBOARD.json`: final global timing and asset paths.
  20. - `PROMPTS.md`: exact ImageGen prompts and call identifiers.
  21. - `HBG_STYLE.json`: single source of truth for orientation, canvas, caption style/safe area, opening motion, approved opening path, and BGM baseline.
  22. - `audio_meta.json`: real durations and opening/body timing.
  23. - `assets/generated/anchors/`: approved identity/style anchors.
  24. - `assets/generated/sheets/`: original generated sheets.
  25. - `assets/generated/scenes/`: split final scene images.
  26. - `qa/`: source snapshots, encoded frames, media probes, and mix previews.
  27. Never silently rewrite plot, viewpoint, tone, ending, or character motivation.
  28. ## Workflow
  29. ### 0. Select the image channel before project work
  30. Read [references/local-account-api.md](references/local-account-api.md) and [references/image-generation.md](references/image-generation.md). Run this read-only readiness check before initializing a new HBG project:
  31. ```bash
  32. scripts/setup_local_cliproxyapi.sh ready
  33. ```
  34. Prefer the user's own localhost CLIProxyAPI account channel, but require explicit confirmation for each new project before consuming account capacity. Never treat invoking this Skill as consent to use the account, install software, start the proxy, start OAuth, log in, or repair an account session.
  35. - If the result is `ready`, tell the user a local account API is available and ask whether to use it for this project. Select `local-account-api` only after the user agrees; do not manually open, print, or summarize its protected environment or OAuth files.
  36. - If the result is `not-running`, ask before starting the configured local proxy.
  37. - If the result is `not-configured` or `unhealthy`, explicitly ask whether to initialize or repair CLIProxyAPI with the user's own account. State that CLIProxyAPI is a third-party proxy, the user must complete browser/device login personally, the flow remains subject to account permissions, quotas, and provider terms, and the setup includes a models check plus one image smoke test that consumes account capacity.
  38. - Do not start image generation, run `start`, `install`, `bootstrap`, `login`, or an OAuth-capable installer command until the user clearly agrees in the current conversation. Do not infer consent from the story request or Skill invocation.
  39. - Never ask the user to paste an account password, Cookie, OAuth record, access token, or API key. Never inspect `auths/`, `client.env`, browser storage, cookies, or provider account data.
  40. - After consent, let the user complete OAuth in the browser or device-code page. Run only non-secret readiness/models checks and the disclosed single-image test.
  41. - If the user declines, the account lacks image entitlement, or the local channel cannot be made healthy without further account action, select `built-in-imagegen` and continue.
  42. Use this consent prompt or a concise equivalent:
  43. ```text
  44. 是否使用你自己的账号在本机初始化 CLIProxyAPI,作为本次人生副本的默认生图接口?
  45. 这会安装第三方 CLIProxyAPI,并打开浏览器或显示设备码,由你本人完成登录。Agent 不会读取账号、Cookie、OAuth 文件或密钥。初始化后会检查 models,并生成 1 张测试图验证图片权限;这会消耗你的账户额度,且仍受账户权限、配额和服务条款限制。
  46. 是否继续?
  47. ```
  48. When the result is already `ready`, use a shorter prompt that still discloses account usage:
  49. ```text
  50. 检测到你已配置好的本地 CLIProxyAPI。是否使用你自己的账号为本项目生成图片?这会消耗你的账户额度,并仍受账户权限、配额和服务条款限制。
  51. ```
  52. Record only the selected channel, consent state, provider label, model, and concurrency in `PROJECT_SPEC.json`. Never record an endpoint, key, OAuth path, token, Cookie, or account identifier.
  53. ### Initialize the project style
  54. Before step 1, initialize and read the style system:
  55. ```bash
  56. # Default: landscape 16:9, 1920×1080
  57. node scripts/init_project_style.mjs PROJECT_DIR
  58. # Only when the user explicitly asks for portrait / 9:16 / vertical video
  59. node scripts/init_project_style.mjs PROJECT_DIR --orientation portrait
  60. ```
  61. If the user does not specify orientation, always use landscape. Portrait is supported but never inferred from short-video subject matter, platform, or a previous project. Read [references/style-system.md](references/style-system.md). Do not author separate HTML and ASS style constants, and never copy raw landscape caption/crop coordinates into portrait or vice versa.
  62. Create `PROJECT_SPEC.json` before running any builder. Read [references/project-spec.md](references/project-spec.md). Story-specific data belongs in this file or the semantic storyboard, not in JavaScript. Run the shared builders from the project directory:
  63. ```bash
  64. node SKILL_DIR/scripts/build_script.mjs
  65. node SKILL_DIR/scripts/build_storyboard_base.mjs
  66. node SKILL_DIR/scripts/build_narration.mjs
  67. node SKILL_DIR/scripts/build_composition.mjs
  68. ```
  69. ### 1. Normalize and estimate
  70. Preserve the source first. Correct only unmistakable transcription errors, broken pronouns, punctuation, or domain terms. Keep second-person narration unless asked otherwise.
  71. Write correction `from` values as the smallest unique source fragment. Do not span optional punctuation or paragraph line breaks when two smaller replacements are safer; source copy often contains transcription-inserted newlines, so long literal replacements create avoidable validation retries.
  72. Estimate duration before generating art. Use 3.4–4.2 Chinese characters per second as an early estimate, then replace estimates with real TTS/VTT timing.
  73. ### 2. Lock the visual IP
  74. Read [references/visual-system.md](references/visual-system.md). Derive project-specific identities in `CHARACTERS.md`; never reuse characters from an example story. Generate and approve the required character anchor or anchors before story scenes. Repeat immutable facial traits in every later prompt; never rely on names alone.
  75. ### 3. Build the HBG opening
  76. Read [references/opening-system.md](references/opening-system.md). Treat the opening as a fixed module inside the full video, not as the whole skill.
  77. Keep the mandatory order:
  78. 1. Narrate only `今天体验的人生副本是……`.
  79. 2. Immediately run ratchet SFX and rapid alternate-life flash together.
  80. 3. Stop on the selected-life image.
  81. 4. Narrate the complete selected-life title while that image remains visible.
  82. 5. Start body narration only after the reveal finishes.
  83. Render Chinese titles in HTML, never inside generated images.
  84. After the opening preview is approved, bind its exact path in `audio_meta.opening.previewVideo` or adopt it to the canonical `HBG_STYLE.json` path. Full rendering must fail when that approved file is absent; never silently reuse an older preview or the raw flash/SFX video.
  85. ### 4. Generate narration and timing
  86. Default to one continuous full-story Edge TTS asset at `+0%` rate. Keep only the opening lead and selected-life reveal as separate TTS assets. Preserve the VTT and treat it as the master timeline.
  87. Treat line wrapping in `SCRIPT.md` as editorial formatting, not speech direction. Before sending the chapter body to Edge TTS, join wrapped lines without inserting a pause and rely on sentence punctuation for phrasing. Never let a newline divide a word, amount, date, measurement, or sentence. Add missing punctuation such as a colon before a spoken list as a recorded source correction rather than letting a line break imitate punctuation.
  88. Derive scene starts, chapter starts, and captions from real cue times. Never distribute scenes evenly after audio exists.
  89. Burn in short synchronized captions, but preserve complete semantic phrases. Use Chinese word segmentation and punctuation boundaries before considering character count. Landscape captions may normally use 8–18 Chinese characters; portrait normally uses 8–14. A complete short utterance such as `你点头` may remain short, but a split operation must never leave a one-to-five-character suffix such as `起来`, `柜上`, `栗子`, `清楚`, or `一步`. Keep one line where possible and no more than two lines. Remove sentence-ending punctuation when the spoken pause already supplies it. Read the values from `HBG_STYLE.json`; do not duplicate them in a composition builder. Use the orientation-specific caption baseline from [references/style-system.md](references/style-system.md): landscape defaults to 48 px with a 58 px bottom margin at 1920×1080; the validated portrait baseline uses 48 px with a 280 px bottom margin at 1080×1920. In ASS, `BorderStyle=3` requires non-zero box padding/outline; zero makes the encoded background effectively disappear. Keep the complete caption box inside the safe area for the selected orientation.
  90. Run `node scripts/audit_caption_semantics.mjs PROJECT_DIR` after narration generation. Do not build the composition when it reports a short split tail, an undersized generated fragment, or a narration line that ends without sentence punctuation.
  91. ### 5. Enforce storyboard density
  92. Read [references/storyboarding.md](references/storyboarding.md). Select semantic beats, then audit every calculated scene duration.
  93. - Target ordinary still duration: 4–8 seconds.
  94. - Allow 8–12 seconds only for a deliberate emotional hold or complex visual reading.
  95. - Split ordinary scenes longer than 12 seconds.
  96. - Treat any scene longer than 16 seconds as a mandatory missing-image defect.
  97. - For an 8–12 minute narration, expect roughly 70–110 stills unless the user explicitly chooses a sparse style.
  98. - For other lengths, size the first storyboard from real TTS duration instead of reusing the 8–12 minute count: start near `ceil(bodyDuration / 6.5)` stills, with a practical range of `bodyDuration / 8` to `bodyDuration / 5`. A 14–15 minute story normally needs about 125–165 stills. Place extra beats proactively inside long explanatory paragraphs, repeated financial details, internal-identity conflict, and denouement passages before generating art.
  99. Add a new still when location, time, dominant action, emotional power, focal object, or memory state changes. Do not hide sparse coverage with an extra-long zoom.
  100. Before building API prompts, write `participants.count` and `participants.allowed` explicitly on every semantic scene. Do not infer participant count later from a keyword heuristic: pronouns such as `他`, `对面`, or `当着他的面` are easy to miss and can turn a two-person action into an incorrect solo frame. Treat missing participant metadata as a planning defect.
  101. ### 6. Generate scene art
  102. Use the image channel selected in step 0. Generate strict 2×2 sheets only when four related, low-risk beats share characters and setting. Require equal panels, uniform black gutters, no text, no captions, no speech bubbles, no logos, and no watermark. Generate high-risk frames as standalone images rather than grid panels: hand close-ups, overlapping limbs, phone front/back orientation, typing, smoking, chopsticks, soldering or other tool contact, and identity-critical hero shots. If a grid panel fails one of these checks, regenerate that beat alone; never rescue it by cropping around the defect.
  103. Opening flash sheets must preserve the target orientation at the panel level. For a landscape project, use standalone landscape images or strict 2×2 sheets whose individual panels are landscape; never split a 5×2 landscape sheet into ten portrait cells and then enlarge them with `object-fit: cover`. Resolve every final flash asset to the exact canvas size before composition building: 1920×1080 for landscape or 1080×1920 for portrait. `validate_style_system.mjs` treats a mismatched flash asset as a hard failure.
  104. The user-owned localhost CLIProxyAPI path is the preferred default after the consent and readiness gate in step 0. Built-in ImageGen is the fallback after decline, failed entitlement, or an unavailable local channel. A user-approved CLIProxyAPI localhost endpoint may supply the bundled imagegen CLI path only after `/v1/models` and one disclosed image smoke test pass. Never store an API key in the project, skill, prompt JSONL, shell history file, or report. After the anchor is approved, independent sheets may run concurrently; default to 5 and cap concurrency at 10. Treat one sheet or standalone frame as one generation job. API output must still be displayed visibly in chat, saved project-locally, inspected, and counted.
  105. For API batches, create `assets/generated/prompts/SHEET_MAP.json` before generation. Map every job to final scene IDs in panel order and prove that every storyboard scene is covered exactly once. Generate into a dedicated staging directory. Some compatible providers or CLI versions flatten `out` subdirectories to basenames when `--out-dir` is used; never assume `sheets/g01.png` will remain nested. Resolve staged files by verified basename, reject collisions, then copy sheets and singles into canonical project directories.
  106. Do not trust the requested API size as the delivered pixel size. Probe every output and normalize every final scene to the exact canvas (`1920×1080` landscape or `1080×1920` portrait) before composition building. Split sheets only after confirming four independent panels and uniform gutters.
  107. Every prompt must declare the exact number of visible people and which characters are allowed. Do not paste the entire supporting-character roster into every prompt: models may insert every described character. Add an explicit prohibition such as `No other person may appear` for identity-critical and high-risk frames.
  108. After every call:
  109. 1. Show the generated sheet visibly in chat.
  110. 2. Save it under `assets/generated/sheets/`.
  111. 3. Inspect identity, anatomy, real-world object orientation and use, gutters, and panel order.
  112. 4. Split it with `scripts/split_2x2.sh`.
  113. 5. Inspect the split images before adding them to the storyboard.
  114. Reject physically impossible anatomy or props even when the image is otherwise attractive. Before judging pose quality, count each visible person's arms, hands, palms, and fingers; confirm every hand belongs to one arm, has the expected number of digits, and remains spatially distinct under overlap. For every hand close-up, inspect the source at 100%: trace each fingertip backward through one palm, one wrist, and one forearm. If overlap makes the number or ownership of hands impossible to prove, reject the frame instead of assuming the anatomy is hidden correctly. A two-hand contact shot must show exactly two wrist-to-palm chains and must not contain a third palm-shaped mass, duplicated finger fan, or finger cluster emerging from beneath another hand. Reject extra, fused, detached, duplicated, ownership-ambiguous, or impossible hands. Phones must have the screen facing the viewer/user, cameras and buttons on plausible sides, fingers wrapping the device naturally without passing through it, and the gaze aligned with the visible screen. Apply the same reality check to cigarettes, chopsticks, bowls, soldering irons, circuit boards, doors, chairs, bedding, tools, and every hand-object contact.
  115. Use separate calls for unrelated settings or identity-sensitive hero frames.
  116. ### 7. Animate static frames
  117. Use deterministic linear camera motion and alternate directions:
  118. - zoom in: `scale 1.00 → 1.10–1.13` with slight x/y drift;
  119. - zoom out: `scale 1.12 → 1.00`;
  120. - pan left/right: retain `scale 1.07–1.11`, move no more than 4% of frame width;
  121. - emotional hold: `scale 1.00 → 1.025`;
  122. - use hard cuts for memory fragments and short dissolves only for emotional continuity.
  123. Animate an image child inside a full-bleed clipped wrapper. Never overlap transform tweens on the same element. Keep every image covering the canvas throughout its motion.
  124. ### 8. Mix narration, SFX, and BGM
  125. Keep narration, ratchet SFX, BGM, and images on distinct tracks. Default to a constant BGM baseline with no narration-triggered ducking or repeated volume automation.
  126. Create a 15–20 second opening mix preview before rendering the full video. Start with an audible bed around 8–12 dB below narration, then adjust in 3–4 dB steps by ear. Preserve at least 3 dB true-peak headroom in the encoded mix. Use [references/opening-system.md](references/opening-system.md) for the validated HBG example.
  127. ### 9. Assemble in HyperFrames
  128. Use one clip per beat or one sub-composition per chapter. Derive clip timing from aligned narration. Use HTML for titles, act labels, and captions. Generate `第一幕`, `第二幕`, and later act labels from the configured chapter count; do not assume exactly ten chapters. Avoid game HUD counters unless explicitly requested.
  129. ### 10. Render long videos safely
  130. Read [references/render-and-qa.md](references/render-and-qa.md) before rendering any video longer than four minutes.
  131. 1. Run `scripts/preflight_long_render.sh PROJECT_DIR`; keep at least 12 GiB free for a 1080p high-quality 8–12 minute render unless a measured project-specific estimate proves less is safe.
  132. 2. Run `node scripts/validate_style_system.mjs PROJECT_DIR`; do not start the long render unless the approved opening, safe caption ratios, flash zoom, and selected-life zoom pass.
  133. 3. Run `scripts/render_long_video.sh PROJECT_DIR OUTPUT.mp4`. It enables chunked encoding, raises the FFmpeg timeout, and uses VideoToolbox on macOS by default.
  134. 4. If measured HyperFrames capture would materialize the full timeline and exceed safe disk space, validate and use `scripts/render_streaming_ffmpeg.mjs PROJECT_DIR OUTPUT.mp4`. Keep scene timing, motion, captions, chapter labels, opening, and audio mix identical; change only the rendering transport.
  135. 5. Always render to a new revisioned filename. Never overwrite the last verified MP4.
  136. 6. On `ENOSPC`, stop and inspect exact `renders/work-<renderJobId>-*` or `renders/ffmpeg-work-<output-name>` directories. Delete only abandoned render work directories after confirming no matching render process is alive; preserve source assets and completed MP4 files.
  137. 7. On `ffmpegEncodeTimeout`, do not recapture repeatedly with the same settings. Keep chunked encoding enabled, use a supported hardware encoder, and raise `FFMPEG_ENCODE_TIMEOUT_MS`.
  138. ### 11. Quality gate
  139. Do not deliver until:
  140. - the anchor and generated sheets are visible in chat;
  141. - every referenced asset is project-local;
  142. - the duration-density audit reports no unexplained scene over 16 seconds;
  143. - `hyperframes check --strict` passes;
  144. - source hero frames and transition midpoints are inspected;
  145. - encoded opening, body transitions, long holds, and final frame are inspected;
  146. - the HTML preview and final ASS caption path both use `HBG_STYLE.json`, and at least one encoded ASS caption frame has a visible background box inside the selected orientation's safe area;
  147. - every visible person has the correct count and ownership of limbs, hands, palms, and fingers, including during overlaps;
  148. - every hand close-up has been opened at full resolution and each fingertip has been traced to exactly one palm, wrist, and forearm; unverifiable occlusion is a rejection, not a pass;
  149. - every important prop is oriented and used plausibly, with special attention to phone front/back direction and hand-object contact;
  150. - resolution, FPS, duration, frame count, audio streams, true peak, and black-frame detection are verified.
  151. - the final encoded MP4, not only source snapshots, has been checked with `scripts/verify_final_video.sh` at the opening, every corrected/high-risk shot, one phone/tool shot, one body transition, and the ending.
  152. Regenerate identity-drifted sheets. Never conceal bad faces or sparse storyboarding with motion blur or speed.
  153. ## Reusable helpers
  154. - `scripts/audit_storyboard_density.mjs`: report or gate storyboard holds longer than 12/16 seconds.
  155. - Run the density audit with the JSON path, for example `node scripts/audit_storyboard_density.mjs PROJECT_DIR/STORYBOARD.json`; passing the project directory itself is invalid.
  156. - `scripts/audit_caption_semantics.mjs`: reject semantic split tails, undersized generated caption fragments, and narration lines without terminal punctuation.
  157. - `scripts/build_script.mjs`: turn `SCRIPT_SOURCE.md` plus `PROJECT_SPEC.json` into a corrected, chaptered `SCRIPT.md`.
  158. - `scripts/build_storyboard_base.mjs`: validate and normalize the agent-authored semantic storyboard without embedding story beats in code.
  159. - `scripts/build_narration.mjs`: generate config-driven continuous Edge TTS, captions, audio timing, and final storyboard timing.
  160. - `scripts/build_composition.mjs`: build a config-driven HyperFrames project with dynamic chapters, opening lives, titles, BGM, and orientation layout.
  161. - `scripts/init_project_style.mjs`: create a locked landscape `HBG_STYLE.json` by default, or a portrait one only with `--orientation portrait`, without overwriting an existing project style.
  162. - `scripts/validate_style_system.mjs`: fail fast on wrong opening dimensions/duration, unsafe caption ratios, missing ASS box padding, or absent opening zoom.
  163. - `scripts/split_2x2.sh`: split a generated sheet into four landscape 1920×1080 PNGs by default, or portrait 1080×1920 PNGs when passed `portrait`.
  164. - `scripts/make_contact_sheet.sh`: create a contact sheet for review.
  165. - `scripts/preflight_long_render.sh`: check free disk space and list abandoned render work directories before a long render.
  166. - `scripts/render_long_video.sh`: run revision-safe long-form HyperFrames rendering with chunked encoding and an extended timeout.
  167. - `scripts/render_streaming_ffmpeg.mjs`: low-disk fallback that renders each still to a short zoom/pan segment, concatenates, burns captions, and mixes the final audio without writing every timeline frame.
  168. - `scripts/verify_final_video.sh`: probe the encoded MP4, scan black/silent intervals and loudness, extract named QA frames, and build a contact sheet.
  169. - `scripts/setup_local_cliproxyapi.sh`: check local readiness without exposing secrets, then—with explicit consent—install a checksum-verified CLIProxyAPI release outside projects, bind a user-owned account to localhost, and create a protected OpenAI-compatible client environment for batch work.
README.md · README · 354 lines · 2 findings marked

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <p align="center">
  2. <img src="docs/showcase/hero.svg" alt="HBG Life Simulation" width="100%" />
  3. </p>
  4. <p align="center">
  5. <a href="https://github.com/Mr-funny/hbg-life-simulation/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/Mr-funny/hbg-life-simulation/ci.yml?branch=main&style=flat-square&label=CI" alt="CI" /></a>
  6. <img src="https://img.shields.io/badge/Agent%20Skill-SKILL.md-8b5cf6?style=flat-square" alt="Agent Skill" />
  7. <img src="https://img.shields.io/badge/Default-1920%C3%971080-e96e3d?style=flat-square" alt="1920x1080" />
  8. <img src="https://img.shields.io/badge/Portrait-supported-32756a?style=flat-square" alt="Portrait supported" />
  9. <img src="https://img.shields.io/badge/TTS-Edge-0f766e?style=flat-square" alt="Edge TTS" />
  10. <img src="https://img.shields.io/badge/Visuals-ImageGen-2563eb?style=flat-square" alt="ImageGen" />
  11. <img src="https://img.shields.io/badge/Local%20API-preferred-0f766e?style=flat-square" alt="Preferred local API" />
  12. <img src="https://img.shields.io/badge/QA-final%20MP4-25221f?style=flat-square" alt="Final MP4 QA" />
  13. </p>
  14. <p align="center">
  15. 把中文“模拟人生 / 人生副本”长文案制作成<strong>统一漫画 IP 的完整旁白视频</strong>。<br />
  16. <strong>快闪人生开头 · 连续自然语速 · 语义字幕 · 静态漫画推拉 · 稳定 BGM · 最终成片质检</strong>
  17. </p>
  18. <a id="agent-install"></a>
  19. ## ⚡ 一句话安装进 Agent
  20. 把下面整段话直接发给 Codex、Claude Code,或其他支持 `SKILL.md` 的 Agent:
  21. ```text
  22. 请从 https://github.com/Mr-funny/hbg-life-simulation 安装
  23. hbg-life-simulation skill。
  24. 请自动识别当前 Agent 的全局 skills 目录;如果已经存在旧版本,请先备份再更新。
  25. 安装后检查 SKILL.md、agents、assets、references 和 scripts 是否完整,
  26. 并校验所有 Shell、JavaScript 和 JSON 文件。
  27. 不要读取、打印、复制或上传任何本地 API Key、会话日志、用户文案、
  28. 生成图片、音频、视频、BGM 或项目素材。
  29. 验证完成后,告诉我如何使用 $hbg-life-simulation
  30. 把一段中文人生故事制作成统一漫画 IP 的横屏旁白视频。
  31. ```
  32. 安装完成后可以直接说:
  33. ```text
  34. 使用 $hbg-life-simulation 处理下面的人生故事。
  35. 默认横屏,先保存原文并锁定主角 IP,再生成连续 Edge TTS、同步短字幕和密集漫画分镜,
  36. 使用 HBG 快闪开头、交替 zoom/pan、恒定 BGM,最后输出并检查完整 MP4。
  37. ```
  38. Skill 会先做一次不读取凭据内容的本地代理就绪检查,然后针对每个新视频项目询问是否使用用户自己的账号生图。即使代理已经就绪,也不能把“调用 Skill”当成账户额度使用或 OAuth 同意。用户同意后,登录仍由用户本人在浏览器或设备码页面完成;用户拒绝或账户没有图片权限时,才回退到内置 ImageGen。
  39. | 统一 IP | 连续旁白 | 语义分镜 | 最终质检 |
  40. |:---:|:---:|:---:|:---:|
  41. | 锚点人物 + 固定特征 | 一篇正文一条音轨 | 4–8 秒静态漫画镜头 | 检查编码后的 MP4 |
  42. ## 🎯 它解决的不是“做一个幻灯片”,而是“交付完整故事”
  43. | 常见问题 | Skill 的处理方式 |
  44. |---|---|
  45. | 开头只有职业名,没有完整人生标题 | 固定 lead → 快闪/齿轮 → 选中人生 → 完整标题顺序 |
  46. | 快闪没有速度感 | 每一帧交替强 zoom-in / zoom-out,并检查编码后运动差值 |
  47. | 主角每张图换脸 | 先生成身份锚点,再在每个提示词重复不可变面部特征 |
  48. | 手机拿反、手指融合、工具不合现实 | 手机、手部和工具镜头使用单图,并进行全分辨率现实检查 |
  49. | 一张图停留几十秒 | 根据真实 TTS 时长规划密度,普通镜头控制在 4–8 秒 |
  50. | 字幕留下两三个字断尾 | 使用中文语义分词、标点边界和短尾审计 |
  51. | 画面比语音晚几秒 | 所有分镜从 Edge TTS 的真实 VTT 时间轴对齐 |
  52. | BGM 忽大忽小或完全听不见 | 默认固定音量,不做逐句 ducking,用开头预览校准 |
  53. | 竖屏参数污染横屏项目 | 默认锁定 1920×1080,只有明确要求才启用 1080×1920 |
  54. | 浏览器预览正常,成品出现黑帧或字幕越界 | 对最终编码 MP4 再做黑帧、静音、响度和关键帧检查 |
  55. > [!IMPORTANT]
  56. > 自动检查通过不等于视频完成。只有人物锚点、宫格拆图、高风险手部/手机镜头、开头运动、字幕安全区和最终编码 MP4 都经过检查,才允许交付。
  57. ## ✨ 核心能力
  58. | 模块 | 能力 |
  59. |---|---|
  60. | 文案整理 | 原文归档、最小转写修正、动态章节切分 |
  61. | 主角 IP | 固定年龄、脸型、发型、识别点、服装与阶段变化 |
  62. | HBG 开头 | 多人生快闪、齿轮/棘轮音效、完整选中人生标题 |
  63. | TTS | 正文一条连续 Edge TTS,默认 `+0%` 自然语速 |
  64. | 字幕 | 真实 VTT 时间、语义短句、无句尾标点、横竖屏独立安全区 |
  65. | 分镜 | 真实音频驱动密度,静态漫画单图与 2×2 宫格混合 |
  66. | 生图 | 默认优先使用用户自己的 localhost CLIProxyAPI;拒绝或不可用时回退内置 ImageGen |
  67. | 本地账户 API | 每个项目先确认;安装、启动、修复或 OAuth 前再次明确说明,用户本人完成登录 |
  68. | 镜头运动 | 交替 zoom-in、zoom-out、pan-left、pan-right 与情绪 hold |
  69. | 音频 | 连续旁白、快闪 SFX、固定增益 BGM 分轨混合 |
  70. | 渲染 | HyperFrames 组合;长片支持低磁盘流式 FFmpeg 压制 |
  71. | QA | 字幕、密度、样式、黑帧、静音、响度、手部、手机与最终帧检查 |
  72. ## 🚀 快速开始
  73. ### 方法一:让 Agent 自动安装(推荐)
  74. 复制 README 首屏的[自然语言安装提示](#agent-install)发给 Agent。
  75. ### 方法二:安装到 Codex
  76. ```bash
  77. curl -fsSL https://raw.githubusercontent.com/Mr-funny/hbg-life-simulation/main/install.sh | sh
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 102 on GitHub
  78. ```
  79. 默认安装到:
  80. ```text
  81. ${CODEX_HOME}/skills/hbg-life-simulation
  82. ```
  83. 未设置 `CODEX_HOME` 时使用 `~/.codex/skills/hbg-life-simulation`。
  84. ### 方法三:安装到 Claude Code
  85. ```bash
  86. curl -fsSL https://raw.githubusercontent.com/Mr-funny/hbg-life-simulation/main/install.sh | sh -s -- --claude
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 116 on GitHub
  87. ```
  88. ### 方法四:明确同意后安装并初始化自己的本地账户 API
  89. 下面的命令会额外下载经过 SHA-256 校验的 [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) 官方发布包,使用 Codex OAuth 登录用户自己的账户,并把服务限制在 `127.0.0.1`:
  90. ```bash
  91. curl -fsSL https://raw.githubusercontent.com/Mr-funny/hbg-life-simulation/main/install.sh | \
  92. sh -s -- --with-local-proxy --proxy-provider codex --accept-oauth-risk
  93. ```
  94. 无浏览器回调环境可以使用设备登录:
  95. ```bash
  96. curl -fsSL https://raw.githubusercontent.com/Mr-funny/hbg-life-simulation/main/install.sh | \
  97. sh -s -- --with-local-proxy --proxy-provider codex-device \
  98. --proxy-no-browser --accept-oauth-risk
  99. ```
  100. > [!WARNING]
  101. > CLIProxyAPI 是 MIT 许可的第三方 OAuth 代理,不是模型提供商的官方 API 客户端。它不会绕过订阅权限、限额、速率限制或服务条款。只允许登录用户本人拥有或获授权管理的账户。
  102. 这组命令本身就是用户的明确操作与风险确认。Agent 不得自行替用户运行带 `--with-local-proxy`、`bootstrap`、`login` 或 `--accept-oauth-risk` 的命令;必须先在当前对话中询问并获得清晰同意。OAuth 页面和设备码页面只能由用户本人操作。
  103. 本地代理配置、客户端密钥和 OAuth 记录默认保存在项目目录之外,并使用受限文件权限。安装器不会修改 Codex 自身的连接配置;这个接口只供明确选择的兼容客户端和批处理脚本使用。
  104. 生命周期命令:
  105. ```bash
  106. SKILL_DIR="${CODEX_HOME:-$HOME/.codex}/skills/hbg-life-simulation"
  107. "$SKILL_DIR/scripts/setup_local_cliproxyapi.sh" status
  108. "$SKILL_DIR/scripts/setup_local_cliproxyapi.sh" ready
  109. "$SKILL_DIR/scripts/setup_local_cliproxyapi.sh" smoke-test
  110. "$SKILL_DIR/scripts/setup_local_cliproxyapi.sh" stop
  111. "$SKILL_DIR/scripts/setup_local_cliproxyapi.sh" start
  112. ```
  113. 完整安全说明见 [references/local-account-api.md](references/local-account-api.md)。
  114. ### 方法五:手动安装
  115. ```bash
  116. git clone https://github.com/Mr-funny/hbg-life-simulation.git
  117. mkdir -p ~/.codex/skills/hbg-life-simulation
  118. cp SKILL.md ~/.codex/skills/hbg-life-simulation/
  119. cp -R agents assets references scripts ~/.codex/skills/hbg-life-simulation/
  120. ```
  121. ## 🤖 使用示例
  122. ### 默认横屏人生故事
  123. ```text
  124. 使用 $hbg-life-simulation 处理下面的文案。
  125. 默认横屏,使用同一个漫画主角贯穿故事,语音不要加速,字幕跟声音同步。
  126. ```
  127. 每个新项目开始时,Skill 默认会询问是否使用你自己的 localhost 账号接口生图;回答“不”即可改用内置 ImageGen,不会启动安装或登录。
  128. ### 明确指定竖屏
  129. ```text
  130. 使用 $hbg-life-simulation 制作这篇人生故事。
  131. 这次明确使用 1080×1920 竖屏;字幕保持在竖屏安全区,不能照搬横屏参数。
  132. ```
  133. ### 使用兼容 Images API
  134. ```text
  135. 使用 $hbg-life-simulation,并使用我已配置在当前进程环境变量中的兼容 Images API。
  136. 先生成主角锚点,再以并发 5 批量生成宫格和高风险单图。
  137. 不得把 endpoint 或 API Key 写入项目、提示词、日志、README 或 Git 仓库。
  138. ```
  139. ### 明确同意使用自己账户的本地 Images API
  140. ```text
  141. 使用 $hbg-life-simulation,先按安全规则初始化 CLIProxyAPI,
  142. 只绑定到 127.0.0.1,并使用我自己的 Codex 账户完成 OAuth。
  143. 先通过 models 和单图测试,再以并发 5 生成项目素材;不要修改 Codex 自身连接配置,
  144. 不要输出或保存 OAuth 记录、client.env、config.yaml 和本地客户端密钥。
  145. ```
  146. ### 只修复已有项目
  147. ```text
  148. 使用 $hbg-life-simulation 检查这个已有项目。
  149. 重点排查字幕短尾、过长静态镜头、手机方向、手部结构、开头 zoom、BGM 和最终 MP4。
  150. ```
  151. ## 🧠 工作原理
  152. ```mermaid
  153. flowchart LR
  154. A["中文人生长文案"] --> B["检查本地代理"]
  155. B --> C{"本项目是否使用本地账号?"}
  156. C -->|"拒绝"| D["回退内置 ImageGen"]
  157. C -->|"同意"| E{"代理已就绪?"}
  158. E -->|"否"| F["用户本人完成安装 / OAuth"]
  159. E -->|"是"| G["使用 localhost Images API"]
  160. F --> G
  161. D --> H["保存原文与最小纠错"]
  162. G --> H
  163. H --> I["锁定主角漫画 IP"]
  164. I --> J["连续 Edge TTS + VTT"]
  165. J --> K["真实时长分镜"]
  166. K --> L["宫格 / 单图生成"]
  167. L --> M["HBG 快闪开头"]
  168. M --> N["HyperFrames zoom / pan"]
  169. N --> O["固定 BGM 混音"]
  170. O --> P["长片流式压制"]
  171. P --> Q["最终 MP4 QA"]
  172. ```
  173. 关键原则:
  174. 1. **原文先冻结。** 只修正明确转写错误,不改剧情、视角、立场或结局。
  175. 2. **声音先落地。** 用真实 TTS/VTT 时间决定分镜,不在音频完成后平均分配画面。
  176. 3. **身份先锚定。** 角色锚点通过后才并发生成其他镜头。
  177. 4. **高风险画面单独生成。** 手机、手部、烟、筷子、键盘、焊接和工具接触不放进拥挤宫格。
  178. 5. **最终 MP4 才是交付对象。** 源图和 HTML 预览不能替代编码后检查。
  179. ## 🗂️ 每个视频项目的核心产物
  180. ```text
  181. project/
  182. ├── SCRIPT_SOURCE.md # 用户原文,保持不变
  183. ├── PROJECT_SPEC.json # 标题、章节、纠错、音频与开头配置
  184. ├── SCRIPT.md # 旁白稿
  185. ├── CHARACTERS.md # 不可变角色身份规则
  186. ├── STORYBOARD_BASE.json # 语义分镜
  187. ├── STORYBOARD.json # 真实全局时间轴
  188. ├── PROMPTS.md # 生图调用与拒绝/重生记录
  189. ├── HBG_STYLE.json # 横竖屏样式唯一来源
  190. ├── audio_meta.json # 真实音频时长
  191. ├── assets/generated/ # 锚点、宫格和最终镜头
  192. ├── qa/ # 源帧与编码后检查
  193. └── renders/ # 版本化 MP4
  194. ```
  195. ## 🧰 常用命令
  196. ```bash
  197. # 初始化默认横屏样式
  198. node /path/to/hbg-life-simulation/scripts/init_project_style.mjs PROJECT_DIR
  199. # 只有明确要求竖屏时
  200. node /path/to/hbg-life-simulation/scripts/init_project_style.mjs PROJECT_DIR --orientation portrait
  201. # 从项目目录运行共享构建器
  202. node /path/to/hbg-life-simulation/scripts/build_script.mjs
  203. node /path/to/hbg-life-simulation/scripts/build_storyboard_base.mjs
  204. node /path/to/hbg-life-simulation/scripts/build_narration.mjs
  205. node /path/to/hbg-life-simulation/scripts/build_composition.mjs
  206. # 密度和样式门禁
  207. node /path/to/hbg-life-simulation/scripts/audit_storyboard_density.mjs STORYBOARD.json
  208. node /path/to/hbg-life-simulation/scripts/validate_style_system.mjs PROJECT_DIR
  209. # 长片流式压制与最终检查
  210. node /path/to/hbg-life-simulation/scripts/render_streaming_ffmpeg.mjs PROJECT_DIR OUTPUT.mp4
  211. /path/to/hbg-life-simulation/scripts/verify_final_video.sh OUTPUT.mp4 QA_DIR 0.5:opening 5.0:title 60:body 600:ending
  212. # 只做非敏感就绪检查
  213. /path/to/hbg-life-simulation/scripts/setup_local_cliproxyapi.sh ready
  214. # 仅在当前对话明确同意后:初始化用户自己的 localhost Images API
  215. /path/to/hbg-life-simulation/scripts/setup_local_cliproxyapi.sh bootstrap \
  216. --provider codex --accept-oauth-risk
  217. ```
  218. ## 🧪 真实流程验证
  219. 此 Skill 已在一条 10 分 49 秒的横屏中文长视频上完成完整集成验证:
  220. | 指标 | 结果 |
  221. |---|---:|
  222. | 画布 | 1920×1080 |
  223. | 帧率 | 30fps |
  224. | 总帧数 | 19472 |
  225. | 静态漫画分镜 | 144 |
  226. | API 生图成功任务 | 46 |
  227. | API 传输失败 | 0 |
  228. | 视觉拒绝并重生 | 2 |
  229. | 黑帧事件 | 0 |
  230. | 异常静音事件 | 0 |
  231. | 综合响度 | -22.8 LUFS |
  232. | True Peak | -4.1 dBFS |
  233. 验证覆盖了快闪 zoom、连续 Edge TTS、同步字幕、固定 BGM、手腕与手机高风险镜头、长片流式压制和最终编码抽帧。
  234. ## 🧰 环境要求
  235. | 依赖 | 用途 |
  236. |---|---|
  237. | Node.js 22+ | 共享构建脚本与 HyperFrames CLI |
  238. | FFmpeg / FFprobe | 拆图、运动、混音、编码与媒体 QA |
  239. | Python 3 + `edge-tts` | 连续中文旁白与 VTT |
  240. | HyperFrames | HTML 时间线、检查、开头预览与渲染 |
  241. | ImageGen 能力 | 漫画锚点、宫格和单图素材 |
  242. | CLIProxyAPI(首选,需同意) | 把用户自己的 Codex 等账户暴露为仅本机可访问的兼容 Images API;失败时回退内置 ImageGen |
  243. | `media-use` / visual QA skills | 音频与最终视觉检查,推荐安装 |
  244. 仓库不包含模型权重、API Key、生成图片、故事文案、声音、BGM 或成片。
  245. ## 🗂️ 仓库结构
  246. ```text
  247. hbg-life-simulation/
  248. ├── SKILL.md # Agent 核心工作流
  249. ├── agents/openai.yaml # Skill UI 元数据
  250. ├── assets/ # 横屏 / 竖屏样式模板
  251. ├── references/ # 开头、视觉、分镜、生图、渲染规则
  252. ├── scripts/ # 构建、拆图、渲染与 QA 工具
  253. ├── docs/showcase/hero.svg # README 代码绘制横幅
  254. ├── .github/workflows/ci.yml # Skill、脚本和模板校验
  255. ├── install.sh # Codex / Claude Code 安装器
  256. └── LICENSE # MIT License
  257. ```
  258. ## 🔐 隐私与素材边界
  259. - 外部提供商 API Key 只能通过当前进程环境变量注入,禁止写入代码、项目、JSONL、报告或 Git 历史;本地 loopback 客户端密钥只能保存在项目外的受限配置中。
  260. - CLIProxyAPI 的 `config.yaml`、`client.env`、OAuth `auths/` 和日志必须位于项目与 Git 工作区之外;本地服务只绑定 `127.0.0.1`。
  261. - Agent 可执行不泄露内容的 `ready` 状态检查,但每个新项目使用账户额度前都必须确认;安装、启动、修复、登录和 OAuth 前必须再次明确说明,不得从调用 Skill 推断用户同意。
  262. - 用户必须亲自在浏览器或设备码页面完成登录;Agent 不读取账号页、Cookie、浏览器存储、OAuth 文件、`client.env` 或本地客户端密钥。
  263. - 本地生成的客户端密钥只用于访问 loopback 代理,不是提供商 OAuth token;两者都禁止打印、上传或提交。
  264. - 不得使用代理绕过账户权限、配额、速率限制或服务条款,也不得登录不属于用户或未经授权的账户。
  265. - 禁止提交用户原始文案、会话日志、生成图片、音频、BGM、视频与 QA 帧。
  266. - API 提示词记录只能保存提示词、模型、尺寸、成功/失败状态,不能保存凭据。
  267. - 兼容 API 可能返回不同尺寸或扁平化输出路径,所有输出必须在本地 staging 后校验。
  268. - 使用第三方音乐、字体、图片或语音服务时,发布者仍需确认许可和平台条款。
  269. - Agent 执行 Git 推送、公开发布或删除操作前,仍需获得用户授权。
  270. ## 📄 关于仓库
  271. 这个仓库保存的是可安装的 Agent Skill 与确定性辅助脚本。它不提供固定故事模板,也不包含任何用户项目;目标是让 Agent 面对不同中文人生长文案时,始终遵守同一套角色一致性、声音连续性、分镜密度、现实检查和最终质量门槛。

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.