{"skills":[{"name":"Find gaps in a trip\u2019s overnight bookings","description":"Compare every night you need a bed with current hotel confirmations, overnight transport and explicit stays with friends.","content":"# Find gaps in a trip\u2019s overnight bookings\n\nCompare every night you need a bed with current hotel confirmations, overnight transport and explicit stays with friends.\n\n## When to use this skill\n\n- Someone has several hotel confirmations for a trip and wants to know if every night is covered.\n- Bookings have been amended or cancelled and the person is not sure which version stands.\n- A trip mixes hotels, a night train or overnight flight and nights with friends or family.\n\n## When not to use it\n\n- Booking, cancelling or changing reservations. The skill only reports gaps and overlaps.\n- Working out cancellation charges for a duplicate booking. Check each booking's terms.\n\n## What you need\n\n- Arrival and departure local dates, required overnight city or cities and the travellers needing cover.\n- Booking references, check-in and check-out dates, cancellation or amendment notices, and confirmed alternative accommodation.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Which nights do you need a bed, and in which city, from the night you arrive to the morning you leave?\n- Who needs to be covered? A booking for one traveller does not cover another.\n- Do you have the latest confirmation for each booking, including amendments and cancellations?\n\n## Method\n\n1. List the nights needed, one row per night, using the local date on which the night starts. Include the arrival night if a bed is needed and stop before the departure morning. Note the city and travellers for each night.\n2. Treat each hotel stay as covering nights from the check-in date up to, but not including, the check-out date. A stay from the 2nd to the 4th covers the nights of the 2nd and 3rd.\n3. Resolve each reservation to its latest active version by reference and date. An amendment replaces the original dates, a cancellation removes cover, and a repeated confirmation email is not a second room.\n4. Mark a night covered only when the arrangement matches the city and traveller. Count a confirmed overnight train, ferry or flight, or a host's confirmed stay, as cover for that night.\n5. List missing nights, and nights covered by two distinct valid arrangements, with dates and references. Back-to-back stays where one checks out and the next checks in on the same date do not overlap.\n6. Raise separately anything that could change the result, such as an unclear arrival date, an unknown city or a missing traveller name. Note that a late departure needs a late check-out, not an extra night.\n\n## Checks before you deliver\n\n- Back-to-back hotels with matching check-out and check-in dates do not overlap by a night.\n- The same night booked in another city leaves the intended city uncovered.\n- Counting both the original and the amended dates of one reservation.\n- Counting a cancelled booking as cover because its confirmation email is still in the inbox.\n- Reading 06\/07 as 6 July on a booking that uses month-first dates, which shifts every night.\n\n## How to present the result\n\nLead with the missing nights, if any, with the city and the check-in and check-out dates needed to fill each. Then show a night-by-night table: date, city, what covers it and the booking reference. List overlaps separately with both references so the person can decide which to cancel.\n\n## Worked example\n\n**Request:** Which nights are missing in Bath?\n\n**Supplied material:**\n\n```text\nBed needed in Bath each night from arrival 2026-06-02 to departure 2026-06-07. One traveller.\nRef H1 Bath check-in Jun 2, check-out Jun 4. Ref H2 Bath check-in Jun 5, check-out Jun 7.\n```\n\n**Answer:** You need a bed in Bath for the night of 4 June, checking out on 5 June. H1 covers the nights of 2 and 3 June. H2 covers 5 and 6 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 the required traveller and city schedule, return missing_nights and overlapping_nights as chronological arrays of ISO night-start dates. List a night under overlapping_nights only when two distinct valid arrangements cover it. Return an empty array when none overlap. Return covered_count as the number of distinct covered nights.\n\n## Sources\n\n- [Premier Inn: arrival and departure terms](https:\/\/www.premierinn.com\/content\/pi\/websites\/desktop\/gb\/en\/secured\/terms\/terms-uk.html): Premier Inn's UK terms set check-in from 3pm and require rooms to be vacated by 12pm on the day of departure. This is why a stay covers the nights from check-in up to, but not including, the check-out date. Each property's own confirmation controls its actual times.\n- [ABTA: vacating your room before a later transfer](https:\/\/www.abta.com\/help-and-complaints\/frequently-asked-questions\/ive-been-told-i-have-vacate-my-room-some-time): ABTA, the UK travel trade association, says it is standard international practice to let rooms from roughly midday to midday, and that more time on the last day usually means a paid late check-out. This supports counting nights by check-in date and treating a late flight as a late check-out, not an extra night.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/find-hotel-booking-gaps\n","scope":"contextual","trigger_keywords":["Find gaps in a trip\u2019s overnight bookings","find-hotel-booking-gaps","find hotel booking gaps","Do my hotel bookings cover every night of the trip?","Do my hotel bookings cover every night of the trip","missing hotel nights","hotel booking gaps","hotel night coverage"],"is_private":true,"is_active":true,"scripts":[{"name":"find-hotel-booking-gaps-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":"find-hotel-booking-gaps-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: find-hotel-booking-gaps\ndescription: \"Check every night of a trip against hotel confirmations, amendments, cancellations, overnight travel and stays with friends, and list the nights with no bed or with two arrangements. Use when someone asks whether any hotel nights are missing or double-booked on their trip.\"\nlicense: CC-BY-4.0\nmetadata:\n  author: Raq.com\n  version: \"2026-11-22\"\n  homepage: https:\/\/skills.raq.com\/skills\/find-hotel-booking-gaps\n---\n\n# Find gaps in a trip\u2019s overnight bookings\n\nCompare every night you need a bed with current hotel confirmations, overnight transport and explicit stays with friends.\n\n## When to use this skill\n\n- Someone has several hotel confirmations for a trip and wants to know if every night is covered.\n- Bookings have been amended or cancelled and the person is not sure which version stands.\n- A trip mixes hotels, a night train or overnight flight and nights with friends or family.\n\n## When not to use it\n\n- Booking, cancelling or changing reservations. The skill only reports gaps and overlaps.\n- Working out cancellation charges for a duplicate booking. Check each booking's terms.\n\n## What you need\n\n- Arrival and departure local dates, required overnight city or cities and the travellers needing cover.\n- Booking references, check-in and check-out dates, cancellation or amendment notices, and confirmed alternative accommodation.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Which nights do you need a bed, and in which city, from the night you arrive to the morning you leave?\n- Who needs to be covered? A booking for one traveller does not cover another.\n- Do you have the latest confirmation for each booking, including amendments and cancellations?\n\n## Method\n\n1. List the nights needed, one row per night, using the local date on which the night starts. Include the arrival night if a bed is needed and stop before the departure morning. Note the city and travellers for each night.\n2. Treat each hotel stay as covering nights from the check-in date up to, but not including, the check-out date. A stay from the 2nd to the 4th covers the nights of the 2nd and 3rd.\n3. Resolve each reservation to its latest active version by reference and date. An amendment replaces the original dates, a cancellation removes cover, and a repeated confirmation email is not a second room.\n4. Mark a night covered only when the arrangement matches the city and traveller. Count a confirmed overnight train, ferry or flight, or a host's confirmed stay, as cover for that night.\n5. List missing nights, and nights covered by two distinct valid arrangements, with dates and references. Back-to-back stays where one checks out and the next checks in on the same date do not overlap.\n6. Raise separately anything that could change the result, such as an unclear arrival date, an unknown city or a missing traveller name. Note that a late departure needs a late check-out, not an extra night.\n\n## Checks before you deliver\n\n- Back-to-back hotels with matching check-out and check-in dates do not overlap by a night.\n- The same night booked in another city leaves the intended city uncovered.\n- Counting both the original and the amended dates of one reservation.\n- Counting a cancelled booking as cover because its confirmation email is still in the inbox.\n- Reading 06\/07 as 6 July on a booking that uses month-first dates, which shifts every night.\n\n## How to present the result\n\nLead with the missing nights, if any, with the city and the check-in and check-out dates needed to fill each. Then show a night-by-night table: date, city, what covers it and the booking reference. List overlaps separately with both references so the person can decide which to cancel.\n\n## Worked example\n\n**Request:** Which nights are missing in Bath?\n\n**Supplied material:**\n\n```text\nBed needed in Bath each night from arrival 2026-06-02 to departure 2026-06-07. One traveller.\nRef H1 Bath check-in Jun 2, check-out Jun 4. Ref H2 Bath check-in Jun 5, check-out Jun 7.\n```\n\n**Answer:** You need a bed in Bath for the night of 4 June, checking out on 5 June. H1 covers the nights of 2 and 3 June. H2 covers 5 and 6 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 the required traveller and city schedule, return missing_nights and overlapping_nights as chronological arrays of ISO night-start dates. List a night under overlapping_nights only when two distinct valid arrangements cover it. Return an empty array when none overlap. Return covered_count as the number of distinct covered nights.\n\n## Sources\n\n- [Premier Inn: arrival and departure terms](https:\/\/www.premierinn.com\/content\/pi\/websites\/desktop\/gb\/en\/secured\/terms\/terms-uk.html): Premier Inn's UK terms set check-in from 3pm and require rooms to be vacated by 12pm on the day of departure. This is why a stay covers the nights from check-in up to, but not including, the check-out date. Each property's own confirmation controls its actual times.\n- [ABTA: vacating your room before a later transfer](https:\/\/www.abta.com\/help-and-complaints\/frequently-asked-questions\/ive-been-told-i-have-vacate-my-room-some-time): ABTA, the UK travel trade association, says it is standard international practice to let rooms from roughly midday to midday, and that more time on the last day usually means a paid late check-out. This supports counting nights by check-in date and treating a late flight as a late check-out, not an extra night.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/find-hotel-booking-gaps\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\/find-hotel-booking-gaps\nReferenced third-party materials retain their own terms.\n"},{"path":"examples\/worked-example.md","content":"# Two reservations with a missing night\n\nWhich nights are missing in Bath?\n\n## Supplied material\n\nBed needed in Bath each night from arrival 2026-06-02 to departure 2026-06-07. One traveller.\nRef H1 Bath check-in Jun 2, check-out Jun 4. Ref H2 Bath check-in Jun 5, check-out Jun 7.\n\n## Worked answer\n\nYou need a bed in Bath for the night of 4 June, checking out on 5 June. H1 covers the nights of 2 and 3 June. H2 covers 5 and 6 June.\n\n## Reasoning\n\nH1 covers the 2nd and 3rd. Its departure morning does not cover the night of the 4th.\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":"Which nights are missing in Bath?\nReturn only the JSON specified in SKILL.md for this test.\n\nBed needed in Bath each night from arrival 2026-06-02 to departure 2026-06-07. One traveller.\nRef H1 Bath check-in Jun 2, check-out Jun 4. Ref H2 Bath check-in Jun 5, check-out Jun 7.\n"},{"path":"tests\/case-1\/expected.json","content":"{\n    \"missing_nights\": [\n        \"2026-06-04\"\n    ],\n    \"overlapping_nights\": [],\n    \"covered_count\": 4\n}\n"},{"path":"tests\/case-1\/explanation.txt","content":"H1 covers the 2nd and 3rd. Its departure morning does not cover the night of the 4th.\n"},{"path":"tests\/case-2\/request.txt","content":"Check my Leeds accommodation, including my host's message.\nReturn only the JSON specified in SKILL.md for this test.\n\nNeed Leeds nights 2026-08-10, 11, 12. Booking A Leeds 10\u201313 Aug amended to 10\u201312 Aug. Booking B Leeds 12\u201313 Aug cancelled. Booking C York 12\u201313 Aug. Host D Leeds confirmed night of Aug 11 only.\n"},{"path":"tests\/case-2\/expected.json","content":"{\n    \"missing_nights\": [\n        \"2026-08-12\"\n    ],\n    \"overlapping_nights\": [\n        \"2026-08-11\"\n    ],\n    \"covered_count\": 2\n}\n"},{"path":"tests\/case-2\/explanation.txt","content":"The amendment supersedes the original. The York room cannot cover Leeds.\n"}],"is_active":true,"is_approved":false}]}]}