{"skills":[{"name":"Forecast a weighted sales pipeline","description":"Build an expected bookings figure from open opportunities while exposing missing close dates and probabilities.","content":"# Forecast a weighted sales pipeline\n\nBuild an expected bookings figure from open opportunities while exposing missing close dates and probabilities.\n\n## When to use this skill\n\n- A sales manager needs this month's or this quarter's weighted pipeline from the CRM.\n- Some deals have no probability or close date and the forecast must show them, not hide them.\n- One customer has been offered alternative packages and can only buy one.\n\n## When not to use it\n\n- Revenue recognition or financial statements. Weighted bookings are not revenue.\n- Forecasting when cash arrives. Use the cash shortfall forecast skill.\n- Setting sales targets or calculating commission.\n\n## What you need\n\n- CRM opportunities with ID, stage, value, currency, probability, expected closing date and revision date\n- Forecast period, as-of date, and treatment of closed orders\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Which period and as-of date, and should won deals be included?\n- Where do the probabilities come from: stage defaults or each salesperson's judgement?\n- Are any opportunities alternative quotes for the same customer decision?\n- Is everything in one currency, and if not, which exchange-rate policy applies?\n\n## Method\n\n1. Select open opportunities whose expected close date falls in the agreed window. Exclude won and lost opportunities unless the request asks for them. List open deals with no close date separately, because they cannot be placed in a period.\n2. Remove duplicate exports of the same opportunity ID, using the latest dated revision as of the cut-off. Conflicting undated versions need clarification.\n3. Separate genuinely separate sales from alternative quotes for one decision, and count each decision once. For mutually exclusive offers with a stated chance of winning and a conditional mix, multiply each amount by both probabilities and add them; if only a range is known, show the range and leave the group expectation unresolved.\n4. For independent opportunities, the weighted value is value times recorded probability. Zero is a recorded probability. Keep blank probabilities visible and out of the weighted total.\n5. Flag open deals whose close date has already passed, or whose probability looks out of line with its stage, for the owner to update. If historical win rates by stage are available, compare them with the recorded probabilities.\n6. Report the weighted subtotal as expected bookings for known probabilities, beside the gross open value. It does not forecast invoicing or cash receipts. Keep currencies separate unless an exchange-rate policy is supplied.\n\n## Checks before you deliver\n\n- A blank probability can hide a material deal; converting it to zero masks the uncertainty.\n- A high probability has no effect on the forecast for this period if the expected close is outside it.\n- Adding both alternative quotes for one decision counts the opportunity twice.\n- Using a superseded revision of an opportunity instead of the latest one at the cut-off.\n- Presenting weighted bookings as revenue or cash for the period.\n\n## How to present the result\n\nLead with the weighted expected bookings for the period and the gross open value beside it. Then give a table: opportunity, stage, close date, value, probability and weighted value. List incomplete deals separately with the missing field and the value at stake, and note what was excluded: won, lost, outside the period and superseded revisions.\n\n## Worked example\n\n**Request:** Forecast open May bookings as of May 1.\n\n**Supplied material:**\n\n```text\nAll GBP, 2026. A open 1000 80% close May 15; B open 2000 probability blank close May 28; C won 500 close May 1; D open 300 20% close June 1; E open 80 25% close unknown.\n```\n\n**Answer:** May has \u00a33,000 in open deals with qualifying close dates. A contributes \u00a3800 to the weighted forecast. B\u2019s \u00a32,000 is in the open total but has no probability. Obtain E\u2019s close date before including its \u00a380 in May. C is won and D closes in June.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nFor one currency return open_value (all qualifying open deals), weighted_known (sum for known probabilities, rounded to two decimals), incomplete as sorted open IDs with missing date or missing in-period probability, and included as sorted open in-period IDs. Exclude both won and lost by default. For explicitly exclusive offers, use the highest bookable alternative for that group in open_value as the gross ceiling, return open_value_basis as the literal highest-bookable-alternative, retain alternative IDs in included, and add alternative_weights keyed by offer for known unconditional probabilities (fractions).\n\n## Sources\n\n- [Odoo \u00b7 Expected revenue report](https:\/\/www.odoo.com\/documentation\/19.0\/applications\/sales\/crm\/performance\/expected_revenue_report.html): Odoo's expected revenue report compiles active leads that have an expected closing date within a chosen time frame. The skill selects the period's opportunities the same way.\n- [Odoo \u00b7 Forecast report](https:\/\/www.odoo.com\/documentation\/19.0\/applications\/sales\/crm\/performance\/forecast_report.html): Odoo calculates prorated revenue as expected revenue multiplied by probability and groups opportunities by the month of their expected closing date. This is the weighting the skill uses.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/forecast-weighted-sales-pipeline\n","scope":"contextual","trigger_keywords":["Forecast a weighted sales pipeline","forecast-weighted-sales-pipeline","forecast weighted sales pipeline","What is our weighted sales pipeline for this quarter?","What is our weighted sales pipeline for this quarter","weighted sales pipeline","probability-weighted pipeline","weight these sales opportunities"],"is_private":true,"is_active":true,"scripts":[{"name":"forecast-weighted-sales-pipeline-check","description":"Compare a saved JSON answer with a published test. Pass tests\/case-1\/expected.json (or another case) and the path to your answer.","language":"python","filename":"forecast-weighted-sales-pipeline-check.py","content":"from pathlib import Path\nimport runpy\n\nrunpy.run_path(str(Path(__file__).parent \/ 'tests' \/ 'check.py'), run_name='__main__')\n","supporting_files":[{"path":"SKILL.md","content":"---\nname: forecast-weighted-sales-pipeline\ndescription: \"Forecast expected bookings for a period from open CRM opportunities by weighting each value by its probability, while keeping missing close dates, blank probabilities and alternative quotes visible. Use when asked for a weighted pipeline, sales forecast or expected revenue from deals.\"\nlicense: CC-BY-4.0\nmetadata:\n  author: Raq.com\n  version: \"2026-11-22\"\n  homepage: https:\/\/skills.raq.com\/skills\/forecast-weighted-sales-pipeline\n---\n\n# Forecast a weighted sales pipeline\n\nBuild an expected bookings figure from open opportunities while exposing missing close dates and probabilities.\n\n## When to use this skill\n\n- A sales manager needs this month's or this quarter's weighted pipeline from the CRM.\n- Some deals have no probability or close date and the forecast must show them, not hide them.\n- One customer has been offered alternative packages and can only buy one.\n\n## When not to use it\n\n- Revenue recognition or financial statements. Weighted bookings are not revenue.\n- Forecasting when cash arrives. Use the cash shortfall forecast skill.\n- Setting sales targets or calculating commission.\n\n## What you need\n\n- CRM opportunities with ID, stage, value, currency, probability, expected closing date and revision date\n- Forecast period, as-of date, and treatment of closed orders\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Which period and as-of date, and should won deals be included?\n- Where do the probabilities come from: stage defaults or each salesperson's judgement?\n- Are any opportunities alternative quotes for the same customer decision?\n- Is everything in one currency, and if not, which exchange-rate policy applies?\n\n## Method\n\n1. Select open opportunities whose expected close date falls in the agreed window. Exclude won and lost opportunities unless the request asks for them. List open deals with no close date separately, because they cannot be placed in a period.\n2. Remove duplicate exports of the same opportunity ID, using the latest dated revision as of the cut-off. Conflicting undated versions need clarification.\n3. Separate genuinely separate sales from alternative quotes for one decision, and count each decision once. For mutually exclusive offers with a stated chance of winning and a conditional mix, multiply each amount by both probabilities and add them; if only a range is known, show the range and leave the group expectation unresolved.\n4. For independent opportunities, the weighted value is value times recorded probability. Zero is a recorded probability. Keep blank probabilities visible and out of the weighted total.\n5. Flag open deals whose close date has already passed, or whose probability looks out of line with its stage, for the owner to update. If historical win rates by stage are available, compare them with the recorded probabilities.\n6. Report the weighted subtotal as expected bookings for known probabilities, beside the gross open value. It does not forecast invoicing or cash receipts. Keep currencies separate unless an exchange-rate policy is supplied.\n\n## Checks before you deliver\n\n- A blank probability can hide a material deal; converting it to zero masks the uncertainty.\n- A high probability has no effect on the forecast for this period if the expected close is outside it.\n- Adding both alternative quotes for one decision counts the opportunity twice.\n- Using a superseded revision of an opportunity instead of the latest one at the cut-off.\n- Presenting weighted bookings as revenue or cash for the period.\n\n## How to present the result\n\nLead with the weighted expected bookings for the period and the gross open value beside it. Then give a table: opportunity, stage, close date, value, probability and weighted value. List incomplete deals separately with the missing field and the value at stake, and note what was excluded: won, lost, outside the period and superseded revisions.\n\n## Worked example\n\n**Request:** Forecast open May bookings as of May 1.\n\n**Supplied material:**\n\n```text\nAll GBP, 2026. A open 1000 80% close May 15; B open 2000 probability blank close May 28; C won 500 close May 1; D open 300 20% close June 1; E open 80 25% close unknown.\n```\n\n**Answer:** May has \u00a33,000 in open deals with qualifying close dates. A contributes \u00a3800 to the weighted forecast. B\u2019s \u00a32,000 is in the open total but has no probability. Obtain E\u2019s close date before including its \u00a380 in May. C is won and D closes in June.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nFor one currency return open_value (all qualifying open deals), weighted_known (sum for known probabilities, rounded to two decimals), incomplete as sorted open IDs with missing date or missing in-period probability, and included as sorted open in-period IDs. Exclude both won and lost by default. For explicitly exclusive offers, use the highest bookable alternative for that group in open_value as the gross ceiling, return open_value_basis as the literal highest-bookable-alternative, retain alternative IDs in included, and add alternative_weights keyed by offer for known unconditional probabilities (fractions).\n\n## Sources\n\n- [Odoo \u00b7 Expected revenue report](https:\/\/www.odoo.com\/documentation\/19.0\/applications\/sales\/crm\/performance\/expected_revenue_report.html): Odoo's expected revenue report compiles active leads that have an expected closing date within a chosen time frame. The skill selects the period's opportunities the same way.\n- [Odoo \u00b7 Forecast report](https:\/\/www.odoo.com\/documentation\/19.0\/applications\/sales\/crm\/performance\/forecast_report.html): Odoo calculates prorated revenue as expected revenue multiplied by probability and groups opportunities by the month of their expected closing date. This is the weighting the skill uses.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/forecast-weighted-sales-pipeline\n"},{"path":"LICENSE.txt","content":"Original Raq.com instructions and synthetic examples: CC BY 4.0.\nhttps:\/\/creativecommons.org\/licenses\/by\/4.0\/\nAttribution: Raq.com, https:\/\/skills.raq.com\/skills\/forecast-weighted-sales-pipeline\nReferenced third-party materials retain their own terms.\n"},{"path":"examples\/worked-example.md","content":"# Missing probability on a large deal\n\nForecast open May bookings as of May 1.\n\n## Supplied material\n\nAll GBP, 2026. A open 1000 80% close May 15; B open 2000 probability blank close May 28; C won 500 close May 1; D open 300 20% close June 1; E open 80 25% close unknown.\n\n## Worked answer\n\nMay has \u00a33,000 in open deals with qualifying close dates. A contributes \u00a3800 to the weighted forecast. B\u2019s \u00a32,000 is in the open total but has no probability. Obtain E\u2019s close date before including its \u00a380 in May. C is won and D closes in June.\n\n## Reasoning\n\nThe unknown probability stays visible in the \u00a33,000 gross pipeline.\n"},{"path":"tests\/check.py","content":"\"\"\"Check a saved agent answer locally with Python 3 (standard library only).\"\"\"\nimport json\nimport math\nimport sys\nfrom pathlib import Path\n\n\ndef compare(expected, actual, path=\"$\", accepted=None):\n    if isinstance(expected, bool) or isinstance(actual, bool):\n        if expected is not actual:\n            yield path\n    elif isinstance(expected, (int, float)) and isinstance(actual, (int, float)):\n        if not math.isclose(expected, actual, rel_tol=0, abs_tol=1e-8):\n            yield path\n    elif isinstance(expected, dict) and isinstance(actual, dict):\n        for key in sorted(set(expected) | set(actual)):\n            if key not in expected or key not in actual:\n                yield f\"{path}.{key}\"\n            elif not any(\n                not list(compare(option, actual[key]))\n                for option in (accepted or {}).get(key, [])\n            ):\n                yield from compare(expected[key], actual[key], f\"{path}.{key}\")\n    elif isinstance(expected, list) and isinstance(actual, list):\n        if len(expected) != len(actual):\n            yield f\"{path} (length)\"\n        for i, (left, right) in enumerate(zip(expected, actual)):\n            yield from compare(left, right, f\"{path}[{i}]\")\n    elif type(expected) != type(actual) or expected != actual:\n        yield path\n\n\ndef main():\n    if len(sys.argv) != 3:\n        raise SystemExit(\"Usage: python3 check.py expected.json answer.json\")\n    try:\n        expected, actual = [json.loads(Path(p).read_text(encoding=\"utf-8\")) for p in sys.argv[1:]]\n        alternatives = Path(sys.argv[1]).with_name(\"accepted.json\")\n        accepted = json.loads(alternatives.read_text(encoding=\"utf-8\")) if alternatives.is_file() else {}\n    except (ValueError, OSError) as error:\n        raise SystemExit(str(error))\n    differences = list(compare(expected, actual, accepted=accepted))\n    if differences:\n        raise SystemExit(\"Different fields: \" + \", \".join(differences))\n    print(\"Pass\")\n\n\nif __name__ == \"__main__\":\n    main()\n"},{"path":"tests\/README.md","content":"Give your agent SKILL.md and one request.txt in a fresh session. Keep the expected answer aside. Save the reply as answer.json, then run this from the tests folder:\n\n    python3 check.py case-1\/expected.json answer.json\n\nEach case also has an explanation. Where accepted.json exists, the checker accepts the alternatives listed there.\n"},{"path":"tests\/case-1\/request.txt","content":"Forecast open May bookings as of May 1.\nReturn only the JSON specified in SKILL.md for this test.\n\nAll GBP, 2026. A open 1000 80% close May 15; B open 2000 probability blank close May 28; C won 500 close May 1; D open 300 20% close June 1; E open 80 25% close unknown.\n"},{"path":"tests\/case-1\/expected.json","content":"{\n    \"open_value\": 3000,\n    \"weighted_known\": 800,\n    \"incomplete\": [\n        \"B\",\n        \"E\"\n    ],\n    \"included\": [\n        \"A\",\n        \"B\"\n    ]\n}\n"},{"path":"tests\/case-1\/explanation.txt","content":"The unknown probability stays visible in the \u00a33,000 gross pipeline.\n"},{"path":"tests\/case-2\/request.txt","content":"Forecast July open bookings at end of June.\nReturn only the JSON specified in SKILL.md for this test.\n\nEUR, 2026. X revision Jun 1: open 800 at 30%, expected Jul 2. X revision Jun 28: open 900 at 50%, expected Jul 2. Y open 400 at 0%, expected Jul 15. Z lost 200 at 0%, close Jul 1.\n"},{"path":"tests\/case-2\/expected.json","content":"{\n    \"open_value\": 1300,\n    \"weighted_known\": 450,\n    \"incomplete\": [],\n    \"included\": [\n        \"X\",\n        \"Y\"\n    ]\n}\n"},{"path":"tests\/case-2\/explanation.txt","content":"The June revision supersedes the original, and zero is a recorded probability.\n"},{"path":"tests\/case-3\/request.txt","content":"What is the expected November booking and the highest single value from this opportunity?\nReturn only the JSON specified in SKILL.md for this test.\n\nGBP. CORE \u00a380,000 or PREMIUM \u00a3100,000; alternatives for the same open project, both close in November. Only one can win. Chance of winning the customer 50%; conditional on winning, 60% take CORE and 40% PREMIUM. No other deals.\n"},{"path":"tests\/case-3\/expected.json","content":"{\n    \"open_value\": 100000,\n    \"weighted_known\": 44000,\n    \"incomplete\": [],\n    \"included\": [\n        \"CORE\",\n        \"PREMIUM\"\n    ],\n    \"alternative_weights\": {\n        \"CORE\": 0.3,\n        \"PREMIUM\": 0.2\n    },\n    \"open_value_basis\": \"highest-bookable-alternative\"\n}\n"},{"path":"tests\/case-3\/explanation.txt","content":"The unconditional weights are 30% and 20%, giving \u00a324,000 plus \u00a320,000. Only one offer can book, so the gross ceiling is \u00a3100,000.\n"}],"is_active":true,"is_approved":false}]}]}