AddThisFeature

AI Next Best Action

Suggest the most useful next step on a record, drawn only from actions the user can take.

involved AI Content

What it adds

A suggestion panel on a record or workflow that proposes a next step, cites the facts behind it, and links to the action.

What your agent is told to do

5
  1. 1

    Build the candidate list first, in ordinary code: enumerate the actions that are valid for this record in its current state and permitted for this user, then let the model choose and rank from that list only. A suggestion the user cannot perform is worse than no suggestion.

  2. 2

    Assemble a compact, explicit fact set for the record — status, dates, owner, recent activity, outstanding obligations — and send only that. Do not send the whole record, unrelated customer data, or free-text notes that may contain personal information the feature does not need.

  3. 3

    Require the model to return the chosen action identifier plus the specific facts that support it, and render those facts beside the suggestion. A suggestion the user cannot audit will be ignored or, worse, trusted blindly.

  4. 4

    Present every suggestion as a proposal the user clicks to perform. Do not execute the suggested action automatically, and mark destructive, irreversible, or externally visible actions so they route through the app's existing confirmation step rather than a one-click accept.

  5. 5

    Recompute when the record's state materially changes, and invalidate the cached suggestion at the same moment. Do not recompute on every page view; that turns a modest per-record cost into an unbounded one.

Edge cases it handles

8
  • The model may name an action that does not exist or that this user lacks permission for. Validate the returned identifier against the candidate list and drop anything that does not match, rather than surfacing a dead control.
  • When the supporting evidence is thin, the correct output is no recommendation. Give the model an explicit way to decline and show a plain empty state instead of manufacturing a weak suggestion to fill the panel.
  • Suggesting an irreversible or high-risk action — deleting, cancelling, charging, notifying a customer — must never be a single click from the suggestion panel. Route it through the same review the app already requires.
  • A record whose state changed after the suggestion was generated must not keep showing the stale advice. Tie the cached suggestion to a version of the record state and discard it when that version moves on.
  • If the model times out, refuses, or returns output that does not parse into a known action, hide the panel entirely. A broken or apologetic suggestion box on every record erodes trust in the whole screen.
  • Per-record generation multiplied across a list view can be ruinously expensive. Generate on the detail view or on explicit request, and cap how many suggestions a workspace can generate in a period.
  • The explanation must describe observed facts, not invent history. Suggestions citing events that are not in the fact set are a defect, not a wording problem.
  • When the model is unavailable, the surrounding record page must render normally with the panel absent, not blocked behind a pending request.

Definition of done

9
  • Every suggestion resolves to an action that exists, is valid for the record's current state, and is permitted for the viewing user.
  • Each suggestion displays the specific facts that support it.
  • No suggested action is performed without an explicit user click, and high-risk actions still pass through the app's confirmation step.
  • Weak evidence produces an explicit no-recommendation state rather than a speculative suggestion.
  • A suggestion is invalidated and regenerated when the record's state changes, and is not regenerated on every view.
  • Model failure, refusal, or unparseable output leaves the record page fully usable with no suggestion shown.
  • Only the assembled fact set is sent to the provider, and generation volume is capped per workspace.
  • 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.