Crm

From BuilderIO/agent-native · View interactive version

Crm is an AI agent skill from the GitHub repository BuilderIO/agent-native. How to run typed CRM work — attributes and options, lists and pipelines, saved and board views, provider proposals, duplicates and merge, gated enrichment, and evidence-grounded call signals. Use for any CRM read, write, setup, or provider question.

How to use this skill

Skill file

CRM

AGENTS.md owns the invariants (attribute typing, bitemporal values, list

authority, the provider handoff, credential and evidence boundaries). This skill

is the how: which action, in what order, and the traps in between. Do not

restate a rule here that AGENTS.md already states — fix it there instead.

Model source of truth: shared/crm-contract.ts. Type registry:

shared/crm-attributes.ts. Every field-value write goes through

server/lib/record-fields.ts.

Pick the starting action

their provider owner identity resolved. Read ownerStatus before trusting an

empty book: unmapped, ambiguous, and unreadable are different failures,

and none of them mean "no records".

selection, list, or view. navigate to show a view rather than describing it.

navigate({ view: "settings", settingsSection }) opens one of CRM's settings

tabs (connection, fields, lists, intelligence, advanced), which the

redesigned Settings shows as tabs on CRM › General; mcp opens the MCP

server page.

and Native SQL never needs it.

Setup and modes

backed by Postgres through local PGlite or a hosted database. Then use the normal record, list,

task, view, and evidence actions. Never require a connection for Native SQL.

it with configure-crm-connection. Never pass a token. HubSpot starts with

companies/contacts/deals; Salesforce with Account/Contact/Opportunity.

before authoring attributes on an object type.

field permissions. Never infer a user's access from a service-account mirror

or a previously visible local row; fail closed when access is ambiguous.

Typed attributes and options

the type, cardinality (multi), authority, and managed options.

title. update-crm-attribute can change presentation, required,

historyTracked, config, archived, and fillMode — never the slug or the

type, because every stored value row is keyed and typed by them.

written. Archiving an option removes it from pickers only; records already

holding it keep the value.

with update-crm-attribute and archived: false.

and celebrate.

Reading the grid

cells for those rows with provenance. Filter, sort, and pagination all run in

SQL, so a filtered page is the real result set, not one page narrowed

afterwards. Pass viewId to apply a saved view's stored filter.

returning unfiltered rows. Do not "fix" that by dropping the filter.

definitions, current values with actor and time, every list the record is in

with that entry's values, and the provider deep link.

Lists and pipelines

the list, not the record. create-crm-list seeds a Stage attribute unless you

pass seedStageAttribute: false.

and lets you decide. Two open deals for one company are two entries.

row and opens a new one, so time-in-stage is derivable from the entry's own

history without a separate audit table.

is the attribute's own options, so a move into an undeclared or archived stage

is refused with a sentence naming the values you may pick (unknown-status,

archived-status), and the move is claimed against the value it was decided

from, so a stage somebody else moved in between comes back as

concurrent-transition instead of being clobbered. Leaving any stage —

including a retired one — is always allowed. On a record, update-crm-record

applies the same gate to local targets; a provider target is still a proposal,

not a blocked transition.

not a way to delete a record.

history, recordId for a record attribute.

Views and boards

save-crm-saved-view stores filter, ordered sort, columns, table/board

presentation, and personal/shared audience. A board view needs a

groupByAttributeId pointing at a status attribute. Pass expectedUpdatedAt so

a concurrent edit is rejected instead of silently overwritten. A view stores

presentation, never provider rows. run-crm-saved-view-program runs the data

program linked to one view.

Writes and the provider handoff

revision-aware, access-checked, idempotent, audited proposals.

before/after diff and a deep link, and records the handoff. A proposal with

status approved and no appliedAt was prepared and handed off — present

that as the next step for the user, never as a failure and never as applied.

compensatable local update to one record, supplied by a trusted automation

trigger, never by action input.

Duplicates and merge

find-crm-duplicates is read-only and never merges. It matches on exact email,

company domain, shared email root domain, and normalized name plus location, and

returns a reason and confidence per candidate. A shared company domain is a

signal between accounts only — colleagues are a relationship, not a duplicate.

For a user-requested second opinion on one record, pass its recordIds and

semanticReview: true. The configured AI decision provider reviews at most

five ambiguous, accessible pairs; its same-entity probability is a suggestion

separate from rule confidence. If semanticReviewUnavailable is true, show the

rule-based candidates and report that the AI review did not complete.

Do not run this for an automatic recent-record scan or treat it as merge approval.

merge-crm-records needs an explicit survivor. It promotes only the values the

survivor lacks, moves list entries, tasks, interactions, evidence, signals, and

relationships from both sides, and tombstones the loser with a merged-into

link instead of deleting it. It is idempotent and approval-gated for non-human

callers. Show the candidate reasons and let a human pick the survivor.

Enrichment (money changes hands)

  1. list-crm-enrichment-slots — which capability slots are usable. A slot's

credential.status of unknown means the lookup itself failed and is not

the same as missing.

  1. estimate-crm-enrichment — line-item cost and period-to-date spend. Quote it

to the user. spendToDate.actorUnits is theirs and is what the cap applies

to; workspaceUnits is everyone's and is context only.

  1. run-crm-enrichment with phase: "verify" — free evidence pass, never

touches contact data. A human reviews its per-record evidence.

  1. run-crm-enrichment with phase: "spend" — requires sourceRunId and the

explicit approvedRecordIds from that review. The paid input set is built

from those approvals, so an unapproved record is never visible to the paid

job. Both phases refuse a duplicate in-flight run for the same scope.

A slot outcome is one of unconfigured, skipped, ok, empty, or error —

report the one you got. "We could not find out" is not "there is none".

Agent attribute fill

run-crm-attribute-fill is manual only. Call it with no values to get the

brief (attribute, managed options, each record's current value and context),

reason over that yourself, then call again with values. Never call a model

inline. Writes merge: a human edit or a purchased value is kept and reported as

kept-existing, an equal value is not rewritten. Classifying against a

status/select attribute must produce one of its managed options; an unknown one

rejects the whole call and writes nothing.

Evidence and signals

record's timeline (bounded summary only) and advances

lastMeaningfulInteractionAt when the entry is meaningful and newer. Use it

from automations and external agents instead of writing the table directly.

speaker, and metadata. For Clips use a durable /share/<id> or /r/<id> page

URL with no access token or transcript fragment — never a clip.created event

URL.

record. Keyword hits are deterministic; smart detectors and summaries are

delegated through agent chat, never a direct model call, and persisted with

record-crm-smart-signal or one atomic record-crm-call-insight batch whose

every quote and timestamp cites an exact stored evidence row.

Enabling, disabling, and deleting a tracker are local configuration only:

never a model call, never a provider mutation. Their settings tab is

navigate({ view: "settings", settingsSection: "intelligence" })

(/settings/app/intelligence).

record. Setting up CRM-to-Clips call automations isn't available yet. Say

this and stop setup. Do not delegate setup through call-agent, ask Clips

to define or enable the automation, or direct the user to set it up manually.

Dashboards

install-crm-pipeline-dashboard is idempotent and owns one per-user data

program that calls the bounded get-crm-pipeline-data through appAction. Do

not reimplement that aggregate with a provider request or put CRM rows in

dashboard config. Edit with save-crm-dashboard plus expectedUpdatedAt;

inspect and roll back with list-crm-dashboard-revisions /

restore-crm-dashboard-revision.

Provider API escape hatch

CRM actions are convenience workflows, not a capability ceiling. For an

endpoint, object, filter, pagination mode, or schema no action expresses, use

provider-api-catalog, then provider-api-docs, then the read-only

provider-api-request. Declare a cohort, selected fields, and a page/row budget

first; stage only that result and reduce it with query-staged-dataset or a

data program. Report provider, scope, filters, page/row counts, truncation, and

gaps. Always pass the selected workspace connectionId for Salesforce so its

actor-bound token and instance URL cannot be separated.

Out of scope

No provider migration, no page builder, no raw provider payload or media in CRM

SQL. Native SQL supports the canonical CRM objects plus generic custom records; a

separate object-authoring engine is not part of this template.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.