@dench.com/cli 3.11.22-staging.602 → 3.11.23-staging.604

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
- "revision": "d65e5be13deeccfa1cedaf8c9b2bf460c070e9571eb67a218c59a3818e3aeb53",
3
- "builtinHash": "606877652bcee2a0c2598f29eb3fe8ba75158218c88e3c114724921221f2eeb0",
2
+ "revision": "3fd0f658b52c7c4fe0b227861db8ea0cf6c44504a40bd7045822c3da3baa1136",
3
+ "builtinHash": "efca59f81a67c995533db5557ba79220624824851ab35880ac96b308b607a01b",
4
4
  "files": {
5
5
  "SKILL.md": {
6
6
  "sha256": "c666443b305498eae9fe5f2a5a8906fde03f2c4b1fe37762e4cd249673ee0131",
@@ -67,8 +67,8 @@
67
67
  "content": "---\nname: navigation\ndescription: Build correct in-app deep links and citations to any Dench workspace destination — settings, CRM objects/records/saved views, Marketplace, installed apps, chat threads, automations, integrations, inbox, meetings, to-dos, files, Find Leads (people/company/job search and saved lists), outreach (accounts, campaigns). Explains the progressive-disclosure left rail (home sections vs CRM vs Pinned section) and ⌘K. Every surface is a query-param URL on the org route (`/<workspace-slug>?path=...`). Load this before linking a user to a place in the app, citing a workspace source, or opening a link from an app/action.\n---\n\n# Dench Workspace Navigation & Deep Links\n\nEverything a user can see in the Dench workspace has a **stable, shareable\nURL**. The whole workspace is one org-scoped route and every destination\n(settings, a CRM object, a single record, a saved view, Marketplace, an\ninstalled app, a chat thread, an automation, meetings, to-dos, the inbox, a\nfile) is encoded in **query parameters** on that route. Learn this scheme\nand you can link a user straight to the right place, cite a source that\nopens on click, or drive navigation from an app or a CRM action.\n\n## Use references already returned by the command\n\nCRM create/get/create-many and campaign draft/create/duplicate/get return a bounded\n`references` sidecar: named `crm-entry`, `crm-object`, or `campaign` destinations\nwith canonical `href`, optional absolute `url`, and the same resolved image used\nby the workspace table and kanban. Use `[reference.label](reference.href)` in\nchat; use its absolute `url` in Slack, iMessage, or other external text. Do not\nprint raw record IDs next to names or run a second lookup solely to build a link.\nThese are navigation references; keep numbered evidence citations unchanged.\n\nRaw `crm objects list`, `crm entries list`, `crm search`, `crm query`, and\n`campaign list` keep their existing JSON shapes. Add `--with-references` when\nnamed links are needed: arrays become `{data, references, referenceCoverage}`.\nProjected/cursor CRM envelopes carry the sidecar alongside their original rows.\nNo metadata is inserted into user fields. Coverage is limited to this command's\nresult (at most 100 references and 16 KiB); it is not the count of all matching\nrecords. A list of results does not require displaying every reference as a chip.\n\nCampaign references use the Outreach engine's `sequenceId` and\n`/?path=~outreach%2Fsequences%2F<sequenceId>`. A `campaign` CRM mirror has a\ndifferent entry ID; never substitute that ID into an Outreach URL. Same-workspace\nlinks open in the existing workspace panel; foreign workspace links remain links\nto that workspace. Neither form changes access permissions.\n\n## The URL model\n\n```\nhttps://dench.com/<workspace-slug>?path=<destination>&<extra-params>\n```\n\n- **`<workspace-slug>`** is the org's slug (e.g. `acme`). It's the first path\n segment and scopes the whole workspace. Get it from\n `dench context --json` → `organizationSlug` (that call also returns\n `approvalsUrl` and `upgradeUrl`). It's also the `organizationSlug` field on\n `dench members list --json`.\n- **`?path=`** selects the destination. Most surfaces are just a `path` value;\n a few (chat, browse) use their own top-level param instead.\n- Visiting a bare `/<workspace-slug>` (no query) redirects to the To-Do(s)\n home (`?path=~todos`).\n- The public demo workspace uses the same contract at `/demo?...` (the path\n segment stays `demo`).\n\n### Relative vs. absolute links\n\n- **Inside the app** (chat replies, an app's `ui.navigate`, a document link),\n prefer the **relative** form `/?path=...` / `/?entry=...` / `/?chat=...`. The\n workspace intercepts these and resolves them against the **current** workspace\n slug — so you never have to know or hard-code the slug, and the click stays a\n fast in-app navigation instead of a full page load.\n- **For an absolute, shareable link** (pasted into email, another channel, or\n copied for later), use the full `https://dench.com/<workspace-slug>?path=...`\n form so it resolves anywhere.\n\nBoth forms accept exactly the same params below — only the prefix differs.\n\n## How the workspace is laid out\n\nThe workspace is **chat on one side** and **closeable content tabs** on the\nother (a CRM table, a file, Settings, Marketplace, To-Do(s), Meetings,\nInbox, Find Leads, Outreach, Automations, Cloud, Memory). A deep link opens\nor focuses the matching content tab — it does not permanently add a rail\nrow.\n\n### Left rail (progressive disclosure)\n\nThe rail is **not** a flat list of every CRM object. Home shows a short\nfixed set grouped into labeled sections; everything else is one click\ndeeper, or pinned up as a shortcut.\n\n**Home (always visible)**\n\n- **Automations** — `/?path=~cron`\n- **Records** section:\n - **To-Do(s)** — `/?path=~todos` (also where a bare `/<slug>` lands)\n - **Meetings** — `/?path=~meetings` (recordings, notes, calendar). This\n replaced the old CRM `meeting` table.\n - **CRM** — a drill-in (database icon, trailing chevron). Files, CRM objects,\n pinned saved views, installed apps, and named groups live **here**,\n not on home. The `< CRM` header goes back.\n- **Demand** section:\n - **Find Leads** — a drill-in with one **Find** row (magnifying-glass\n icon) and a **Lists** drill (saved Find lists and CRM lists). Switch\n People / Companies / Job postings using the tabs inside the Find\n page, not separate sidebar rows. Bare `~find` opens People.\n - **Outreach** — a drill-in. Slides the same rail over to Campaigns /\n Inbox / Accounts / Newsletters. Bare `~outreach` opens Campaigns\n (whose URL segment is `~outreach/sequences`). Inbox keeps its own\n path, `/?path=~crm/inbox`.\n- **Pinned** — workspace-shared shortcuts of CRM rows (formerly\n called \"Pinned\"; hidden while empty). This is what users mean by \"add\n a tab on the left for Leads\" or \"pin Deals to my sidebar\". A row that\n is only first in CRM is **not** visible on home.\n- **Recent chats** plus **… More** — the Chats drill-in (full thread\n list). Chats are not a home-level tab of their own.\n\n**Footer (always visible)**\n\n- **Marketplace** — Integrations / Skills / Apps & Plugins / Templates\n- **Connect agent**\n- **Org menu** (workspace name + chevron) — **Settings** lives here. It\n is not a rail row. Switching settings sections updates one closeable\n content tab.\n- Theme toggle\n\n**⌘K / Ctrl+K** (or the search icon at the top of the rail) opens the\ncommand palette: jump to any object, record, chat, automation, file,\nsettings section, or action (New chat, New automation, Invite member).\nWhen a user asks how to find something, mention ⌘K and also send the\ndeep link.\n\n**Settings.** Open from the org menu, ⌘K (\"Settings\"), or\n`/?path=~settings/<section>`. If someone says \"left rail settings are\nmissing\", they are looking for the org menu or ⌘K — do not describe a\nSettings row on the rail, and do not tell them to refresh or email\nsupport.\n\n**\"I can't see X on the left.\"** X is almost always in CRM. Pin it\nto the home Pinned section (`pin_sidebar_item` with\n`pinnedToSidebar: true`, or `dench crm sidebar pin <nav-id>`).\nReordering it to the top of CRM does not put it on home. See\n[`references/CRM.md`](https://dench.com/references/CRM.md) → \"The Sidebar\".\n\n## Destination cheat sheet\n\n`{slug}` = workspace slug · `{id}` = a record id · `{object}` = a CRM object's\ncanonical `name` (see `references/CRM.md`).\n\n```text\nWorkspace home (lands on To-Dos): /{slug}\nCRM object list: /{slug}?path={object}\nCRM saved view: /{slug}?path={object}&view={View Name}\nCRM analytics dashboard (sheet): /{slug}?path={object}&analytics=1[&view={View Name}][&analyticsPeriod=this_month]\nCRM \"assigned to me\" (personal): /{slug}?path={object}&assignee=me[&view={View Name}][&assigneeField={Field}]\nCRM record (opens detail): /{slug}?path={object}&entry={object}:{id}\nPeople profile: /{slug}?path=people&entry=people:{id}\nCompany profile: /{slug}?path=company&entry=company:{id}\nA comment on a record: /{slug}?path={object}&entry={object}:{id}&comment={commentId}\nA workspace member's profile: /{slug}?member={userId}\nChat thread: /{slug}?chat={threadId}\nTo-Do(s): /{slug}?path=~todos\nMeetings home: /{slug}?path=~meetings\nOne meeting: /{slug}?path=~meetings/{id}\nOne calendar event: /{slug}?path=~meetings/event/{eventId}\nFind Leads (People): /{slug}?path=~find\nFind Leads · Companies: /{slug}?path=~find/companies\nFind Leads · Jobs: /{slug}?path=~find/jobs\nA saved Find list: /{slug}?path=~find/{kind}/{artifactId}\nMarketplace (Integrations): /{slug}?path=~marketplace/integrations\nMarketplace · Skills: /{slug}?path=~marketplace/skills\nMarketplace · Apps & Plugins: /{slug}?path=~marketplace/discover\nMarketplace · Templates: /{slug}?path=~marketplace/templates\nInstalled app: /{slug}?path=/apps/{app-slug}.dench.app\nAutomations dashboard: /{slug}?path=~cron\nOne automation: /{slug}?path=~cron/{jobId}\nInbox: /{slug}?path=~crm/inbox\nInbox + a conversation: /{slug}?path=~crm/inbox&lead={personId}&convo={conversationId}\nMemory: /{slug}?path=~memories\nUsage: /{slug}?path=~settings/usage\nOutreach: /{slug}?path=~outreach\nOutreach · Accounts: /{slug}?path=~outreach/accounts\nOutreach · Campaigns: /{slug}?path=~outreach/sequences\nOutreach · Newsletters: /{slug}?path=~outreach/newsletters\nCloud: /{slug}?path=~cloud\nA workspace file/doc: /{slug}?path=reports/q1-summary.md\nSettings (a specific section): /{slug}?path=~settings/billing\n```\n\n## Settings\n\nSettings is **not** a left-rail row. It opens as a window over the\nworkspace from the org menu at the bottom of the rail (workspace name),\nfrom ⌘K, or from a `~settings/<section>` link; the chat and the right panel\nstay as they were underneath. Switching sections updates that same window.\nPath form: `~settings/<section>`.\n\n| Destination | `path` |\n| --- | --- |\n| Profile | `~settings/profile` |\n| Members & access | `~settings/members` |\n| Plan & billing | `~settings/billing` |\n| Usage | `~settings/usage` |\n| Models & tools | `~settings/models` |\n| Notetaker | `~settings/notetaker` |\n| Sync | `~settings/sync` |\n| Notifications | `~settings/notifications` |\n| API keys | `~settings/api_keys` |\n| Enterprise access | `~settings/enterprise` |\n\nExample: `/{slug}?path=~settings/api_keys` opens the API-keys section. Old\nsection aliases (`general`→profile, `access`→members, `keys`→api_keys,\n`features`/`ai_settings`/`agent`→models,\n`recorder`/`meeting_recording`→notetaker, `sso`/`scim`→enterprise,\n`approvals`→profile) still\nresolve.\n\n**Sync** (`~settings/sync`, Agent behavior group, also the gear beside \"New\"\non the Automations tab) is what Dench does on its own with the workspace's\nemail, calendar, Slack and LinkedIn: eight switches, all on by default,\nadmin-only — Accounts from email, Contacts from LinkedIn, Accounts from Slack\nConnect, Contacts from calendar, Research dossier, Tasks from email, Qualify\nleads that book, Summaries and Brief. Turning one off stops new work; nothing\nalready created is removed. CLI: `dench settings sync` /\n`dench settings sync set <key> on|off`.\nFormer settings destinations canonicalize to their workspace tabs:\n`~settings/skills`→`~marketplace/skills`,\n`~settings/integrations`→`~marketplace/integrations`,\n`~settings/memory`→`~memories`, `~settings/tutorials`→`~tutorials`, and\n`~settings/referrals`→`~referrals`. The legacy `~usage` path still opens the\nusage dashboard, but new links should use `~settings/usage`. The retired\nstandalone `~integrations`, `~skills`, and `~app-store` paths still resolve\nto the matching Marketplace section.\n\nA few things are **standalone pages** rather than the modal:\n`/{slug}/approvals`, `/{slug}/usage`, `/{slug}/referrals` (the in-workspace\n\"Refer & earn\" panel is `?path=~referrals`).\n\n## CRM\n\nUse the object's **canonical `name`** (singular lowercase: `people`, `company`,\n`task`, `deal`, `lead`, or any custom object). The UI display label (\"Clients\")\ndoes not go in the URL — resolve it to the canonical name with\n`dench crm objects list --json` first.\n\n| Destination | Format |\n| --- | --- |\n| Object list (table/kanban/…) | `?path={object}` |\n| A saved view | `?path={object}&view={View Name}` |\n| The analytics dashboard, opened | `?path={object}&analytics=1` (add `&view=` for a view's own dashboard, `&analyticsPeriod=` for the period pill) |\n| Only my / a member's / unassigned rows | `?path={object}&assignee=me` · `&assignee={userId}` · `&assignee=unassigned` (add `&assigneeField=` to name the people field) |\n| A specific record | `?path={object}&entry={object}:{entryId}` |\n| Force a layout | `?path={object}&viewType=table\\|kanban\\|calendar\\|timeline\\|gallery\\|list` |\n\n**Analytics.** Every object table has a dashboard strip above it: KPI stats\nin the header row, chart cards on a 6-track grid (each a third, half, two\nthirds or the full row wide — gauge/donut, bar, funnel, leaderboard, trend,\nforecast, world map), and a **full-view sheet** (the strip's ⤢) with the\nwhole set, including charts hidden from the strip under \"Only here\". The\ntoolbar's *Analytics* toggle collapses the strip — team-shared, like saved\nviews. Each card's caption carries a ⋮ menu (Edit chart, Width, Hide from /\nShow on dashboard, Delete); drag the caption to reorder, drag the card's\nright edge to resize; the ⚙ button opens the object's shared analytics\nsetup (field roles). Every one of those has a `dench crm analytics …` verb\n(CRM.md). The header's **period pill** (\"This month\", …) scopes the charts\nAND the rows underneath; it is never saved onto a view. Dashboards are **per\nobject or per view**: every view shows the object's shared dashboard until\nit gets its own (Customers on `company` ships one), and any active view\nfollows its own filters by default. Clicking a chart segment filters the\ntable (chips in the header); the map drills into the country/state where\nthe data is.\n\n- `analytics=1` opens the full sheet on load (consumed once, then dropped\n from the URL).\n- `analyticsPeriod=` is one of `this_week` `this_month` `last_month`\n `this_quarter` `last_quarter` `this_year` and pins the period pill.\n- In-chat **analytics cards** (`present_artifact({ kind: \"analytics\" })`,\n or a `dench crm analytics compute …` bash run) show the same live charts\n in the transcript; their **Open** goes to exactly this link. In-chat\n **app cards** (`kind: \"app\"`) embed a small App SDK widget; *Keep as app*\n turns it into `/apps/{slug}.dench.app`.\n\n**Assigned to me.** Between Filter and Sort every object view has an avatar\npill — the viewer's own picture — that switches on the **personal** scope:\nonly rows whose people field includes them. Its dropdown offers any\nmember, **Unassigned** and **Everyone**, and (only when the object has two\nor more `user` fields) which field counts. It is remembered per member +\nobject in the browser and is *never* saved onto the view, so it cannot\nchange what teammates see; rows, hero count, kanban columns, column sums\nand the analytics strip all follow it. Objects with no `user` field have\nno pill.\n\n- `assignee=me` / `assignee={userId}` / `assignee=unassigned` switches it on\n for that visit and remembers it (consumed once, then dropped from the\n URL). `assigneeField=` names the people field. Same vocabulary as\n `dench crm … --assigned-to`; `dench crm analytics compute --mine` prints\n such a link.\n\nRecord-detail deep params (all optional, appended after `entry=`):\n\n- `entryTab=` — which tab of the record is active:\n `notes` (default, omit it) · `inbox` (the unified email + LinkedIn +\n calendar-activity tab; legacy `emails` and `activity` values land here) ·\n `meetings` · `outreach` · `team`. There is no History tab any more: field\n changes live in the Overview's **Activity** feed under Notes, together\n with comments, so legacy `entryTab=history` (and `details`) land on the\n Overview.\n- `comment={commentId}` — scroll the record's Activity feed to that comment\n and highlight it. Comment ids come from `dench crm comments list`.\n- `entryFocus={object}:{id}` — drill into a related record inside the panel.\n- `returnObject={object}&returnView={View Name}` — the \"back\" target when the\n record was opened from another object's view.\n\nWhat a record's Overview shows that Dench wrote on its own (link to the\nrecord; there is no separate page for any of these):\n\n- **Notes** (the pinned document at the top): on a company Dench created\n from email / Slack Connect / LinkedIn / a calendar invitee, the generated\n **account dossier** section sits inside it between `<!-- dench:dossier -->`\n markers, with \"Dossier · updated <date>\" and a **Regenerate dossier**\n action in the card header (company records only). CLI:\n `dench crm entries dossier <id> [--regenerate]`.\n- **Activity**: `slack_message` rows from a bound Slack Connect channel,\n `linkedin_in`/`linkedin_out` rows once a LinkedIn counterparty is filed,\n the \"Meeting booked: <title>\" Status change on a lead that auto-qualified,\n and the tasks Dench created from live email (`system:email-tasks`, their\n Notes carry `[thread: …]`).\n- **Why is this account here?** has no UI surface: `dench crm detections\n list --json` (verdict, counterparty type, evidence) and `dench crm\n detections undo` are the way to answer and to roll back.\n\n**Record header quick actions** (Compose email · Add to outreach · Visit\nsite · Gmail · Copy link) end with a **Shared ▾ / Hidden ▾** menu for any\nmember who owns a running connection (inbox, LinkedIn or calendar). Its one\nitem — *Hide my emails with this record from the workspace* ↔ *Show my emails\nwith this record to the workspace* — is the per-record privacy opt-out:\nsharing is the default for everything a member connects, and this keeps\nthat member's own threads about the record (an account: about every contact\nand opportunity linked to it) to themself. On a contact whose account the\nmember hid the item is disabled and reads *Hidden with <Account>*. CLI:\n`dench crm privacy status|hide|show <object> <entryId>`. The whole\nconnection: Outreach → the inbox row's **Workspace / Private** menu.\n\nExamples:\n\n```text\n/{slug}?path=deal # all deals\n/{slug}?path=deal&view=Open pipeline # a saved view\n/{slug}?path=deal&analytics=1&analyticsPeriod=this_quarter # the deal dashboard sheet, this quarter\n/{slug}?path=company&view=Customers&analytics=1 # the Customers view's own dashboard\n/{slug}?path=task&assignee=me # my tasks (personal scope on)\n/{slug}?path=deal&view=Open pipeline&assignee=unassigned # unowned deals in that view\n/{slug}?path=deal&entry=deal:j57xyz # one deal, detail open\n/{slug}?path=people&entry=people:k91abc&entryTab=inbox\n/{slug}?path=company&entry=company:j57xyz&comment=m3kabc # jump to one comment\n```\n\n### Members (people who work here, not CRM people)\n\nA workspace **member** is a teammate with a login, not a `people` record.\nTheir profile — photo, tagline, role, local time, live presence, open\ntasks, and everything they commented on or edited across the CRM — opens as\na panel over whatever is on screen:\n\n```text\n/{slug}?member={userId}\n```\n\n`member=` is an overlay, not a destination: it composes with any other\nparams (`/{slug}?path=deal&member={userId}` shows the deal list with the\nprofile open). Inside notes and comments the same link is a mention:\n`[@Ada](/?member={userId})` notifies Ada and renders as a pill that opens\nher profile. Get ids from `dench members list --json`; read the same data\nwithout the UI via `dench members get <userId|email>`. Never link a\nteammate to a `people` record — that is for external contacts.\n\nInbox sits in the Outreach drill-in and Meetings is a home-rail destination (neither is a CRM drill-in row):\n\n- Inbox: `?path=~crm/inbox` — a lead-centred unified inbox. Extra params:\n `&q={search}`, `&lead={personId}` (select a lead), and\n `&convo={conversationId}` (open a conversation — e.g.\n `email:thread:{id}` or `linkedin`). Legacy `&thread=` / `&gmail=`\n links still resolve into `convo`.\n Only contacts matched to readable CRM records by a detected email **or**\n LinkedIn profile appear, including identities in custom fields and objects.\n Webhook messages alone do not add a sender to Inbox. Each email thread shows\n its latest message preview; call activity opens its meeting record.\n The list loads more automatically as you scroll. Sender photos come from\n synced CRM/connected-account contacts or workspace member profiles. Contacts access is\n not required for Inbox; when no permitted photo is available, use initials.\n Email HTML preserves sender layout, adapts colors to light/dark mode, and\n folds quoted replies behind **Show quoted text**. Remote images stay opt-in.\n- Meetings: `?path=~meetings` (home), `?path=~meetings/{id}` (one\n recording), and `?path=~meetings/event/{eventId}` (a calendar event).\n Legacy `?path=~crm/calendar` still resolves where it is wired.\n\n> **A link is a one-time trip. A home Pinned row is permanent.** If\n> the user wants somewhere to be *easy to get back to* on the left rail —\n> \"add a tab for Leads\", \"pin this to my sidebar\" — pin it to the home\n> Pinned section (`pin_sidebar_item` with `pinnedToSidebar: true`),\n> covered in\n> [`references/CRM.md`](https://dench.com/references/CRM.md) under\n> \"The Sidebar\". Reordering the row inside CRM does not put it on\n> home. Never tell the user to click the `⋯` menu themselves.\n\n## Apps\n\n- **Marketplace · Apps & Plugins** (apps): `?path=~marketplace/discover`.\n Legacy `?path=~app-store` still lands here. Bare `?path=~marketplace`\n opens Integrations.\n- **A specific installed app**: `?path=/apps/{app-slug}.dench.app` — the value\n is the app folder path and must include the leading `/apps/` and the\n `.dench.app` suffix (e.g. `/apps/agents-feed.dench.app`). An app has one entry\n (`index.html`); there is no separate URL param for a screen *inside* an app —\n route inside the app itself, or use the bridge (below).\n\nAn app can drive workspace navigation through the `window.dench` bridge (needs\nthe `ui` permission):\n\n```js\nawait dench.ui.navigate(\"people\"); // open a CRM object\nawait dench.ui.navigate(\"~marketplace/discover\"); // open Marketplace · Apps & Plugins\nawait dench.ui.navigate(\"/apps/other.dench.app\"); // open another app\nawait dench.ui.openEntry(\"deal\", \"j57xyz\"); // open a record's detail\n```\n\n`dench.ui.navigate(path)` takes any `path` value from this doc. See\n`references/APPS.md` for the full bridge.\n\n## Chat\n\n- **A thread**: `?chat={threadId}`. Nested agent threads (spawned by\n `spawn_agent`) are ordinary threads — they open with the same `?chat=` param;\n their parent linkage lives in the workspace data, not the URL.\n- **Pre-fill and send a message**: `?send={text}` (consumed immediately once).\n- `path` and `chat` combine — `/{slug}?path=people&chat={threadId}` shows the\n People object with a chat open alongside.\n\n## Automations (`~cron`)\n\n| Destination | Format |\n| --- | --- |\n| Dashboard (Automations tab) | `?path=~cron` |\n| Runs tab | `?path=~cron&cronView=runs` |\n| New automation | `?path=~cron/new` |\n| One automation | `?path=~cron/{jobId}` |\n| …filtered runs | `…&cronRunFilter=all\\|ok\\|error\\|running&cronRun={epochMs}` |\n| Edit automation | `?path=~cron/{jobId}/edit` |\n\nThe dashboard has exactly two views: `overview` (the default) and\n`runs`. Legacy `cronView=timeline` lands on Runs; the retired\n`calendar`/`insights`/`rules` values (and the old `cronCalMode` /\n`cronDate` params) are still accepted but land on the overview.\n\nSee `references/AUTOMATIONS.md` for the automations model itself.\n\n## Outreach\n\nOutreach is a rail drill-in (in the Demand section, like Find Leads).\nIts rows, in order, are Campaigns, Inbox, Accounts and Newsletters.\nCampaigns, Accounts and Newsletters each open a section of the same\ncloseable Outreach tab. Path form: `~outreach/<section>`. Bare\n`~outreach` opens Campaigns. Inbox opens its own Inbox tab.\n\n| Destination | `path` |\n| --- | --- |\n| Campaigns (sequenced follow-ups — URL segment stays `sequences`) | `~outreach/sequences` |\n| Inbox (email + LinkedIn replies; its own tab, not an Outreach section) | `~crm/inbox` |\n| Accounts (email + LinkedIn senders) | `~outreach/accounts` |\n| Newsletters (one-shot, deprecated) | `~outreach/newsletters` |\n\nExample: `/{slug}?path=~outreach/accounts` opens the connected-accounts\npanel. The Campaigns section kept its historical `sequences` URL segment\nwhen it was renamed, so bookmarks survive — do not link\n`~outreach/campaigns`. Inbox is not an Outreach section either: link\n`~crm/inbox`, never `~outreach/inbox` (an unknown segment opens\nCampaigns). Legacy `~outreach/mailboxes` and\n`~outreach/linkedin` still land on Accounts. Legacy\n`?path=~outreach&outreachView=senders` still lands on Accounts;\n`outreachView=sequences` lands on Campaigns; `outreachView=campaigns`\nlands on Newsletters (the original one-shot path).\n\n## Find Leads (`~find`)\n\nFind Leads is a home-rail drill-in (Demand section):\nsearch People / Companies / Jobs backed by the enrichment gateway, save\nresults as lists, and explicitly import chosen prospects into the CRM.\nUsing these search tools or presenting their result cards does not establish\nprospecting intent. Ordinary web, company, or hiring research does not require\n`lead-finding` or ICP questions, reads, or scoring.\n\n| Destination | `path` |\n| --- | --- |\n| People search (default) | `~find` |\n| Companies search | `~find/companies` |\n| Jobs search | `~find/jobs` |\n| A saved list / search artifact | `~find/{kind}/{artifactId}` |\n\n`{kind}` is `people`, `companies`, or `jobs`; `{artifactId}` is the saved\nsearch artifact's id. The rail drill shows a single **Find** row with a\nmagnifying-glass icon, plus a **Lists** drill — saved Find lists and CRM\nlists. The Find page's People / Companies / Job postings tabs choose the\nsearch type; the Find row stays selected for all three. Picking a saved\nlist opens it in the main panel while the rail stays put. The retired\n`~find/lists` path still resolves (lands on People).\n\nSaved lists are workspace resources, independent of the chat that created\nthem. In a new chat, discover them with\n`dench lists --search \"<name or topic>\" --limit 25 --json`; use\n`continueCursor` with `--cursor` until `isDone` or the requested scope is\ncovered. Do not assume the newest page is the whole workspace. If multiple\nlists match, ask which one before importing people.\n\nPeople lists show **Work email**, **Phone**, and **Personal email** columns.\nPlay in a cell starts only that person's field lookup, with credit usage disclosed\non the control; no popup or per-profile ICP approval step is required. Results,\nan **Enriching** shimmer, **Not found**, retry, and check-status controls appear in the cell.\nA column's header play targets the selected profiles, or the whole saved list\nacross pages and filters when nothing is selected. On unsaved results it\ntargets only loaded profiles. Bulk runs use a compact inline credit confirmation.\nCompleted field lookups, including misses, are reused. Other optional columns\nstay behind the column-visibility control until needed.\nFor new prospect discovery, lead-finding reads `/workspace/ORGANISATION.md`\nand does not create `ICP.md`. The current request overrides that brief.\nThe result is one saved list, explicitly presented\nin chat; intermediate search batches stay in the activity details. To combine\nchosen person rows without searching again, use `dench lists save --title\n\"Shortlist\" --people-file /tmp/shortlist.json --json`, then present the returned\nartifact ID. Renaming a search never changes which rows are in it.\nFind currently hides the **ICP fit** and **Why this lead** columns. Saved\nassessments still describe AI relevance out of 100 (not conversion probability)\nwhen someone asked for a score. Finding a list does not score every profile.\nScore only on request, using `dench lists assess <id> --assessments-file <file> --json`\n(1–100 `{row, suggestion: {fit, score, reason}}` records per file). These are\nreturned in `review.suggestion` by `lists rows` and included in CSV exports.\nUnassessed profiles have no invented score or visible **Not scored** column. The title\nsits beneath the person's name; the separate Title column is optional.\nSingle lookups show progress only in their cell. Click Find on different people\nto run them concurrently; repeated clicks on the same person are guarded.\nBulk runs show a temporary floating loading bar, not a toolbar or table banner.\nIt counts the requested field only and disappears on completion, with an outcome\nsummary. Not-found and failed lookups count as processed; pending/uncertain jobs\ndo not. Dismissing the popup leaves jobs running. Reopening a list shows its saved\ncell results without resurrecting historical progress UI.\nFilter to **All**, **Enriching**, **Enriched**, **No contacts found**,\n**Failed**, or **Not enriched**. Enriched means actual contact data was\nreturned, not merely that the lookup completed. Results stay in this list\nuntil a separate **Add to Leads** action. **Not enriched** means no obtained\ncontact data, including profiles whose enrichment has never started;\n**No contacts found** means a completed lookup returned no contacts.\n\nRead the current list with\n`dench lists rows <artifactId> --enrichment enriched --limit 100 --json`\n(also accepts `all`, `in_progress`, `no_contacts`, `failed`, or `not_enriched`),\nfollowing its `continueCursor`/`isDone`. A saved search preview or old CSV can\nbe stale. The open list's chat context identifies its selection/filter; fetch\nfresh rows before acting on \"these people\" and never widen that scope to the\nwhole list. For explicit CRM imports and requested lead statuses, load\n`lead-finding`; import uses the original saved-row indices returned as `index`,\nreuses existing identities, and preserves the list. Import sets the requested\nconfigured Lead status only; it does not send outreach, invent replies, or\nrun conversion automation.\n\n## Other navigable surfaces\n\n| Destination | `path` |\n| --- | --- |\n| Marketplace · Integrations | `~marketplace/integrations` |\n| Marketplace · Skills | `~marketplace/skills` |\n| Marketplace · Apps & Plugins | `~marketplace/discover` |\n| Marketplace · Templates | `~marketplace/templates` |\n| To-Do(s) | `~todos` |\n| Meetings | `~meetings` |\n| One meeting | `~meetings/{id}` |\n| One calendar event | `~meetings/event/{eventId}` |\n| Find Leads (People) | `~find` |\n| Find Leads · Companies | `~find/companies` |\n| Find Leads · Jobs | `~find/jobs` |\n| A saved Find list | `~find/{kind}/{artifactId}` |\n| Memory | `~memories` |\n| Usage | `~settings/usage` |\n| Tutorials | `~tutorials` |\n| Outreach | `~outreach` (opens Campaigns) |\n| Outreach · Accounts | `~outreach/accounts` |\n| Outreach · Campaigns | `~outreach/sequences` |\n| Outreach · Newsletters | `~outreach/newsletters` |\n| Cloud | `~cloud` |\n| Refer & earn (in-workspace) | `~referrals` |\n| Browser / Desktop | `~desktop` |\n\n**Marketplace · Integrations** (`~marketplace/integrations`) is where the\nin-house connections live: the Slack card (\"Add to Slack\" — one org-admin\nOAuth install powers both the Slack messaging channel and the agent\n`SLACK_*` tools), MCP servers, and the Dench-brokered Gmail / Outlook /\nCalendar / LinkedIn connections. The Slack install/reconnect URL itself is\n`/api/slack/install?slug={workspace-slug}` (admin-gated; not a `?path=`\ndeep link). Under the connected Slack card sits the **Slack Connect\nchannels** list: every externally shared channel with its state — bound to\nan account (\"Reading #acme-shared · N messages so far\" while the 90-day\nbackfill runs), *needs invite* (\"Invite @Dench to #acme-shared\", or the\nother org's admins have not allowed apps), *unresolved* (\"Which account is\n#acme-shared?\" — an admin picks the company), or inactive — plus\n\"Re-read channel\", \"Change account\", and \"Reconnect Slack\" when the install\npredates the `channels:join` scope. The LinkedIn and Slack connect dialogs\nstate what Dench will do with the connection and link to Settings → Sync.\n\nFiles & documents use their **workspace-relative path** as `path`:\n\n```text\n/{slug}?path=reports/q1-summary.md # a markdown doc\n/{slug}?path=data/pipeline.duckdb # a database file\n/{slug}?path=IDENTITY.md # a magic/agent file\n/{slug}?path=image-generations/logo.png # a generated image\n/{slug}?path=a.md&preview=b.md # open a.md with b.md in a preview pane\n/{slug}?path=deal&analytics=1 # the deal table with its dashboard sheet open\n/{slug}?browse=/absolute/path&hidden=1 # file-browser mode for a raw dir\n/{slug}?path=deal&terminal=1 # also open the terminal drawer\n```\n\n## Full query-param reference\n\n| Param | Meaning |\n| --- | --- |\n| `path` | Primary destination: an object name, a `~virtual` surface, an `/apps/*.dench.app`, or a workspace file path. |\n| `entry` | `{object}:{entryId}` — open a CRM record's detail. |\n| `entryTab` | Active tab in the record detail (`notes` default, `inbox`, `meetings`, `outreach`, `team`; legacy `emails`/`activity` land on `inbox`, legacy `history`/`details` land on the Overview). |\n| `comment` | A comment id — scrolls the record's Activity feed to it. Pairs with `entry`. |\n| `member` | A workspace member's user id — opens their profile panel over the current view. |\n| `entryFocus` | `{object}:{entryId}` — drilled-in related record inside the detail. |\n| `returnObject` / `returnView` | \"Back\" target when a record was opened from another object/view. |\n| `view` | A CRM saved view name for the object in `path`. |\n| `analytics` | `1` opens the object's analytics dashboard sheet on load (consumed once). |\n| `analyticsPeriod` | Period pill preset for the dashboard: `this_week`, `this_month`, `last_month`, `this_quarter`, `last_quarter`, `this_year`. |\n| `assignee` / `assigneeField` | Personal \"assigned to …\" scope: `me`, `unassigned`, or a member userId; `assigneeField` names the `user` field. Applied once, remembered, dropped from the URL. |\n| `viewType` | Layout: `table`, `kanban`, `calendar`, `timeline`, `gallery`, `list`. |\n| `filters` / `sort` | Base64-encoded JSON for one-shot deep links (normally persisted locally). |\n| `search` / `page` / `pageSize` / `cols` | Table search, pagination, visible columns. |\n| `chat` | A chat thread id (top-level or nested). |\n| `fileChat` | File-scoped chat session id (active while a file is open in the main panel). |\n| `send` | Text to pre-fill + send once into chat. |\n| `cronView` / `cronRunFilter` / `cronRun` | Automations dashboard view (`overview`/`runs`) + run filter/selection. Legacy `cronCalMode`/`cronDate` are accepted but inert. |\n| `q` / `lead` / `convo` | Inbox search + selected lead + open conversation. Legacy `thread`/`gmail` map into `convo`. |\n| `browse` / `hidden` | Raw file-browser dir + show-hidden toggle. |\n| `preview` | A second file to show in a preview pane. |\n| `terminal` | `1` opens the terminal drawer. |\n\n## Encoding rules\n\n- URL-encode a `path` value that contains `/` or spaces\n (`encodeURIComponent`), but leave a leading `~` literal (`~settings/billing`,\n not `%7Esettings/billing`).\n- `entry` / `entryFocus` keep the `:` literal: `deal:j57xyz`.\n- `member` and `comment` take the bare record id.\n- `view` names URL-encode spaces (`Open+pipeline` or `Open%20pipeline`).\n\n## Linking vs. citing\n\n- **A normal link** to a destination: a plain markdown link,\n `[Open the deal](/?path=deal&entry=deal:j57xyz)`.\n- **A citation** (a source that backs a claim): a markdown link whose visible\n text is a small number, rendered as a compact pill:\n `Closed last week [1](/?path=deal&entry=deal:j57xyz).` When citing a **file**\n or a **chat**, append a `#:~:text=<short unique snippet>` fragment so the\n click scrolls to and highlights the exact line, e.g.\n `[1](/?path=USER.md#:~:text=Co-founder%20%26%20CEO)`.\n\n## Related\n\n- CRM objects, records & saved views: [`references/CRM.md`](https://dench.com/references/CRM.md)\n- Curating the sidebar itself (home Pinned strip / CRM reorder /\n archive):\n [`references/CRM.md`](https://dench.com/references/CRM.md) → \"The Sidebar\"\n- Meetings (`~meetings`): [`references/MEETINGS.md`](https://dench.com/references/MEETINGS.md)\n- Dench Apps & the `window.dench` bridge: [`references/APPS.md`](https://dench.com/references/APPS.md)\n- Automations (`~cron`): [`references/AUTOMATIONS.md`](https://dench.com/references/AUTOMATIONS.md)\n- CRM action buttons: [`references/ACTIONS.md`](https://dench.com/references/ACTIONS.md)\n"
68
68
  },
69
69
  "references/SALES.md": {
70
- "sha256": "88f09d66f7535e476bfef4f888a1cde642f7553950470eb2ed40ec9b57e9aa8a",
71
- "content": "---\nname: sales\ndescription: CRM sales pipeline playbook for explicitly adding leads, outreach prep, sales qualification, opportunities, forecasting, and existing account/contact research. Covers Leads -> Opportunities -> Customers, raw lead fields, naming, conversion, and selected-record Notes. For sales prospect discovery, outreach target-account lists, and saved prospect-list actions, load lead-finding first; search results stay outside the CRM until explicitly imported.\n---\n\n# Dench Sales Playbook (Sales Template, end to end)\n\nThis is the operating manual for running a real sales motion inside Dench.\nIt sits on top of the generic CRM playbook (`references/CRM.md`) — read that\nfirst for field types, batch writes, the protected `Notes` field, relation\nmodeling, and query syntax. This file covers the **sales discipline**: how\nleads, opportunities, accounts, and contacts fit together, and how you (the\nagent) should behave when working on the CRM sales pipeline.\n\n**Golden rule:** prospect discovery belongs in a saved prospect list. Load\n`lead-finding` for prospect discovery, optional confirmed enrichment, and explicit\nimport. It reads `/workspace/ORGANISATION.md` for who the workspace sells to\nand does not create `ICP.md`. The current request overrides that brief.\nIt saves one list at the requested count and stops.\nNo per-profile ICP approval is required. Once the user imports chosen prospects,\nmanage those Leads through the pipeline below; do not create premature\nAccount/Contact records.\n\n## When this playbook applies\n\nLoad and follow this playbook whenever the user's request involves any of:\n\n- \"new lead\", \"add this lead\", \"log this prospect\", \"enrich this lead\"\n- \"pipeline\", \"deals\", \"opportunities\", \"forecast\", \"what's in the pipeline\"\n- \"qualify\", \"move to qualified\", \"this lead is real\", \"book the deal\"\n- \"outreach\", \"cold email\", \"follow up\", \"sequence prep\", \"draft an intro\"\n- \"account research\", \"company research\", \"who's the POC\", \"find the\n decision maker\", \"research this founder\"\n- \"customers\", \"renewals\", \"churn\", \"expansion\", \"won/lost\"\n\nFor \"find leads\", TAL, ICP review, or \"who should we sell to\", use\n`lead-finding` instead. Discovery does not require installing a sales pipeline.\nOrdinary web, company, or hiring research without prospecting intent does not\nrequire `lead-finding` or ICP questions, reads, or scoring.\n\nIf the workspace does NOT yet have a sales pipeline and the user asks for\none (a \"sales CRM\", \"deal pipeline\", \"lead tracker\", \"CRM for sales\"),\n**recommend and install the Sales Template first** (see below) instead of\nhand-building objects.\n\n## The Sales Template\n\nOne install lays down the entire Salesforce-style motion:\n\n```bash\ndench crm templates list --json # see catalog + installed flags\ndench crm templates install sales # idempotent; safe to re-run\ndench crm templates remove-sample-data sales # drop the demo rows when ready\n```\n\nWhat it creates:\n\n- **`lead`** — the inbox for unqualified demand: explicitly imported\n prospects and inbound hand-raisers. Worked by outbound/SDR motion.\n- **`opportunity`** — active revenue pursuits. One per deal; a company can\n have many over time (new business, renewal, expansion).\n- **`case`** — customer issues/requests, linked to Account + Contact.\n- **`company`** relabeled **Accounts** — the durable company spine. ONE\n record per real company. Gains `Type`, `Source`, `Customer Lifecycle`,\n `Account Owner`, `Renewal Date`, plus a pinned **Customers** view.\n- **`people`** relabeled **Contacts** — the durable person spine.\n- **Saved views** pinned on a first-template install: **Leads** (kanban\n by `Status`), **Opportunities** (kanban by `Stage`, summing `Amount`),\n and the accounts **Customers** kanban. Cases stay off the rail. A later\n template install adds its views unpinned.\n- **Deterministic automations** (fire inside writes — see Automations below).\n- A **workspace rule** describing the motion, and a few cross-linked\n **sample rows** (tagged `Sample`).\n\nInstalls are idempotent and compose — re-running tops up anything missing\nwithout duplicating. Canonical object names stay `company`/`people` even\nthough the UI shows Accounts/Contacts; use the canonical names in commands.\n\n## The mental model (Salesforce-style)\n\n```\nlead ──qualify──▶ opportunity ──Closed Won──▶ Account.Type = Customer\n │ │\n │ (on qualify) ├─ Account (company spine, 1 per company)\n └─ raw POC + company └─ Primary Contact (people spine)\n```\n\n- **Leads are raw, disposable, pre-relationship.** A lead is \"someone we\n might sell to\" plus the research behind that hunch. Leads are NOT durable\n records — they get qualified (promoted) or disqualified (dropped).\n- **Opportunities are money.** An opportunity only exists once a lead is\n qualified. It tracks one pursuit through stages to Won/Lost.\n- **Accounts and Contacts are the durable spine.** They outlive any single\n deal. Relationship history, notes, and ownership live here.\n- **Customers are not a table.** A company becomes a customer when it has a\n Closed Won opportunity — the automation flips `company.Type = Customer`\n and starts `Customer Lifecycle`. Manage customers via the Accounts\n \"Customers\" view, not a separate object.\n\n## The raw-lead-until-qualified rule (important)\n\n**Before a lead is qualified, do NOT create related Account/Contact rows.**\nA prospect explicitly imported from a saved list is a single `lead` row holding *raw* fields —\nnot links to `company`/`people`. This keeps the spine clean (no half-baked\ncompanies/contacts created for prospects that never convert).\n\nSo when you add or import leads:\n\n- Put the company identity in **raw text/url fields on the lead**:\n `Company Name`, `Company Website`, `Company LinkedIn URL`.\n- Put the point-of-contact in **raw fields on the lead**: `POC` (person\n name), `POC LinkedIn URL`, `Email`, `Job Title`.\n- Leave the `Account` **relation** field EMPTY. It gets filled by the\n qualify-to-convert automation, not by you up front.\n- Leave `Contact` EMPTY too unless the person already exists as a `people`\n row. Do not create a `company` row or a `people` row \"to be safe\". Don't.\n\nTwo cases where a pre-qualification lead legitimately carries a link:\n\n- The company or contact **already exists** in the spine (e.g. an existing\n customer raises a new need) — link it; conversion reuses the record.\n- **An outreach enrollment did it.** Enrolling a `people` row in a campaign\n (`dench campaign add <campaign> --object people --entries <ids>` or\n `--view \"<view>\"`, or the Add people dialog; see `references/CAMPAIGNS.md`)\n finds or creates the lead for that person and sets its `Contact` to the\n existing row, so all campaign activity lands on one lead. That is\n expected — leave the link alone. `Account` is never pre-linked this way.\n\n## Lead naming convention\n\nA lead's `Name` is the headline you see in the list/kanban. Use:\n\n- **`<Person Name> from <Company>`** when you know the POC.\n e.g. `Jane Okafor from Acme`, `Marcus Bell from Vercel`.\n- **Just the company name** when the POC is not yet identified.\n e.g. `Acme` — and make \"find the POC\" the next action. Do **not** write\n placeholders like \"Unknown POC from Acme\"; the bare company name is the\n correct title until a real person is found.\n\n## Deep-research Notes (selected rows, not list-builds)\n\nA Notes dossier is for **researching a specific record**, not for every row\nof a 5K find. List-building (`search_people` / `search_companies` /\n`search_jobs`) writes identities into a saved list artifact. That is complete\nwork for a find. Only an explicit import of requested profiles creates Leads;\nthose rows may have empty Notes.\n\nWhen the user asks to research a selected lead/contact/account/opportunity,\nthe dossier is the product. A one-line dossier on a researched row is\nincomplete — treat it like a failed tool call and fill it before you report\ndone.\n\n**Where it goes.** Before researching, read what the workspace already knows:\n`dench crm activity <object> <id> --json` (emails, meetings, Slack, LinkedIn,\ncomments, earlier notes — see `references/CRM.md`, \"The Activity Ledger\").\nThen:\n\n- A record **you are creating** → write the dossier into its `Notes`\n document (the rules below).\n- A record that **already exists** → add a NEW timeline note:\n `dench crm notes create <object> <id> --title \"Research — <date>\"\n --body-file …`. Never overwrite the human's `Notes` document with it.\n- An **account Dench created on its own** (detected from email, a Slack\n Connect channel, a LinkedIn conversation, a calendar invitee) already\n carries a generated dossier section in `Notes`, between\n `<!-- dench:dossier -->` markers (`dench crm entries dossier <id> --json`\n says when it was written). Read it first, add your findings BELOW it as a\n timeline note, never edit or duplicate it; `--regenerate` asks Dench to\n research again. See `references/CRM.md`, \"The account dossier\".\n\nBefore you say a **researched** record is done, re-read its `Notes` and ask:\n\"could a teammate brief themselves on this in 90 seconds and know exactly\nwhat to do next?\" If not, improve the research; do not buy contact data\nunless the user requested it.\n\nWhat belongs in `Notes` per object (write as Markdown; `Notes` is the\nprotected richtext field on every object — never invent `Description`/\n`Research`/`Bio` columns):\n\n- **Lead `Notes`** — the prospect dossier:\n - TL;DR: who they are, why they're a fit, the single strongest signal.\n - The POC: name, role, why they're the right person, LinkedIn.\n - Company overview: what they do, stage, size, website, funding/signal\n evidence with source URLs.\n - Why now: the concrete reason to reach out this week.\n - Partnership / proposal ideas: how we'd actually serve or partner with\n them.\n - A draft cold-email / first-touch angle (draft only — never auto-send).\n - Source log + confidence + any gaps.\n- **Contact (`people`) `Notes`** — deep research on the *person*: role and\n scope, background, what they care about, how they buy, relationship\n history, how to reach them.\n- **Account (`company`) `Notes`** — deep research on the *company*:\n business, market, structure, current vendors/stack, risks, and\n partnership/serve ideas tailored to them.\n- **Opportunity `Notes`** — the deal plan: scope, stakeholders, partnership/\n proposal ideas, what we're proposing, objections, next steps, and the\n path to Closed Won.\n\nWhen the user requests contact enrichment for existing CRM records, use\n`enrich_person` (verified email/LinkedIn by name + company) — and only\never write a contact email/phone that came back from an enrichment tool,\nnever a guessed `first.last@company` (see CRM.md Safety/Enrichment).\n\n## The pipeline flow (after explicit import)\n\n1. **Find → saved list.** For prospecting, load `lead-finding`; it owns\n the shortlist, optional enrichment confirmation, and explicit import flow.\n Search results stay outside Leads. Selecting a profile or suggesting ICP\n fit is not the sales `Qualified` status and does not trigger conversion.\n2. **Capture → `lead`, only on request.** Each explicitly imported profile\n is a `lead` with raw `POC` +\n `Company Name` (+ website, LinkedIn, email, title), named\n `<Person> from <Company>` (or company-only if no POC). Notes optional.\n Imports dedupe by identity (LinkedIn > email > domain): a row matching\n an existing entry reuses it — saving the same rows to another view pins\n the same entries there, never duplicates. Enrichment is optional. Apply\n the user's requested configured status; without one, new imports start\n at New and reused records keep their status. Never default to Qualified.\n Artifact import sets status without running conversion/outreach automations,\n even when the requested status is Qualified. It creates/reuses the Lead\n only; normal CRM status updates are a separate action with normal automation\n behavior.\n3. **Research → lead `Notes`.** Only when asked to research selected rows:\n enrich the POC and company; write the full dossier. Set `Next Follow-Up`.\n4. **Work the status.** `Status` is the source of truth — don't track it\n in prose. Campaigns move it for you, forward-only: the first invite,\n LinkedIn message, or email delivered sets New → Contacted, and a reply\n sets Replied. `Last touch` holds the time of the latest interaction\n (send, acceptance, reply). The user may explicitly request a status on\n import or an existing record; read the configured options rather than\n inventing one. Setting Contacted/Replied alone does not send outreach,\n create message history, or stamp a fabricated interaction. Never move a\n status backwards incidentally during deduplication. Keep `Next Follow-Up`\n current when the task calls for it.\n5. **Qualify.** When the lead is real (budget/fit/intent), set\n `Status = Qualified`. **Do not hand-create the opportunity, account, or\n contact** — the automation does it (next section). Disqualified leads go\n to `Disqualified`, not deleted.\n6. **Convert (automatic).** The qualify automation creates/reuses the\n Account (from `Company Name` + raw company fields), creates/reuses the\n Contact (from `POC` + raw person fields) **only if a POC name exists**,\n links them on the lead, stamps `Converted At`, and opens one\n `opportunity` in `Discovery` linked to the lead/Account/Contact.\n7. **Plan the opportunity.** Fill the opportunity `Notes` deal plan, set\n `Amount` and `Close Date`, and move `Stage` Discovery → Proposal →\n Negotiation.\n8. **Close.** `Stage = Closed Won` flips the Account to Customer and starts\n `Customer Lifecycle = Onboarding` (automatic). `Closed Lost` ends the\n pursuit; the account/contact remain for future opportunities.\n9. **Keep the spine current.** Ongoing relationship notes, renewals, and\n expansion live on the Account/Contact, and new pursuits open as NEW\n opportunities on the same Account.\n\n## Find filter values (use the canonical vocabularies)\n\nThe find lanes take two kinds of filters — check which kind before\nguessing values:\n\n- **Closed vocabularies** — a value outside the list matches nothing, so\n look them up rather than inventing:\n - `seniorities`: Owner, Founder, C-level, Partner, VP, Head, Director,\n Manager, Senior.\n - `headcountRanges`: `1-10`, `11-50`, `51-200`, `201-500`, `501-1000`,\n `1001-5000`, `5001-10000`, `10001+`.\n - `companyTypes`: Partnership, Nonprofit, Educational, Privately Held,\n Public Company, Self-Owned, Self-Employed, Government Agency.\n - `jobFunctions` / `subFunctions`, `languages`: long enums.\n - `industries`: also a canonical list (\"Software Development\", not\n \"software\"), but it is matched loosely, so a partial value still\n works. Prefer the canonical one — it is more precise and keeps every\n provider eligible.\n- **Free text with curated suggestions** — `titles`, `pastTitles`,\n `locations`, `companyHeadquarters`, `universities`, `skills`,\n `keywords`. Custom values work; the catalogs give proven spellings\n (e.g. \"San Francisco Bay Area\", \"Massachusetts Institute of\n Technology\").\n\n### How values are matched\n\nFree text matches as a **substring**, so `titles: [\"Founder\"]` also\nreturns \"Co-Founder\" and \"Founder & CEO\". That is usually what you want,\nbut it widens results several-fold — one live query went from 706 to\n22,558 — so a 500-row cap fills with weaker matches. Pass\n`exactMatch: true` (`--exact` on the CLI) to require whole strings when\nthe broad list is too noisy.\n\nThree things ignore that flag and are always exact: identifiers\n(`companyDomains`, `linkedinUrl`), the closed vocabularies above, and\nnumeric ranges. `keywords` is always loose — it is a text probe over the\ncurrent title, not a value to equal.\n\nOn the CLI, a filter value that itself contains a comma is kept whole\nwhen it matches a known vocabulary entry, so\n`--industries \"Technology, Information and Internet\"` is one industry\nrather than two. Quote the value, or repeat the flag, to be explicit.\nSplitting it by hand produces values that exist in no vocabulary and the\nprovider rejects the entire search.\n\nDiscover both from the same catalog:\n\n```bash\ndench leads filters # everything\ndench leads filters --filter industries --search \"software\"\ndench leads filters --filter company-hq --search \"berlin\"\n```\n\nor fetch <https://dench.com/references/find-filter-options.json>. A\ngenerated lead-finder skill should reference these vocabularies instead\nof hard-coding guessed filter values.\n\n## Automations (what fires for you)\n\nThe sales template installs deterministic rules that run *inside* the write\nthat triggers them (`dench crm automations list --json` to inspect):\n\nThese are normal CRM-write rules. `dench artifacts import` skips them for\nboth new and reused Leads, including when importing with `--status Qualified`.\n\n- **Qualified lead → Account + Contact + Opportunity.** When `lead.Status`\n becomes `Qualified`: reuse `Account`/`Contact` if already linked; else\n find-or-create the Account from the lead's `Company Name` (carrying\n `Company Website` → `Website`, `Company LinkedIn URL` → `LinkedIn URL`);\n if a `POC` name exists, find-or-create the Contact (carrying `Email`,\n `Job Title`, `POC LinkedIn URL`) and link it to the Account; **if no POC\n name, create only the Account** and leave the opportunity's Primary\n Contact empty. Then stamp `Converted At` on the lead and open one\n `opportunity` in `Discovery` (deduped by the `Lead` link).\n- **Closed Won → Customer.** When `opportunity.Stage` becomes `Closed Won`:\n the linked Account's `Type` flips to `Customer` and `Customer Lifecycle`\n starts at `Onboarding`, with the deal owner set as `Account Owner`.\n\nConsequences for you:\n\n- **Set the status / stage and let the rule fire.** Don't hand-create the\n opportunity, account, or contact on qualify — that duplicates work. Write\n responses include an `automationEffects` array describing what the rule\n created/updated; that's expected, not a bug.\n- The created Account/Contact/Opportunity start with thin notes. Research\n their dossiers when requested; conversion alone does not authorize\n additional paid enrichment.\n- Rules fire on transitions only. Bulk imports and sample data don't\n retroactively fire them.\n- Campaign writebacks (`Status` → Contacted/Replied, `Last touch`) run with\n rules enabled and appear in `dench crm history` as field changes by the\n actor `Campaign: <sequence name>`. The per-event feed (sent, accepted,\n replied, skipped) is the record's History tab in the web app. The\n template's own rules ignore these writebacks (convert fires on\n `Qualified` only); a custom rule on `Status` will fire.\n- Every outreach campaign and newsletter is also a CRM record of the\n `campaign` object (`Name`, `Kind` Sequence/Newsletter, `Channel`,\n `Status`, `Owner`, `Started at`, `Enrolled`, `Replied`, `Bounced`,\n `Source ID`). `dench crm entries list campaign` lists them; the rows are\n written by Outreach and cannot be created by hand. Find a campaign's\n record with\n `dench crm query campaign --where '{\"Name\":\"<name>\"}' --select Name,\"Source ID\" --json`;\n its `Source ID` is the campaign id the outreach commands take\n (`dench email multichannel …`, `dench campaign …`). `Replied` counts\n people who replied at least once, whether or not the campaign stopped\n for them; `Bounced` counts people whose email bounced. Each lead carries\n a multi-valued `Campaign` relation naming every campaign it was enrolled\n in, appended at enrollment and never removed —\n `dench crm query lead --where '{\"Campaign\":{\"$contains\":\"<campaign entry id>\"}}' --json`\n answers \"who is in this campaign\". A newsletter's `Enrolled` and\n `Status` refresh at lifecycle moments (submit, pause, resume, cancel,\n archive, completion); its `Bounced` ticks as bounces arrive.\n\n## Lead fields (sales template)\n\nThe base template ships `lead` with: `Name`, `Status`\n(New/Contacted/Replied/Qualified/Disqualified), raw `POC`, `Company Name`,\n`Company Website`, `Company LinkedIn URL`, `Email`, `Job Title`,\n`POC LinkedIn URL`, the `Account`/`Contact` relations (filled on convert,\nor `Contact` pre-linked by an outreach enrollment), `Source`, `Owner`,\n`Next Follow-Up`, `Last touch` (stamped by campaigns), `LinkedIn connection`\n(Not connected / Invited / Connected — moved forward by campaigns when a\nconnection request is sent or accepted), `Campaign` (relation to every\ncampaign the lead was enrolled in, appended by outreach), `Converted At`,\n`Tags`, and `Notes`.\n\n### Optional TAL / scoring extensions\n\nFor target-account-list and lead-scoring motions, add these `lead` fields\n(create them once with `dench crm fields create lead ...`; they are\nrecommended extensions, not part of the base template):\n\n- `Fit Score` (number) — 0–100 ICP fit.\n- `Fit Reason` (text) — one-line why-fit summary.\n- `Signal` (enum) — strongest buying signal (e.g. Recent Funding, New Exec\n Hire, Headcount Growth, Market Expansion).\n- `Vertical` (enum) — target segment.\n- `Funding Date` (date), `Funding Amount` (text), `Funding Source URL`\n (url) — funding-signal evidence.\n- `Draft Outreach Angle` (text) — one-line first-touch hook (draft only).\n- `Confidence` (enum: High/Medium/Low/Review Required).\n- `TAL Run Date` (date) — when a scheduled TAL run last updated the row\n (distinct from `Last touch`, which is outreach activity).\n\nKeep the heavy prose (per-section research, evidence, partnership ideas,\ndraft cold email) in `Notes`; these fields are the short, filterable/\nsortable facets you build views and reports on.\n\n## Role recipes\n\n**Founder / seller building a target account list**\n\nLoad `lead-finding`: discover → saved shortlist → optional confirmed\nenrichment → explicit import. Do not create a Lead for every\ncompany or install a pipeline merely to select prospects. After import,\nadd requested TAL fields and follow-ups to the selected CRM records.\n\n**Returning to a saved list in a new chat**\n\n- Find the list with `dench lists list --search \"<name or topic>\" --json`\n and follow cursors, not only the most recent results. Read fresh saved rows\n with `dench lists rows <id> --enrichment enriched --json` (or the requested\n enrichment filter); do not rely on an old transcript or CSV.\n- \"Add those people as Replied\" means the exact requested selection/filter\n and the workspace's configured Replied status. Use the original zero-based\n `index` values from `lists rows` with `dench artifacts import <id> --to lead\n --rows 0,4,9 --status \"Replied\" --json`. Reuse existing CRM records, preserve\n the list, and do not imply any messages were sent or received.\n- Artifact import with Qualified sets the Lead status only; it does not run\n conversion automation or create Account, Contact, or Opportunity records.\n A normal CRM qualification/status change outside import retains the\n configured automation behavior described below.\n\n**SDR / AE adding a single lead**\n- One `lead` with raw `POC` + `Company Name` (+ website/LinkedIn/email/\n title), the requested configured status (otherwise New), and any requested\n research or follow-up date. Don't touch `company`/`people` before qualification.\n\n**Research agent enriching leads before outreach**\n- For each lead: `enrich_person` the POC, research the company, and write\n the full `Notes` dossier (TL;DR, POC profile, company overview, why-now,\n partnership ideas, draft cold email, sources). Fill the raw LinkedIn/\n email/title fields. Leave relations empty.\n\n**Qualifying an existing CRM lead outside artifact import**\n- When the user explicitly requests sales qualification (not ICP review),\n set `Status = Qualified` and let the automation create\n the Account, (optional) Contact, and Opportunity. Research the new\n Account/Contact/Opportunity `Notes` only when asked; a status change does\n not authorize additional paid enrichment.\n\n**Sales manager reviewing pipeline**\n- Read the opportunity **Opportunities** view (kanban by `Stage`, summed\n `Amount`). Surface stale `Next Follow-Up` leads, opportunities with no\n recent activity, and deals missing `Amount`/`Close Date`.\n- Numbers are answered with the dashboard, not prose: the sales template\n installs analytics on `lead` (total, by source, conversion) and\n `opportunity` (open pipeline, win rate, by stage, forecast, won $ over\n time, by owner, by account HQ). In the web chat, `present_artifact({\n kind: \"analytics\", objectName: \"opportunity\", period: \"this_quarter\" })`\n shows the live dashboard; add `panelIds` for one chart or `panels` for an\n ad-hoc one (\"won $ by owner this quarter\" → a `leaderboard`, `metric:\n \"sum\"`, `metricField: \"Amount\"`, `groupBy: \"Owner\"`, `filters` on\n `Stage = Closed Won`). From a script, `dench crm analytics compute\n opportunity --period this_quarter --json` is the same math (see\n `references/CRM.md` → Analytics). `dench crm aggregate` / `reports\n generate` are one-shot JSON for scripts, not for showing people.\n\n**Preparing an opportunity plan**\n- On the opportunity `Notes`: scope, stakeholders, partnership/proposal\n ideas, what we're proposing, objections + answers, and the next step to\n advance the stage. Draft outreach as drafts only.\n\n## Discipline checklist (bias hard toward these)\n\n- New search prospect → a saved list. Only explicitly requested profiles\n become Leads; enrichment and ICP assessment are not prerequisites. Do not\n create Account/Contact rows first.\n- Raw `POC` + `Company Name` on the lead; relations stay empty until\n qualified.\n- Lead named `<Person> from <Company>` (or company-only when no POC).\n- Selected CRM records researched at the user's request get a `Notes`\n dossier; discovery lists do not require one per profile.\n- Explicit sales qualification through a normal CRM update sets\n `Status = Qualified` and lets the automation convert; artifact import sets\n status only. Don't hand-create the opportunity/account/contact.\n- One Account per real company; many opportunities over time; never convert\n an opportunity into another object.\n- Exclude `Sample`-tagged rows from real outreach, counts, and reports.\n- A pipeline / forecast / win-rate question gets a live chart\n (`present_artifact` kind `analytics`), never a markdown table of rows.\n- Outreach is draft-only unless the user explicitly authorized sending (see\n `references/EMAIL-CAMPAIGNS.md` for managed sending).\n"
70
+ "sha256": "3e13d08adff3235eb81da384cb646bb20550b2562a04ef0ee9897b1e0fb9421c",
71
+ "content": "---\nname: sales\ndescription: CRM sales pipeline playbook for explicitly adding leads, outreach prep, sales qualification, opportunities, forecasting, and existing account/contact research. Covers Leads -> Opportunities -> Customers, raw lead fields, naming, conversion, and selected-record Notes. For sales prospect discovery, outreach target-account lists, and saved prospect-list actions, load lead-finding first; search results stay outside the CRM until explicitly imported.\n---\n\n# Dench Sales Playbook (Sales Template, end to end)\n\nThis is the operating manual for running a real sales motion inside Dench.\nIt sits on top of the generic CRM playbook (`references/CRM.md`) — read that\nfirst for field types, batch writes, the protected `Notes` field, relation\nmodeling, and query syntax. This file covers the **sales discipline**: how\nleads, opportunities, accounts, and contacts fit together, and how you (the\nagent) should behave when working on the CRM sales pipeline.\n\n**Golden rule:** prospect discovery belongs in a saved prospect list. Load\n`lead-finding` for prospect discovery, optional confirmed enrichment, and explicit\nimport. It reads `/workspace/ORGANISATION.md` for who the workspace sells to\nand does not create `ICP.md`. The current request overrides that brief.\nIt saves one list at the requested count and stops.\nNo per-profile ICP approval is required. Once the user imports chosen prospects,\nmanage those Leads through the pipeline below; do not create premature\nAccount/Contact records.\n\n## When this playbook applies\n\nLoad and follow this playbook whenever the user's request involves any of:\n\n- \"new lead\", \"add this lead\", \"log this prospect\", \"enrich this lead\"\n- \"pipeline\", \"deals\", \"opportunities\", \"forecast\", \"what's in the pipeline\"\n- \"qualify\", \"move to qualified\", \"this lead is real\", \"book the deal\"\n- \"outreach\", \"cold email\", \"follow up\", \"sequence prep\", \"draft an intro\"\n- \"account research\", \"company research\", \"who's the POC\", \"find the\n decision maker\", \"research this founder\"\n- \"customers\", \"renewals\", \"churn\", \"expansion\", \"won/lost\"\n\nFor \"find leads\", TAL, ICP review, or \"who should we sell to\", use\n`lead-finding` instead. Discovery does not require installing a sales pipeline.\nOrdinary web, company, or hiring research without prospecting intent does not\nrequire `lead-finding` or ICP questions, reads, or scoring.\n\nIf the workspace does NOT yet have a sales pipeline and the user asks for\none (a \"sales CRM\", \"deal pipeline\", \"lead tracker\", \"CRM for sales\"),\n**recommend and install the Sales Template first** (see below) instead of\nhand-building objects.\n\n## The Sales Template\n\nOne install lays down the entire Salesforce-style motion:\n\n```bash\ndench crm templates list --json # see catalog + installed flags\ndench crm templates install sales # idempotent; safe to re-run\ndench crm templates remove-sample-data sales # drop the demo rows when ready\n```\n\nWhat it creates:\n\n- **`lead`** — the inbox for unqualified demand: explicitly imported\n prospects and inbound hand-raisers. Worked by outbound/SDR motion.\n- **`opportunity`** — active revenue pursuits. One per deal; a company can\n have many over time (new business, renewal, expansion).\n- **`case`** — customer issues/requests, linked to Account + Contact.\n- **`company`** relabeled **Accounts** — the durable company spine. ONE\n record per real company. Gains `Type`, `Source`, `Customer Lifecycle`,\n `Account Owner`, `Renewal Date`, plus a pinned **Customers** view.\n- **`people`** relabeled **Contacts** — the durable person spine.\n- **Saved views** pinned on a first-template install: **Leads** (kanban\n by `Status`), **Opportunities** (kanban by `Stage`, summing `Amount`),\n and the accounts **Customers** kanban. Cases stay off the rail. A later\n template install adds its views unpinned.\n- **Deterministic automations** (fire inside writes — see Automations below).\n- A **workspace rule** describing the motion, and a few cross-linked\n **sample rows** (tagged `Sample`).\n\nInstalls are idempotent and compose — re-running tops up anything missing\nwithout duplicating. Canonical object names stay `company`/`people` even\nthough the UI shows Accounts/Contacts; use the canonical names in commands.\n\n## The mental model (Salesforce-style)\n\n```\nlead ──qualify──▶ opportunity ──Closed Won──▶ Account.Type = Customer\n │ │\n │ (on qualify) ├─ Account (company spine, 1 per company)\n └─ raw POC + company └─ Primary Contact (people spine)\n```\n\n- **Leads are raw, disposable, pre-relationship.** A lead is \"someone we\n might sell to\" plus the research behind that hunch. Leads are NOT durable\n records — they get qualified (promoted) or disqualified (dropped).\n- **Opportunities are money.** An opportunity only exists once a lead is\n qualified. It tracks one pursuit through stages to Won/Lost.\n- **Accounts and Contacts are the durable spine.** They outlive any single\n deal. Relationship history, notes, and ownership live here.\n- **Customers are not a table.** A company becomes a customer when it has a\n Closed Won opportunity — the automation flips `company.Type = Customer`\n and starts `Customer Lifecycle`. Manage customers via the Accounts\n \"Customers\" view, not a separate object.\n\n## The raw-lead-until-qualified rule (important)\n\n**Before a lead is qualified, do NOT create related Account/Contact rows.**\nA prospect explicitly imported from a saved list is a single `lead` row holding *raw* fields —\nnot links to `company`/`people`. This keeps the spine clean (no half-baked\ncompanies/contacts created for prospects that never convert).\n\nSo when you add or import leads:\n\n- Put the company identity in **raw text/url fields on the lead**:\n `Company Name`, `Company Website`, `Company LinkedIn URL`.\n- Put the point-of-contact in **raw fields on the lead**: `POC` (person\n name), `POC LinkedIn URL`, `Email`, `Job Title`.\n- Leave the `Account` **relation** field EMPTY. It gets filled by the\n qualify-to-convert automation, not by you up front.\n- Leave `Contact` EMPTY too unless the person already exists as a `people`\n row. Do not create a `company` row or a `people` row \"to be safe\". Don't.\n\nTwo cases where a pre-qualification lead legitimately carries a link:\n\n- The company or contact **already exists** in the spine (e.g. an existing\n customer raises a new need) — link it; conversion reuses the record.\n- **An outreach enrollment did it.** Enrolling a `people` row in a campaign\n (`dench campaign add <campaign> --object people --entries <ids>` or\n `--view \"<view>\"`, or the Add people dialog; see `references/CAMPAIGNS.md`)\n finds or creates the lead for that person and sets its `Contact` to the\n existing row, so all campaign activity lands on one lead. That is\n expected — leave the link alone. `Account` is never pre-linked this way.\n\n## Lead naming convention\n\nA lead's `Name` is the headline you see in the list/kanban. Use:\n\n- **`<Person Name> from <Company>`** when you know the POC.\n e.g. `Jane Okafor from Acme`, `Marcus Bell from Vercel`.\n- **Just the company name** when the POC is not yet identified.\n e.g. `Acme` — and make \"find the POC\" the next action. Do **not** write\n placeholders like \"Unknown POC from Acme\"; the bare company name is the\n correct title until a real person is found.\n\n## Deep-research Notes (selected rows, not list-builds)\n\nA Notes dossier is for **researching a specific record**, not for every row\nof a 5K find. List-building (`search_people` / `search_companies` /\n`search_jobs`) writes identities into a saved list artifact. That is complete\nwork for a find. Only an explicit import of requested profiles creates Leads;\nthose rows may have empty Notes.\n\nWhen the user asks to research a selected lead/contact/account/opportunity,\nthe dossier is the product. A one-line dossier on a researched row is\nincomplete — treat it like a failed tool call and fill it before you report\ndone.\n\n**Where it goes.** Before researching, read what the workspace already knows:\n`dench crm activity <object> <id> --json` (emails, meetings, Slack, LinkedIn,\ncomments, earlier notes — see `references/CRM.md`, \"The Activity Ledger\").\nThen:\n\n- A record **you are creating** → write the dossier into its `Notes`\n document (the rules below).\n- A record that **already exists** → add a NEW timeline note:\n `dench crm notes create <object> <id> --title \"Research — <date>\"\n --body-file …`. Never overwrite the human's `Notes` document with it.\n- An **account Dench created on its own** (detected from email, a Slack\n Connect channel, a LinkedIn conversation, a calendar invitee) already\n carries a generated dossier section in `Notes`, between\n `<!-- dench:dossier -->` markers (`dench crm entries dossier <id> --json`\n says when it was written). Read it first, add your findings BELOW it as a\n timeline note, never edit or duplicate it; `--regenerate` asks Dench to\n research again. See `references/CRM.md`, \"The account dossier\".\n\nBefore you say a **researched** record is done, re-read its `Notes` and ask:\n\"could a teammate brief themselves on this in 90 seconds and know exactly\nwhat to do next?\" If not, improve the research; do not buy contact data\nunless the user requested it.\n\nWhat belongs in `Notes` per object (write as Markdown; `Notes` is the\nprotected richtext field on every object — never invent `Description`/\n`Research`/`Bio` columns):\n\n- **Lead `Notes`** — the prospect dossier:\n - TL;DR: who they are, why they're a fit, the single strongest signal.\n - The POC: name, role, why they're the right person, LinkedIn.\n - Company overview: what they do, stage, size, website, funding/signal\n evidence with source URLs.\n - Why now: the concrete reason to reach out this week.\n - Partnership / proposal ideas: how we'd actually serve or partner with\n them.\n - A draft cold-email / first-touch angle (draft only — never auto-send).\n - Source log + confidence + any gaps.\n- **Contact (`people`) `Notes`** — deep research on the *person*: role and\n scope, background, what they care about, how they buy, relationship\n history, how to reach them.\n- **Account (`company`) `Notes`** — deep research on the *company*:\n business, market, structure, current vendors/stack, risks, and\n partnership/serve ideas tailored to them.\n- **Opportunity `Notes`** — the deal plan: scope, stakeholders, partnership/\n proposal ideas, what we're proposing, objections, next steps, and the\n path to Closed Won.\n\nWhen the user requests contact enrichment for existing CRM records, use\n`enrich_person` (verified email/LinkedIn by name + company) — and only\never write a contact email/phone that came back from an enrichment tool,\nnever a guessed `first.last@company` (see CRM.md Safety/Enrichment).\n\n## The pipeline flow (after explicit import)\n\n1. **Find → saved list.** For prospecting, load `lead-finding`; it owns\n the shortlist, optional enrichment confirmation, and explicit import flow.\n Search results stay outside Leads. Selecting a profile or suggesting ICP\n fit is not the sales `Qualified` status and does not trigger conversion.\n2. **Capture → `lead`, only on request.** Each explicitly imported profile\n is a `lead` with raw `POC` +\n `Company Name` (+ website, LinkedIn, email, title), named\n `<Person> from <Company>` (or company-only if no POC). Notes optional.\n Imports dedupe by identity (LinkedIn > email > domain): a row matching\n an existing entry reuses it — saving the same rows to another view pins\n the same entries there, never duplicates. Enrichment is optional. Apply\n the user's requested configured status; without one, new imports start\n at New and reused records keep their status. Never default to Qualified.\n Artifact import sets status without running conversion/outreach automations,\n even when the requested status is Qualified. It creates/reuses the Lead\n only; normal CRM status updates are a separate action with normal automation\n behavior.\n3. **Research → lead `Notes`.** Only when asked to research selected rows:\n enrich the POC and company; write the full dossier. Set `Next Follow-Up`.\n4. **Work the status.** `Status` is the source of truth — don't track it\n in prose. Campaigns move it for you, forward-only: the first invite,\n LinkedIn message, or email delivered sets New → Contacted, and a reply\n sets Replied. `Last touch` holds the time of the latest interaction\n (send, acceptance, reply). The user may explicitly request a status on\n import or an existing record; read the configured options rather than\n inventing one. Setting Contacted/Replied alone does not send outreach,\n create message history, or stamp a fabricated interaction. Never move a\n status backwards incidentally during deduplication. Keep `Next Follow-Up`\n current when the task calls for it.\n5. **Qualify.** When the lead is real (budget/fit/intent), set\n `Status = Qualified`. **Do not hand-create the opportunity, account, or\n contact** — the automation does it (next section). Disqualified leads go\n to `Disqualified`, not deleted.\n6. **Convert (automatic).** The qualify automation creates/reuses the\n Account (from `Company Name` + raw company fields), creates/reuses the\n Contact (from `POC` + raw person fields) **only if a POC name exists**,\n links them on the lead, stamps `Converted At`, and opens one\n `opportunity` in `Discovery` linked to the lead/Account/Contact.\n7. **Plan the opportunity.** Fill the opportunity `Notes` deal plan, set\n `Amount` and `Close Date`, and move `Stage` Discovery → Proposal →\n Negotiation.\n8. **Close.** `Stage = Closed Won` flips the Account to Customer and starts\n `Customer Lifecycle = Onboarding` (automatic). `Closed Lost` ends the\n pursuit; the account/contact remain for future opportunities.\n9. **Keep the spine current.** Ongoing relationship notes, renewals, and\n expansion live on the Account/Contact, and new pursuits open as NEW\n opportunities on the same Account.\n\n## Find filter values (use the canonical vocabularies)\n\nThe find lanes take two kinds of filters — check which kind before\nguessing values:\n\n- **Closed vocabularies** — a value outside the list matches nothing, so\n look them up rather than inventing:\n - `seniorities`: Owner, Founder, C-level, Partner, VP, Head, Director,\n Manager, Senior.\n - `headcountRanges`: `1-10`, `11-50`, `51-200`, `201-500`, `501-1000`,\n `1001-5000`, `5001-10000`, `10001+`.\n - `companyTypes`: Partnership, Nonprofit, Educational, Privately Held,\n Public Company, Self-Owned, Self-Employed, Government Agency.\n - `jobFunctions` / `subFunctions`, `languages`: long enums.\n - `industries`: also a canonical list (\"Software Development\", not\n \"software\"), but it is matched loosely, so a partial value still\n works. Prefer the canonical one — it is more precise and keeps every\n provider eligible.\n- **Free text with curated suggestions** — `titles`, `pastTitles`,\n `locations`, `companyHeadquarters`, `universities`, `skills`,\n `keywords`. Custom values work; the catalogs give proven spellings\n (e.g. \"San Francisco Bay Area\", \"Massachusetts Institute of\n Technology\").\n\n### How values are matched\n\nFree text matches as a **substring**, so `titles: [\"Founder\"]` also\nreturns \"Co-Founder\" and \"Founder & CEO\". That is usually what you want,\nbut it widens results several-fold — one live query went from 706 to\n22,558 — so a 500-row cap fills with weaker matches. Pass\n`exactMatch: true` (`--exact` on the CLI) to require whole strings when\nthe broad list is too noisy.\n\nThree things ignore that flag and are always exact: identifiers\n(`companyDomains`, `linkedinUrl`), the closed vocabularies above, and\nnumeric ranges. `keywords` is always loose — it is a text probe over the\ncurrent title, not a value to equal.\n\nOn the CLI, a filter value that itself contains a comma is kept whole\nwhen it matches a known vocabulary entry, so\n`--industries \"Technology, Information and Internet\"` is one industry\nrather than two. Quote the value, or repeat the flag, to be explicit.\nSplitting it by hand produces values that exist in no vocabulary and the\nprovider rejects the entire search.\n\nDiscover both from the same catalog:\n\n```bash\ndench leads filters # everything\ndench leads filters --filter industries --search \"software\"\ndench leads filters --filter company-hq --search \"berlin\"\n```\n\nor fetch <https://dench.com/references/find-filter-options.json>. A\ngenerated lead-finder skill should reference these vocabularies instead\nof hard-coding guessed filter values.\n\n## Automations (what fires for you)\n\nThe sales template installs deterministic rules that run *inside* the write\nthat triggers them (`dench crm automations list --json` to inspect):\n\nThese are normal CRM-write rules. `dench artifacts import` skips them for\nboth new and reused Leads, including when importing with `--status Qualified`.\n\n- **Qualified lead → Account + Contact + Opportunity.** When `lead.Status`\n becomes `Qualified`: reuse `Account`/`Contact` if already linked; else\n find-or-create the Account from the lead's `Company Name` (carrying\n `Company Website` → `Website`, `Company LinkedIn URL` → `LinkedIn URL`);\n if a `POC` name exists, find-or-create the Contact (carrying `Email`,\n `Job Title`, `POC LinkedIn URL`) and link it to the Account; **if no POC\n name, create only the Account** and leave the opportunity's Primary\n Contact empty. Then stamp `Converted At` on the lead and open one\n `opportunity` in `Discovery` (deduped by the `Lead` link).\n- **Closed Won → Customer.** When `opportunity.Stage` becomes `Closed Won`:\n the linked Account's `Type` flips to `Customer` and `Customer Lifecycle`\n starts at `Onboarding`, with the deal owner set as `Account Owner`.\n\nConsequences for you:\n\n- **Set the status / stage and let the rule fire.** Don't hand-create the\n opportunity, account, or contact on qualify — that duplicates work. Write\n responses include an `automationEffects` array describing what the rule\n created/updated; that's expected, not a bug.\n- The created Account/Contact/Opportunity start with thin notes. Research\n their dossiers when requested; conversion alone does not authorize\n additional paid enrichment.\n- Rules fire on transitions only. Bulk imports and sample data don't\n retroactively fire them.\n- Campaign writebacks (`Status` → Contacted/Replied, `Last touch`) run with\n rules enabled and appear in `dench crm history` as field changes by the\n actor `Campaign: <sequence name>`. The per-event feed (sent, accepted,\n replied, skipped) is the record's History tab in the web app. The\n template's own rules ignore these writebacks (convert fires on\n `Qualified` only); a custom rule on `Status` will fire.\n- Every multichannel campaign and newsletter is also a CRM record of the\n `campaign` object (`Name`, `Kind` Sequence/Newsletter, `Channel`,\n `Status`, `Owner`, `Started at`, `Enrolled`, `Replied`, `Bounced`,\n `Source ID`). `dench crm entries list campaign` lists them; the rows are\n written by Outreach and cannot be created by hand. Older email\n sequences and LinkedIn sequences have no `campaign` record, so never\n count campaigns from that object: `dench campaign list` plus\n `dench email sequence list` covers them all. Find a campaign's\n record with\n `dench crm query campaign --where '{\"Name\":\"<name>\"}' --select Name,\"Source ID\" --json`;\n its `Source ID` is the campaign id the outreach commands take\n (`dench email multichannel …`, `dench campaign …`). `Replied` counts\n people who replied at least once, whether or not the campaign stopped\n for them; `Bounced` counts people whose email bounced. Each lead carries\n a multi-valued `Campaign` relation naming every campaign it was enrolled\n in, appended at enrollment and never removed —\n `dench crm query lead --where '{\"Campaign\":{\"$contains\":\"<campaign entry id>\"}}' --json`\n answers \"who is in this campaign\". A newsletter's `Enrolled` and\n `Status` refresh at lifecycle moments (submit, pause, resume, cancel,\n archive, completion); its `Bounced` ticks as bounces arrive.\n\n## Lead fields (sales template)\n\nThe base template ships `lead` with: `Name`, `Status`\n(New/Contacted/Replied/Qualified/Disqualified), raw `POC`, `Company Name`,\n`Company Website`, `Company LinkedIn URL`, `Email`, `Job Title`,\n`POC LinkedIn URL`, the `Account`/`Contact` relations (filled on convert,\nor `Contact` pre-linked by an outreach enrollment), `Source`, `Owner`,\n`Next Follow-Up`, `Last touch` (stamped by campaigns), `LinkedIn connection`\n(Not connected / Invited / Connected — moved forward by campaigns when a\nconnection request is sent or accepted), `Campaign` (relation to every\ncampaign the lead was enrolled in, appended by outreach), `Converted At`,\n`Tags`, and `Notes`.\n\n### Optional TAL / scoring extensions\n\nFor target-account-list and lead-scoring motions, add these `lead` fields\n(create them once with `dench crm fields create lead ...`; they are\nrecommended extensions, not part of the base template):\n\n- `Fit Score` (number) — 0–100 ICP fit.\n- `Fit Reason` (text) — one-line why-fit summary.\n- `Signal` (enum) — strongest buying signal (e.g. Recent Funding, New Exec\n Hire, Headcount Growth, Market Expansion).\n- `Vertical` (enum) — target segment.\n- `Funding Date` (date), `Funding Amount` (text), `Funding Source URL`\n (url) — funding-signal evidence.\n- `Draft Outreach Angle` (text) — one-line first-touch hook (draft only).\n- `Confidence` (enum: High/Medium/Low/Review Required).\n- `TAL Run Date` (date) — when a scheduled TAL run last updated the row\n (distinct from `Last touch`, which is outreach activity).\n\nKeep the heavy prose (per-section research, evidence, partnership ideas,\ndraft cold email) in `Notes`; these fields are the short, filterable/\nsortable facets you build views and reports on.\n\n## Role recipes\n\n**Founder / seller building a target account list**\n\nLoad `lead-finding`: discover → saved shortlist → optional confirmed\nenrichment → explicit import. Do not create a Lead for every\ncompany or install a pipeline merely to select prospects. After import,\nadd requested TAL fields and follow-ups to the selected CRM records.\n\n**Returning to a saved list in a new chat**\n\n- Find the list with `dench lists list --search \"<name or topic>\" --json`\n and follow cursors, not only the most recent results. Read fresh saved rows\n with `dench lists rows <id> --enrichment enriched --json` (or the requested\n enrichment filter); do not rely on an old transcript or CSV.\n- \"Add those people as Replied\" means the exact requested selection/filter\n and the workspace's configured Replied status. Use the original zero-based\n `index` values from `lists rows` with `dench artifacts import <id> --to lead\n --rows 0,4,9 --status \"Replied\" --json`. Reuse existing CRM records, preserve\n the list, and do not imply any messages were sent or received.\n- Artifact import with Qualified sets the Lead status only; it does not run\n conversion automation or create Account, Contact, or Opportunity records.\n A normal CRM qualification/status change outside import retains the\n configured automation behavior described below.\n\n**SDR / AE adding a single lead**\n- One `lead` with raw `POC` + `Company Name` (+ website/LinkedIn/email/\n title), the requested configured status (otherwise New), and any requested\n research or follow-up date. Don't touch `company`/`people` before qualification.\n\n**Research agent enriching leads before outreach**\n- For each lead: `enrich_person` the POC, research the company, and write\n the full `Notes` dossier (TL;DR, POC profile, company overview, why-now,\n partnership ideas, draft cold email, sources). Fill the raw LinkedIn/\n email/title fields. Leave relations empty.\n\n**Qualifying an existing CRM lead outside artifact import**\n- When the user explicitly requests sales qualification (not ICP review),\n set `Status = Qualified` and let the automation create\n the Account, (optional) Contact, and Opportunity. Research the new\n Account/Contact/Opportunity `Notes` only when asked; a status change does\n not authorize additional paid enrichment.\n\n**Sales manager reviewing pipeline**\n- Read the opportunity **Opportunities** view (kanban by `Stage`, summed\n `Amount`). Surface stale `Next Follow-Up` leads, opportunities with no\n recent activity, and deals missing `Amount`/`Close Date`.\n- Numbers are answered with the dashboard, not prose: the sales template\n installs analytics on `lead` (total, by source, conversion) and\n `opportunity` (open pipeline, win rate, by stage, forecast, won $ over\n time, by owner, by account HQ). In the web chat, `present_artifact({\n kind: \"analytics\", objectName: \"opportunity\", period: \"this_quarter\" })`\n shows the live dashboard; add `panelIds` for one chart or `panels` for an\n ad-hoc one (\"won $ by owner this quarter\" → a `leaderboard`, `metric:\n \"sum\"`, `metricField: \"Amount\"`, `groupBy: \"Owner\"`, `filters` on\n `Stage = Closed Won`). From a script, `dench crm analytics compute\n opportunity --period this_quarter --json` is the same math (see\n `references/CRM.md` → Analytics). `dench crm aggregate` / `reports\n generate` are one-shot JSON for scripts, not for showing people.\n\n**Preparing an opportunity plan**\n- On the opportunity `Notes`: scope, stakeholders, partnership/proposal\n ideas, what we're proposing, objections + answers, and the next step to\n advance the stage. Draft outreach as drafts only.\n\n## Discipline checklist (bias hard toward these)\n\n- New search prospect → a saved list. Only explicitly requested profiles\n become Leads; enrichment and ICP assessment are not prerequisites. Do not\n create Account/Contact rows first.\n- Raw `POC` + `Company Name` on the lead; relations stay empty until\n qualified.\n- Lead named `<Person> from <Company>` (or company-only when no POC).\n- Selected CRM records researched at the user's request get a `Notes`\n dossier; discovery lists do not require one per profile.\n- Explicit sales qualification through a normal CRM update sets\n `Status = Qualified` and lets the automation convert; artifact import sets\n status only. Don't hand-create the opportunity/account/contact.\n- One Account per real company; many opportunities over time; never convert\n an opportunity into another object.\n- Exclude `Sample`-tagged rows from real outreach, counts, and reports.\n- A pipeline / forecast / win-rate question gets a live chart\n (`present_artifact` kind `analytics`), never a markdown table of rows.\n- Outreach is draft-only unless the user explicitly authorized sending (see\n `references/EMAIL-CAMPAIGNS.md` for managed sending).\n"
72
72
  }
73
73
  }
74
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dench.com/cli",
3
- "version": "3.11.22-staging.602",
3
+ "version": "3.11.23-staging.604",
4
4
  "description": "Dench agent workspace CLI.",
5
5
  "type": "module",
6
6
  "bin": {