{
  "schema": "leumas.docs.page/1",
  "id": "adapter:domain/deal-forecaster",
  "slug": "adapters/domain/deal-forecaster",
  "kind": "capabilities",
  "bucket": "package",
  "title": "deal-forecaster",
  "name": "Deal Forecaster",
  "eyebrow": null,
  "chip": null,
  "summary": "Sales pipeline forecasting and quota analytics for CRM revenue teams: forecast computes a probability-weighted pipeline total from a list of deals (amount x stage win-probability), grouped by stage...",
  "keywords": [
    "deal-forecaster",
    "forecasting",
    "probability-weighted",
    "winprobability",
    "verbal",
    "closed-won",
    "closed-lost",
    "close-rate"
  ],
  "audience": "both",
  "funnel": {
    "product": null,
    "cta": null
  },
  "body": "# deal-forecaster\n\nAn intelligent microservice adapter pack for sales pipeline forecasting and quota analytics. The math\nis deterministic and exact and runs fully offline. Only `whatIf`'s optional narrative uses the shared\nLLM helper (when `options.narrate` is set and a model is reachable), and it silently falls back to a\ntemplated sentence otherwise. Hybrid results are tagged `{ mode: 'heuristic' | 'llm' }` — the numbers\nare always exact regardless of mode.\n\n## Tools\n\n| Tool | What it does |\n|---|---|\n| `forecast` | Probability-weighted pipeline total from a list of `deals` (amount x win-probability), grouped by stage and owner, with top deals and open-pipeline breakdown. |\n| `winProbability` | Maps a pipeline `stage` (lead, qualified, discovery, proposal, negotiation, verbal, closed-won, closed-lost) to a default close-rate %. Omit `stage` to get the whole map. |\n| `quotaPacing` | From `closed`, `quota` and `daysLeft` (optional `daysElapsed`), reports attainment, run-rate, daily rate needed, projected attainment and a status (quota-hit / on-track / at-risk / off-track). |\n| `categoryForecast` | Best-case / most-likely (commit) / worst-case scenario totals with the basis of each band. |\n| `whatIf` | Re-scores the pipeline under hypotheticals (`stageShift`, `amountMultiplier`, `winRateDelta`, `includeStages`, `excludeStages`) and reports the delta vs baseline. **Hybrid narrative.** |\n\n## Deal shape\n\n```js\n{ id?, name?, amount, stage, probability?, owner?, closeDate? }\n```\n\n`amount` accepts numbers or currency strings (`\"$12,000\"`). If `probability` is omitted it is derived\nfrom `stage`; unknown stages default to a conservative 10%. `probability` may be a fraction (`0.45`)\nor a percent (`45`).\n\n## Usage\n\n```js\nimport pack from './index.js';\n\nconst deals = [\n  { id: 'A', amount: 50000, stage: 'negotiation', owner: 'sam' },\n  { id: 'B', amount: 20000, stage: 'proposal', owner: 'lee' },\n  { id: 'C', amount: 80000, stage: 'lead' },\n];\n\npack.adapters.forecast({ deals });               // weighted pipeline total + breakdowns\npack.adapters.winProbability({ stage: 'proposal' });\npack.adapters.quotaPacing({ closed: 120000, quota: 200000, daysLeft: 12, daysElapsed: 18 });\npack.adapters.categoryForecast({ deals });       // best / commit / worst\nawait pack.adapters.whatIf({ deals, changes: { stageShift: 1, amountMultiplier: 1.1 } });\n```\n\n## DRY boundary notes\n\n- Not generic stats: `numbers` / `statistics` own series analytics (percentiles, anomalies). This pack\n  is CRM-specific pipeline math (stage→win-rate, commit/best/worst scenarios, quota pacing).\n- Not `finance`: no NPV / interest / loan math. This is revenue forecasting on opportunities.\n- Self-contained: no cross-pack imports except `../_shared/llm.js`.\n",
  "source": {
    "path": "shared/engines/adapters/domain/deal-forecaster/README.md",
    "blobSha": "",
    "commit": "",
    "committedAt": "",
    "provenance": "no-git",
    "bytes": 2979,
    "hash": "5ac32078d5801745d8b321a3e5624dd519305eaa"
  },
  "urls": {
    "html": "/p/adapters/domain/deal-forecaster",
    "json": "/docs/adapters/domain/deal-forecaster.json",
    "md": "/docs/adapters/domain/deal-forecaster.md"
  },
  "links": {
    "composes": [],
    "usedBy": [],
    "product": [],
    "howTo": [],
    "skills": []
  }
}
