---
name: deal-flow-analytics
description: >
Publishes the organization's recent deal flow as a live page: deals added per month and
breakdowns by stage, source, region, deal lead and each custom field worth reporting on, with
a concentration callout. The page reads the numbers from Carta each time it opens, so it is
current whenever it is opened. Use this skill when the user says things like "deal flow
analytics", "analyze our deal flow", "review deals added in the last 12 months", "who
introduced most of our deals", "breakdown of deals by sector", "where is our deal flow
coming from", or "/deal-flow-analytics". Covers the trailing 12 months. Returns counts per
dimension, not a list of individual deals: use search-deals for that.
allowed-tools:
# The only source for a connector's name
- list_connectors
# The organization the published title names. Its answer also confirms the connector answers.
- mcp__carta__get_current_user
- mcp__claude_ai_Carta__get_current_user
- mcp__2827383e-1775-4df3-b6ff-04d5392f6d18__get_current_user
- Bash(uv run "${CLAUDE_PLUGIN_ROOT}/skills/deal-flow-analytics/scripts/build_live_page.py" *)
- Artifact
- ToolSearch
version: 2.0.0
model: inherit
---
carta-crm:1.20.26
# Deal Flow Analytics
Publishes the page as **`Deal Flow Analytics - `**, icon **📈**.
**This skill never reads deal data and never copies any.** The page fetches the analytics from
Carta when someone opens it, in one call. Do not call `aggregate_deals`, `get_deal_fields` or
`search_deals` here.
## Voice
Never mention the template, the script, tool names, files, paths or this skill. Progress lines
speak in the user's words: "Setting up your page", "Publishing the page".
## Budget
A live page that already exists opens after **one** turn with tool calls (Step 0). A first publish
takes **three**: Step 0, Step 3 and Step 4. Step 1 and Step 2 apply what Step 0 read and make no
call. When a tool is deferred, add the one turn Step 0 names. Add no other call. When a failure is not one this skill names, stop and tell the user
what came back. Do not retry with a variation.
## The grant, and why it is this narrow
The page declares `crm_read_tool` and nothing else. **Every viewer of the URL inherits that
grant**, and a non-empty `capabilities` object replaces the stored one on every republish.
`crm_read_tool` cannot write. Do **not** add `crm_call_tool`: it reaches every write, and a
viewer of a URL must not have that.
## Step 0: Opening turn
In the turn that opens this skill, make these calls in parallel and nothing else:
```
Artifact({action: "list", scope: "mine", limit: 50})
```
- `get_current_user`, for its organization. If it fails or names no organization, leave the
organization out and carry on.
- `list_connectors`, for Step 2.
- `Read` `${CLAUDE_PLUGIN_ROOT}/references/gate-has-artifact-tool.md` and
`${CLAUDE_PLUGIN_ROOT}/references/gate-carta-connector-name.md` (the plugin's own
`references/`, not this skill's). Do not search for them.
When `Artifact` or `get_current_user` is deferred, replace each deferred call with one
`ToolSearch` that loads both (`select:Artifact`, and `get_current_user`). In the next turn, make
every call it replaced (the list call, `get_current_user`, or both), in parallel. That turn
counts toward the Budget.
## Step 1: Find the published page
Look for an artifact titled exactly **`Deal Flow Analytics - `** (with no
organization, **`Deal Flow Analytics`**). An artifact for a different organization is not a
match. Keep its `url`.
**It is there, its label is `Live deal flow analytics`, and the user did not ask for a
rebuild:** the page is live, so it is already current. Go to Step 5 with that `url`. Make no
other call: no build and no publish. Do not apply the gates read in Step 0.
A rebuild is asked for with words like "rebuild", "republish", "redeploy" or "update the
template".
**A match with any other label, or a label the list does not show,** is a snapshot from before
the page was live, or cannot be told from one. Go on to Step 2 and redeploy it in place at the
kept `url`.
**No match:** go on to Step 2 and omit `url` on the first publish.
## Step 2: The gates and the connector's name
Apply the artifact gate and the connector gate read in Step 0. Make no call of your own. Take
the name from the Step 0 `list_connectors` answer, and ask the user when several connectors
match. The Step 0 `get_current_user` call is the confirmation call the connector gate asks for:
when it answered, the connector answers.
When there is no Carta connector, or `get_current_user` did not answer, do not stop and do not
ask: use `Carta`, publish the page anyway, and say so in Step 5. The page then tells each viewer
to add the Carta connector, and it works once they do.
## Step 3: Write the page
Run this as its own command on one line, with the script path exactly as written and every
argument quoted. Chain nothing before or after it. Do not search for the script.
```
uv run "${CLAUDE_PLUGIN_ROOT}/skills/deal-flow-analytics/scripts/build_live_page.py" --connector "" --organization "" --out "/deal-flow-analytics-.html"
```
`` is the organization lowercased with non-alphanumerics collapsed to `-`, or `analytics`
with no organization. Leave `--organization` out when there is none.
## Step 4: Publish
`url` is the only difference between a first publish and a redeploy.
```
Artifact({
file_path: "/deal-flow-analytics-.html",
url: "",
description: "Your deal flow: deals added per month and breakdowns by stage, source, region, deal lead and custom fields.",
favicon: "📈",
label: "Live deal flow analytics",
capabilities: {
mcp: {
servers: [
{
server: "",
tools: ["crm_read_tool"]
}
]
}
}
})
```
> **No `title` here.** The tool takes it from the file's `` tag. **Omit `favicon` on a
> redeploy**, so the tab keeps its icon.
## Step 5: Reply
Give the user the URL and say what the page does:
- It reads **live**: opening it, or its Refresh button, shows the current numbers for the
trailing 12 months.
- It **cannot write** to their CRM.
- Anyone they share it with reads this organization's deal flow through it. Say this plainly.
- When Step 2 found no connector: the page asks each viewer to add the Carta connector.