WhatsApp capture → script
One expensive browser run (QR once) → durable session jar → capture a named task’s network → script under /workspace/whatsapp-scripts/<slug>/ → later runs replay with session auth. Re-QR only on auth death.
Auth
Canonical jar (box-local, never export): /home/box/whatsapp-auth/auth.env
Personal overrides: /home/box/whatsapp-auth/personal.env
Pointers: /workspace/whatsapp-scripts/_auth/AUTH_PATH.txt (+ optional PERSONAL_PATH.txt)
Loader: /workspace/whatsapp-scripts/_lib/auth.py
First-time / dead session
- Open
https://web.whatsapp.com/with browserUse (this bot’s Chrome). - Surface QR /
request_box_helpimmediately — do not ask whether the owner can scan. User scans on the desktop. - When the chat list is visible, export session into
auth.env(mode 0600). Prefer helpers under/home/box/whatsapp-auth/. - Run
auth-checkbefore failing tasks. Re-export after re-link. - Never paste Cookie / tokens into chat, persona, skill, or GitHub.
SoT per slug (finish one)
- http_replay (preferred when real): only recorded URLs/methods/bodies. No invented endpoints.
- headless_live / opaque_ws: if traffic is WS/protobuf and no stable HTTP surface exists, document
opaque_wsin the slug README and ship browserUse or headless CDP Live until HTTP capture exists. Do not fake REST.
Build discipline
Serialize one slug or wave item at a time. No parallel all-waves / multi-stuck browser runs. No backlog drain unprompted.
Parked
If capture, confirm, or QR handoff is parked with no reply: remind once after ~24h, then stop.
Mutating
One-line confirm. No mass send / spam tooling.
Public share
Scrubbed persona + this skill + script shapes from grok_bots/whatsapp-bot/. Never auth.env, personal.env, HARs with tokens, or phone numbers from live chats.
Pack: https://github.com/alexhawat/bots-agents-skills/tree/main/grok_bots/whatsapp-bot Template: https://x.ai/bot/t-Axu4DmT9x2DEPa1eNW1