Summarize the week's Salesforce closed won deals for the team

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

Runs
Fridays at 16:00
Posts
Report card

From your apps to your board

How the skill works: your agent reads closed won from Salesforce, fridays at 16:00, and gives you report card and the report in the chat.

Reads

  • SalesforceClosed won
reads
Your agentClaude Code, Codex, Cursor or GeminiFridays at 16:00
posts

You get

  • Report cardOn your board, updated in place every run
  • The report in the chatEvery run, with or without Briefkin

What you get

  • 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.

The card on the right is a sample. Yours shows your own numbers and updates in place every run.

What lands on your board

AcmeSalesforce closed won digest · Claude Code

$412k closed won this week across 7 deals

Seven deals, average $58.9k. Marco closed the largest, Contoso at $132k.

Closed won$412k
Deals7
Average deal$58.9k
AccountAmountOwnerTypeCompetitorWin reason
Contoso$132kMarcoNewGlobexFaster onboarding
Relecloud$96kDanaRenewalNoneNot recorded
Adatum$58kSamNewGlobexFaster onboarding
Fabrikam$44kPriyaUpgradeNoneNeeded SSO
Wingtip$38kLenaNewInitechPrice
Tailspin Toys$27kTheoNewGlobexFaster onboarding
Coho Winery$17kSamUpgradeNoneNot recorded

Globex was the competitor in 3 of 7 wins, and all three cited faster onboarding.

Done
An example with made-up numbers. Your agent posts your real ones.

What it does

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.

How it works

  1. 1Query closed won

    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. 2Catch late updates

    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. 3

    3Add 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. 4

    4Write 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.

  5. Post it to the board

    With BRIEFKIN_TOKEN set, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.

Install and run it

Pick your agent, where the data comes from and how to schedule it; the commands below follow.

Agent
Data
Schedule
  1. Install the skill

    One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.

    shellcurl -fsSL https://briefkin.dev/skills/salesforce-closed-won-digest/install | sh
  2. Run it

    Ask Claude Code:

    promptRun the salesforce-closed-won-digest skill

    Or paste the prompt instead of installing:

    promptUsing SOQL on Salesforce, list opportunities closed won this week: IsWon = true and CloseDate = THIS_WEEK, plus any whose stage changed to Closed Won this week according to OpportunityHistory. For each: account, opportunity name, amount, owner, type, and competitors from the OpportunityCompetitors related list, plus any win reason field we have. Give me the total, the number of deals and the average deal size, a table sorted by amount, and the competitor that came up most. Write "not recorded" where a field is empty; do not guess reasons.
  3. Put it on a schedule

    Fridays at 16:00, from cron on any machine where Claude Code is signed in:

    crontab0 16 * * 5 claude -p "Run the salesforce-closed-won-digest skill"

    Add it with crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.

  4. Send it to your board

    Connect Briefkin once with curl -fsSL https://briefkin.dev/install | sh and every run lands on your board as a report card. How setup works

View the SKILL.mdRaw file
SKILL.md---
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

What your agent needs

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

Connecting Salesforce

  1. Salesforce Hosted MCP Servers. Salesforce runs MCP servers for your org; in Setup under MCP Servers, activate the read-only SObject Reads server and copy its URL. To use it from Claude, create an External Client App with OAuth (scopes mcp_api and refresh_token, callback https://claude.ai/api/mcp/auth_callback) and add the URL as a custom connector (server reference).
  2. The sf CLI. Log in once with sf org login web --alias prod, then run sf data query --query "SELECT Name, StageName, Amount, CloseDate FROM Opportunity WHERE IsClosed = false" --target-org prod --json. Salesforce's DX MCP server (npx @salesforce/mcp) reuses the same CLI login for local agents.
  3. REST API with OAuth. An External Client App with the api and refresh_token scopes; the skill reads SF_INSTANCE_URL and SF_ACCESS_TOKEN (or a refresh token) and calls the query endpoint.

SObject Reads and SOQL never write, but the user's permissions are the real limit: run reports as an integration user whose permission set grants Read on Opportunity, Account, Lead and Case and nothing else.

Questions

Where does the competitor come from?

From the standard Competitors related list on the opportunity (the OpportunityCompetitor object). Many orgs use a custom picklist instead; name that field in the skill and it fills the same column.

Does THIS_WEEK start on Sunday or Monday?

It follows the locale of the user the query runs as: Sunday for English (United States), Monday for most European locales. For a fixed Monday to Friday window, filter on explicit dates instead.

Do I need Briefkin to use the Salesforce closed won digest skill?

No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a report card, so you can glance at it instead of asking again.

Which agents can run it?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.

Can it work without an API or MCP server, from my browser?

Yes. Switch the data source to "Your browser" and the steps change to the Salesforce pages themselves: the agent opens login.salesforce.com in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.

Read this report on your board, not in a chat log

Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.

Free during the open beta. No card.