Template Replication to Jianying
Purpose
Use this workflow for an authorized template video whose pictures come from the supplied source footage. Reproduce the template's editing structure without copying its original narration, music file, watermark, or brand assets.
The default delivery path is:
template analysis -> source import -> picture lock -> template-caption timing lock -> rewrite-to-fit -> timed narration -> ChatCut review -> Jianying editable draft
Do not export an MP4 unless the user explicitly approves export.
At the start of every run, read references/runtime-process.md. On a new Windows or macOS computer, also read references/platform-setup.md. Before dense QA, read references/acceptance.md. Before Jianying delivery, read references/jianying-migration.md.
Phase 0: New-computer environment preflight
Run a read-only environment preflight before importing media, creating projects, generating speech, or building a Jianying draft. Do this every time the skill runs on an unfamiliar computer or when the environment may have changed.
Run the bundled local checks, passing the result of a separate non-mutating ChatCut connector check:
python scripts/preflight_environment.py --workspace "<project-directory>" --require-jianying --chatcut-status ready --chatcut-detail "Authenticated read-only capability call passed" --scan-root "<project-directory>"
Use python3 on macOS when python is not an approved Python 3.10+ command. If Jianying's macOS draft root is not discovered, pass --jianying-draft-root explicitly. Never assume CapCut and Jianying draft schemas are interchangeable.
Bootstrap safely: first check whether a supported Python command exists. If it does not, complete the remaining read-only checks manually, report Python as missing, and request explicit authorization before proposing any Python installation. Never install Python merely to run the preflight.
Check and record:
- operating system and architecture;
- free space on the workspace, temporary-file, download, and Jianying draft volumes;
ffmpegandffprobeavailability plus versions and basic decode/probe smoke tests;- a supported Python runtime plus the standard-library modules used by bundled validators and draft builders;
- ChatCut connector/plugin availability, authentication, and one non-mutating project-list or capability call;
- Jianying Pro installation and the current user's draft-root location when Jianying delivery is requested;
- read/write access to a project-scoped staging directory and the ability to create a harmless temporary file there;
- required fonts, codecs, local helper runtimes, and media utilities actually referenced by the selected workflow;
- whether any required media path, temporary path, or draft path is hard-coded to another computer or user account.
The media analysis, manifest validation, ChatCut reconstruction, and staged delivery package are portable across Windows and macOS. Treat direct Jianying draft injection as conditional on the installed Jianying build and require a real open/edit/undo test on both platforms.
Classify every check as ready, missing, incompatible, optional, or not needed. Do not report the environment ready until required version checks and smoke tests pass.
If anything required is missing or incompatible:
- Stop before the first dependent mutation.
- Tell the user exactly what is missing, why it is required, the supported version or compatibility requirement, the official or well-known source, expected disk/network/admin impact, and the exact proposed install or configuration action.
- Request explicit authorization before installing, upgrading, changing PATH, enabling a plugin, signing in, or modifying Jianying/ChatCut configuration.
- Install only the authorized items. Never install an obscure third-party plugin, use a deprecated API, bundle credentials, or substitute an unreviewed binary.
- After installation, rerun the version check and smoke test. Report failures honestly and do not continue through a broken dependency.
Treat authorization as scoped: approval for one dependency does not authorize other installations or system changes. Never assume administrator access. Prefer per-user installation and reversible configuration when they meet the requirement.
Non-negotiable rules
- Create a new independent ChatCut project or timeline. Do not read, modify, or reuse a same-named old project.
- Treat the template as analysis input only. Use the supplied source footage for all reproduced pictures and original dialogue.
- Build and approve the picture track before generating narration, captions, or final BGM automation.
- Once the user approves picture alignment, lock it logically. Sound work must not change its source mapping, speed, crop, or cuts unless the user explicitly reopens picture review.
- After picture approval, reproduce every template narration-caption start and end before rewriting copy or generating speech. Treat those caption intervals as fixed timing slots.
- Never move or resize an approved caption interval merely to fit rewritten copy or TTS. Shorten the copy first, then fit speech within
0.9-1.1x. - Prefer continuous source passages. Do not create one- or two-second fragments unless the template itself cuts there.
- An original-dialogue interval is one continuous source passage at
1xand0dB, extending through the full sentence and natural tail. - A narration interval and an original-dialogue interval are mutually exclusive, except for a deliberately documented crossfade of a few frames.
- Every concrete narration claim must be visible when the sentence starts. If no matching picture exists, rewrite or delete the claim.
- Verify picture alignment every
0.5sand at every cut. First/middle/last-frame checking alone is insufficient. - Deliver Jianying as separated editable tracks. Never flatten an MP4 and label it an editable draft.
Phase 1: Intake and project isolation
Collect:
- template video;
- all source episodes or long-form source videos;
- desired voice and BGM preference, if the user changes the current default;
- requested output editor and whether MP4 export is authorized.
Inspect media metadata before editing: path, codec, dimensions, fps, duration, audio streams, and time base.
For long source videos:
- analyze and transcribe whole episodes locally;
- never upload a whole episode to ChatCut or leave a whole-file upload pending;
- cut only the exact timeline-required source intervals, keeping intact original-dialogue passages;
- split those required intervals into approximately
3-5 minuteH.264/AAC chunks only when upload reliability requires it; - keep a manifest containing the original file, chunk index, original source start, original source end, codec, and checksum;
- use official ChatCut import and resume the same asset when possible;
- do not create repeated duplicate assets after failures;
- report upload or transcription failures immediately.
Do not use a locally flattened substitute if editable source import fails.
Phase 2: Canonical template map
Analyze the complete template before editing. Maintain one canonical interval table:
template start/end frames -> picture/action -> source file -> source in/out -> audio mode -> template caption start/end -> template words -> rewritten words -> narration speed -> BGM behavior
The table is the only authoritative map. All later changes reference interval IDs rather than recreating the story plan.
Classify audio intervals:
narration: third-person summary, commentary, or words not continuously present in source dialogue;original: template words match source dialogue and the visible speaker or waveform confirms the match;intentional_silence: silence that is demonstrably present in the template.
Do not classify from wording alone. For uncertain boundaries, inspect transcript timing, mouth movement, and waveform. Original-dialogue boundaries must preserve the first phoneme, last phoneme, breath, and natural tail.
Phase 3: Picture-first replication
Rebuild the template on the source timeline using exact source in/out points.
- At template time
T, the output must show the same source scene, character, action phase, direction, and comparable composition atT. - Use the template's actual cut points. Never use fixed-duration chunks as editing units.
- Do not insert reaction shots, doorway shots, scenery, or repeated frames merely to fill narration.
- If the template holds a continuous scene, use one continuous source item. Internal splits are allowed only when required for audio-mode boundaries and must retain continuous source time.
- When a sentence describes a person, object, action, or place, that evidence must already be on screen at sentence start.
Generate the frame map before narration. Then run dense verification using the acceptance procedure in references/acceptance.md.
Stop at a picture-review checkpoint. Continue only after the user approves picture alignment.
Phase 4: Template-caption timing lock
After the user approves the picture track:
- Extract the start and exclusive end frame of every template narration caption.
- Place one editable review caption item for each narration sentence at exactly that interval.
- Preserve the template's sentence grouping, line count, and caption order.
- Verify caption activity against the template at every boundary and every
0.5ssample. - Lock these intervals. Later copy and speech work may change text or audio only, never the caption start or end.
Do not infer caption duration from generated speech. The template caption interval is the timing authority.
Phase 5: Copy fitting and sound reconstruction
Narration
Rewrite rather than copy the template narration:
- preserve facts, information order, suspense points, pauses, and sentence timing;
- change sentence structure and vocabulary;
- do not invent key people, motives, evidence, events, or outcomes;
- rewrite inside the already locked caption interval;
- begin near the template sentence length, then shorten as needed until the selected voice fits the fixed slot;
- generate one audio item per continuous narration interval;
- never let narration cross an original-dialogue interval.
Use the user-selected voice. Do not assume a permanent voice across projects.
Timing:
- match the locked caption start and exclusive end exactly;
- first shorten or tighten wording while preserving visible facts and narrative order;
- keep narration speed within
0.9-1.1x; - reject any take that still overruns the fixed slot at
1.1x; - trim trailing silence only; never trim a phoneme or sentence tail.
Original dialogue
When the template plays source dialogue:
- place the corresponding source passage directly and continuously;
- use
1xspeed and0dB; - let the complete sentence finish, even if the final duration drifts slightly from the template;
- stop narration and narration captions;
- avoid an extra dialogue carrier track when the approved picture item's embedded source audio is continuous and reliable;
- if the approved picture mapping contains source-time jumps, overlay one continuous source picture-and-audio passage instead of stitching audio fragments.
Do not cut original dialogue at a visual cut or subtitle boundary if the spoken sentence continues.
Coverage and transitions
After reconstruction, scan the entire timeline. Every frame must be covered by exactly one of:
- narration;
- original dialogue;
- documented intentional silence.
Reject:
- clipped tail syllables;
- repeated words;
- two voices playing together;
- unplanned silent gaps;
- rapid fragment switching;
- original dialogue below
0dB.
Use approximately three-frame fades only when they do not weaken speech.
Phase 6: Captions and BGM
Captions:
- keep the locked template narration-caption intervals; update their text only;
- retain the approved template-style position, line count, timing, white text, and black outline unless the user specifies another style;
- do not generate duplicate captions during original-dialogue intervals;
- retain source burned-in dialogue subtitles;
- do not mosaic source subtitles unless explicitly requested.
BGM:
- use an original or licensed substitute with the same narrative function;
- keep it on a separate track;
- reproduce the template's entrances, exits, and ducking;
- during original dialogue, lower BGM to about
-18dBwhile keeping dialogue at0dB; - end BGM with the timeline; do not lengthen the project.
- if the approved ChatCut timeline has no independent BGM track, do not import an unrelated BGM from an older draft.
Phase 7: ChatCut checkpoints
Keep recoverable versions:
picture-lock;caption-timing-lock;sound-rebuild;final-QA.
Verify changes in the visible ChatCut editor when the user requests visible collaboration. Do not export until the user confirms the reviewed version.
Use the ChatCut capabilities for import, transcription, voice, music, verification, and export. If a ChatCut call returns an unexpected result, follow the ChatCut known-errors workflow before retrying.
Phase 8: Jianying migration
Preserve the approved ChatCut version and create a new unique Jianying draft. Follow references/jianying-migration.md.
Required editable tracks:
- base picture, embedded source sound muted;
- continuous original-dialogue picture/audio overlays at
0dB; - replaceable narration;
- replaceable BGM when one exists in the approved timeline.
For this user's default Jianying handoff, do not carry the narration-caption track. Preserve the caption interval manifest so Jianying built-in 解说小帅 (中文-平淡) can replace each narration clip without changing its approved start or end.
Use local stable media files, not temporary signed URLs. Stage and validate the draft in the workspace before copying it into Jianying's draft directory. Never overwrite another Jianying draft.
If Jianying rejects the draft, stop, remove only the new draft, and report the validation failure. Do not fall back to a flattened video.
Final acceptance
Before calling the work complete:
- all template/output picture comparisons pass at
0.5ssamples and cut neighborhoods; - no black frames, unrelated shots, repeated source fragments, or source-time drift remain;
- all narration starts on matching visual evidence;
- all narration audio starts and ends on its locked template-caption interval, with speed within
0.9-1.1x; - all original dialogue is continuous, complete,
1x, and0dB; - no unplanned silence, overlap, clipped words, or duplicate captions remains;
- BGM is ducked correctly and ends with the timeline;
- Jianying opens the new draft and allows an edit/undo test on a narration clip, clip edge, and audio volume;
- canvas, fps, frame count, source mapping, speed, crop, position, and volume match the approved manifest.
Report separately:
- structural/source-frame verification;
- rendered pixel comparison, if actually performed;
- audio coverage and boundary verification;
- Jianying open/edit verification.
Never describe source-map verification as a pixel-perfect rendered comparison.
Reusable validator
Create a project manifest using the schema in references/acceptance.md, then run:
python scripts/validate_replica_manifest.py path\to\replica-manifest.json
Use --self-test after modifying the validator.
Run scripts/preflight_environment.py --help after modifying the preflight script, then run one real local preflight and inspect its JSON and exit code.
Before distributing the Skill, run scripts/verify_portable_package.py on both the folder and the ZIP. The audit must report no credentials, foreign home-directory paths, cache files, or missing required resources.