Communitygithub.com

climbing-video-analysis-director

固定机位攀岩/抱石视频的基础姿态与字幕分析编排、GRIP 全线岩点和逐肢三态接触、技术候选几何复核、用户难点确认、导演剪辑计划、剪映 staging/安装与核验。Use when 用户要「攀岩难点拆解导演」「GRIP 岩点接触复核」「crux 候选确认后出剪映草稿」「攀岩分析到剪辑计划」;输入需有源视频和线路颜色,可选用户指定难点。不适用:移动机位、纯姿态叠加成片(→ climbing-pose-analysis)、纯合集(→ climbing-collection-jianying);本技能不负责口播原理撰写/TTS,也不生成 Three.js 动画,只衔接后续技能已完成的 anim3d final 与 narration。

climbing-video-analysis-director 是什么?

climbing-video-analysis-director is a Claude Code agent skill that 固定机位攀岩/抱石视频的基础姿态与字幕分析编排、GRIP 全线岩点和逐肢三态接触、技术候选几何复核、用户难点确认、导演剪辑计划、剪映 staging/安装与核验。Use when 用户要「攀岩难点拆解导演」「GRIP 岩点接触复核」「crux 候选确认后出剪映草稿」「攀岩分析到剪辑计划」;输入需有源视频和线路颜色,可选用户指定难点。不适用:移动机位、纯姿态叠加成片(→ climbing-pose-analysis)、纯合集(→ climbing-collection-jianying);本技能不负责口播原理撰写/TTS,也不生成 Three.js 动画,只衔接后续技能已完成的 anim3d final 与 narration。.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/anjingcuc/climbing-video-skills/tree/HEAD/skills/analysis/climbing-video-analysis-director

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Climbing Video Analysis & Director's Cut

Push a fixed-camera source video to a validated Jianying draft. A shared engine handles deterministic computations; this skill is responsible for sequencing, user confirmation, and contract gates—it does not duplicate upstream algorithms.

Before starting analysis, read references/ANALYSIS-CONTRACT.md; before selecting cruxes and writing plan.json, read references/DIRECTION.md.

Hard Boundaries

  1. Only fixed-camera, single-route videos. The source video enters Jianying via its original absolute path + in/out points—zero transcoding, no proxy or pre-cut segments.
  2. GRIP full-route holds and per-limb contact precede technical naming. Missed holds, occlusions, or low confidence are unknown, not off.
  3. dyno requires both feet simultaneously off >= 0.20s in frame-by-frame contact_evidence. Old contacts=false, scores, or voiceovers are not substitutes. A user-specified dyno must also record the recalculated both_off_frames / both_feet_off_s in selected[].refine of the manifest. Passing the gate only indicates airborne time in the window—not necessarily a two-foot jump: if frame-by-frame shows a single-foot takeoff, then releasing a hold before both feet are off, write it faithfully in evidence.naming_boundary, and the voiceover must not say "both feet pushed off the wall" (e.g., dyno_2400: right leg pushes → left leg stands → both feet off 0.33 s after releasing hold).
  4. User-specified cruxes take priority over candidate scores. Before entering plan.json, the user must confirm 1–3 cruxes. If the user names a move (e.g., "the dyno at the start"), first locate then confirm: scan the full video using kinematics (center-of-mass velocity peaks, both-feet-off segments) plus coach's concurrent voiceover to find the time window, and distinguish between "actual climb on the route" and "coach's explanation/demonstration on the mat". If both look plausible, present both windows with evidence and let the user choose; if no reply, take the one from the climb segment and note the discarded alternative under superseded in the manifest.
  5. Voiceover/TTS and Three.js production are handed off to subsequent skills. plan.json may only reference anim3d/<crux_id>/final/ and its MP4, plus the same project's narration.json.
  6. build-draft only writes staging; installation is a separate explicit step. Do not overwrite drafts already managed by Jianying—use a new draft name.

Input & Deliverables

Required input: source video path, route color (color name or GRIP cluster ID). Optional input: user-specified crux technical name/time window/description, subtitle dictionary, GRIP session, completed animation assets.

Recommended directory:

<project>/
  assets/ or original video location     source video, no transcoding
  plan.json                              director's plan
  draft_assets/                          title cards
  anim3d/<crux_id>/final/               animation MP4 from subsequent skill
  anim3d/<crux_id>/narration.json
<work>/
  words.json / caps.json / captions.srt
  pose.json / analysis.json
  route.json / analysis_route.json
  tech_route.json / crux_candidates.json / crux_candidates_refined.json
  crux_manifest.json
  draft-timeline.json / draft-test/

route.json must contain both full-route color candidate_holds and contact-confirmed holds; analysis_route.json must carry per-frame per-limb on/off/unknown evidence. Field and manifest formats are defined in the analysis contract.

CLI & Shared Engine

PY=<climb environment python>
RUN=<this skill>/scripts/run.py
$PY $RUN --help

The five core subcommands are grip-route, mine-cruxes, refine-tech, build-draft, and title-card. Additional subcommands: contact-v2, tech-holds, qa-strip, transcribe, caption (caption_fix), caption-llm, extract-pose, biomech, tech-moves, validate, install-draft.

Parameters after the subcommand are forwarded as-is; external engine exit codes are returned as-is; run.py <subcommand> --help shows the original engine's help. If an engine is missing, follow the error to install the corresponding skill or set:

Environment variableDefault directory
CLIMBING_DIRECTOR_CRUX_SCRIPTS~/.agents/skills/climbing-crux-explainer-jianying/scripts
CLIMBING_DIRECTOR_POSE_SCRIPTS~/.agents/skills/climbing-pose-analysis/scripts
CLIMBING_DIRECTOR_JIANYING_SCRIPTS~/.agents/skills/climbing-collection-jianying/scripts
CLIMBING_DIRECTOR_PYTHONInterpreter of the current run.py

Shared implementations remain in their original skills; this directory contains only adapters and local contract checks. Actual build also requires build_draft.py's existing dependencies (ffprobe, course-compose writer).

Verifiable Workflow

1. Register Input & Run Base Analysis

Record source video absolute path, display dimensions/rotation, route color, and optional user crux. If fixed-camera or route color cannot be confirmed, ask—do not guess.

Run as required by the upstream environment:

$PY $RUN transcribe <video> -o <work>/words.json --dict DICT.md
$PY $RUN caption <work>/words.json -o <work>/captions.srt --json <work>/caps.json --dict DICT.md
$PY $RUN extract-pose <video> -o <work>/pose.json --model <model.pt>
$PY $RUN validate pose <work>/pose.json --min-detect 0.75
$PY $RUN biomech <work>/pose.json <work>/analysis.json
$PY $RUN validate analysis <work>/analysis.json --min-com 0.85

If no voiceover, skip transcribe/caption, but subsequent steps must not fabricate breath pauses for that source. Optional caption-llm only changes text, not timestamps. Done: both upstream validates pass; required subtitle/pose/analysis files are ready.

2. Build GRIP Route & Three-State Contact

At a frame with no climber or a clear route, run GRIP analyze, fix selection with edit --select <color group> and obtain session/state.json. GRIP colors are only candidates; the actual route is determined by contact confirmation. Contact matching may use holds of other colors; open footholds cannot be filtered out by color.

$PY $RUN grip-route <work>/analysis.json --grip-session <session/state.json> \
  --pose <work>/pose.json --route <color|cluster id|all> --out <work>/route.json \
  --analysis-out <work>/analysis_route_v1.json
$PY $RUN contact-v2 <work>/analysis_route_v1.json --fh <display height> \
  --out <work>/analysis_route.json --anchors <work>/inferred_anchors.json \
  --report <work>/contact_v2_report.json [--review <work>/contact_review.json]
$PY $RUN check-contract route <work>/route.json
$PY $RUN validate analysis <work>/analysis_route.json --min-com 0.85
$PY $RUN check-contract analysis <work>/analysis_route.json
$PY $RUN qa-strip <work>/analysis_route.json <work>/route.json <source video> \
  --times <seconds near crux, comma-separated> --out <work>/review/qa_<id>.jpg --anchors <work>/inferred_anchors.json

contact-v2 runs after grip-route: mats are not holds; while standing, both feet will be judged off, triggering the dyno gate. Small footholds missed by GRIP, fleeting false contacts, tracking jumping to wall decor also produce false off. It only removes false off (ground anchors / dwell-inferred footholds / fleeting cleanup / outlier protection)—unknown remains unknown. Check the report for both_feet_off_frames before→after, and verify each inferred foothold.

--route all is for spray walls / tape-rated routes, walls with multi-color holds mixed: all colors are candidates (color="all", cluster=-1), contact confirmation decides which holds are on the route; each hold carries its GRIP color cluster's color_hex so the 3D scene can reproduce real hold colors. For single-color routes, write the color name as before.

For false on that automatic rules cannot resolve (hovering foot inside large hold bbox; foot lifted near wall but judged down because of 0.90× canvas height), use --review: contact_review.json each entry {limb, t0, t1, status, [hold_id], [to_hold_id], frames_checked(≥2 frames), note}—verify by frame, then write; it takes effect after all auto anchors and cannot be reverted. Each change is recorded in the frame-by-frame reviewed field and the report. unknown→off is rejected—it would fabricate airborne evidence for the dyno gate. The manifest's evidence.pose_note must state which review was used.

Extract frames near cruxes to verify hold bounding boxes and contact circles (qa-strip outputs strip images). Done: candidate/confirmed holds, contact_summary, per-limb three-state evidence complete; an empty confirmed route triggers review.

When the source is on a mapped network drive (e.g., Synology Z:\): While a long-running job (pose extraction, slow-motion render) is reading it, do not open it with another process— Path.resolve() / os.stat on network drives can throw PermissionError ([WinError 33]) due to file locks, while ffprobe/ffmpeg/.NET shared reads are unaffected. extract_pose.py already parses the path and retries on transient locks; the contract check falls back to GetFileAttributesW / WNetGetUniversalName without opening the file. build-draft uses os.path.abspath to preserve the drive letter—do not rewrite Z:\ to UNC paths; the contract check normalizes both sides before comparison, unaffected. A render process occasionally hangs on the first ffmpeg read of the source (minutes of zero output): simply kill that process and rerun—do not wait.

3. Mine & Geometrically Refine Candidates

$PY $RUN tech-moves <work>/analysis_route.json <work>/tech_route_moves.json
$PY $RUN tech-holds <work>/analysis_route.json <work>/tech_route_moves.json <work>/route.json \
  --out <work>/tech_route.json --report <work>/tech_holds_report.json
$PY $RUN mine-cruxes <work>/analysis_route.json <work>/tech_route.json \
  --captions <work>/caps.json -o <work>/crux_candidates.json
$PY $RUN refine-tech <work>/analysis_route.json <work>/crux_candidates.json \
  -o <work>/crux_candidates_refined.json

tech-moves only looks at skeleton—does not detect side pulls, underclings, heel hooks (requires grasp direction). Frames standing on the mat are also treated as climbing. tech-holds uses GRIP hold geometry to add rail_hang (side-pull on vertical hold), leg_hook (leg extended side to hook hold), barndoor_lean (hip shifting toward the other hand after release), and re-evaluates flagging and foot-switch on the same hold. Read its relabel list, check each orig_tech.

Include user-specified windows in the same refinement input; preserve their user source—do not inflate scores to override priority. Check each refine entry; re-classifications keep orig_tech. For fine details 2D cannot distinguish, use evidence-based names (e.g., "toe hook") and perform frame-level visual verification. Done: each candidate has time window, geometric numbers, and visual conclusion; dynos pass the positive airborne gate.

4. User Confirmation & Manifest Freeze

Present the user with 1–3 recommended items and any user-specified items: technical name, t0/t1/t_peak, evidence, whether re-classified. User-specified items come first; low scores must not eliminate them. When the user has already clearly specified cruxes, only clarify ambiguous windows/naming—do not re-pitch candidates.

Write <work>/crux_manifest.json per the analysis contract, recording user_directed, ordered selected, and confirmation. A director's plan may not be created before confirmation. user_directed only lists currently valid directives: old directives that the user corrected are removed from it and moved to superseded (with reason)— keeping a directive in user_directed without a corresponding selected will cause the contract to reject "user-specified cruxes not all included."

$PY $RUN check-contract crux <work>/crux_manifest.json \
  --analysis <work>/analysis_route.json
# For each selected ID, export a unique instance; same tech name does not overwrite
$PY $RUN export-crux <work>/crux_manifest.json --crux-id <crux_id> \
  -o <work>/crux_instances/<crux_id>.json

Done: each user directive has a corresponding origin=user selection, confirmed IDs in order; all dynos pass frame-by-frame recalculation via analysis. Each instance file's crux_id is the unique directory name for subsequent narration/scene/anim/anim3d; paths is the unique path mapping; tech is only for principle library reuse.

5. Handoff to Subsequent Animation Assets

Pass manifest, crux_instances/<crux_id>.json, route, analysis_route, and real pose to subsequent voiceover/Three.js skills; this skill does not produce principles, TTS, or animations. The plan is complete only after receiving and verifying:

anim3d/<crux_id>/final/           contains final MP4
anim3d/<crux_id>/narration.json   subtitles matching final audio/duration
anim3d/review_<crux_id>/final/    optional: coach commentary segment (when user wants "commentary after explanation")
anim3d/review_<crux_id>/narration.json

plan.json does not reference intermediate HTML, per-sentence WAV, alignment, draft animations, or old anim/ artifacts.

6. Generate Title Cards & Director's Plan

$PY $RUN title-card <project> --series <series> --main <main title> \
  --sub <subtitle> --out draft_assets/title_card_v1.png
$PY $RUN check-contract plan <project>/plan.json \
  --analysis <work>/analysis_route.json --check-media

Assemble per the director's contract: hook → hook_anim → [title] → main → anim → replay → main.... If there is a coach commentary segment, insert it after replay with role: "review", then back to main. If title content changes, use a new PNG filename. Both animation branches' full voiceover goes through Jianying's native subtitle track, defaulting to 88% Y position; if the final HUD has different reserved space, explicitly set anim_subtitle_y (pixel offset) in the plan. --analysis checks that the plan's source video and analysis.meta.video refer to the same file; --check-media only checks existence (when source is locked by another process on a network drive, verify existence and drive-letter mapping without opening the file—no false negative). Review each breath: adjustment printed by the builder: the replay in-point must not catch before the audience has already seen the footage before the animation (otherwise a word is heard twice). Done: structure, final/narration whitelist, breath words, source identity, and asset existence all pass.

7. Build Staging, Explicit Install, Verify

$PY $RUN build-draft <project> <work> <new draft name>
$PY $RUN check-contract staging <work>/draft-test --check-media

Confirm the builder outputs gaps=OK, clip count matches plan segment count, and review each breath: adjustment. Install only when requested:

$PY $RUN install-draft <work>/draft-test <new draft name>
$PY $RUN check-contract staging <jianying draft library>/<new draft name> --check-media

Finally, ask the user to drag through the draft in Jianying to check cuts, animation positions, subtitles, and title cards. Any edits the user makes belong to the user. Done: director's contract gates G1–G8 all pass; only the draft is delivered—no full video render.

Failure Handling & Regression

  • Missing engine: set the corresponding scripts environment variable per the error; do not rebuild a duplicate implementation in this directory.
  • Contract failure: fix upstream data or plan, then re-run; do not change unknown to off to pass the dyno gate.
  • final/narration incomplete: stop at handoff; do not construct an installable draft.
  • After modifying a script in this directory, run $PY -m pytest tests -q. Tests only use mock/temporary JSON—no video analysis, rendering, or Jianying installation.

相关技能