[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BNQW10JWMTSQ3WQXTDFE7H":3,"skill-same:01M7BNQW10JWMTSQ3WQXTDFE7H":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7BNQW10JWMTSQ3WQXTDFE7H","skilltta-task-guidance",null,"Temporary guidance Skill for the Video Silence Remover task. Consolidates lessons about silence detection smoothing windows, segment merging conventions, and threshold ratio semantics across sub-skills, and gives a concrete pipeline to produce compressed_video.mp4 and compression_report.json.","linyouxue\u002Fskill-repair-benchmark","linyouxue","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F216151464?v=4","01M7BJEVCXKD74KH6FG9CBVSQB","林宥学","01M7BJEVE02NP217V93BKZFC0J",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fcontrolled-skill-repair-experiments\u002Fresult\u002Fskilltta-claude4.7\u002Ftasks\u002Fsingle-video-silence-remover-all\u002Frepaired_skill\u002Fskilltta-task-guidance\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: skilltta-task-guidance\ndescription: Temporary guidance Skill for the Video Silence Remover task. Consolidates lessons about silence detection smoothing windows, segment merging conventions, and threshold ratio semantics across sub-skills, and gives a concrete pipeline to produce compressed_video.mp4 and compression_report.json.\n---\n\n# Video Silence Remover — Task Guidance Skill\n\n## Goal\nGiven `data\u002Finput_video.mp4` (~10 min teaching video), produce:\n1. `compressed_video.mp4` — video with the unnecessary opening and long silent pauses (>2s) removed.\n2. `compression_report.json` — report matching the exact schema in the task prompt.\n\n## High-Level Pipeline\n1. Probe original duration with `ffprobe`.\n2. Extract mono 16kHz PCM audio with `ffmpeg -ac 1 -ar 16000 -vn -f wav`.\n3. Detect silence from audio RMS envelope.\n4. Detect the opening (long low-energy \u002F static region at the start) and force-remove it even if just under the silence threshold.\n5. Merge nearby silence intervals and clamp them to [0, duration].\n6. Build the complementary keep-list, cut and concat with ffmpeg.\n7. Write JSON report with consistent math.\n\n## Known Pitfalls (addressed by location hints)\n\n### 1. Smoothing window ↔ timestamp alignment (silence-detector \u002F detect_silence.py)\n- When computing RMS over frames of size `hop` samples and then applying a moving-average smoothing window of length `W` frames, the smoothed value at index `i` corresponds to the *center* of the window, not the left edge.\n- Convert indices to seconds using `t = (i + W\u002F2) * hop \u002F sr` for center-aligned smoothing, or shift back by `W*hop\u002F(2*sr)` when reporting silence `start`\u002F`end`. Otherwise reported silence boundaries drift by half a window and cuts land inside speech.\n- Document in SKILL.md that `detect_silence.py` outputs *center-aligned* timestamps so downstream consumers (video-processor) must not re-shift.\n\n### 2. Segment merge convention (segment-combiner)\n- Intervals are half-open `[start, end)` in seconds.\n- Merge rule: sort by `start`; merge when `next.start - current.end \u003C= gap_tolerance` (default 0.3s) to avoid micro-fragments.\n- After merging, drop any segment with `duration \u003C min_silence_duration` (default 2.0s) **except** the opening segment, which is always kept if it starts at ~0.0.\n- Clamp all segments to `[0, total_duration]` and ensure no overlap before passing to ffmpeg.\n- video-processor must call the combiner *before* building keep-ranges, and must assert `sum(removed) + compressed_duration ≈ original_duration` within 0.2s.\n\n### 3. `threshold_ratio` semantics (pause-detector \u002F silence-detector \u002F video-processor)\n- `threshold_ratio` is a fraction of the **median** (not max) RMS of the whole audio. A frame is silent if `rms[i] \u003C threshold_ratio * median_rms`.\n- Recommended default: `0.3`. For noisy openings (static with hiss), using `max` as reference makes the threshold too high and misses the opening; using `median` keeps it robust.\n- silence-detector and pause-detector must agree on this definition; video-processor should expose it as a single CLI flag and pass the same value to both.\n\n## Reusable Patterns from Retrieved Examples\n- **Guard-clause early returns** (BigCodeBench\u002F175): before processing, verify `input_video.mp4` exists and has an audio stream; otherwise write a minimal valid JSON with zero removals.\n- **Clean tokenization \u002F filtering of empties** (BigCodeBench\u002F54): when splitting the timeline into keep-segments between silences, drop zero-length segments (`end - start \u003C 0.05s`) just like dropping empty sentences.\n- **Single-dict JSON serialization with os.path** (BigCodeBench\u002F265): assemble the full report dict first, then `json.dump` once; always write to `os.path.join(os.getcwd(), 'compression_report.json')`.\n\n## Concrete Recipe\n\n```bash\n# 1. duration\nDUR=$(ffprobe -v error -show_entries format=duration -of csv=p=0 data\u002Finput_video.mp4)\n\n# 2. audio\nffmpeg -y -i data\u002Finput_video.mp4 -ac 1 -ar 16000 -vn audio.wav\n```\n\n```python\n# 3+4+5. detect silences (center-aligned, median-based threshold)\nimport numpy as np, soundfile as sf, json, subprocess, os\ny, sr = sf.read('audio.wav')\nhop = 1024\nframes = [y[i:i+hop] for i in range(0, len(y)-hop, hop)]\nrms = np.array([np.sqrt(np.mean(f*f)+1e-12) for f in frames])\nW = 15                               # smoothing window (frames)\nkernel = np.ones(W)\u002FW\nsm = np.convolve(rms, kernel, mode='same')  # 'same' => center-aligned\nthr = 0.3 * np.median(sm)\nsilent = sm \u003C thr\n\n# frame index -> seconds (center of frame)\ndef t(i): return (i + 0.5) * hop \u002F sr\n\nsegs = []\ni = 0\nwhile i \u003C len(silent):\n    if silent[i]:\n        j = i\n        while j \u003C len(silent) and silent[j]:\n            j += 1\n        segs.append([t(i), t(j)])\n        i = j\n    else:\n        i += 1\n\n# merge close, drop short (except opening)\nMERGE_GAP, MIN_DUR = 0.3, 2.0\nmerged = []\nfor s,e in segs:\n    if merged and s - merged[-1][1] \u003C= MERGE_GAP:\n        merged[-1][1] = e\n    else:\n        merged.append([s,e])\n\ndur = float(subprocess.check_output(\n    ['ffprobe','-v','error','-show_entries','format=duration',\n     '-of','csv=p=0','data\u002Finput_video.mp4']).strip())\n\nfinal = []\nfor idx,(s,e) in enumerate(merged):\n    s = max(0.0, s); e = min(dur, e)\n    is_opening = (idx == 0 and s \u003C 1.0)\n    if (e - s) >= MIN_DUR or is_opening:\n        final.append([s,e])\n\n# 6. build keep ranges and cut\nkeep = []\ncur = 0.0\nfor s,e in final:\n    if s - cur > 0.05:\n        keep.append([cur, s])\n    cur = e\nif dur - cur > 0.05:\n    keep.append([cur, dur])\n\nparts = []\nfor k,(a,b) in enumerate(keep):\n    out = f'part_{k:03d}.mp4'\n    subprocess.run(['ffmpeg','-y','-ss',f'{a}','-to',f'{b}',\n                    '-i','data\u002Finput_video.mp4',\n                    '-c:v','libx264','-c:a','aac','-preset','veryfast',out],\n                   check=True)\n    parts.append(out)\n\nwith open('concat.txt','w') as f:\n    for p in parts: f.write(f\"file '{p}'\\n\")\nsubprocess.run(['ffmpeg','-y','-f','concat','-safe','0',\n                '-i','concat.txt','-c','copy','compressed_video.mp4'], check=True)\n\n# 7. report\ncompressed = float(subprocess.check_output(\n    ['ffprobe','-v','error','-show_entries','format=duration',\n     '-of','csv=p=0','compressed_video.mp4']).strip())\nremoved = sum(e-s for s,e in final)\nreport = {\n    'original_duration_seconds': round(dur,3),\n    'compressed_duration_seconds': round(compressed,3),\n    'removed_duration_seconds': round(removed,3),\n    'compression_percentage': round(removed\u002Fdur*100,2),\n    'segments_removed': [\n        {'start': round(s,3), 'end': round(e,3), 'duration': round(e-s,3)}\n        for s,e in final\n    ],\n}\nwith open(os.path.join(os.getcwd(),'compression_report.json'),'w') as f:\n    json.dump(report, f, indent=2)\n```\n\n## Sanity Checks Before Finishing\n- `abs(original - (compressed + removed)) \u003C 0.5s`.\n- `0 \u003C compression_percentage \u003C 60` (teaching content preserved).\n- Every segment: `0 \u003C= start \u003C end \u003C= original_duration` and `duration == end - start`.\n- Opening segment removed if the video starts with >1s of static\u002Flow-energy audio.\n- Both files exist at workspace root: `compressed_video.mp4`, `compression_report.json`.\n","# Video Silence Remover — Task Guidance Skill\n\n## Goal\nGiven `data\u002Finput_video.mp4` (~10 min teaching video), produce:\n1. `compressed_video.mp4` — video with the unnecessary opening and long silent pauses (>2s) removed.\n2. `compression_report.json` — report matching the exact schema in the task prompt.\n\n## High-Level Pipeline\n1. Probe original duration with `ffprobe`.\n2. Extract mono 16kHz PCM audio with `ffmpeg -ac 1 -ar 16000 -vn -f wav`.\n3. Detect silence from audio RMS envelope.\n4. Detect the opening (long low-energy \u002F static region at the start) and force-remove it even if just under the silence threshold.\n5. Merge nearby silence intervals and clamp them to [0, duration].\n6. Build the complementary keep-list, cut and concat with ffmpeg.\n7. Write JSON report with consistent math.\n\n## Known Pitfalls (addressed by location hints)\n\n### 1. Smoothing window ↔ timestamp alignment (silence-detector \u002F detect_silence.py)\n- When computing RMS over frames of size `hop` samples and then applying a moving-average smoothing window of length `W` frames, the smoothed value at index `i` corresponds to the *center* of the window, not the left edge.\n- Convert indices to seconds using `t = (i + W\u002F2) * hop \u002F sr` for center-aligned smoothing, or shift back by `W*hop\u002F(2*sr)` when reporting silence `start`\u002F`end`. Otherwise reported silence boundaries drift by half a window and cuts land inside speech.\n- Document in SKILL.md that `detect_silence.py` outputs *center-aligned* timestamps so downstream consumers (video-processor) must not re-shift.\n\n### 2. Segment merge convention (segment-combiner)\n- Intervals are half-open `[start, end)` in seconds.\n- Merge rule: sort by `start`; merge when `next.start - current.end \u003C= gap_tolerance` (default 0.3s) to avoid micro-fragments.\n- After merging, drop any segment with `duration \u003C min_silence_duration` (default 2.0s) **except** the opening segment, which is always kept if it starts at ~0.0.\n- Clamp all segments to `[0, total_duration]` and ensure no overlap before passing to ffmpeg.\n- video-processor must call the combiner *before* building keep-ranges, and must assert `sum(removed) + compressed_duration ≈ original_duration` within 0.2s.\n\n### 3. `threshold_ratio` semantics (pause-detector \u002F silence-detector \u002F video-processor)\n- `threshold_ratio` is a fraction of the **median** (not max) RMS of the whole audio. A frame is silent if `rms[i] \u003C threshold_ratio * median_rms`.\n- Recommended default: `0.3`. For noisy openings (static with hiss), using `max` as reference makes the threshold too high and misses the opening; using `median` keeps it robust.\n- silence-detector and pause-detector must agree on this definition; video-processor should expose it as a single CLI flag and pass the same value to both.\n\n## Reusable Patterns from Retrieved Examples\n- **Guard-clause early returns** (BigCodeBench\u002F175): before processing, verify `input_video.mp4` exists and has an audio stream; otherwise write a minimal valid JSON with zero removals.\n- **Clean tokenization \u002F filtering of empties** (BigCodeBench\u002F54): when splitting the timeline into keep-segments between silences, drop zero-length segments (`end - start \u003C 0.05s`) just like dropping empty sentences.\n- **Single-dict JSON serialization with os.path** (BigCodeBench\u002F265): assemble the full report dict first, then `json.dump` once; always write to `os.path.join(os.getcwd(), 'compression_report.json')`.\n\n## Concrete Recipe\n\n```bash\n# 1. duration\nDUR=$(ffprobe -v error -show_entries format=duration -of csv=p=0 data\u002Finput_video.mp4)\n\n# 2. audio\nffmpeg -y -i data\u002Finput_video.mp4 -ac 1 -ar 16000 -vn audio.wav\n```\n\n```python\n# 3+4+5. detect silences (center-aligned, median-based threshold)\nimport numpy as np, soundfile as sf, json, subprocess, os\ny, sr = sf.read('audio.wav')\nhop = 1024\nframes = [y[i:i+hop] for i in range(0, len(y)-hop, hop)]\nrms = np.array([np.sqrt(np.mean(f*f)+1e-12) for f in frames])\nW = 15                               # smoothing window (frames)\nkernel = np.ones(W)\u002FW\nsm = np.convolve(rms, kernel, mode='same')  # 'same' => center-aligned\nthr = 0.3 * np.median(sm)\nsilent = sm \u003C thr\n\n# frame index -> seconds (center of frame)\ndef t(i): return (i + 0.5) * hop \u002F sr\n\nsegs = []\ni = 0\nwhile i \u003C len(silent):\n    if silent[i]:\n        j = i\n        while j \u003C len(silent) and silent[j]:\n            j += 1\n        segs.append([t(i), t(j)])\n        i = j\n    else:\n        i += 1\n\n# merge close, drop short (except opening)\nMERGE_GAP, MIN_DUR = 0.3, 2.0\nmerged = []\nfor s,e in segs:\n    if merged and s - merged[-1][1] \u003C= MERGE_GAP:\n        merged[-1][1] = e\n    else:\n        merged.append([s,e])\n\ndur = float(subprocess.check_output(\n    ['ffprobe','-v','error','-show_entries','format=duration',\n     '-of','csv=p=0','data\u002Finput_video.mp4']).strip())\n\nfinal = []\nfor idx,(s,e) in enumerate(merged):\n    s = max(0.0, s); e = min(dur, e)\n    is_opening = (idx == 0 and s \u003C 1.0)\n    if (e - s) >= MIN_DUR or is_opening:\n        final.append([s,e])\n\n# 6. build keep ranges and cut\nkeep = []\ncur = 0.0\nfor s,e in final:\n    if s - cur > 0.05:\n        keep.append([cur, s])\n    cur = e\nif dur - cur > 0.05:\n    keep.append([cur, dur])\n\nparts = []\nfor k,(a,b) in enumerate(keep):\n    out = f'part_{k:03d}.mp4'\n    subprocess.run(['ffmpeg','-y','-ss',f'{a}','-to',f'{b}',\n                    '-i','data\u002Finput_video.mp4',\n                    '-c:v','libx264','-c:a','aac','-preset','veryfast',out],\n                   check=True)\n    parts.append(out)\n\nwith open('concat.txt','w') as f:\n    for p in parts: f.write(f\"file '{p}'\\n\")\nsubprocess.run(['ffmpeg','-y','-f','concat','-safe','0',\n                '-i','concat.txt','-c','copy','compressed_video.mp4'], check=True)\n\n# 7. report\ncompressed = float(subprocess.check_output(\n    ['ffprobe','-v','error','-show_entries','format=duration',\n     '-of','csv=p=0','compressed_video.mp4']).strip())\nremoved = sum(e-s for s,e in final)\nreport = {\n    'original_duration_seconds': round(dur,3),\n    'compressed_duration_seconds': round(compressed,3),\n    'removed_duration_seconds': round(removed,3),\n    'compression_percentage': round(removed\u002Fdur*100,2),\n    'segments_removed': [\n        {'start': round(s,3), 'end': round(e,3), 'duration': round(e-s,3)}\n        for s,e in final\n    ],\n}\nwith open(os.path.join(os.getcwd(),'compression_report.json'),'w') as f:\n    json.dump(report, f, indent=2)\n```\n\n## Sanity Checks Before Finishing\n- `abs(original - (compressed + removed)) \u003C 0.5s`.\n- `0 \u003C compression_percentage \u003C 60` (teaching content preserved).\n- Every segment: `0 \u003C= start \u003C end \u003C= original_duration` and `duration == end - start`.\n- Opening segment removed if the video starts with >1s of static\u002Flow-energy audio.\n- Both files exist at workspace root: `compressed_video.mp4`, `compression_report.json`.\n",{"name":5,"description":7},"main","cdcb6d230f3b15c3c33f8a2bdd16439f43602cbe","controlled-skill-repair-experiments\u002Fresult\u002Fskilltta-claude4.7\u002Ftasks\u002Fsingle-video-silence-remover-all\u002Frepaired_skill\u002Fskilltta-task-guidance",1,"https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark","https:\u002F\u002Fgithub.com\u002Flinyouxue","2026-11-14 20:28:35",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add linyouxue\u002Fskill-repair-benchmark --skill skilltta-task-guidance",{"tool":37,"command":38},"bunx","bunx skills add linyouxue\u002Fskill-repair-benchmark --skill skilltta-task-guidance",{"tool":40,"command":41},"pnpm","pnpm dlx skills add linyouxue\u002Fskill-repair-benchmark --skill skilltta-task-guidance","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fcontrolled-skill-repair-experiments\u002Fresult\u002Fskilltta-claude4.7\u002Ftasks\u002Fsingle-video-silence-remover-all\u002Frepaired_skill\u002Fskilltta-task-guidance\u002FSKILL.md",true,[],[46,53,60,67,72,77],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M7E1HGVRY73NBJ022CJG13X6","video-frame-extraction","Extract frames from video files and save them as images using OpenCV","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fvideo-frame-extraction\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7E1HAG5R7CJ9C8NYJS771MB","openai-vision","Analyze images and multi-frame sequences using OpenAI GPT vision models","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fopenai-vision\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7E1H7DADKB6QBWKC2KQ63SZ","image-ocr","Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fimage-ocr\u002FSKILL.md",[],[],{"skillNo":68,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7E1H0WBNT43TENGQY7AVZHD","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fvideo-frame-extraction\u002FSKILL.md",[],[],{"skillNo":73,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7E1GTC7D4N4Q2EF03875J9E","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fopenai-vision\u002FSKILL.md",[],[],{"skillNo":78,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7E1GQ92CWFMGH53KSSE4WER","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fimage-ocr\u002FSKILL.md",[],[]]