Communitygithub.com

JianYing AI Automation Video Editing Skill

An advanced wrapper API (JyWrapper) for automating JianYing (剪映) Pro video editing, providing out-of-the-box Python interfaces for screen recording, media import, subtitle generation, web motion graphics compositing, and project export. Fully compatible with MacOS (Apple Silicon/Intel) and Windows, supporting v5.9+ (draft_info.json) architecture, auto-healing, smart TTS subtitles, and recording with smart zoom.

What is JianYing AI Automation Video Editing Skill?

This skill provides a Python library (`JyWrapper`) and a collection of CLI tools to automate video editing within JianYing Pro (剪映), a popular video editing application. It enables AI agents to perform complex editing tasks programmatically, including screen recording with smart zoom, importing media assets, generating and aligning TTS voiceovers with subtitles, applying web-to-video motion graphics, and exporting finished drafts. The skill supports both MacOS (Apple Silicon and Intel) and Windows platforms, and is designed to work with JianYing v5.9+ using the `draft_info.json` architecture. Key features include automatic project healing for corrupted drafts, a draft inspector for analyzing project structure, a cloud music library indexer, and robust headless export for MP4 and SRT files. Its modular rule system guides agents through setup, media handling, text effects, keyframes, and generative editing workflows, making it an essential tool for developers and AI agents who need to automate high-volume or repetitive video production tasks.

Works with✓Claude Code~Codex CLI~Cursor✓Antigravity
npx skills add https://github.com/2789927464king-jpg/video-skill-ku/tree/HEAD/jianying-editor-skill

Ask in your favorite AI

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

Documentation

JianYing Editor Skill

Use this skill when the user wants to automate video editing, generate drafts, or manipulate media assets in JianYing Pro.

Agent execution playbook: docs/agent-playbook.md Minimal command SOP: docs/minimal-command-sop.md Natural language usage guide: usage.md Draft inspector CLI: python <SKILL_ROOT>/scripts/draft_inspector.py list --limit 20 python <SKILL_ROOT>/scripts/draft_inspector.py summary --name "DraftName" python <SKILL_ROOT>/scripts/draft_inspector.py show --name "DraftName" --kind content --json For generic editing requests, always follow the "Quick Edit Runtime Template" and "Acceptance Checklist" in that playbook.

🚨 Critical Developer Rules

  1. Script Location: Do not create editing scripts inside the Skill's own directory. All clip logic implementation code (.py scripts) must be placed in the root directory of the user's current project (or a subdirectory like scripts/), to keep the Skill library pure and portable.
  2. Version and Architecture:
    • Dual Platform Support: Fully supports MacOS (path detection/screen recording) and Windows.
    • Auto-healing: Supports v5.9+ (draft_info.json). If a draft is corrupted or has version conflicts, initialize JyProject with overwrite=True to trigger automatic repair.
  3. Music Selection:
    • For simple demos, use default music. For real projects, prioritize searching and recommending relevant tracks from data/cloud_music_library.csv, or filter by keyword based on the video theme (e.g., "technology", "warmth").
    • Ask the user: "I found a few cloud-based tracks that match the theme. Would you like to try them? (e.g., Illuminate - tech vibe)".

📚 Rules

Read the individual rule files for specific tasks and constraints:

🎯 Agent Quick Routing

  • Cloud video + cloud music: rules/media.md + rules/audio-voice.md -> examples/cloud_video_music_tts_demo.py
  • Smart TTS & subtitles (Script-to-Video): rules/text.md + rules/audio-voice.md -> core API add_narrated_subtitles
  • Voiceover & subtitle alignment: rules/text.md + rules/audio-voice.md -> examples/cloud_video_music_tts_demo.py
  • Screen recording & smart zoom: rules/recording.md -> tools/recording/recorder.py
  • Batch/headless export: rules/core.md + rules/cli.md -> examples/robust_auto_export.py
  • Movie commentary generation: rules/generative.md -> scripts/movie_commentary_builder.py

📖 Examples

Refer to these for complete workflows:

🧠 Prompts & Integrated Tools

Use these templates and scripts for complex tasks:

  • Asset Search: Find filters, transitions, and animations by Chinese/English name:
    python <SKILL_ROOT>/scripts/asset_search.py "复古" -c filters
    
  • Movie Commentary Builder: Generate 60s commentary videos from a storyboard JSON:
    python <SKILL_ROOT>/scripts/movie_commentary_builder.py --video "video.mp4" --json "storyboard.json"
    
  • Sync Native Assets: Import your favorited/played BGM/Styles from JianYing App to the Skill:
    python <SKILL_ROOT>/scripts/sync_jy_assets.py
    # Index cloud materials from your existing drafts
    python <SKILL_ROOT>/scripts/build_cloud_music_library.py
    python <SKILL_ROOT>/scripts/build_cloud_text_styles_library.py
    
  • README to Tutorial: Convert a project's README.md into a full installation tutorial video script:
    • Read prompt: prompts/readme_to_tutorial.md
    • Inject content into {{README_CONTENT}} variable
  • Screen Recorder & Smart Zoom: Record your screen and auto-apply zoom keyframes:
    python <SKILL_ROOT>/tools/recording/recorder.py
    # Web preview capture (high performance)
    python <SKILL_ROOT>/scripts/web_recorder.py --url "http://localhost:3000" --duration 5
    # Or apply zoom to existing video:
    python <SKILL_ROOT>/scripts/jy_wrapper.py apply-zoom --name "Project" --video "v.mp4" --json "e.json"
    
  • Draft Inspector: Examine draft structure and metadata (v5.9+ support):
    python <SKILL_ROOT>/scripts/draft_inspector.py list --limit 20
    python <SKILL_ROOT>/scripts/draft_inspector.py summary --name "DraftName"
    
  • Auto Exporter: Headless export of a draft to MP4/SRT:
    python <SKILL_ROOT>/scripts/auto_exporter.py "DraftName" "output.mp4" --res 1080 --fps 60
    # For SRT only:
    python <SKILL_ROOT>/scripts/jy_wrapper.py export-srt --name "DraftName"
    
    Note: MP4 auto export uses Windows UI Automation. On macOS, generate the draft and export it manually from JianYing.
  • Template Clone & Replacer: Safely clone a template and batch replace materials (to prevent damaging the original template):
    # Clone a template to create a new project
    python <SKILL_ROOT>/scripts/jy_wrapper.py clone --template "Hotel Template" --name "CustomerA_Copy"
    
  • API Validator: Run a quick diagnostic of your environment:
    python <SKILL_ROOT>/scripts/api_validator.py
    

🚀 Quick Start Example

import os
import sys

# 1. Environment initialization (must be at the top of the script, supports Win/Mac)
current_dir = os.path.dirname(os.path.abspath(__file__))
env_root = os.getenv("JY_SKILL_ROOT", "").strip()
# Detect Skill path (supports Antigravity, Trae, Claude, etc.)
skill_root = next((p for p in [
    env_root,
    os.path.join(current_dir, ".agents", "skills", "jianying-editor"),
    os.path.join(current_dir, ".agent", "skills", "jianying-editor"),
    os.path.join(current_dir, ".trae", "skills", "jianying-editor"),
    os.path.join(current_dir, ".claude", "skills", "jianying-editor"),
    os.path.join(current_dir, "skills", "jianying-editor"),
    os.path.abspath(".agents/skills/jianying-editor"),
    os.path.abspath(".agent/skills/jianying-editor"),
    os.path.abspath(".trae/skills/jianying-editor"),
    os.path.abspath(".claude/skills/jianying-editor"),
    os.path.abspath("skills/jianying-editor"),
    os.path.dirname(current_dir)
] if p and os.path.exists(os.path.join(p, "scripts", "jy_wrapper.py"))), None)

if not skill_root: raise ImportError("Could not find jianying-editor skill root.")
sys.path.insert(0, os.path.join(skill_root, "scripts"))
from jy_wrapper import JyProject

if __name__ == "__main__":
    # 2. Initialize project (supports v5.9+ and auto-healing)
    project = JyProject("New AI Video", overwrite=True)
    assets_dir = os.path.join(skill_root, "assets")

    # 3. Smart TTS & subtitles (One-click Script-to-Video)
    project.add_narrated_subtitles(
        text="Welcome to the JianYing automation Skill. This is an advanced version fully compatible with macOS.",
        speaker="zh_female_xiaopengyou"
    )

    # 4. Import additional media
    project.add_media_safe(os.path.join(assets_dir, "video.mp4"), "0s")
    project.add_media_safe(os.path.join(assets_dir, "audio.mp3"), "0s", track_name="Audio")

    # 5. Add animated title
    project.add_text_simple("JianYing Automation Enabled", start_time="1s", duration="3s", anim_in="Vintage Typewriter")

    project.save()

🛠️ Initialization & Project Rules

When initializing a JyProject, always set the resolution based on the aspect ratio of the main video asset. The default is landscape (1920x1080).

🚨 Script Location Rules

Do not create your business editing scripts inside the Skill installation directory.

  • Correct approach: Place your editing Python scripts in the project's root directory.
  • Reason: The Skill directory should only contain the toolset source code, so that future git pull upgrades are easy. Mixing business code into it will cause version control chaos.

Individual skills in this repo

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

2789927464king-jpg/video-skill-ku

剪辑环境的唯一管理者:就绪检查(skills 是否最新 → Runtime 是否配套)、Skills 更新激活、Runtime 安装与体检。用户说检查更新、安装剪辑环境、装播放器、检查剪辑环境、剪辑环境就绪了吗、配置转录凭证时使用;业务 Skill(剪口播/字幕/画面/导出)第 0 步也引用本 Skill 的就绪检查。不用于剪辑、字幕、画面、导出本身或项目数据迁移。

2789927464king-jpg/video-skill-ku

剪辑中文口播原素材:逐词转录、词典修字出修字表、五轮扫描找口误与重复、汇总表与重复句子表、打开 Studio 让用户复核、复盘沉淀用户偏好与词典。只产出一份已复核的删词账本,不切媒体、不做字幕、不做分镜动画。用户说剪口播、处理口误、生成口播基础素材、继续剪口播,或确认卡回传 action=return_cut_review 时使用。不要用于执行物理剪切、导出剪后视频、单独安装、单独打开工作台或口播分镜成片。

2789927464king-jpg/video-skill-ku

把剪好的口播烧成一个成片文件:账本切片段、推近、字幕、HTML 画面层,一次全部烧进 mp4。用户说导出、出成片、烧字幕、渲染、导出视频、生成最终文件时使用。不要用于生成删词候选、写字幕、做画面动画。

2789927464king-jpg/video-skill-ku

整理、脱敏并上报 chengfeng-videocut 的 GitHub Bug。用户说上报 Bug、反馈剪口播问题、提交 GitHub Issue、这个问题告诉开发者,或要求继续提交已预览的 Bug 草稿时使用。不要用于功能建议、普通排错、代码提交或未获用户确认的自动上报。

2789927464king-jpg/video-skill-ku

给剪好的口播做字幕:直接用已有的逐词稿加账本算出剪后时间(不必导出、不必重新转录)、用词典和作者文稿改写听错的专名、按句子分屏、在 Studio 里逐屏复核。用户说做字幕、加字幕、改字幕、重新分屏、字幕不对时使用。不要用于删词剪辑、物理剪切、分镜动画或成片渲染。

2789927464king-jpg/video-skill-ku

操作 chengfeng-videocut 剪辑工作台的已有工程,通过 Runtime CLI 查工程与词句位置、添加或替换画面覆盖层、移除画面、删除明确指定的词句或片段、拆分裁剪移动已有片段、调整画布比例并回读核验。用户说插入片段、删掉这句、移除动画、换个画面、调整顺序或管理时间线时使用;先区分画面覆盖与主轨顺延插入,不负责自动判断口误、创作动画、制作字幕、导出或排查安装故障。

2789927464king-jpg/video-skill-ku

Create Ian Xiaohei-style HTML/SVG motion illustrations for Chinese articles, scripts, storyboard scenes, workflow explanations, concept metaphors, and short video visual aids. Use when the user asks for 小黑 SVG、漫画感 HTML、分层 SVG 动效、把小黑生图做成 HTML/SVG、可编辑矢量动效、口播流程动画、手绘漫画动效、正文配图动画, or wants a Xiaohei illustration style adapted into controllable HTML/SVG/GSAP output instead of raster image generation.

2789927464king-jpg/video-skill-ku

给剪好的口播配画面:在录屏上盖 HTML 层(圈重点标注 / 小黑整屏动画 / 推近),层绑字幕屏、由播放器逐帧驱动、直接在预览里看。用户说做分镜、配画面、加动画、圈重点、B-roll、做 storyboard 时使用。不要用于删词剪辑、字幕、物理剪切或成片渲染。

Related Skills