Tools and files

The registry of skills and scripts, the folder map, commands and what is tracked by git.

TL;DR

Five skills live in .claude/skills/; the main one, video-script-production, holds 12 scripts, 2 data files (rules.json, voice-patterns.json) and 26 reference files. Research code is in src/ (33 ecosystem stages, series analysis, topic research). Per-video work is in research/<topic>/. The authoritative registry of tools is .claude/skills/video-script-production/references/tools.md, which must be updated in the same session as any tool is created or changed. transcripts/, reports/, data/ and .env are gitignored and local.

  • One command to remember: check.js.
  • Rule: before building a script, check tools.md; it exists to stop the same scratch script being built twice.
  • Kinds: D deterministic (same input, same output, no model), L uses a model (results vary), H a procedure for the agent to follow.

Skills

SkillKindWhat it doesUsed at
video-script-productionD + HWrites and checks a script to the v6 bar: lessons A to M, linter, damage test, gate runner, ledger check, scaffold, retime, calibration, session log, Hinglish parity, TTS builder. Entry SKILL.md, procedure references/runbook.md.S0, S3 to S11
winning-video-teardownL (Sonnet analysts) + DTakes winning videos, finds each mechanism and quotes the moment, counts which recur. Taxonomy of script, packaging and thumbnail mechanisms.S2; series study
script-cohort-analysisL (Haiku raters via script-rater) + DBlind, pre-registered statistical test of which script rules predict performance in a cohort. Rubric v3: 45 checks, 11 dimensions.Series study; once enough comparable scripts exist
within-channel-studyD + HWhat separates a channel's best, median and worst videos.Channel and topic evidence
ecosystem-raterDRates niches on demand, room, evergreen value, upload pressure, monetization.Niche selection

Agent: .claude/agents/script-rater.md, the blind rater for the cohort skill (reads one task file, writes validated JSON).

Scripts in video-script-production/scripts/

ScriptKindInput to outputWhen
check.jsD--dir --version [--prev] [--fix] [--no-selftest] to every gate, STATUS-vN.md, lint/; BAR MET or what to do next. Exit 1 on a hard gate.End of every stage; session start
lint.jsD--script --chain [--label --out] to lint-<label>.json/.md; exit 1 on FAIL. 70 rules.S8
selftest.jsD--script --chain to a damage test (56 mutations on v7).S8; whenever a rule changes
ledger-check.jsD--script [--chain --facts --strict]: every spoken digit figure is in the ledger; sections exist.S8
retime.jsD--script [--write --check]: heading time ranges from word counts.S8
extract-vo.jsD--script [--mode timed|blind|plain --out]: the spoken text, numbered.S9, S10; TTS copy-paste
calibrate.jsD--dir <winner transcripts> [--script] [--out]: voice, rhythm, comparison, admission, "you" and name measures with medians.When thresholds are set or new winners arrive
session-log.jsD[--jsonl --since --until --prompts --user --out]: every search, fetch and subagent of a Claude Code session as Markdown.S11
compare.jsD--a --b --sa --sb --out: side-by-side text-level measures.S8
scaffold.jsD--dir --version [--beats --title] [--from vP]: blank script, chain, FACTS, hand-off, or the next version copied from the last.S0
hinglish-parity.jsD--english --hinglish [--allow --max-ratio]: beats, paragraphs, digits, question marks, quotes, names and graphics match; length ratio per beat.After writing a Hinglish version
tts-gemini.jsD--script --spec --out --name: per-beat Gemini TTS prompts for 3.1 and 3.8, refusing to write unless the words match.Voice stage
rules.jsondataEvery threshold with its reason; the bar block. Read, never edited to pass.
voice-patterns.jsondataRegexes for negation pivots, run-ups, stock phrases, comparison markers, stock figures, verdict words, viewer address.Read by lint.js

Repo code used upstream

ToolKindWhat it does
src/topic-research/cli.js "<topic>" --entity= --max= --also= --refreshLSearch, transcripts, extraction, synthesis, research/<slug>/report.md and synthesis.json. Cached. See page 05.
src/topic-research/export-csv.js, export-cohort.jsD (network)Every video seen with channel subscriber counts; transcripts in the teardown layout.
src/series-analysis/* (npm run series -- <cmd> --series=<id>)D + LFind, enrich, rank and cohort videos for a series. See page 03.
src/series-analysis/topic-study.js --series=fall-of-xDWhich subjects draw views. See page 04.
src/series-viewer/server.jsDLocal viewer on port 3100 for series results, with single-video teardown generation.
src/stages/01-*.js to 33-*.jsD + LEcosystem intelligence. See page 02.
src/llm.js, src/gemini.jsLLanguage-model client: Gemma 4 on the Gemini API, falling back to Ollama.
src/transcript-fetch.js, src/video-info-fetch.jsDCaption and metadata fetch.

Video stage (research/the-fall-of-moser-baer/video/tools/)

ToolKindInput to output
beat_text.pyDTTS prompt (3.1) to reference-words.json
whisper_words.pyL (Whisper decoding)Beat WAVs to raw/B#.whisper.json
align_words.pyDReference words, Whisper words, WAVs and the script to B#.json, words.json, align-report.md
split_whisper.pyDHelper (not described in the registry)

Folder map

ecosystem-generic/
  CLAUDE.md                     standing instructions, loaded automatically
  README.md, README-SERIES-ANALYSIS.md, README-WITHIN-CHANNEL-ANALYSIS.md, QUEUE-DEFINITIONS.md
  SCIENCE-ECOSYSTEM-RUNBOOK.md, catalogue-crawl-investigation-v1.md
  config.js, config-*.js        one niche definition each (config.js = the active one: crochet)
  package.json                  npm scripts (discover ... series, series:viewer, test:all)
  docs/                         these pages, plus older Markdown (SCRIPT-PIPELINE.md, PROMPT-cafe-coffee-day.md)
  series/                       why-x-died.json, fall-of-x.json (series specs)
  seeds/                        topics.json, discovery-v2.json, human-reference-channels.json
  src/
    stages/                     01 to 33, the ecosystem pipeline
    analysis/, discovery/       scoring, queues, within-channel statistics
    series-analysis/            cli, cohorts, scoring, signals, store, topic-study, report
    series-viewer/              local web viewer
    topic-research/             cli, extract, synthesize, report, export-*, sources/
    llm.js, gemini.js, db.js ...
  tests/                        16 test files (npm run test:all)
  ecosystem-ratings/            scorecard.md and one folder per niche (probe queries, metrics)
  research/
    the-fall-of-moser-baer/     report.md, synthesis.json, search.json, transcripts/, extractions/,
                                teardown/ (SYNTHESIS.md, cohort-*, run/), script/ (SCRIPT-v3..v7, chain-v4..v7,
                                HANDOFF, STATUS, lint/, tts/, audio/), video/ (tools, timing, PRODUCTION-PLAN.md)
    the-fall-of-cafe-coffee-day/ same shape; script/ has FACTS.md, SCRIPT-v1.md, PROGRESS.md, RESEARCH-LOG-v1.md
  .claude/
    skills/                     the five skills
    agents/script-rater.md
  data/        (gitignored)     SQLite databases, ai-mode-poc/
  reports/     (gitignored)     queue, qualification, series-analysis, topic-study reports
  transcripts/ (gitignored)     per-channel samples (_study/), series-analysis/ cohorts and teardowns, _script_ledger.json

Inside video-script-production/

PathHolds
SKILL.mdEntry point: lessons table, the steps, the reference index.
references/runbook.md, quality-bar.mdThe eleven stages, defaults, maturity ladder; what "finished" means. Read first.
references/history.md, research-log.md, research-log-round7.mdHow v3 became v7; every search and fetch behind it.
references/s1-rival-brief.md, s2-teardown.md, research-protocol.mdThe research stages in full.
references/principles.md, texture.md, implicit-pull.md, voice.md, stakes-and-load.md, beat-contract.md, opening-protocol.mdThe reasoning and evidence behind the lessons.
references/chain-schema.md, lint-fixes.mdThe file formats and every rule's usual cause and fix.
references/read-aloud-checklist.md, reader-prompts.md, handoff-template.mdThe judgement gates and the final message.
references/lesson-protocol.md, review-round-7.mdHow a review comment becomes a rule; the 35-note trace.
references/hinglish-adaptation.mdHinglish rules, parity, TTS.
references/launch-prompt.mdThe prompt that makes a fresh session run the whole pipeline for one topic.
references/tools.md, learnings.mdThe tools registry; what each script taught.
examples/moser-baer-v6/, moser-baer-v7/Frozen copies of the approved script, chain, gate report and a map of the form.

Command cheat sheet

# where does a script stand?
node .claude/skills/video-script-production/scripts/check.js --dir research/the-fall-of-moser-baer/script --version v7 --no-selftest

# new topic
node .claude/skills/video-script-production/scripts/scaffold.js --dir research/<slug>/script --version v1 --beats 13 --title "<title>"
node src/topic-research/cli.js "the fall of <x>" --entity="<X>" --max=8      # run in the background; 20 to 25 min
node .claude/skills/video-script-production/scripts/check.js --dir research/<slug>/script --version v1 --fix

# next version of an existing script
node .claude/skills/video-script-production/scripts/scaffold.js --dir research/<slug>/script --version v2 --from v1

# spoken text for reading, readers or TTS
node .claude/skills/video-script-production/scripts/extract-vo.js --script research/<slug>/script/SCRIPT-vN.md --mode plain

# Hinglish checks and TTS prompts
node .claude/skills/video-script-production/scripts/hinglish-parity.js --english SCRIPT-vN.md --hinglish SCRIPT-vN-hinglish.md
node .claude/skills/video-script-production/scripts/tts-gemini.js --script SCRIPT-vN-hinglish.md --spec tts/spec-vN-hinglish.json --out tts --name vN-hinglish

# series and topic studies
npm run series:all
npm run series -- cohorts --series=why-x-died
node src/series-analysis/topic-study.js --series=fall-of-x

# research record at the end of a run
node .claude/skills/video-script-production/scripts/session-log.js --since <iso time> --out research/<slug>/script/RESEARCH-LOG-vN.md

# tests
npm run test:all

Use the full paths from the repo root. Write code and regexes with the Write or Edit tool, not shell heredocs.

Git and what is tracked

Memory notes

Notes for this project are in the Claude memory folder (C:\Users\nnjha\.claude\projects\C--Users-nnjha-OneDrive-Desktop-ecosystem-generic\memory\), indexed by MEMORY.md: the series study, the lessons A to M and the user's preferences, the Moser Baer script state, the pipeline docs pointer, the Hinglish and TTS state, and the video timing pipeline. They are background context and may be out of date; verify against the files.

Known gaps (candidates for the next tools)

  1. Cohort rubric v4 for the E to M checks, so script-cohort-analysis can test them blind once there are enough comparable scripts.
  2. A terms-per-30-seconds density rule and a calibration of the K3 budget on winners (K3, K4 and M1 are a partial answer).
  3. A check that a script's [CHECK] rows are the same set as its open items (today only the words are checked).
  4. A speech-timing check with a real text-to-speech pass. Partly answered by the beat WAVs; the headings still use 150 wpm.
  5. A packaging check (title and thumbnail) in the linter; today the title tension is a judgement written in the hand-off.
  6. A second-topic validation run of the whole runbook with the K, L, M rules.

Scratch tools that were promoted (so you do not rebuild them)

The calibration scripts became calibrate.js; the transcript-mining scripts became session-log.js; the blind-file maker became extract-vo.js --mode blind; manual timecode edits became retime.js; the lost Gemini prompt generator became tts-gemini.js; the throwaway parity check became hinglish-parity.js. A scratch script that is done twice should be promoted the same way, with a row in tools.md.

Written 2026-10-27 from the repository files and the project memory notes. If a page and a file disagree, the file is right: fix the page.