watching-whatsapp
Skill12 starsChanged 2 months agoMITView on GitHub
Monitor WhatsApp Web for new messages using Playwright browser automation. Use when setting up WhatsApp monitoring, processing unread chats, sending messages, or configuring auto-reply behavior. Requires manual QR code scan on first run. NOT when using WhatsApp Business API (different architecture).
In this repository60 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- browser-useSkill
- browsing-with-playwrightSkill
- building-chatgpt-appsSkill
- building-chat-interfacesSkill
- building-chat-widgetsSkill
- building-mcp-serversSkill
- building-nextjs-appsSkill
- building-rag-systemsSkill
- configuring-better-authSkill
- configuring-dapr-pubsubSkill
- containerizing-applicationsSkill
- context7-efficientSkill
- context-degradationSkill
- context-fundamentalsSkill
- context-optimizationSkill
- creating-skillsSkill
- deploying-cloud-k8sSkill
- deploying-kafka-k8sSkill
- deploying-postgres-k8sSkill
- designing-nextjs-uiSkill
- digital-fte-orchestratorSkill
- doc-coauthoringSkill
- docxSkill
- evaluationSkill
- fetching-library-docsSkill
- generating-ceo-briefingSkill
- installing-skill-trackerSkill
- internal-commsSkill
- managing-calendarSkill
- managing-odooSkill
- managing-servicesSkill
- memory-systemsSkill
- multi-agent-patternsSkill
- nextjs-devtoolsSkill
- nx-monorepoSkill
- operating-k8s-localSkill
- operating-production-servicesSkill
- pdfSkill
- posting-facebookSkill
- posting-instagramSkill
- posting-linkedinSkill
- posting-twitterSkill
- pptxSkill
- project-designerSkill
- researching-with-deepwikiSkill
- scaffolding-fastapi-daprSkill
- scaffolding-openai-agentsSkill
- sending-emailsSkill
- skill-creatorSkill
- streaming-llm-responsesSkill
- styling-with-shadcnSkill
- systematic-debuggingSkill
- theme-factorySkill
- tool-designSkill
- watching-filesystemSkill
- watching-gmailSkill
- working-with-documentsSkill
- working-with-spreadsheetsSkill
- xlsxSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
Use when setting up WhatsApp monitoring, processing unread chats, sending messages, or configuring auto-reply behavior.
- Distinctive: line 8
NOT when using WhatsApp Business API (different architecture).
- Distinctive: line 87
Only 120 seconds to scan QR code.
- Distinctive: line 107
Only messages at or above threshold get auto-reply.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
WhatsApp Watcher Skill
Monitors WhatsApp Web and creates task files for important messages.
Quick Start
# Start watcher (visible browser)
python src/watchers/whatsapp_watcher.py
# Or via MCP server (for sending)
python src/mcp_servers/whatsapp_server.pyArchitecture
MCP Server (whatsapp_server.py)
│
▼ Creates queue file
Vault/WhatsApp_Queue/SEND_to_*.md
│
▼ Watcher picks up
Watcher (whatsapp_watcher.py)
│
▼ Browser automation
WhatsApp Web → Message sentWhy queues? MCP doesn't drive browser directly to prevent session locking.
First Run
- Browser opens automatically
- Scan QR code with WhatsApp mobile (120 second timeout)
- Session persists in
config/whatsapp_data/ - On auth failure: Creates alert in
Vault/Needs_Action/
Production Gotchas ⚠️
Contact Name Must Match Exactly
The to parameter must match the contact name in your phone EXACTLY (case-sensitive):
# ✗ FAILS - Different case
send_whatsapp_message(to="john doe", message="Hello")
# ✓ WORKS - Exact match
send_whatsapp_message(to="John Doe", message="Hello")Priority Classification System
Messages are auto-classified by keywords:
| Priority | Keywords | Action |
| Urgent | urgent, asap, emergency, critical | Immediate escalation |
| High | important, invoice, payment, deadline | Same-day review |
| Medium | question, request, update | Standard queue |
| Low | thanks, ok, noted | Archive |
Known Contacts Get Priority Boost
Known contacts (from config/known_senders.json) get automatic priority upgrade:
- Medium → High for known contacts
- Unknown + High = ESCALATION (special handling)
WhatsApp Web Selector Changes
WhatsApp updates their DOM frequently. Multiple fallback selectors are used:
# Primary input selector
input_selector = 'div[contenteditable="true"][data-tab="10"]'
# Fallback
input_selector = 'div[data-testid="conversation-compose-box-input"]'QR Code Timeout
Only 120 seconds to scan QR code. After that:
- Auth fails
- Debug screenshot saved to
Vault/Logs/ - Alert task created in
Vault/Needs_Action/
PII Redaction in Logs
Phone numbers are automatically redacted in audit logs:
+1 234 567 8900 → [REDACTED]Auto-Reply Feature
Enable automatic responses based on priority:
WHATSAPP_AUTO_REPLY=true
WHATSAPP_AUTO_REPLY_THRESHOLD=high # Options: urgent, high, medium, lowOnly messages at or above threshold get auto-reply.
MCP Tools
Via whatsapp_server.py:
send_whatsapp_message(to, message, requires_approval)- Queue message for sending
Configuration
| Variable | Default | Description |
WHATSAPP_POLL_INTERVAL | 30 | Seconds between checks |
WHATSAPP_HEADLESS | false | Run browser hidden |
WHATSAPP_AUTO_REPLY | false | Enable auto-reply |
WHATSAPP_AUTO_REPLY_THRESHOLD | high | Minimum priority for auto-reply |
DRY_RUN | false | Test mode (no actual sends) |
Sending Messages
With Approval (Default)
send_whatsapp_message(
to="John Doe",
message="Your invoice is ready",
requires_approval=True # Creates file in Pending_Approval/
)Move file to Vault/WhatsApp_Queue/ renamed as SEND_to_*.md to send.
Direct Send (Trusted)
send_whatsapp_message(
to="John Doe",
message="Quick update",
requires_approval=False # Goes directly to queue
)Verification
Run: python scripts/verify.py
Related Skills
sending-emails- Email sending patternsdigital-fte-orchestrator- Task processing loop
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

