---
name: salesforce-closed-won-digest
description: "Friday afternoon: every deal closed won this week with amount, owner, and the competitor or win reason where one was recorded. Use when the user asks for this, or when it runs on a schedule."
---

# Salesforce closed won digest

Friday afternoon: every deal closed won this week with amount, owner, and the competitor or win reason where one was recorded.

Wins get announced one at a time in a chat channel and the thread is buried by Friday. Founders want the week in one place: how much closed, who closed it, and who we beat. Sales leaders want the same list to see which competitor keeps coming up and why customers picked you.

At 16:00 on Friday the agent pulls the week's closed won opportunities and writes the digest. Where the rep filled in the Competitors related list or a win reason, it goes next to the deal; where they did not, the digest says "not recorded" instead of guessing.

## Two ways to get the data

Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.

## Route A: API or MCP server

### What you need

- Read access to Opportunity, OpportunityHistory and OpportunityCompetitor, through `sf data query`, the REST API or a Salesforce connector.

If something is missing, say what and stop; do not invent numbers.

### Steps

1. **Query closed won** (Salesforce): `SELECT Id, Name, Account.Name, Owner.Name, Amount, CloseDate, Type, LeadSource, (SELECT CompetitorName FROM OpportunityCompetitors) FROM Opportunity WHERE IsWon = true AND CloseDate = THIS_WEEK ORDER BY Amount DESC`.
2. **Catch late updates** (Salesforce): Also read `OpportunityHistory` rows with `StageName = 'Closed Won'` and `CreatedDate = THIS_WEEK`, so a deal marked won today with an older close date still makes the list.
3. **Add the win reason**: If your org has a win reason or primary competitor field (often custom, such as `Win_Reason__c`), add it to the query. If it does not, leave the column as "not recorded"; never infer a reason from the description.
4. **Write the digest**: Total won, deal count and average deal size, then one row per deal with account, amount, owner, type, competitor and reason. Finish with the competitor or reason that came up most this week.

## Route B: the browser

### What you need

- Signed in to Salesforce with the Run Reports permission and read access to the team's opportunities and their Competitors related list.

If something is missing, say what and stop; do not invent numbers.

### Steps

Start at https://login.salesforce.com/. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.

1. **Run a closed won report**: From your My Domain open **Reports** > **New Report**, report type **Opportunities with Competitors**, so each row can carry a competitor name. Filters: Show Me All opportunities, **Won** equals True, **Close Date** set to the relative date `THIS WEEK`. Columns: Account Name, Opportunity Name, Amount, Opportunity Owner, Type, Lead Source, Competitor Name, plus your win reason field if you have one. Sort by Amount descending.
2. **Catch late updates**: Run a second report of type **Opportunity History** with **To Stage** equals Closed Won and **Last Modified Date** `THIS WEEK`, so a deal marked won today with an older close date is not missed.
3. **Fill the blanks honestly**: Opportunities with no competitor row and no reason show "not recorded"; do not read one into the description. Deals with competitors appear once per competitor, so count distinct opportunities.
4. **Write the digest**: Total won, deal count and average deal size, one row per deal with account, amount, owner, type, competitor and reason, and the competitor or reason that came up most. Save both reports for next Friday.

Note: THIS WEEK follows the signed-in user's locale (Sunday start for English, United States), the same as the API route; use explicit dates for a fixed Monday to Friday window. Many orgs track competitors in a custom picklist instead of the related list; use the plain Opportunities report type with that field in that case.

## The report

- **Won this week**: total, deal count and average deal size.
- **Each deal**: account, amount, owner, type, competitor and win reason, largest first.
- **Pattern**: the competitor or reason that came up most.
- Deals with no competitor or reason recorded, so reps can fill them in.

## Post it to Briefkin

When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.

```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
  -H "authorization: Bearer $BRIEFKIN_TOKEN" \
  -H "content-type: application/json" \
  -d @- <<'JSON'
{
  "v": 1,
  "event_id": "salesforce-closed-won-digest/<date of this run, e.g. 2026-10-16>",
  "item_key": "salesforce-closed-won-digest",
  "project": "Acme",
  "source": "Salesforce closed won digest skill",
  "kind": "update",
  "title": "$412k closed won this week across 7 deals",
  "summary": "Seven deals, average **$58.9k**. Marco closed the largest, Contoso at **$132k**.",
  "widget": [
    {
      "type": "Grid",
      "props": {
        "columns": 3
      },
      "children": [
        {
          "type": "Stat",
          "props": {
            "label": "Closed won",
            "value": "$412k",
            "tone": "ok"
          }
        },
        {
          "type": "Stat",
          "props": {
            "label": "Deals",
            "value": 7
          }
        },
        {
          "type": "Stat",
          "props": {
            "label": "Average deal",
            "value": "$58.9k"
          }
        }
      ]
    },
    {
      "type": "Table",
      "props": {
        "columns": [
          "Account",
          "Amount",
          "Owner",
          "Type",
          "Competitor",
          "Win reason"
        ],
        "align": [
          "left",
          "right",
          "left",
          "left",
          "left",
          "left"
        ],
        "rows": [
          [
            "Contoso",
            "$132k",
            "Marco",
            "New",
            "Globex",
            "Faster onboarding"
          ],
          [
            "Relecloud",
            "$96k",
            "Dana",
            "Renewal",
            "None",
            "Not recorded"
          ],
          [
            "Adatum",
            "$58k",
            "Sam",
            "New",
            "Globex",
            "Faster onboarding"
          ],
          [
            "Fabrikam",
            "$44k",
            "Priya",
            "Upgrade",
            "None",
            "Needed SSO"
          ],
          [
            "Wingtip",
            "$38k",
            "Lena",
            "New",
            "Initech",
            "Price"
          ],
          [
            "Tailspin Toys",
            "$27k",
            "Theo",
            "New",
            "Globex",
            "Faster onboarding"
          ],
          [
            "Coho Winery",
            "$17k",
            "Sam",
            "Upgrade",
            "None",
            "Not recorded"
          ]
        ]
      }
    },
    {
      "type": "Callout",
      "props": {
        "text": "Globex was the competitor in 3 of 7 wins, and all three cited faster onboarding.",
        "tone": "info"
      }
    }
  ]
}
JSON
```

Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.

## Run it on a schedule

Suggested: Fridays at 16:00 (`0 16 * * 5`). From cron, with the agent signed in on that machine:

```bash
0 16 * * 5 claude -p "Run the salesforce-closed-won-digest skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```

Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/salesforce-closed-won-digest#schedule

Source: https://briefkin.dev/skills/salesforce-closed-won-digest
