Skip to content
Back to skills

Delay Repay Claims

ASecurity

Compute rail delay-repay compensation from an input.json of journeys (ticket, fare, departDue, departed, arriveDue, arrived) and write delay-payouts.csv beside it. Use whenever asked to calculate passenger payouts, delay refunds or compensation for late or cancelled train services from journey timetable data.

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

Security analysis

A100/100

Scanned December 6, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill delay-repay-claims --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Delay Repay Claims?

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

Security grade badge for Delay Repay Claims
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-delay-repay-claims-af1a4c3c/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-delay-repay-claims-af1a4c3c)

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: delay-repay-claims
description: Compute rail delay-repay compensation from an input.json of journeys (ticket, fare, departDue, departed, arriveDue, arrived) and write delay-payouts.csv beside it. Use whenever asked to calculate passenger payouts, delay refunds or compensation for late or cancelled train services from journey timetable data.
---

# Delay-repay payouts

Read `input.json` in the working folder and write `delay-payouts.csv` in the same folder. You can't run code, so work each journey out by hand, carefully.

## Rules (derived from the worked examples)

For each journey, in input order:

1. **Cancelled**: if `arrived` is null (or `departed` is null), the service was cancelled. Delay column is the word `cancelled`; payout is 100% of fare.
2. **Otherwise** delay = minutes from `arriveDue` to `arrived`. Only arrival counts; ignore departure lateness. Convert each HH:MM to minutes (hours*60 + minutes) and subtract. Early arrival gives a negative delay, which is treated as no delay.
3. Payout tier by arrival delay in whole minutes:
   - under 15: no payout, **omit the journey from the CSV entirely**
   - 15 to 29: 25% of fare
   - 30 to 59: 50% of fare
   - 60 or more: 100% of fare
   Boundaries are inclusive at the lower end (15 pays, 14 doesn't; 30 is 50%, 29 is 25%; 60 is 100%, 59 is 50%).
4. Payout is in dollars with exactly two decimals (e.g. `18.00`, `5.00`, `13.00`). Fares are whole dollars, so 25% or 50% gives at most .25/.50/.75; if a fare is fractional, round to the nearest cent.

## Output

`delay-payouts.csv`, with this header then one line per paid journey, in input order, comma-separated, no quotes or spaces, newline-terminated:

```
ticket,delay,payout
RT-2207,30,18.00
RT-1096,cancelled,13.00
```

The delay column holds the integer minutes (no unit) or `cancelled`. If no journey qualifies, write only the header line.

## Check before finishing

- Recompute each delay from the arrival times (not departure) and double-check subtractions across the hour (e.g. 10:05 to 10:35 = 30; 11:50 to 12:05 = 15; 07:45 to 08:44 = 59).
- Confirm excluded journeys really were under 15 minutes (or early), and none were dropped by mistake.
- Confirm the file is written next to input.json.

## Worked check

Fare 26, due 11:40, arrived 12:25: delay 45, tier 50%, payout `13.00`.
Fare 16, due 13:00, arrived 13:29: delay 29, tier 25%, payout `4.00`.

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 development →

Comments

Loading comments…

Newsletter

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