Communitygithub.com

Sora 影片生成技能

為當前專案建立或管理短影片(產品展示、行銷短片、電影級鏡頭、UI 畫面)。預設使用 `sora-2` 模型與結構化提示詞增強流程,並偏好使用內建 CLI 以確保可重複執行。注意:`$sora` 是提示詞中的技能標籤,非 Shell 指令。

Sora 影片生成技能 是什麼?

這個技能讓 AI 助理能夠為當前專案建立與管理短影片,適用於產品展示、行銷短片、電影風格鏡頭以及 UI 畫面錄製等場景。它預設使用 OpenAI 的 `sora-2` 模型,並提供一個完整的提示詞結構化增強流程,讓使用者可以透過模板化的方式生成精準的影片內容。技能支援單一影片生成、基於既有影片的重新混音、批次處理大量提示詞,以及非同步任務的狀態輪詢與資產下載。 主要支援的平台為任何能執行 Python 與 CLI 的環境(例如本機終端機或支援代碼執行的 AI 代理程式)。其核心工作流程是透過內建的 `scripts/sora.py` CLI 工具來執行,使用者只需提供提示詞與參數,技能便會自動處理 API 呼叫、結構化提示詞、等待任務完成,最後將影片、縮圖與 spritesheet 等資產下載到本機。為了避免檔案過多,技能會在完成後清理中間產生的暫存檔案。 使用者必須先設定 `OPENAI_API_KEY` 環境變數才能進行 API 呼叫。技能也內建了嚴格的內容安全防護機制,例如禁止生成包含版權角色、真實人物或 18 禁內容的影片。此外,它提供了詳細的參考文件(如 CLI 指令、API 參數、提示詞範本、疑難排解等),協助使用者快速上手。對於長時間的提示詞,建議使用 `--prompt-file` 避免 Shell 跳脫問題,並搭配 `--no-augment` 來防止雙重包裝。

相容平台~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/openai/skills/sora

在你喜歡的 AI 中提問

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

說明文件

Sora 影片生成技能 是做什麼的?

為當前專案建立或管理短影片(產品展示、行銷短片、電影級鏡頭、UI 畫面)。預設使用 sora-2 模型與結構化提示詞增強流程,並偏好使用內建 CLI 以確保可重複執行。注意:$sora 是提示詞中的技能標籤,非 Shell 指令。

使用時機

  • 根據提示詞生成新的影片片段
  • 透過 ID 重新混音現有影片
  • 查詢狀態、列出任務或下載資產(影片/縮圖/spritesheet)
  • 批次執行(大量提示詞或多種變體)

決策樹(生成 vs 重新混音 vs 狀態/下載 vs 批次)

  • 如果使用者有 video id 並且想要修改 → 重新混音 (remix)
  • 如果使用者有 video id 並且想要查詢狀態或下載資產 → 狀態/輪詢/下載 (status/poll/download)
  • 如果使用者需要大量提示詞/資產 → 批次生成 (create-batch)
  • 如果使用者要求兩個版本且僅有微小變動(相同鏡頭,不同主體/細節) → 先 生成 (create) 基礎版本,再 重新混音 (remix) 產生變化
  • 其他情況 → 生成 (create)(或如果他們想要一次取得就緒資產,則使用 生成並輪詢 (create-and-poll))

工作流程

  1. 判斷意圖:生成 vs 重新混音 vs 狀態/下載 vs 批次。
  2. 收集輸入:提示詞、模型、尺寸、秒數以及任何輸入參考圖片。
  3. 如果是批次:在 tmp/ 下撰寫一個暫存的 JSONL 檔案(每行一個任務),執行一次,然後刪除該 JSONL。
  4. 偏好使用 CLI 增強旗標(--use-case、--scene、--camera 等),而不是預先撰寫結構化提示詞。如果你已經產生了結構化提示詞檔案,請傳入 --no-augment 以避免雙重包裝。
  5. 使用合理的預設值執行內建 CLI(scripts/sora.py)(請參閱 references/cli.md)。對於較長的提示詞,建議使用 --prompt-file 以避免 Shell 跳脫問題;如果提示詞已經結構化,請搭配 --no-augment。
  6. 對於非同步任務,輪詢直到完成(或使用 create-and-poll)。
  7. 下載資產(影片/縮圖/spritesheet)並儲存到本地。
  8. 移除呼叫期間建立的中間檔案(例如 prompt.txt、remix_job.json、暫存 JSONL)。如果沙箱禁止 rm,則跳過清理或將檔案截斷而不顯示錯誤。
  9. 每次迭代只針對單一變更進行修改,以維持連貫性。

驗證

  • 必須設定 OPENAI_API_KEY 才能進行即時 API 呼叫。

如果缺少金鑰,請提供使用者以下步驟:

  1. 在 OpenAI 平台 UI 中建立 API 金鑰:https://platform.openai.com/api-keys
  2. 將 OPENAI_API_KEY 設定為系統環境變數。
  3. 主動提出協助使用者根據其作業系統/Shell 設定環境變數。
  • 切勿要求使用者直接在聊天中貼上完整金鑰。請要求他們在本機設定好後再確認。

預設值與規則

  • 預設模型:sora-2(使用 sora-2-pro 可獲得更高 fidelity)。
  • 預設尺寸:1280x720。
  • 預設秒數:4(允許值:"4"、"8"、"12",需以字串形式傳入)。
  • 一律透過 API 參數設定尺寸與秒數;提示詞中的文字描述不會改變這些值。
  • 使用 OpenAI Python SDK(openai 套件);不要使用原始 HTTP 請求。
  • 在任何即時 API 呼叫前都必須要求 OPENAI_API_KEY。
  • 如果 uv 快取權限失敗,請設定 UV_CACHE_DIR=/tmp/uv-cache。
  • 輸入的參考圖片必須為 jpg/png/webp 格式,且應與目標尺寸相符。
  • 下載網址大約在 1 小時後過期;請將資產複製到您自己的儲存空間。
  • 偏好使用內建 CLI,且 除非使用者要求,否則切勿修改 scripts/sora.py。
  • Sora 可以生成音訊;如果使用者要求配音/音訊,請在 Audio: 和 Dialogue: 行明確指定,並保持簡短。

API 限制

  • 模型僅限於 sora-2 和 sora-2-pro。
  • 存取 Sora 模型的 API 需要組織驗證過的帳戶。
  • 影片長度限制為 4/8/12 秒,且必須透過 seconds 參數設定。
  • API 預期 seconds 為字串列舉("4"、"8"、"12")。
  • 輸出尺寸受模型限制(請參閱 references/video-api.md 瞭解支援的尺寸)。
  • 影片生成是非同步的;您必須輪詢直到完成才能下載。
  • 速率限制因使用層級而異(請勿列出具體限制)。
  • API 會強制執行內容限制(請參閱下方的防護措施)。

防護措施(必須強制執行)

  • 僅允許適合 18 歲以下觀眾的內容。
  • 禁止使用受版權保護的角色或音樂。
  • 禁止出現真人(包括公眾人物)。
  • 包含人臉的輸入圖片會被拒絕。

提示詞增強

將提示詞重新格式化為結構化、以製作為導向的規格書。僅將隱含的細節明確化;不要發明新的創意要求。

範本(僅包含相關行):

Use case: <影片用途>
Primary request: <使用者的主要提示詞>
Scene/background: <地點、時間、氛圍>
Subject: <主要主體>
Action: <單一明確動作>
Camera: <鏡頭類型、角度、運鏡>
Lighting/mood: <燈光 + 情緒>
Color palette: <3-5 種色彩錨點>
Style/format: <電影/動畫/格式提示>
Timing/beats: <節拍或節奏>
Audio: <環境音效 / 音樂 / 旁白(如果要求)>
Text (verbatim): "<確切文字>"
Dialogue:
<對話>
- Speaker: "簡短台詞。"
</dialogue>
Constraints: <必須保留/必須避免>
Avoid: <負面限制>

增強規則:

  • 保持簡短;僅加入使用者已經暗示或在其他地方提供的細節。
  • 對於重新混音,明確列出不變項("相同鏡頭,僅變更 X")。
  • 如果任何關鍵細節遺失且會阻礙成功,請提出問題;否則直接進行。
  • 如果您將結構化提示詞檔案傳遞給 CLI,請加上 --no-augment 以避免工具重新包裝它。

範例

生成範例(單一鏡頭)

Use case: product teaser
Primary request: a close-up of a matte black camera on a pedestal
Action: slow 30-degree orbit over 4 seconds
Camera: 85mm, shallow depth of field, gentle handheld drift
Lighting/mood: soft key light, subtle rim, premium studio feel
Constraints: no logos, no text

重新混音範例(不變項)

Primary request: same shot and framing, switch palette to teal/sand/rust with warmer backlight
Constraints: keep the subject and camera move unchanged

提示詞最佳實踐(簡短清單)

  • 每個鏡頭一個主要動作 + 一種運鏡。
  • 使用節拍或節奏來控制時間("走兩步、停頓、轉身")。
  • 對於 UI 或螢幕文字,請保持文字簡短並鎖定鏡頭。
  • 當出現偽影(閃爍、抖動、快速移動)時,加入簡短的 Avoid 行。
  • 較短的提示詞更具創意;較長的提示詞更可控。
  • 將對話放入專用區塊;對於 4-8 秒的片段,保持台詞簡短。
  • 對於重新混音,明確陳述不變項(相同鏡頭、相同運鏡)。
  • 透過單一變更的後續提示來進行疊代,以保持連續性。

資產類型指南

當請求指向特定成品時,請使用下列模組。它們提供針對性的範本與預設值。

  • 電影級鏡頭:references/cinematic-shots.md
  • 社群廣告:references/social-ads.md

CLI + 環境注意事項

  • CLI 指令與範例:references/cli.md
  • API 參數快速參考:references/video-api.md
  • 提示詞指南:references/prompting.md
  • 範例提示詞:references/sample-prompts.md
  • 疑難排解:references/troubleshooting.md
  • 網路/沙箱提示:references/codex-network.md

參考文件對照表

  • references/cli.md:如何透過 scripts/sora.py 執行 create/poll/remix/download/batch。
  • references/video-api.md:API 層面的控制項(模型、尺寸、持續時間、變體、狀態)。
  • references/prompting.md:提示詞結構與疊代指南。
  • references/sample-prompts.md:可直接複製貼上的提示詞食譜(僅範例;無額外理論)。
  • references/cinematic-shots.md:電影級鏡頭的範本。
  • references/social-ads.md:短社群廣告節拍的範本。
  • references/troubleshooting.md:常見錯誤與修正方法。
  • references/codex-network.md:網路/權限問題的疑難排解。

Individual skills in this repo

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

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

相關技能