#!/bin/bash
# label.sh <i> -> labels/<i>.json ; haiku, no tools, project settings only (no user hooks)
i=$1; f=skills/$i.md; o=labels/$i.json
[ -s "$f" ] || exit 0; [ -s "$o" ] && exit 0
SCHEMA='{"type":"object","properties":{"about_video":{"type":"boolean","description":"true if the skill makes, edits, cuts, captions, renders or publishes video"},"engine":{"type":"string","enum":["ffmpeg_local","remotion","hyperframes","other_code_render","gen_api","hosted_editor","publish_upload","prompt_writing","planning_text"],"description":"main way the skill produces or changes video: ffmpeg_local = runs ffmpeg/moviepy/whisper or similar on local files; remotion = React Remotion; hyperframes = HeyGen HyperFrames HTML; other_code_render = Manim, three.js, GSAP/HTML, Blender, shaders; gen_api = calls a generation model API (HeyGen, fal, Seedance, Kling, MiniMax, Higgsfield...) itself; hosted_editor = drives a cloud editor or MCP service (CloudEdit, ChatCut, VideoDB, OpenChatCut); publish_upload = uploads or schedules to platforms; prompt_writing = only writes prompts for generators; planning_text = scripts, storyboards, reviews, strategy with no rendering"},"needs_paid_key":{"type":"boolean","description":"needs a paid API key or paid account to do its main job"},"local_tools":{"type":"array","items":{"type":"string"},"description":"local binaries or libraries it runs, e.g. ffmpeg, whisper, node, python, blender"}},"required":["about_video","engine","needs_paid_key","local_tools"]}'
head -c 16000 "$f" | claude -p "Classify the Claude Code skill below (its SKILL.md is on stdin). Answer only with the structured output." \
  --model haiku --setting-sources project --tools "" --json-schema "$SCHEMA" --output-format json > "$o.tmp" 2>/dev/null && mv "$o.tmp" "$o"
