AI agent skills related to using social media
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Require reading DMs before sending to prevent context-free messages

read-dms.sh now records a read timestamp to ~/.claude-social/dms-last-read.json
after fetching messages. send-dm.sh checks this file before sending and refuses
if the conversation wasn't read within the last 10 minutes, with a clear error
message to re-read first.

This mirrors how chat UIs work: you see prior messages before composing a reply.

Claude 1ddeb583 2b9e87b2

+37
+15
bluesky/read-dms.sh
··· 48 48 print(f'{ts} | {who}: {text}') 49 49 print() 50 50 " 51 + 52 + # Record that we read this conversation, so send-dm.sh can verify context was loaded 53 + python3 -c " 54 + import json, os, datetime, sys 55 + convo_id = sys.argv[1] 56 + path = os.path.expanduser('~/.claude-social/dms-last-read.json') 57 + data = {} 58 + if os.path.exists(path): 59 + with open(path) as f: 60 + data = json.load(f) 61 + data[convo_id] = datetime.datetime.now(datetime.timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ') 62 + os.makedirs(os.path.dirname(path), exist_ok=True) 63 + with open(path, 'w') as f: 64 + json.dump(data, f, indent=2) 65 + " "$CONVO_ID"
+22
bluesky/send-dm.sh
··· 23 23 CONVO_ID="$1" 24 24 MESSAGE_TEXT="$2" 25 25 26 + # Refuse to send if DMs haven't been read recently (within 10 minutes). 27 + # This prevents sending without context, analogous to how chat UIs show history before composing. 28 + python3 -c " 29 + import json, os, datetime, sys 30 + convo_id = sys.argv[1] 31 + path = os.path.expanduser('~/.claude-social/dms-last-read.json') 32 + if not os.path.exists(path): 33 + print('ERROR: Read DM history before sending. Run: bash bluesky/read-dms.sh ' + convo_id, file=sys.stderr) 34 + sys.exit(1) 35 + with open(path) as f: 36 + data = json.load(f) 37 + last_read = data.get(convo_id) 38 + if not last_read: 39 + print('ERROR: Read DM history before sending. Run: bash bluesky/read-dms.sh ' + convo_id, file=sys.stderr) 40 + sys.exit(1) 41 + last_dt = datetime.datetime.strptime(last_read, '%Y-%m-%dT%H:%M:%SZ').replace(tzinfo=datetime.timezone.utc) 42 + age = (datetime.datetime.now(datetime.timezone.utc) - last_dt).total_seconds() 43 + if age > 600: 44 + print(f'ERROR: DM history last read {int(age/60)}m ago (max 10m). Re-read first: bash bluesky/read-dms.sh ' + convo_id, file=sys.stderr) 45 + sys.exit(1) 46 + " "$CONVO_ID" 47 + 26 48 # Authenticate 27 49 ACCESS_JWT=$(bash "${SCRIPT_DIR}/../atproto/authenticate.sh") 28 50