name: hk-credit-cards-kb-updater description: Use when updating hk-credit-cards-kb by dumping promo_guide_url HTML and writing simplified per-card promotion YAML files.
Purpose
This skill updates hk-credit-cards-kb by extracting promotion details from source pages and writing per-card YAML files under hk-credit-cards-kb/references/.
Inputs
references/cards.yamlis the source of card metadata and target card list.- For each card,
promo_guide_urlis the default primary source. - User-provided URL(s), PDF(s), or other source files are allowed as additional priority sources.
Required Tool Invocation
Use this exact command format:
.venv/bin/python <SCRIPT_PATH> <URL>
Use this script path from the updater skill root:
SCRIPT_PATH=./scripts/dump_html.py
Always use .venv/bin/python because dump_html.py depends on Playwright in that environment.
Update Workflow
Process cards strictly one by one.
For each card in references/cards.yaml:
- Read card metadata and target output path
hk-credit-cards-kb/references/<id>.yaml. - Run the dump script with the card's
promo_guide_url. - Parse the returned raw HTML and extract all promotion details.
- Merge details from user-provided sources if available (URL/PDF/etc.), prioritizing newer and more explicit terms.
- Write or update exactly one per-card YAML file.
- Move to the next card only after finishing the current card.
Do not batch multiple cards in a single extraction pass.
HTML Parsing And Information Preservation
- Preserve promotion information as losslessly as possible in plain text.
- Include all meaningful terms: conditions, thresholds, caps, exclusions, registration requirements, payment methods, merchant scope, category scope, and validity cues.
- Ignore irrelevant site metadata (UI boilerplate, tracking, layout-only fragments).
- Treat
del/ strikethrough content as obsolete or inactive terms unless the page explicitly states otherwise. - If HTML comments or nearby context clarify a promotion term, use that context when writing the description.
YAML Output Schema
Write per-card YAML using this simplified schema:
id: string
name_en: string
name_zh: string
issuer: string
payment_network: string
official_url: string
promo_guide_url: string
promotions:
- description: string
tc_url: string | null
validity: string | null
as_of: YYYY-MM-DD
Rules:
promotionsis the canonical list key.tc_urlmust benullif no terms URL is found.validitymust benullif no reliable date range can be inferred.- Keep base fields aligned with
references/cards.yaml.
Language Rules
- Write promotion descriptions in English.
- Keep proper nouns and merchant/program names in their original form when translation would reduce precision.
- Keep card metadata fields from
references/cards.yamlas-is, includingname_zh.
Quality Bar
- Prefer precise and complete wording over short summaries.
- Avoid generic statements if concrete terms are present in sources.
- If source terms conflict, prefer official terms pages or the latest effective source and reflect uncertainty in the description.
- If a card appears discontinued or source content looks stale, report it to the user.
References
references/cards.yaml: list of cards to maintainscripts/dump_html.py: HTML dump scripthk-credit-cards-kb/references/*.yaml: output files