write-tweet
${var} —
[format] [argument]. Pick one of three formats, then pass its argument. Empty ⇒ drafts (standalone tweet drafts).thread …⇒ a multi-tweet thread.remix …⇒ remix of your past tweets.revise:<instruction>⇒ revise the last saved draft (the Telegram force-reply shape, e.g.revise:make it punchier). See Selector below.
Read memory/MEMORY.md for context on recent articles, digests, topics being tracked, and the operator's tracked handles/token. Each branch then reads its own memory/logs/ window (drafts: 3 days, thread: 7 days, remix: 14 days) — see the branch.
Selector
Revise intercept first (Telegram force-reply). If ${var} starts with revise: → jump straight to Branch: REVISE (below) and stop; do not token-parse. This is the shape scripts/telegram-route.sh sends when the operator replies to a "refine this draft?" prompt — the revise: prefix would otherwise fall through to the drafts branch.
Otherwise, parse ${var} once, before doing anything else:
- Trim whitespace. Take the first token (everything up to the first space or the first
:), lowercased. - If that token is one of
drafts,thread,remix→ that's the format. The argument is the remainder of${var}after stripping the keyword and one optional following:and surrounding whitespace. - Otherwise → format is drafts and the argument is the entire
${var}(backward-compatible with the legacyvar = topic/URLbehaviour).