Skip to content
SlashClone
Made by@revopslab

Weekly forecast rollup

@revopslab/weekly-forecast-rollup

Roll an opportunity export from HubSpot, Salesforce, or any CRM into closed won, commit, best case, and pipeline by rep and team for the quarter, then compare with last week: what moved, which deals slipped or were pulled in, upgrades, downgrades, new, won, lost, and dropped deals.

SkillRevOpsv1.0.0 (latest)Tested
Activity
New: be the first to try it
  1. 1---
  2. 2name: weekly-forecast-rollup
  3. 3description: Build the weekly sales forecast rollup from an opportunity export (HubSpot, Salesforce, or any CRM CSV). Totals closed won, commit, best case, and pipeline by rep and team for the quarter, compares with last week's export, and lists slipped, pulled-in, upgraded, downgraded, new, won, lost, and dropped deals. Use when the user says "roll up the forecast", "what changed since last week", "which deals slipped", "commit by rep", "prep the Monday forecast call", or shares two weekly opportunity exports.
  4. 4license: MIT
  5. 5---
  6. 6
  7. 7# Weekly forecast rollup
  8. 8
  9. 9Turns this week's and last week's opportunity exports into the numbers a forecast call needs, with every movement explained by deal. The script does the math. You check the inputs, read the result, and write the short narrative.
  10. 11## When to use
  11. 13- Monday or Friday forecast prep, or before a board or leadership update.
  12. 14- "Why did commit drop?" or "which deals slipped out of the quarter?"
  13. 15- Not for setting quota or attainment math. This reports what the CRM says.
  14. 17## Inputs
  15. 191. **This week's export** in `data/`, for example `data/opps-2026-11-04.csv`. One row per opportunity, open and closed, for at least the period. Needed: an ID, amount, and close date. Strongly recommended: name, owner, team (or owner role or region), stage, forecast category.
  16. 202. **Last week's export** with the same columns. Suggest the user saves each week's export with the date in the file name so next week's comparison is free.
  17. 213. **The period**: usually the current quarter. Ask if unclear.
  18. 23Columns are matched by common names (Salesforce: `Opportunity ID`, `Opportunity Owner`, `Forecast Category`; HubSpot: `Record ID`, `Deal owner`, `Forecast category`, `Deal Stage`). If a column has another name, pass `--map field=Column Name` (fields: `id`, `name`, `owner`, `team`, `amount`, `close_date`, `stage`, `forecast_category`).
  19. 25## Steps
  20. 271. Find the two most recent exports in `data/`. Confirm the dates and period with the user.
  21. 282. Run:
  22. 30 ```bash
  23. 31 node scripts/forecast-rollup.mjs data/opps-2026-11-04.csv data/opps-2026-10-28.csv --period-start 2026-10-01 --period-end 2026-12-31 --out out --name forecast-2026-11-04
  24. 32 ```
  25. 343. Read `out/<name>.json`. Check `data_problems` first. Many deals with no forecast category or unreadable dates mean the numbers are not trustworthy yet; say so before anything else.
  26. 354. Write the narrative in 5 bullets or fewer: where forecast landed, the biggest movement and why (by deal), what slipped out of the period, any rep whose commit dropped, and the 2 or 3 deals to discuss on the call.
  27. 365. Show the narrative, then the "By rep" table from `out/<name>.md`.
  28. 38## Category rules
  29. 40- Closed won counts by stage (`Closed Won`) or category `Closed`. Closed lost and `Omitted` are left out of every total.
  30. 41- Forecast = closed won + commit. Upside = forecast + best case. Pipeline is reported on its own.
  31. 42- A deal with no category counts as pipeline and is listed in `data_problems`.
  32. 43- A deal in last week's export but not this week's is "dropped": deleted, merged, or filtered out of the view. Ask the user which.
  33. 45## Output to the user
  34. 47```markdown
  35. 48**Q4 forecast: $177,000 (+$32,000 WoW).** Upside $237,000. Pipeline in period $0.
  36. 50- Northwind Traders ($50,000) closed won; Adventure Works ($40,000) moved to commit.
  37. 51- Contoso Robotics ($30,000) slipped to 2027-01-15, out of the quarter.
  38. 52- Fabrikam Health commit cut by $8,000 to $72,000.
  39. 53- Tailspin Toys lost; Proseware dropped from the export (check if deleted).
  40. 54- Discuss: Contoso slip reason, Fabrikam discount, Wide World Importers next step.
  41. 55```
  42. 57## Guardrails
  43. 59- Report what the exports say. Never move a deal between categories yourself; suggest it as a question for the rep.
  44. 60- Do not write back to the CRM.
  45. 61- Amounts are summed as given. If the export mixes currencies, stop and ask for a converted amount column.