AddThisFeature

Direct Messages

Let two users hold a private conversation inside the app instead of leaving to email.

involved Collaboration

What it adds

One-to-one private threads with message history, per-conversation unread counts, and blocking.

What your agent is told to do

5
  1. 1

    Build the conversation list, the thread view, and the unread badge. Keep the first version to one-to-one threads only and defer group conversations, reactions, threading, and file attachments rather than shipping all of them half-finished.

  2. 2

    Reuse the app's existing Read and Unread State and Notification Center rather than inventing a second unread mechanism and a second alert path. A message notification should sit alongside every other notification the user gets.

  3. 3

    Reuse the composer, mention handling, and rendering rules from Comments and Mentions instead of writing a second message editor with subtly different escaping.

  4. 4

    Assign message ordering from the server, with a monotonic sequence per conversation, and use client timestamps only for display. Sorting by client clock produces conversations that read out of order.

  5. 5

    Do not deliver a message to someone who has blocked the sender, and do not tell the sender they have been blocked. Accept the send, show it in their own thread, and stop it at delivery.

Edge cases it handles

8
  • Device clocks disagree by minutes. Order messages by a server-assigned sequence within the conversation so a reply never appears above the message it answers.
  • A user with the app open on a phone and a laptop must see the unread count drop on both when they read a thread on either. Read state belongs to the conversation and the user, not to a device.
  • Blocking must stop delivery in both directions, hide the existing thread from the blocker's list, and survive the blocked user creating a new conversation to get around it.
  • Loading older messages must keep the visible message under the user's eye in place. Anchoring to scroll offset instead of to a message will jump the view every time a page loads.
  • When an account is deleted, decide explicitly whether the other participant keeps the history with an anonymised sender or loses the thread, and apply that consistently rather than leaving orphaned rows.
  • A message sent while offline must be queued and shown as pending, then confirmed or clearly failed, never silently dropped.
  • Private messages are a harassment vector. Provide a report action on a conversation that feeds the existing Content Reporting flow, and rate-limit new conversations started by new accounts.
  • Message bodies must be escaped on output and links treated as untrusted. A pasted script in a private message is still a stored cross-site scripting hole.

Definition of done

9
  • Two users can hold a private thread with history that persists across sessions.
  • Message order is determined by a server-assigned sequence and reads correctly regardless of device clocks.
  • Unread counts are consistent across every device the user has open.
  • Blocking stops delivery in both directions and cannot be circumvented by starting a new conversation.
  • Paginating older messages preserves the reader's scroll position.
  • Account deletion has a defined, consistently applied effect on existing threads.
  • Conversations can be reported through the app's existing reporting flow.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.