Skip to content
Back to skills

Delay Repay Claims

ASecurity

Use this skill when a user wants rail delay-repay compensation worked out: calculating payouts for late or cancelled train journeys from a journeys list (ticket, fare, due and actual times) and writing delay-payouts.csv. Not for refunds of unrelated tickets or other CSV tasks.

  • 24 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 6, 2026
tools

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-51ef4ea1/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-delay-repay-claims-51ef4ea1)

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: "Use this skill when a user wants rail delay-repay compensation worked out: calculating payouts for late or cancelled train journeys from a journeys list (ticket, fare, due and actual times) and writing delay-payouts.csv. Not for refunds of unrelated tickets or other CSV tasks."
---

# Delay-repay claims

Compute passenger compensation for late or cancelled rail services and write `delay-payouts.csv`.

## Inputs
- `input.json` in the working folder: `{"journeys": [{ticket, fare, departDue, departed, arriveDue, arrived}, ...]}`.
- `fare` is dollars (number). Times are 24-hour `HH:MM`, same day. `departed` and `arrived` are `null` for a cancelled service.
- If `input.json` is missing or has no `journeys` array, stop and tell the user. An empty array is valid: write only the header.

## Rules
Process journeys in input order.

1. Cancelled: `departed` is null OR `arrived` is null. Row is `ticket,cancelled,<fare>` (100% of fare).
2. Otherwise, minutes = `H*60+M` of each time. `delay = arrived - arriveDue` (ARRIVAL delay only; ignore departure times).
3. Payout fraction by delay (integer minutes):
   - delay < 15 (including 0 and negative, i.e. early): no payout, **omit the row**.
   - 15 <= delay <= 29: 25% of fare
   - 30 <= delay <= 59: 50% of fare
   - delay >= 60: 100% of fare
4. `payout = fare * fraction`, rounded half up to 2 decimals, always printed with exactly 2 decimals (`5.00`, not `5`). No currency symbol.
5. A delay row prints delay as a plain integer of minutes (`59`, not `59 min`).

Boundaries: 14 -> none, 15 -> 25%, 29 -> 25%, 30 -> 50%, 59 -> 50%, 60 -> 100%.

## Steps
1. Read `input.json`.
2. For each journey apply the rules above; work the minutes arithmetic out explicitly (e.g. 10:35 - 10:05 = 635 - 605 = 30).
3. Write `delay-payouts.csv` next to `input.json`: first line exactly `ticket,delay,payout`, then one row per qualifying journey, comma-separated, no quotes, no spaces, newline-terminated lines.
4. Re-read the file and check: row count, order, 2-decimal payouts, no row for on-time or early journeys.

## Ambiguity
- Arrival earlier than due time by crossing midnight is not expected; if `arrived < arriveDue` treat as early (no payout).
- Do not ask questions; if a field is malformed for one journey, skip it and mention it in the reply.

## Example
Journeys: RT-2207 fare 36, due 10:05 arrived 10:35 -> delay 30 -> 50% -> `RT-2207,30,18.00`. RT-4718 fare 20, due 11:50 arrived 12:05 -> 15 -> `RT-4718,15,5.00`. RT-5310 arrived 14 min late -> omitted. RT-1096 fare 13 cancelled -> `RT-1096,cancelled,13.00`.

```csv
ticket,delay,payout
RT-2207,30,18.00
RT-4718,15,5.00
RT-1096,cancelled,13.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 tools →

Comments

Loading comments…

Newsletter

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