{"skills":[{"name":"Reconcile a systematic review\u2019s flow counts","description":"Follow records through screening, retrieval and inclusion, and locate the first inconsistent count in the review diagram.","content":"# Reconcile a systematic review\u2019s flow counts\n\nFollow records through screening, retrieval and inclusion, and locate the first inconsistent count in the review diagram.\n\n## When to use this skill\n\n- Someone is finalising a systematic or scoping review and wants the PRISMA flow diagram checked before submission.\n- A peer reviewer or editor has said the flow diagram numbers do not add up.\n- The number of included studies differs from the number of included reports and someone needs to know which figure is right.\n\n## When not to use it\n\n- Judging whether individual screening decisions were correct. Use the abstract screening skill or a second reviewer.\n- Drawing the diagram. PRISMA provides templates and a diagram app; this skill checks the numbers that go into it.\n- Reporting the search strategies. Use the search strategy log skill for PRISMA-S items.\n\n## What you need\n\n- PRISMA flow counts, exclusion reasons and the mapping from included reports to individual studies.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Is this a new review or an update, and does the diagram include other sources such as websites and citation searching as well as databases and registers? PRISMA 2020 has a template for each case.\n- Can you share the screening log or reference manager counts behind each box? A mismatch is fixed from the log, not by adjusting the diagram.\n- Do you have the mapping from included reports to studies, such as trial registration numbers?\n\n## Method\n\n1. Identify the template: new or updated review, databases and registers only or with other sources. Work one branch at a time and keep the other-sources branch separate.\n2. List every box with its unit. Records are identified, removed before screening, screened and excluded. Reports are sought, not retrieved, assessed and excluded with reasons. Studies are included.\n3. Reconcile in order, each time using the previous stage's reported figure: identified minus removals before screening equals screened; screened minus excluded equals reports sought; sought minus not retrieved equals assessed; assessed minus full-text exclusions equals included reports. Subtract each documented removal once.\n4. Check that the full-text exclusion reasons add up to the number of reports excluded, and that reports never retrieved are kept apart from reports excluded after assessment.\n5. Count distinct study IDs in the report-to-study mapping, independently of the diagram, and compare with the studies box. Two reports of one trial are two reports but one study.\n6. Name the first box that disagrees and show the arithmetic. Ask for the underlying log rather than inventing exclusions to balance the chart, and do not adjust later boxes until the first error is resolved, because they may already reflect the fix.\n\n## Checks before you deliver\n\n- Two publications on one trial can be two reports but one study.\n- Reports never retrieved are separate from reports excluded after assessment.\n- Treating a conference abstract and a journal article about the same study as duplicate records. They are separate reports.\n- Exclusion reasons that sum to more than the excluded total because some reports were given several reasons. Give one primary reason per report, or say that reasons overlap.\n- Forgetting records removed before screening for reasons other than duplication, such as automation tools, which PRISMA 2020 records in their own box.\n\n## How to present the result\n\nStart with the result: either 'all counts reconcile' or the first box that does not, with the arithmetic that shows it. Then a table of each box with its reported count, the count expected from the previous stage and whether they match. Finish with corrected figures where the log supports them, and the specific questions for the screening log where it does not.\n\n## Worked example\n\n**Request:** Check this single-branch flow.\n\n**Supplied material:**\n\n```text\nIdentified 30; duplicates 5; screened 25; screen exclusions 17; sought 8; unavailable 2; assessed 6; full-text exclusions 3; included reports 3. Mapping: R1\/A, R2\/A, R3\/B. Labelled studies: 3.\n```\n\n**Answer:** Change the final studies box from 3 to 2. Keep 3 included reports: R1 and R2 both describe A, and R3 describes B. The earlier counts reconcile, including the two reports that could not be retrieved.\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 first_mismatch as screened, sought, assessed, included, studies, or null. Return distinct_studies as the number of distinct study IDs in the supplied complete mapping, or null if the mapping is absent.\n\n## Sources\n\n- [PRISMA 2020 flow diagram](https:\/\/www.prisma-statement.org\/prisma-2020-flow-diagram): The official templates for new and updated reviews, with and without other sources, tracking records identified, screened and excluded with reasons through to included studies.\n- [PRISMA 2020 statement (Page et al., BMJ 2021)](https:\/\/pmc.ncbi.nlm.nih.gov\/articles\/PMC8005924\/): Item 16a asks for the number of records identified through to the number of studies included, ideally in a flow diagram. Box 1 defines records, reports and studies and notes that one study may have several reports.\n- [Cochrane Handbook, chapter 4: Searching for and selecting studies](https:\/\/www.cochrane.org\/authors\/handbooks-and-manuals\/handbook\/current\/chapter-04): Section 4.6.1 makes the study, not the report, the unit of interest, and 4.6.4 says the first criterion a study fails can be its primary reason for exclusion, with at least one explicit reason documented for each excluded study.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/review-flow-reconciliation\n","scope":"contextual","trigger_keywords":["Reconcile a systematic review\u2019s flow counts","review-flow-reconciliation","review flow reconciliation","Do the numbers in my PRISMA flow diagram add up?","Do the numbers in my PRISMA flow diagram add up","prisma figure","prisma flow counts","check my prisma diagram"],"is_private":true,"is_active":true,"scripts":[{"name":"review-flow-reconciliation-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":"review-flow-reconciliation-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: review-flow-reconciliation\ndescription: \"Reconcile the counts in a PRISMA 2020 flow diagram stage by stage, keep reports and studies apart, and find the first box that does not add up. Use when someone drafting or reviewing a systematic review wants its flow diagram numbers checked against the screening log.\"\nlicense: CC-BY-4.0\nmetadata:\n  author: Raq.com\n  version: \"2026-11-22\"\n  homepage: https:\/\/skills.raq.com\/skills\/review-flow-reconciliation\n---\n\n# Reconcile a systematic review\u2019s flow counts\n\nFollow records through screening, retrieval and inclusion, and locate the first inconsistent count in the review diagram.\n\n## When to use this skill\n\n- Someone is finalising a systematic or scoping review and wants the PRISMA flow diagram checked before submission.\n- A peer reviewer or editor has said the flow diagram numbers do not add up.\n- The number of included studies differs from the number of included reports and someone needs to know which figure is right.\n\n## When not to use it\n\n- Judging whether individual screening decisions were correct. Use the abstract screening skill or a second reviewer.\n- Drawing the diagram. PRISMA provides templates and a diagram app; this skill checks the numbers that go into it.\n- Reporting the search strategies. Use the search strategy log skill for PRISMA-S items.\n\n## What you need\n\n- PRISMA flow counts, exclusion reasons and the mapping from included reports to individual studies.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Is this a new review or an update, and does the diagram include other sources such as websites and citation searching as well as databases and registers? PRISMA 2020 has a template for each case.\n- Can you share the screening log or reference manager counts behind each box? A mismatch is fixed from the log, not by adjusting the diagram.\n- Do you have the mapping from included reports to studies, such as trial registration numbers?\n\n## Method\n\n1. Identify the template: new or updated review, databases and registers only or with other sources. Work one branch at a time and keep the other-sources branch separate.\n2. List every box with its unit. Records are identified, removed before screening, screened and excluded. Reports are sought, not retrieved, assessed and excluded with reasons. Studies are included.\n3. Reconcile in order, each time using the previous stage's reported figure: identified minus removals before screening equals screened; screened minus excluded equals reports sought; sought minus not retrieved equals assessed; assessed minus full-text exclusions equals included reports. Subtract each documented removal once.\n4. Check that the full-text exclusion reasons add up to the number of reports excluded, and that reports never retrieved are kept apart from reports excluded after assessment.\n5. Count distinct study IDs in the report-to-study mapping, independently of the diagram, and compare with the studies box. Two reports of one trial are two reports but one study.\n6. Name the first box that disagrees and show the arithmetic. Ask for the underlying log rather than inventing exclusions to balance the chart, and do not adjust later boxes until the first error is resolved, because they may already reflect the fix.\n\n## Checks before you deliver\n\n- Two publications on one trial can be two reports but one study.\n- Reports never retrieved are separate from reports excluded after assessment.\n- Treating a conference abstract and a journal article about the same study as duplicate records. They are separate reports.\n- Exclusion reasons that sum to more than the excluded total because some reports were given several reasons. Give one primary reason per report, or say that reasons overlap.\n- Forgetting records removed before screening for reasons other than duplication, such as automation tools, which PRISMA 2020 records in their own box.\n\n## How to present the result\n\nStart with the result: either 'all counts reconcile' or the first box that does not, with the arithmetic that shows it. Then a table of each box with its reported count, the count expected from the previous stage and whether they match. Finish with corrected figures where the log supports them, and the specific questions for the screening log where it does not.\n\n## Worked example\n\n**Request:** Check this single-branch flow.\n\n**Supplied material:**\n\n```text\nIdentified 30; duplicates 5; screened 25; screen exclusions 17; sought 8; unavailable 2; assessed 6; full-text exclusions 3; included reports 3. Mapping: R1\/A, R2\/A, R3\/B. Labelled studies: 3.\n```\n\n**Answer:** Change the final studies box from 3 to 2. Keep 3 included reports: R1 and R2 both describe A, and R3 describes B. The earlier counts reconcile, including the two reports that could not be retrieved.\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 first_mismatch as screened, sought, assessed, included, studies, or null. Return distinct_studies as the number of distinct study IDs in the supplied complete mapping, or null if the mapping is absent.\n\n## Sources\n\n- [PRISMA 2020 flow diagram](https:\/\/www.prisma-statement.org\/prisma-2020-flow-diagram): The official templates for new and updated reviews, with and without other sources, tracking records identified, screened and excluded with reasons through to included studies.\n- [PRISMA 2020 statement (Page et al., BMJ 2021)](https:\/\/pmc.ncbi.nlm.nih.gov\/articles\/PMC8005924\/): Item 16a asks for the number of records identified through to the number of studies included, ideally in a flow diagram. Box 1 defines records, reports and studies and notes that one study may have several reports.\n- [Cochrane Handbook, chapter 4: Searching for and selecting studies](https:\/\/www.cochrane.org\/authors\/handbooks-and-manuals\/handbook\/current\/chapter-04): Section 4.6.1 makes the study, not the report, the unit of interest, and 4.6.4 says the first criterion a study fails can be its primary reason for exclusion, with at least one explicit reason documented for each excluded study.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/review-flow-reconciliation\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\/review-flow-reconciliation\nReferenced third-party materials retain their own terms.\n"},{"path":"examples\/worked-example.md","content":"# Reports versus studies\n\nCheck this single-branch flow.\n\n## Supplied material\n\nIdentified 30; duplicates 5; screened 25; screen exclusions 17; sought 8; unavailable 2; assessed 6; full-text exclusions 3; included reports 3. Mapping: R1\/A, R2\/A, R3\/B. Labelled studies: 3.\n\n## Worked answer\n\nChange the final studies box from 3 to 2. Keep 3 included reports: R1 and R2 both describe A, and R3 describes B. The earlier counts reconcile, including the two reports that could not be retrieved.\n\n## Reasoning\n\nThe article counts reconcile. Two reports describe study A.\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":"Check this single-branch flow.\nReturn only the JSON specified in SKILL.md for this test.\n\nIdentified 30; duplicates 5; screened 25; screen exclusions 17; sought 8; unavailable 2; assessed 6; full-text exclusions 3; included reports 3. Mapping: R1\/A, R2\/A, R3\/B. Labelled studies: 3.\n"},{"path":"tests\/case-1\/expected.json","content":"{\n    \"first_mismatch\": \"studies\",\n    \"distinct_studies\": 2\n}\n"},{"path":"tests\/case-1\/explanation.txt","content":"The article counts reconcile. Two reports describe study A.\n"},{"path":"tests\/case-2\/request.txt","content":"Locate the earliest error.\nReturn only the JSON specified in SKILL.md for this test.\n\nIdentified 100; duplicates 10; screened 95; screen exclusions 90; sought 5; unavailable 0; assessed 5; full-text exclusions 4; included 1. Mapping absent.\n"},{"path":"tests\/case-2\/expected.json","content":"{\n    \"first_mismatch\": \"screened\",\n    \"distinct_studies\": null\n}\n"},{"path":"tests\/case-2\/explanation.txt","content":"100 minus 10 gives 90, before the later figures are considered.\n"}],"is_active":true,"is_approved":false}]}]}