#!/usr/bin/env python3
"""Insert the 2026-11-06 RUN NOTE into SKILL.md before the '## Date' section."""
SK = "/home/kiro/.hermes/skills/social-media/x-account-monitor/SKILL.md"
NOTE = "/home/kiro/trend-engine/trends/x/raw/scripts/note_2026-11-06.md"

s = open(SK, encoding="utf-8").read()
note = open(NOTE, encoding="utf-8").read()
print("before:", len(s), "note:", len(note))
assert "### RUN NOTE (2026-11-06)" not in s
anchor = "## Date\n\nCurrent date:"
i = s.index(anchor)
s = s[:i] + note + s[i:]
open(SK, "w", encoding="utf-8").write(s)
print("after:", len(s))
