{"skills":[{"name":"Compare historical amounts in the same year\u2019s money","description":"Use one documented price-index series to put two amounts on the same purchasing-power basis.","content":"# Compare historical amounts in the same year\u2019s money\n\nUse one documented price-index series to put two amounts on the same purchasing-power basis.\n\n## When to use this skill\n\n- Someone wants to compare a budget, salary, grant or price from an earlier year with a recent one after inflation.\n- A report quotes historical amounts and the writer needs them in today's money or a stated base year.\n- Amounts have been adjusted with different indices or base years and someone wants to know whether the comparison holds.\n\n## When not to use it\n\n- Comparing living costs between places. An area price index measures change over time in that area, not price levels relative to other areas.\n- Contractual uprating such as rent reviews, pensions or index-linked payments. Use the index and method the contract or legislation names.\n- Forecasting future inflation or converting between currencies.\n\n## What you need\n\n- Nominal amounts and dates; index value for each period and the target period from the same series.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Which country and currency are the amounts in? UK work usually uses ONS CPIH or CPI and US work the BLS CPI-U, so ask rather than assume.\n- What period does each amount relate to (calendar year, financial year, a month), and which period should the results be in? Index values must match those periods.\n- Is a specialist index more suitable, such as an earnings index for wages or a construction cost index for building work? A general consumer index can be a poor proxy for a specific basket.\n\n## Method\n\n1. Confirm the country, currency and purpose, and choose one published series that suits it. Record its identifier, geography, coverage and frequency. In the UK, ONS publishes CPIH, its lead measure, and CPI, both referenced to 2015 = 100. In the US, BLS publishes CPI-U.\n2. Take every index value, including the target period's, from that one series. Match each amount's period: an annual average for a calendar-year amount, the relevant month for a monthly price. Use indexes that are not seasonally adjusted for comparisons across years.\n3. If the supplied index values come from different series or reference bases, look for a published linked series or conversion factor from the same publisher. If none is supplied, do not divide one series by another: leave that conversion unknown.\n4. Convert each amount: amount \u00d7 (target-period index \u00f7 index for the amount's period). Keep full precision until the final display.\n5. Report each converted amount, the real difference (last minus first) and, if helpful, the real percentage change. Label the unit precisely, for example '2025 prices, ONS CPIH'.\n6. Say what the index measures: the average change in prices of goods and services bought by households. It does not describe any one household's or organisation's costs and may misstate a specialist basket.\n\n## Checks before you deliver\n\n- Multiplying by the price change a second time double-counts inflation.\n- Index points from two incompatible series cannot be divided even when both happened to start at 100.\n- Using a December index for an annual budget, or an annual average for one month's price, mismatches the periods.\n- Treating a city or regional index as a comparison of price levels between places. BLS says an area index measures change in that area only.\n- Using RPI for a general UK comparison. ONS says RPI does not meet the standard for accredited official statistics and still publishes it mainly because long-term contracts depend on it.\n\n## How to present the result\n\nStart with the answer in plain terms: whether the later amount is higher or lower in real terms, and by how much in the target period's money. Then a short table with each amount, its date, the index value used and the converted amount, naming the series. Finish with one sentence on what the index measures and any limit on the comparison.\n\n## Worked example\n\n**Request:** Compare in 2025 dollars.\n\n**Supplied material:**\n\n```text\nSeries City-A: 2015 index 100, 2025 index 125. Budget 2015 $800; budget 2025 $1000. Target 2025, City-A.\n```\n\n**Answer:** Both budgets equal $1,000 in 2025 City-A dollars. The 2015 budget converts as $800 \u00d7 125 \u00f7 100. The nominal $200 increase produces a $0 change in purchasing power on this index.\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\nReturn converted as amounts in input order rounded to two decimals or null for incompatible inputs; difference equals last minus first, or null if either is missing.\n\n## Sources\n\n- [US Bureau of Labor Statistics: purchasing power and constant dollars](https:\/\/www.bls.gov\/cpi\/factsheets\/purchasing-power-constant-dollars.htm): Shows constant-dollar conversion as the amount multiplied by the ratio of the later index to the earlier index, with a worked CPI-U example, and shows that the chosen base period changes the constant-dollar figures.\n- [US Bureau of Labor Statistics: CPI questions and answers](https:\/\/www.bls.gov\/cpi\/questions-and-answers.htm): States that an individual area index measures price change in that area and cannot be used to compare living costs between areas, and recommends indexes that are not seasonally adjusted for escalation.\n- [Office for National Statistics: consumer price inflation quality and methodology information](https:\/\/www.ons.gov.uk\/economy\/inflationandpriceindices\/methodologies\/consumerpriceinflationincludesall3indicescpihcpiandrpiqmi): For UK work: CPIH is the ONS lead inflation index, CPI and CPIH are referenced to 2015 = 100 and measure average price change for consumer goods and services across the UK, and RPI does not meet the standard for accredited official statistics.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/constant-price-comparison\n","scope":"contextual","trigger_keywords":["Compare historical amounts in the same year\u2019s money","constant-price-comparison","constant price comparison","What would a \u00a320,000 salary in 2005 be worth in today\u2019s money?","What would a \u00a320,000 salary in 2005 be worth in today\u2019s money","constant dollars","inflation-adjusted comparison","in today's money"],"is_private":true,"is_active":true,"scripts":[{"name":"constant-price-comparison-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":"constant-price-comparison-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: constant-price-comparison\ndescription: \"Convert money amounts from different years into one year's prices with a single price index, such as CPIH, CPI or CPI-U, and report the real change. Use when someone asks what a past price, salary, budget or grant is worth in today's money, or whether spending rose after inflation.\"\nlicense: CC-BY-4.0\nmetadata:\n  author: Raq.com\n  version: \"2026-11-22\"\n  homepage: https:\/\/skills.raq.com\/skills\/constant-price-comparison\n---\n\n# Compare historical amounts in the same year\u2019s money\n\nUse one documented price-index series to put two amounts on the same purchasing-power basis.\n\n## When to use this skill\n\n- Someone wants to compare a budget, salary, grant or price from an earlier year with a recent one after inflation.\n- A report quotes historical amounts and the writer needs them in today's money or a stated base year.\n- Amounts have been adjusted with different indices or base years and someone wants to know whether the comparison holds.\n\n## When not to use it\n\n- Comparing living costs between places. An area price index measures change over time in that area, not price levels relative to other areas.\n- Contractual uprating such as rent reviews, pensions or index-linked payments. Use the index and method the contract or legislation names.\n- Forecasting future inflation or converting between currencies.\n\n## What you need\n\n- Nominal amounts and dates; index value for each period and the target period from the same series.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Which country and currency are the amounts in? UK work usually uses ONS CPIH or CPI and US work the BLS CPI-U, so ask rather than assume.\n- What period does each amount relate to (calendar year, financial year, a month), and which period should the results be in? Index values must match those periods.\n- Is a specialist index more suitable, such as an earnings index for wages or a construction cost index for building work? A general consumer index can be a poor proxy for a specific basket.\n\n## Method\n\n1. Confirm the country, currency and purpose, and choose one published series that suits it. Record its identifier, geography, coverage and frequency. In the UK, ONS publishes CPIH, its lead measure, and CPI, both referenced to 2015 = 100. In the US, BLS publishes CPI-U.\n2. Take every index value, including the target period's, from that one series. Match each amount's period: an annual average for a calendar-year amount, the relevant month for a monthly price. Use indexes that are not seasonally adjusted for comparisons across years.\n3. If the supplied index values come from different series or reference bases, look for a published linked series or conversion factor from the same publisher. If none is supplied, do not divide one series by another: leave that conversion unknown.\n4. Convert each amount: amount \u00d7 (target-period index \u00f7 index for the amount's period). Keep full precision until the final display.\n5. Report each converted amount, the real difference (last minus first) and, if helpful, the real percentage change. Label the unit precisely, for example '2025 prices, ONS CPIH'.\n6. Say what the index measures: the average change in prices of goods and services bought by households. It does not describe any one household's or organisation's costs and may misstate a specialist basket.\n\n## Checks before you deliver\n\n- Multiplying by the price change a second time double-counts inflation.\n- Index points from two incompatible series cannot be divided even when both happened to start at 100.\n- Using a December index for an annual budget, or an annual average for one month's price, mismatches the periods.\n- Treating a city or regional index as a comparison of price levels between places. BLS says an area index measures change in that area only.\n- Using RPI for a general UK comparison. ONS says RPI does not meet the standard for accredited official statistics and still publishes it mainly because long-term contracts depend on it.\n\n## How to present the result\n\nStart with the answer in plain terms: whether the later amount is higher or lower in real terms, and by how much in the target period's money. Then a short table with each amount, its date, the index value used and the converted amount, naming the series. Finish with one sentence on what the index measures and any limit on the comparison.\n\n## Worked example\n\n**Request:** Compare in 2025 dollars.\n\n**Supplied material:**\n\n```text\nSeries City-A: 2015 index 100, 2025 index 125. Budget 2015 $800; budget 2025 $1000. Target 2025, City-A.\n```\n\n**Answer:** Both budgets equal $1,000 in 2025 City-A dollars. The 2015 budget converts as $800 \u00d7 125 \u00f7 100. The nominal $200 increase produces a $0 change in purchasing power on this index.\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\nReturn converted as amounts in input order rounded to two decimals or null for incompatible inputs; difference equals last minus first, or null if either is missing.\n\n## Sources\n\n- [US Bureau of Labor Statistics: purchasing power and constant dollars](https:\/\/www.bls.gov\/cpi\/factsheets\/purchasing-power-constant-dollars.htm): Shows constant-dollar conversion as the amount multiplied by the ratio of the later index to the earlier index, with a worked CPI-U example, and shows that the chosen base period changes the constant-dollar figures.\n- [US Bureau of Labor Statistics: CPI questions and answers](https:\/\/www.bls.gov\/cpi\/questions-and-answers.htm): States that an individual area index measures price change in that area and cannot be used to compare living costs between areas, and recommends indexes that are not seasonally adjusted for escalation.\n- [Office for National Statistics: consumer price inflation quality and methodology information](https:\/\/www.ons.gov.uk\/economy\/inflationandpriceindices\/methodologies\/consumerpriceinflationincludesall3indicescpihcpiandrpiqmi): For UK work: CPIH is the ONS lead inflation index, CPI and CPIH are referenced to 2015 = 100 and measure average price change for consumer goods and services across the UK, and RPI does not meet the standard for accredited official statistics.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/constant-price-comparison\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\/constant-price-comparison\nReferenced third-party materials retain their own terms.\n"},{"path":"examples\/worked-example.md","content":"# An unchanged real budget\n\nCompare in 2025 dollars.\n\n## Supplied material\n\nSeries City-A: 2015 index 100, 2025 index 125. Budget 2015 $800; budget 2025 $1000. Target 2025, City-A.\n\n## Worked answer\n\nBoth budgets equal $1,000 in 2025 City-A dollars. The 2015 budget converts as $800 \u00d7 125 \u00f7 100. The nominal $200 increase produces a $0 change in purchasing power on this index.\n\n## Reasoning\n\nThe extra $200 exactly offsets the index movement.\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":"Compare in 2025 dollars.\nReturn only the JSON specified in SKILL.md for this test.\n\nSeries City-A: 2015 index 100, 2025 index 125. Budget 2015 $800; budget 2025 $1000. Target 2025, City-A.\n"},{"path":"tests\/case-1\/expected.json","content":"{\n    \"converted\": [\n        1000,\n        1000\n    ],\n    \"difference\": 0\n}\n"},{"path":"tests\/case-1\/explanation.txt","content":"The extra $200 exactly offsets the index movement.\n"},{"path":"tests\/case-2\/request.txt","content":"Can I compare these in target dollars?\nReturn only the JSON specified in SKILL.md for this test.\n\nTarget Metro-A index 150. First $600 with Metro-A index 120. Second $700 with Rural-B index 140. No bridge.\n"},{"path":"tests\/case-2\/expected.json","content":"{\n    \"converted\": [\n        750,\n        null\n    ],\n    \"difference\": null\n}\n"},{"path":"tests\/case-2\/explanation.txt","content":"Only the first amount has a compatible denominator.\n"}],"is_active":true,"is_approved":false}]}]}