AddThisFeature

Comments and Mentions

Keep discussion on the record instead of in chat and email.

involved Collaboration

What it adds

Threaded comments attached to a record, with @-mentions that notify the person mentioned.

What your agent is told to do

5
  1. 1

    Attach comments to a record polymorphically so the same component works across object types rather than being rebuilt per model.

  2. 2

    Store mentions as structured references to user IDs, not as raw text parsed at render time. Display names change; IDs do not.

  3. 3

    Restrict the mention picker to users who can already see the record, and reject mentions of anyone else on the server.

  4. 4

    Notify each mentioned user once per comment. Track what has been sent so an edit or a delivery retry cannot fire a second notification.

  5. 5

    Do NOT allow raw HTML in comment bodies. Sanitize to a small allowlist and render links with rel=noopener — comments are the most-pasted surface in any app.

Edge cases it handles

6
  • Editing a comment to add a new mention should notify only the newly added person, never everyone again.
  • A deleted user's past mentions must still render as inert text, not as a broken link or a blank.
  • Deleting a comment with replies must not orphan them — either soft-delete with a tombstone or cascade deliberately.
  • Mentioning someone must never grant them access. If they cannot open the record, the notification is a dead link.
  • Comments arriving in realtime must insert in a stable order, and must not scroll the reader away from what they were reading.
  • Show edited and deleted state. A silently rewritten comment is a trust problem in any thread people rely on.

Definition of done

8
  • Comments attach to any supported record type through one implementation.
  • Mentions are stored as user references and survive display-name changes.
  • Only users with access to the record can be mentioned, enforced server-side.
  • Each mention notifies exactly once, including across edits and retries.
  • Comment bodies are sanitized to an allowlist and links carry rel=noopener.
  • Edited and deleted comments are visibly marked and ordering stays stable under realtime updates.
  • 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.