ahmedsakri/youtube-agent-pro / openai/skills/yt-script
yt-script
VerifiedWrite a YouTube video script from a raw idea - hook options off 21 formulas, scored, then the full spoken script with the retention beats marked. Use whenever the user wants a video script, a hook, an opening line, "what should I say", "write my next video", or is about to record and does not have the first fifteen seconds yet.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 2.8 KB |
| agents/openai.yaml | config | 258 B |
| hooks.json | config | 9.7 KB |
| hookscore.py | script | 5.9 KB |
hookscore.py
View on GitHub#!/usr/bin/env python3
"""hookscore.py - score a YouTube hook before you waste a take on it.
Five properties, 0-100 each, and a verdict that is 60% the mean and 40% the weakest one. The
weakest-link weighting is deliberate: a hook with four strong properties and one dead one is a hook
that leaks at the dead one, and averaging hides that.
python3 hookscore.py hooks.txt # one hook per line, ranked
python3 hookscore.py --hook "one line" # score a single hook
python3 hookscore.py --json hooks.txt # machine-readable
WHAT THIS CAN AND CANNOT TELL YOU. These are English-oriented writing heuristics based on
wording and structure, not validated predictions of retention, views, or other performance.
They do not evaluate audience demand, delivery, visuals, or whether a statement is true.
Treat a low score as a reason to look again, never a high score as a promise.
"""
import argparse, json, os, re, sys
HERE = os.path.dirname(os.path.abspath(__file__))
FORMULAS = json.load(open(os.path.join(HERE, "hooks.json")))["hooks"]
FILLER = {"basically","actually","literally","just","really","very","so","kind","sort","like",
"guys","hey","welcome","today","video","subscribe","channel"}
VAGUE = {"amazing","incredible","insane","crazy","huge","massive","game","changer","secret",
"powerful","ultimate","best","revolutionary","mind","blowing","unbelievable"}
CONCRETE = re.compile(r"\b(\d[\d,.]*\s?(%|k|m|x|s|m|h)?|\$\d|\d+\s?(second|minute|hour|day|week|month|year)s?)\b", re.I)
YOU = re.compile(r"\b(you|your|you're|youre|yourself)\b", re.I)
STAKE = re.compile(r"\b(lose|lost|wasting|waste|quit|fail|broke|cost|risk|before|stop|never|die|dying|dead)\b", re.I)
CURIOSITY = re.compile(r"\b(why|how|what|which|until|before|but|nobody|almost|except|reason|actually)\b", re.I)
def words(t): return re.findall(r"[a-z0-9'%$.]+", t.lower())
def specificity(t):
w = words(t)
if not w: return 0
nums = len(CONCRETE.findall(t))
vague = sum(1 for x in w if x in VAGUE)
filler = sum(1 for x in w if x in FILLER)
s = 34 + nums * 22 - vague * 16 - filler * 5
# proper nouns that are not sentence-initial read as named things
s += min(18, 6 * sum(1 for x in t.split()[1:] if x[:1].isupper()))
return max(0, min(100, s))
def address(t):
n = len(YOU.findall(t))
first = 30 if YOU.search(" ".join(t.split()[:6])) else 0
return max(0, min(100, 26 + n * 20 + first))
def stakes(t):
n = len(STAKE.findall(t))
return max(0, min(100, 22 + n * 26 + (14 if CONCRETE.search(t) else 0)))
def curiosity(t):
n = len(CURIOSITY.findall(t))
q = 18 if t.strip().endswith("?") else 0
# a hook that resolves itself has no gap left
closed = -18 if re.search(r"\b(because|so that|which means)\b", t, re.I) else 0
return max(0, min(100, 24 + n * 17 + q + closed))
def brevity(t):
n = len(words(t))
if n == 0: return 0
# 9-24 words is the band a spoken hook lands in at ~150wpm inside 10 seconds
if 9 <= n <= 24: return 100
if n < 9: return max(30, 100 - (9 - n) * 11)
return max(10, 100 - (n - 24) * 7)
PROPS = [("SPECIFICITY", specificity), ("ADDRESS", address), ("STAKES", stakes),
("CURIOSITY", curiosity), ("BREVITY", brevity)]
def classify(t):
best, hits = None, 0
for f in FORMULAS:
n = sum(1 for p in f["match"] if re.search(p, t, re.I))
if n > hits: best, hits = f, n
return (best["name"] if best else "Unclassified"), hits
def score(t):
parts = {n: fn(t) for n, fn in PROPS}
vals = list(parts.values())
verdict = round(0.6 * (sum(vals) / len(vals)) + 0.4 * min(vals))
name, hits = classify(t)
return parts, verdict, name, hits
def band(v): return "STRONG" if v >= 72 else "WORKABLE" if v >= 55 else "WEAK"
def report(t, parts, verdict, name, hits):
print(f"\n {t.strip()}")
print(f" {'-' * min(72, max(20, len(t.strip())))}")
for k, v in parts.items():
print(f" {k:<12} {v:3d} {'#' * (v // 5)}")
print(f" {'VERDICT':<12} {verdict:3d} {band(verdict)}")
print(f" formula {name}" + (f" ({hits} pattern{'s' if hits != 1 else ''} matched)" if hits else " (no formula matched - that is usually a summary, not a hook)"))
low = min(parts, key=parts.get)
print(f" weakest {low} - {FIX[low]}")
FIX = {
"SPECIFICITY": "swap one adjective for a number, a name or a date",
"ADDRESS": "say 'you' in the first six words",
"STAKES": "name what it costs them to keep doing it the current way",
"CURIOSITY": "cut the half of the sentence that answers itself",
"BREVITY": "9 to 24 words. Read it out loud and stop where you run out of breath",
}
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("file", nargs="?")
parser.add_argument("--hook")
parser.add_argument("--json", action="store_true")
args = parser.parse_args()
as_json = args.json
if (args.file is None) == (args.hook is None):
parser.error("provide a text file or --hook, not both")
try:
lines = [args.hook] if args.hook is not None else open(args.file, encoding="utf-8").read().splitlines()
except OSError as exc:
parser.error(str(exc))
lines = [line for line in lines if line.strip()]
if not lines:
parser.error("provide at least one nonempty hook")
out = []
for t in lines:
parts, verdict, name, hits = score(t)
out.append({"hook": t.strip(), "properties": parts, "verdict": verdict,
"band": band(verdict), "formula": name, "matched": hits})
out.sort(key=lambda r: -r["verdict"])
if as_json:
print(json.dumps([{k: v for k, v in r.items() if k != "matched"} for r in out], indent=1)); return
for r in out:
report(r["hook"], r["properties"], r["verdict"], r["formula"], r["matched"])
if len(out) > 1:
print(f"\n winner: {out[0]['hook'].strip()} ({out[0]['verdict']}, {out[0]['band']})\n")
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |