executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
lov-compress-video把指定视频压到尽可能小且画质不明显下降:默认 HEVC CRF 28 保留分辨率,可选质量 档、目标体积、VMAF 画质门禁与替换原文件模式。Use when 用户说“把这个视频压小” “压缩到 50M 以内”或 “compress this video as small as possible”。
Independent GitHub snapshot · Automated classification · Original documentation governs
把一个或多个视频文件压缩成体积尽可能小、肉眼看不出明显损失的 MP4。默认策略是
libx265 CRF 28、保留分辨率与帧率、AAC 96k,输出 <原名>-compressed.mp4 放在原
文件旁边,原文件不动。质量档、目标体积、VMAF 门禁和替换模式都是可选开关。
lov-list-videoslov-media-creatorlov-media-preprocessorbaoyu-compress-imageEvery generated Skill is connected to the shared user-profile/v1 contract in
skill.yaml. Read the shared user, brand, workspace, preferences, and this
Skill's skills.<skill_id> namespace at the start of every run. Keep the source
portable: resolved personal values belong in the shared profile, never here.
When the user directly states a durable preference or brand fact, persist it
through scripts/profile_store.py and report the saved profile path. Put
Skill-specific values under records.<field>; use brand.<field> or
user.<field> for shared values. Do not persist inferred secrets or credentials.
See references/user-profile.md for the complete contract.
本 Skill 读取的长期记录(都可选):
| 记录 | 含义 |
|---|---|
records.default_quality | smallest / small(默认)/ balanced / high |
records.default_codec | hevc(默认)/ h264 / av1 |
records.default_preset | x264/x265 preset,默认按质量档选 |
records.audio_bitrate | AAC 码率 kbit/s,默认按质量档选 |
records.max_edge | 长边像素上限,默认不缩放 |
records.min_vmaf | 画质门禁分数,设置后每次都会测 VMAF 并按需重编 |
records.output_dir | 固定输出目录,默认放原文件旁边 |
records.replace_original | true 时默认替换原文件;只有用户明确说过才可写入 |
Read references/skill-composition.md before deciding whether to invoke or
extend any adjacent capability. The record distinguishes optional upstream and
downstream handoffs from embedded Kit modules. Do not silently depend on a
sibling Skill that is not shipped with this source.
You MUST follow these steps in order.
SKILL_DIR if the environment provides it.scripts/compress_video.py、scripts/profile_store.py、
references/encoding-guide.md、references/skill-composition.md 均存在。ffmpeg -encoders 里必须有 libx265;缺 libvmaf 时不能用 --vmaf /
--min-vmaf,缺 libsvtav1 时不能用 --codec av1。When running scripts manually:
export SKILL_DIR="/path/to/lov-compress-video"
Resolve context.profile on every invocation. The precedence is current request,
project context, Skill-specific profile records, shared preferences, shared
brand/user profile, then safe defaults. A direct user statement about a durable
preference or brand fact should be saved with scripts/profile_store.py record
using --confirm, followed by a concise saved-path report.
--output-dir 或替换模式。small:CRF 28)--quality balanced 或 high--quality smallest(CRF 32、slow、长边 1080、64k 音频)--target-size XXM(两遍码率模式)--codec h264--fast(VideoToolbox,体积大约多两成,画质分更低)--replace;原文件进废纸篓,--permanent 才直接删除replace_original。--min-vmaf 90:脚本会测分并在不达标时降 CRF
重编,最多两次。VMAF 测量约等于再解码一遍两条视频,长片要先告知耗时。references/skill-composition.md。批量场景的上游是 lov-list-videos
(先列出候选再压),下游是 lov-media-publisher(压完上传)。python3 "$SKILL_DIR/scripts/compress_video.py" input.mov --dry-run
python3 "$SKILL_DIR/scripts/compress_video.py" input.mov
# 画质门禁:VMAF 不到 90 就降 CRF 重编
python3 "$SKILL_DIR/scripts/compress_video.py" input.mov --min-vmaf 90
# 目标体积 50 MB(两遍编码)
python3 "$SKILL_DIR/scripts/compress_video.py" input.mov --target-size 50M
# 4K 压成 1080p、30fps、H.264,给兼容性优先的场景
python3 "$SKILL_DIR/scripts/compress_video.py" input.mov --max-edge 1080 --fps 30 --codec h264
# 批量:输出到一个目录,JSON 结果供后续统计
python3 "$SKILL_DIR/scripts/compress_video.py" *.MP4 --output-dir ~/compressed --json
# 替换模式:写 <原名>.mp4,原文件移到废纸篓
python3 "$SKILL_DIR/scripts/compress_video.py" input.mov --replace
进度显示在 stderr:百分比、速度倍数与 ETA。长片可以直接告诉用户预计时长 (1080p 在 Apple Silicon 上 libx265 medium 约 3 到 6 倍速,即 1 小时视频 10 到 20 分钟)。
用户说出长期偏好时写回 Profile,例如“以后都用 h264”:
python3 "$SKILL_DIR/scripts/profile_store.py" record \
--skill-id lov-compress-video \
--path records.default_codec \
--value '"h264"' \
--confirm
duration-mismatch;输出不比源小会丢弃并报 skipped-larger(--force 保留)。
两种情况下替换模式都不会动原文件。--json 里已包含这些字段。--fast)或磁盘空间不足。skill-card.yaml, cases/cases.json, and pricing-card.yaml as the
standard trust bundle for this Skill.--codec h264 需 libx264,--codec av1 需
libsvtav1,--vmaf / --min-vmaf 需 libvmaf;Homebrew 的 ffmpeg 默认全部包含--fast 与废纸篓式 --replace 依赖 macOS(VideoToolbox、Finder)references/skill-composition.md