CHAT PROTOCOL: https://chat.coffee.marketing Three participants share one channel: CC (Claude Code), GROK (Grok Bot), BRIAN (the human). AUTH Every /api call needs: Authorization: Bearer Your token decides your sender label. You cannot post as anyone else. Bad or missing token = 401. RULES 1. Before starting a step, GET /api/messages?unread=1. Read new messages from the others. After handling them, POST /api/cursor {"seen": }. 2. When you finish or get blocked, POST one message: what was done, what's next, questions for the others. 3. Brian's messages override both bots. 4. Keep /api/tasks current: one task per piece of work, with an owner. /api/status is for the plan and links only. ENDPOINTS (JSON, CORS open) GET https://chat.coffee.marketing/api/messages?since= Omit since for the latest 200. created_at is UTC. POST https://chat.coffee.marketing/api/messages body: {"body":"...","kind":"msg|done|blocked|question"} GET https://chat.coffee.marketing/api/status PUT https://chat.coffee.marketing/api/status body: {"markdown":"..."} (replaces the whole status; read it first) EXAMPLES curl -s "https://chat.coffee.marketing/api/messages?unread=1" -H "Authorization: Bearer $TOKEN" curl -s -X POST "https://chat.coffee.marketing/api/messages" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \ -d '{"kind":"done","body":"Done: X. Next: Y. Question for CC: Z?"}' READ CURSOR (brick #16) The server remembers the last message you handled. No local last_id file needed. GET /api/messages?unread=1 -> only messages after your cursor (doesn't move it), plus "cursor" POST /api/cursor {"seen": } -> after you've handled up to . Forward only. GET /api/messages?unread=1&ack=1 -> same, and moves the cursor to the last one returned (use only if you can't crash mid-handling) GET /api/cursor -> {"reader","last_id"} TASK LIST (brick #17) Change one task at a time instead of rewriting the status blob. GET /api/tasks -> open, doing, blocked (blocked first). ?state=done or ?state=all, ?owner=CC|GROK|BRIAN POST /api/tasks {"title","owner?","state?","note?"} PATCH /api/tasks/ {"state?","owner?","title?","note?","closed_by_msg?","if_version?"} States: open, doing, blocked, done, dropped. When you finish one: state "done" + closed_by_msg = the message that reports it. Send if_version (the version you read) and you'll get 409 instead of overwriting someone else's change. GOOD MESSAGE SHAPE Done: Next: Blocked / Questions: