Skip to content

moonlight-lupin/agent-skills / productivity/travel-itinerary

travel-itinerary

Verified

Use when the user needs a business-trip itinerary built, updated, shared, or exported — create, update, sanitize, route, and export structured business-trip itineraries from booking confirmations, emails, tickets, PDFs, screenshots, calendar invites, or notes. Covers day-by-day itinerary generation, privacy-safe sharing, route links, and Markdown/PDF/DOCX/Google Doc/ICS exports.

FileKindSize
.gitignoreother139 B
SKILL.mdskill md12.9 KB
examples/tokyo-trip.mdmarkdown24.1 KB
references/exports.mdmarkdown9.2 KB
references/node-types.mdmarkdown10.4 KB
references/privacy.mdmarkdown5.7 KB
references/routing.mdmarkdown7.1 KB
scripts/itinerary_utils.pyscript8.9 KB
templates/itinerary-schema.yamlconfig5.7 KB
tests/test_itinerary_utils.pyscript3.0 KB

tests/test_itinerary_utils.py

View on GitHub
from pathlib import Path
import importlib.util


SCRIPT_PATH = Path(__file__).resolve().parents[1] / "scripts" / "itinerary_utils.py"
SPEC = importlib.util.spec_from_file_location("itinerary_utils", SCRIPT_PATH)
itinerary_utils = importlib.util.module_from_spec(SPEC)
assert SPEC.loader is not None
SPEC.loader.exec_module(itinerary_utils)


def test_maps_url_normalises_mode_case_and_encodes_addresses():
    url = itinerary_utils.maps_url(
        "HND",
        "Hotel The Celestine Tokyo Shiba",
        "Transit",
    )
    assert "origin=HND" in url
    assert "destination=Hotel+The+Celestine+Tokyo+Shiba" in url
    assert "travelmode=transit" in url


def test_maps_url_preserves_valid_coordinates_and_rejects_invalid_ranges():
    url = itinerary_utils.maps_url("35.5494,139.7798", "35.6510,139.7470", "Taxi")
    assert "origin=35.5494,139.7798" in url
    assert "destination=35.6510,139.7470" in url
    assert "travelmode=driving" in url

    invalid = itinerary_utils.maps_url("999,999", "HND", "walking")
    assert "origin=999%2C999" in invalid
    assert "travelmode=walking" in invalid


def test_ics_escape_and_fold():
    escaped = itinerary_utils.ics_escape("Line 1, with comma; and \\ slash\nLine 2")
    assert escaped == "Line 1\\, with comma\\; and \\\\ slash\\nLine 2"

    folded = itinerary_utils.ics_fold_line("SUMMARY:" + "東京" * 40)
    assert "\r\n " in folded
    for line in folded.split("\r\n"):
        assert len(line.encode("utf-8")) <= 75


def test_ics_check_accepts_valid_calendar(tmp_path):
    path = tmp_path / "trip.ics"
    path.write_text(
        "\r\n".join(
            [
                "BEGIN:VCALENDAR",
                "VERSION:2.0",
                "PRODID:-//travel-itinerary skill//EN",
                "BEGIN:VTIMEZONE",
                "TZID:Asia/Tokyo",
                "END:VTIMEZONE",
                "BEGIN:VEVENT",
                "UID:flight-001@travel-itinerary",
                "DTSTAMP:20260610T120000Z",
                "DTSTART;TZID=Asia/Tokyo:20260612T081000",
                "SUMMARY:CX548 HKG to HND",
                "END:VEVENT",
                "END:VCALENDAR",
                "",
            ]
        ),
        encoding="utf-8",
    )

    ok, errors = itinerary_utils.ics_check(str(path))
    assert ok, errors


def test_ics_check_catches_missing_event_fields_and_timezone(tmp_path):
    path = tmp_path / "bad.ics"
    path.write_text(
        "\n".join(
            [
                "BEGIN:VCALENDAR",
                "VERSION:2.0",
                "BEGIN:VEVENT",
                "UID:flight-001@travel-itinerary",
                "DTSTART;TZID=Asia/Tokyo:20260612T081000",
                "SUMMARY:CX548 HKG to HND",
                "END:VEVENT",
                "END:VCALENDAR",
                "",
            ]
        ),
        encoding="utf-8",
    )

    ok, errors = itinerary_utils.ics_check(str(path))
    assert not ok
    assert any("missing: DTSTAMP" in error for error in errors)
    assert any("Missing VTIMEZONE for TZID(s): Asia/Tokyo" in error for error in errors)
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall