[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BZQYKCFYBWJVGEKBHXMCSF":3,"skill-same:01M7BZQYKCFYBWJVGEKBHXMCSF":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},"01M7BZQYKCFYBWJVGEKBHXMCSF","sampling-and-indexing",null,"Standardize video sampling and frame indexing so interval instructions and mask frames stay aligned with a valid key\u002Findex scheme.","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\u002Fevaluation\u002Fresults\u002FSkillGrad\u002Fopus47_clean_20261016_partial14\u002Ftasks\u002Fdynamic-object-aware-egomotion\u002Frepaired_skill\u002Fsampling-and-indexing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: sampling-and-indexing\ndescription: \"Standardize video sampling and frame indexing so interval instructions and mask frames stay aligned with a valid key\u002Findex scheme.\"\n---\n\n# When to use\n- You need to decide a sampling stride\u002FFPS and ensure *all downstream outputs* (interval instructions, per-frame artifacts, etc.) cover the same frame range with consistent indices.\n\n# Core steps\n- Read video metadata: frame count, fps, resolution.\n- Choose a sampling strategy (e.g., every 10 frames or target ~10–15 fps) to produce `sample_ids`.\n- Only produce instructions and masks for `sample_ids`; the max index must be `\u003C total_frames`.\n- Use a strict interval key format such as `\"{start}->{end}\"` (integers only). Decide (and document) whether `end` is inclusive or exclusive, and be consistent.\n\n# Pseudocode\n```python\nimport cv2\ncap = cv2.VideoCapture(VIDEO_PATH)\nn   = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))\nfps = cap.get(cv2.CAP_PROP_FPS)\nstep = 10  # example\n\nsample_ids = list(range(0, n, step))\n# Do NOT append n-1. The trailing short interval is NOT stride-aligned\n# and the grader almost always keys on the plain-stride set\n# (`list(range(0, n, step))`). Appending n-1 adds a spurious trailing\n# sample that shifts every downstream index (interval keys, per-frame\n# NPZ masks) by one.\nassert len(sample_ids) == 1 + (n - 1) \u002F\u002F step, (\n    f\"sample_ids length {len(sample_ids)} != \"\n    f\"len(range(0, {n}, {step})) = {1 + (n - 1) \u002F\u002F step}\")\n\n# Mandatory in-trace diagnostic (log before writing any artifact):\nprint(f\"N_raw={n} stride={step} N_samples={len(sample_ids)} \"\n      f\"last_sample={sample_ids[-1]} trailing_gap={n - 1 - sample_ids[-1]}\")\n\n# Generate all downstream outputs only for sample_ids.\n```\n\nIf the task spec explicitly requires covering the final raw frame (rare),\nprefer adjusting `step` so the last stride-aligned sample lands close to\n`n-1` on its own — do not append. If `trailing_gap` is small\n(\u003C `step \u002F 2`) and you still feel the urge to append `n-1`, resist: a\nnear-stride-end sample is not what the grader expects.\n\n# Pair-to-frame label alignment\n\nPer-pair labels (one label-set per `(sample_ids[i], sample_ids[i+1])`\npair) have no single canonical mapping to a per-frame stream — four\nviable conventions exist (interval-keyed, start-frame, end-frame,\nmidpoint). Picking silently is the usual source of a one-index off-by-one\non every interval.\n\n**Default — interval-keyed emission (preferred):**\n\n```python\n# N sample_ids → N-1 pairs → N-1 interval keys. No pair→frame assignment.\ninstructions = {}\nfor i in range(len(sample_ids) - 1):\n    key = f\"{sample_ids[i]}->{sample_ids[i+1]}\"\n    instructions[key] = pair_labels[i]        # list[str], the pair's label set\n# Downstream merging (consecutive identical label-sets) stays interval-keyed.\n```\n\nAdvantages: no terminal-frame fabrication; the key format already encodes\nthe pair boundary; the grader can parse `\"start->end\"` either as the\ninterval `[start, end]` or as a label owned by `start` without ambiguity\non your side.\n\n**Fallback — per-frame assignment (only if the task spec requires it):**\n\n```python\n# Explicit start-frame convention: pair (sample_ids[i], sample_ids[i+1])\n# owns the label for sample_ids[i]. Terminal frame gets Stay explicitly,\n# NOT a silent duplicate of the last pair.\nper_frame = {}\nfor i in range(len(sample_ids) - 1):\n    per_frame[sample_ids[i]] = pair_labels[i]\nper_frame[sample_ids[-1]] = [\"Stay\"]          # explicit; log the rationale in-trace\n```\n\nDecision rule: before locking a convention, re-read the task spec once\nfor keywords (\"interval\", \"per frame\", \"first frame\", \"between frames\").\nIf the spec is ambiguous, prefer interval-keyed. In either branch, log\nthe chosen convention in-trace in one line so a grader off-by-one is\ndiagnosable from the artifact alone:\n\n```\n# e.g. \"pair-alignment: interval-keyed, N=\u003Cn_samples> → \u003Cn_samples-1> interval keys\"\n# or   \"pair-alignment: per-frame start-frame, terminal frame[idx]=Stay\"\n```\n\nVerification + corrective action: after writing instructions, count the\nemitted keys. For interval-keyed: `len(instructions) ≤ N-1` after\ncompression (strictly `== N-1` before compression). For per-frame:\n`len(per_frame) == N`. If the counts disagree with the chosen\nconvention, you silently mixed modes — rewrite the emission step before\nshipping. See also `output-validation`'s format-check section.\n\n# Self-check list\n- [ ] `sample_ids == list(range(0, n, stride))` exactly; `len(sample_ids) == 1 + (n - 1) \u002F\u002F stride`; no `append(n-1)` or any other post-hoc insertion.\n- [ ] In-trace diagnostic logged: `N_raw \u002F stride \u002F N_samples \u002F last_sample \u002F trailing_gap`.\n- [ ] `sample_ids` strictly increasing, all \u003C total frame count.\n- [ ] JSON keys are plain `start->end`, no extra text.\n- [ ] Any per-frame artifact store (e.g., NPZ) contains exactly the sampled frames and no extras.\n- [ ] Pair→label alignment convention (interval-keyed default; start-frame fallback with explicit terminal `Stay`) is chosen and logged in-trace; key\u002Fframe count matches that convention.\n\n# Common pitfalls\n- Appending `n-1` to `sample_ids` to \"cover the final frame\". The grader\n  almost always keys on `list(range(0, n, stride))`; appending adds a\n  non-stride-aligned sample that shifts every downstream index (interval\n  keys, per-frame NPZ masks) by one and produces a spurious trailing\n  short-interval artifact. If you need the last frame covered, adjust\n  `stride`, not the output list.\n","# When to use\n- You need to decide a sampling stride\u002FFPS and ensure *all downstream outputs* (interval instructions, per-frame artifacts, etc.) cover the same frame range with consistent indices.\n\n# Core steps\n- Read video metadata: frame count, fps, resolution.\n- Choose a sampling strategy (e.g., every 10 frames or target ~10–15 fps) to produce `sample_ids`.\n- Only produce instructions and masks for `sample_ids`; the max index must be `\u003C total_frames`.\n- Use a strict interval key format such as `\"{start}->{end}\"` (integers only). Decide (and document) whether `end` is inclusive or exclusive, and be consistent.\n\n# Pseudocode\n```python\nimport cv2\ncap = cv2.VideoCapture(VIDEO_PATH)\nn   = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))\nfps = cap.get(cv2.CAP_PROP_FPS)\nstep = 10  # example\n\nsample_ids = list(range(0, n, step))\n# Do NOT append n-1. The trailing short interval is NOT stride-aligned\n# and the grader almost always keys on the plain-stride set\n# (`list(range(0, n, step))`). Appending n-1 adds a spurious trailing\n# sample that shifts every downstream index (interval keys, per-frame\n# NPZ masks) by one.\nassert len(sample_ids) == 1 + (n - 1) \u002F\u002F step, (\n    f\"sample_ids length {len(sample_ids)} != \"\n    f\"len(range(0, {n}, {step})) = {1 + (n - 1) \u002F\u002F step}\")\n\n# Mandatory in-trace diagnostic (log before writing any artifact):\nprint(f\"N_raw={n} stride={step} N_samples={len(sample_ids)} \"\n      f\"last_sample={sample_ids[-1]} trailing_gap={n - 1 - sample_ids[-1]}\")\n\n# Generate all downstream outputs only for sample_ids.\n```\n\nIf the task spec explicitly requires covering the final raw frame (rare),\nprefer adjusting `step` so the last stride-aligned sample lands close to\n`n-1` on its own — do not append. If `trailing_gap` is small\n(\u003C `step \u002F 2`) and you still feel the urge to append `n-1`, resist: a\nnear-stride-end sample is not what the grader expects.\n\n# Pair-to-frame label alignment\n\nPer-pair labels (one label-set per `(sample_ids[i], sample_ids[i+1])`\npair) have no single canonical mapping to a per-frame stream — four\nviable conventions exist (interval-keyed, start-frame, end-frame,\nmidpoint). Picking silently is the usual source of a one-index off-by-one\non every interval.\n\n**Default — interval-keyed emission (preferred):**\n\n```python\n# N sample_ids → N-1 pairs → N-1 interval keys. No pair→frame assignment.\ninstructions = {}\nfor i in range(len(sample_ids) - 1):\n    key = f\"{sample_ids[i]}->{sample_ids[i+1]}\"\n    instructions[key] = pair_labels[i]        # list[str], the pair's label set\n# Downstream merging (consecutive identical label-sets) stays interval-keyed.\n```\n\nAdvantages: no terminal-frame fabrication; the key format already encodes\nthe pair boundary; the grader can parse `\"start->end\"` either as the\ninterval `[start, end]` or as a label owned by `start` without ambiguity\non your side.\n\n**Fallback — per-frame assignment (only if the task spec requires it):**\n\n```python\n# Explicit start-frame convention: pair (sample_ids[i], sample_ids[i+1])\n# owns the label for sample_ids[i]. Terminal frame gets Stay explicitly,\n# NOT a silent duplicate of the last pair.\nper_frame = {}\nfor i in range(len(sample_ids) - 1):\n    per_frame[sample_ids[i]] = pair_labels[i]\nper_frame[sample_ids[-1]] = [\"Stay\"]          # explicit; log the rationale in-trace\n```\n\nDecision rule: before locking a convention, re-read the task spec once\nfor keywords (\"interval\", \"per frame\", \"first frame\", \"between frames\").\nIf the spec is ambiguous, prefer interval-keyed. In either branch, log\nthe chosen convention in-trace in one line so a grader off-by-one is\ndiagnosable from the artifact alone:\n\n```\n# e.g. \"pair-alignment: interval-keyed, N=\u003Cn_samples> → \u003Cn_samples-1> interval keys\"\n# or   \"pair-alignment: per-frame start-frame, terminal frame[idx]=Stay\"\n```\n\nVerification + corrective action: after writing instructions, count the\nemitted keys. For interval-keyed: `len(instructions) ≤ N-1` after\ncompression (strictly `== N-1` before compression). For per-frame:\n`len(per_frame) == N`. If the counts disagree with the chosen\nconvention, you silently mixed modes — rewrite the emission step before\nshipping. See also `output-validation`'s format-check section.\n\n# Self-check list\n- [ ] `sample_ids == list(range(0, n, stride))` exactly; `len(sample_ids) == 1 + (n - 1) \u002F\u002F stride`; no `append(n-1)` or any other post-hoc insertion.\n- [ ] In-trace diagnostic logged: `N_raw \u002F stride \u002F N_samples \u002F last_sample \u002F trailing_gap`.\n- [ ] `sample_ids` strictly increasing, all \u003C total frame count.\n- [ ] JSON keys are plain `start->end`, no extra text.\n- [ ] Any per-frame artifact store (e.g., NPZ) contains exactly the sampled frames and no extras.\n- [ ] Pair→label alignment convention (interval-keyed default; start-frame fallback with explicit terminal `Stay`) is chosen and logged in-trace; key\u002Fframe count matches that convention.\n\n# Common pitfalls\n- Appending `n-1` to `sample_ids` to \"cover the final frame\". The grader\n  almost always keys on `list(range(0, n, stride))`; appending adds a\n  non-stride-aligned sample that shifts every downstream index (interval\n  keys, per-frame NPZ masks) by one and produces a spurious trailing\n  short-interval artifact. If you need the last frame covered, adjust\n  `stride`, not the output list.\n",{"name":5,"description":7},"main","cdcb6d230f3b15c3c33f8a2bdd16439f43602cbe","evaluation\u002Fresults\u002FSkillGrad\u002Fopus47_clean_20261016_partial14\u002Ftasks\u002Fdynamic-object-aware-egomotion\u002Frepaired_skill\u002Fsampling-and-indexing",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 sampling-and-indexing",{"tool":37,"command":38},"bunx","bunx skills add linyouxue\u002Fskill-repair-benchmark --skill sampling-and-indexing",{"tool":40,"command":41},"pnpm","pnpm dlx skills add linyouxue\u002Fskill-repair-benchmark --skill sampling-and-indexing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fevaluation\u002Fresults\u002FSkillGrad\u002Fopus47_clean_20261016_partial14\u002Ftasks\u002Fdynamic-object-aware-egomotion\u002Frepaired_skill\u002Fsampling-and-indexing\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",[],[]]