Knowledge Video Decomposer
Use this skill to turn source-gated transcript, subtitle, ASR, or approved local
material into a structured knowledge package. In v0.6, platform acquisition is
owned by acquire-source-material; this skill's old platform acquisition scripts
are legacy compatibility paths.
Core workflow:
- Inspect the source and collect metadata.
- Before processing any video URL or platform page, read references/chrome-routing.md, references/chrome-probe-contract.md, references/source-status.md, and references/platform-prerequisites.md.
- When starting a new platform workflow, diagnosing an environment failure, or handing the workflow to a new Agent, run scripts/doctor.py and save doctor_report.json / doctor_report.md under logs or 00_source. Doctor is read-only: it checks yt-dlp, ffmpeg/ffprobe, faster-whisper, Node.js, Chrome plugin files, cookies-file presence, Chromium App-Bound signals, Python encoding, and UTF-8 writing, but does not fetch media, launch Chrome, install extensions, or reveal cookie values.
- Legacy only: use scripts/acquisition_runner.py for old first-pass platform acquisition probing. New URL acquisition should create
00_acquisition/manifest.jsonthroughacquire-source-material. - Legacy only: use scripts/platform_media_runner.py for old URL-to-material chains. New URL acquisition should be handed off through the acquisition bundle protocol.
- Use scripts/acquisition_probe.py to record source status, source classes, failed probes, Chrome routing state, and the next allowed route when probe results already exist or when another tool produced the evidence.
- Platform blocks, HTTP 429, bot/CAPTCHA/login barriers, RequestBlocked errors, or Hearsay URL timeouts on platform URLs must enter the Chrome route decision in references/chrome-routing.md instead of repeating the same extractor.
- When a yt-dlp bare request or youtube_transcript_api hits a platform block (HTTP 429, bot check, sign-in required, RequestBlocked), first identify the browser that actually owns the authorized login state, then try
--cookies-from-browser edgeor--cookies-from-browser chromeas appropriate, or use a user-exported Netscapecookies.txt. Never infer the browser from the control-plugin name. - If the selected browser profile is locked or cookie decryption fails, do not loop over profiles or silently switch browser families. Follow references/platform-prerequisites.md: request approval before closing the actual browser, or request a user-exported Netscape
cookies.txt; never read, display, copy, or commit cookie values. - If yt-dlp with cookies exposes only storyboards/images or reports
n challenge solving failed, add a supported JavaScript runtime such as Node.js and, when accepted,--remote-components ejs:githubbefore declaring media unavailable. - After yt-dlp with cookies, Chrome page inspection, or browser-derived probing obtains subtitles, audio, or a browser-visible transcript, that material must pass through source-status gating (references/source-status.md) before entering full decomposition.
- Legacy/manual route: when Chrome opens a page and no visible transcript or caption UI is present, the old Chrome deep-probe sequence may still record observations, but new workflows should convert any user-approved transcript, subtitle, page text, or media export into an acquisition bundle before source-gate ingest.
- Use references/chrome-probe-contract.md and scripts/chrome_media_probe.py for legacy normalization or manual adapter work only. Chrome observations must not bypass the source gate.
- If Chrome deep-probe succeeds (an actual local media file or subtitle file was exported, or a public downloadable media/subtitle URL was confirmed and fetched), and subsequent ASR or subtitle parsing succeeds, the material qualifies as browser_derived_media - a primary source class that can support source_confirmed. Refer to references/source-status.md for the exact definition and recording requirements.
- If no primary transcript, no browser-derived media, and no user-provided or legitimately acquired local file exists, stop full decomposition and request primary material. Record that the missing requirement is primary media/transcript, not merely a better prompt.
- Prefer reliable existing subtitles or transcripts from the platform, yt-dlp (with the explicitly selected Edge/Chrome profile or user-exported cookies as needed), user-provided files, or local parsers - subject to the source-status gate.
- Use scripts/asr_pipeline.py when a legitimate local audio/video file exists and subtitles/transcripts are unavailable or insufficient. The pipeline runs or resumes faster-whisper ASR, normalizes the transcript, records
primary_audio_asrprovenance, writes ASR quality, alignment, and diarization-compatible reports, and then hands off to segmentation. Missing word timestamps or speaker labels must degrade gracefully and must not turn ASR into a verified verbatim transcript. - Use scripts/transcript_normalizer.py to normalize local transcript/subtitle material (
.txt,.md,.srt,.vtt,.jsonl,.json) into01_transcript/raw_transcript.jsonl,01_transcript/clean_transcript.jsonl, and01_transcript/clean_transcript.md. The normalizer may open the decomposition gate for source-confirmed transcript material, but it must not write segments, inventory, logic, or video_analysis_pack. - Normalize transcript material into timestamped artifacts where timestamps exist, and record transcript provenance, language, confidence, and known limitations.
- Use scripts/transcript_segmenter.py to segment confirmed/partial transcript material into
02_segments/subtitle_segments.json,02_segments/syntax_segments.json, and02_segments/argument_segments.json. Subtitle segments are a readability/timing layer; argument segments are the semantic/rhetorical layer. The segmenter may write05_gap_check/segmentation_gap_check.md, but it must not write inventory, source logic, or video_analysis_pack. - Use scripts/inventory_extractor.py to extract candidate concepts, examples, claims, and analogies into
03_inventory/. Inventory entries must preserve evidence spans and remain candidates until source logic review verifies them. The extractor must not write source logic or video_analysis_pack. - Use scripts/source_logic_builder.py to reconstruct source-faithful speaker logic into
04_logic/source_logic.mdand04_logic/logic_graph.json. This stage may write source-logic gap notes, but it must not add external critique, downstream interpretation, or video_analysis_pack. - Use scripts/evidence_auditor.py after source logic exists to audit transcript, segment, inventory, and graph evidence. It writes
05_gap_check/evidence_audit.json,05_gap_check/evidence_map.json,05_gap_check/claim_source_audit.json, and05_gap_check/gap_check.md; it must not writevideo_analysis_pack.md. Claims require transcript-backed spans, examples require concrete context, and source-logic nodes require transcript-backed evidence. - Use scripts/video_analysis_pack_builder.py only after
05_gap_check/evidence_audit.json,05_gap_check/evidence_map.json, and05_gap_check/claim_source_audit.jsonexist and the auditpack_gateallows a full or explicitly partial pack. This stage writesvideo_analysis_pack.mdand must preserve the full/partial scope label. - Preserve evidence links to timestamps or source spans.
- For Chinese, non-ASCII, Markdown, or JSON artifacts, use scripts/write_artifact.py, apply_patch, or another verified UTF-8 path. Do not write long Chinese artifacts through shell here-strings, inline command strings, PowerShell
>redirection, or other paths that can silently change encoding or turn characters into question marks. - In
source_blocked,source_failed,secondary_only, ordegraded_report_only, do not pre-create the full analysis directory shape (01_transcript,02_segments,03_inventory,04_logic,05_gap_check) and do not createvideo_analysis_pack.md. Write only00_sourcenotes plus a clearly labeled degraded/acquisition report. - Validate outputs with scripts/artifact_validator.py before handing them downstream.
- Output a video_analysis_pack for knowledge-document-composer only after evidence audit and validation pass for an allowed full or explicitly partial source status.
Runner guidance:
- Use scripts/doctor.py before acquisition when the environment is unknown, after a tool-path failure, or before long platform runs. Treat doctor failures as environment/setup issues, not source-content failures.
- Read the doctor
setup_requirementstable before declaring a source blocked or failed.yt-dlp, relevant media tools, Chrome plugin readiness, safe UTF-8 writing, and route-specific ASR/cookies/Node prerequisites must be separated from content availability. - User-exported cookies, extension installation/approval, CAPTCHA/paywall/private/region permission, and local primary-material handoff are manual user steps. Do not automate or fake them.
--youtube-cookies automeans onlywork/youtube-cookies/youtube.cookies.txt; it must not trigger Downloads scanning, browser-cookie extraction, full-disk search, or opening cookie contents.- Legacy only: use scripts/acquisition_runner.py when reproducing older URL probe behavior. Listed subtitles or media formats are only available routes; they are not
source_confirmeduntil a local subtitle/transcript/audio-derived transcript artifact exists. - Legacy only: use scripts/platform_media_runner.py when reproducing older URL acquisition chains. Downloaded audio must still be followed by scripts/asr_pipeline.py; it is recorded as
pending_primary_media_for_asr, not asprimary_audio_asr. - Legacy/manual adapter only: use scripts/chrome_media_probe.py after Chrome/pageAssets/Playwright inspection has produced layer observations. It writes standard Chrome deep-probe artifacts and suggests the acquisition signal, but it does not launch or control Chrome by itself.
- Use scripts/asr_pipeline.py for local audio/video that has been user-provided or legitimately acquired. It should produce
01_transcript/asr_transcript.jsonl, canonicalclean_transcriptartifacts,00_source/asr_pipeline_report.json,00_source/asr_pipeline_report.md,00_source/asr_alignment_report.json, and00_source/asr_diarization.json. - Use scripts/transcript_normalizer.py after a transcript/subtitle file exists. It writes transcript artifacts and source-status metadata only; it does not perform semantic decomposition.
- Use scripts/transcript_segmenter.py after
01_transcript/clean_transcript.jsonlexists and source status issource_confirmedor explicitly partial. It writes02_segments/subtitle_segments.json,02_segments/syntax_segments.json, and02_segments/argument_segments.jsononly and leaves inventory, source logic, and pack creation to later stages. - Use scripts/inventory_extractor.py after
02_segments/argument_segments.jsonexists. It writes03_inventoryartifacts and inventory gap notes only; source logic and final pack creation remain later stages. - Use scripts/source_logic_builder.py after
03_inventoryexists. It writes04_logicartifacts and source-logic gap notes only; final pack creation remains a later gated stage. - Use scripts/evidence_auditor.py after
04_logic/logic_graph.jsonand04_logic/source_logic.mdexist. It writes final pre-pack gap artifacts plusevidence_map.jsonandclaim_source_audit.json, then returns whether the next stage may build a full pack, a partial pack, or must fix evidence findings first. - Use scripts/video_analysis_pack_builder.py after the evidence auditor returns
enter_video_analysis_pack_builderorenter_partial_video_analysis_pack_builderand all evidence sidecars exist. It writes onlyvideo_analysis_pack.mdand relies on the audit gate rather than reinterpreting source material. - Use scripts/workflow_runner.py as a low-cost hard-gate runner for acquisition signals and minimal blocked/degraded status outputs.
- Do not treat workflow_runner.py as a full analyzer: it does not fetch media, launch Chrome, create transcripts, segment content, or produce a complete video_analysis_pack.
Read references/platform-prerequisites.md before processing YouTube or platform URLs where yt-dlp, cookies, JavaScript runtime, bot/sign-in checks, DPAPI/App-Bound failures, n challenge, missing subtitles, or local ASR routes may arise.
Read references/chrome-routing.md and references/chrome-probe-contract.md before processing video URLs and whenever Chrome route, page-state, platform block, Hearsay URL timeout, 429, bot, CAPTCHA, login, RequestBlocked, visible-transcript, or Chrome deep-probe decisions arise.
Read references/source-status.md before processing video URLs and before deciding whether full, partial, blocked, secondary-only, or degraded outputs are allowed.
Read references/artifact-schema.md before writing intermediate artifacts.
Read references/transcription-fallback.md before running ASR when reliable subtitles or transcripts are unavailable.