Skip to content
Back to skills

Excess Baggage

ASecurity

Use this skill when you need to work out airline check-in excess baggage fees: extra checked pieces beyond a cabin's allowance plus per-bag overweight charges, for a list of passengers, and produce a fee report of who owes what (e.g. from input.json to excess-baggage.csv). Not for carry-on rules, flight pricing or refunds.

  • 24 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added December 6, 2026
datagoapi

Works with

  • api

Security analysis

A100/100

Scanned December 6, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill excess-baggage --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Excess Baggage?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Excess Baggage
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-excess-baggage-68d35003/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-excess-baggage-68d35003)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: excess-baggage
description: "Use this skill when you need to work out airline check-in excess baggage fees: extra checked pieces beyond a cabin's allowance plus per-bag overweight charges, for a list of passengers, and produce a fee report of who owes what (e.g. from input.json to excess-baggage.csv). Not for carry-on rules, flight pricing or refunds."
---

# Excess baggage fees

## Inputs
Read `input.json` in the working folder (the folder that holds it is where output goes):
- `allowances`: object, cabin -> `{pieces, kg}` (included checked bags; weight limit per bag).
- `extraPieceCents`: cents per extra piece.
- `overweightCents`: cents per started 5 kg over the limit.
- `passengers`: array of `{booking, name, cabin, bags}`; `bags` = integer kg per bag, in belt order.

## Rules (per passenger)
Let `P` = allowance pieces, `L` = allowance kg for the passenger's cabin, `n` = length of `bags`.
1. Extra pieces: `extra = max(0, n - P)`; the bags at index `P` onward (0-based, belt order) are the extra ones. Charge `extra * extraPieceCents`.
2. Overweight, for EVERY bag (included and extra), independently: `over = w - L`; `steps = 0` if `over <= 0`, else `ceil(over / 5)` = `(over + 4) div 5` (integer division). Charge `steps * overweightCents`. Never pool or carry unused weight between bags.
3. `feeCents = extra*extraPieceCents + sum(steps)*overweightCents`.
4. Zero bags -> fee 0. `P = 0` -> every bag is an extra piece.

Do the arithmetic in integer cents. Check each bag explicitly; do not estimate.

## Steps
1. Read input.json. For each passenger, list each bag with its index, steps and whether it is extra; compute `feeCents`.
2. Keep only passengers with `feeCents > 0`.
3. Sort by `feeCents` descending; ties by `name` ascending in plain ASCII byte order (uppercase before lowercase, space before letters; not locale or case-insensitive).
4. Write `excess-baggage.csv` beside input.json: header `booking,name,bags,fee`, one row per kept passenger, `bags` = n, `fee` = `feeCents/100` with exactly two decimals, no currency sign or thousands separators (e.g. `105.00`, `0.50`). Use newline line endings with a final newline. If no one qualifies, the file contains only the header.
5. If a value contains a comma or double quote (e.g. name), quote the field CSV-style, doubling inner quotes.

## Missing or odd data
- Cabin not in `allowances`: do not guess; match case-insensitively only if unambiguous, otherwise skip no one silently — state the problem to the user and treat nothing as free.
- Missing `bags`: treat as empty. Do not invent data.
- Do not edit input.json.

## Example
economy: 1 piece, 23 kg; extra 6500; step 2000. Bags `[29, 12]`: bag 29 -> over 6 -> 2 steps = 4000; bag 12 is extra = 6500, no overweight. Fee 10500 -> `B1,Ann,2,105.00`.

Before finishing, re-open the CSV and verify the order, row count and decimals.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.