Skip to content
Back to skills

Regatta Series

ASecurity

Use this skill when the user wants a club dinghy regatta or race series scored from race officer sheets (boats, finishers, DNF/OCS/DNS/DSQ/SCP codes): low-point race scores, a discard, tie-breaks, final standings as series.csv and per-race winners. Not for handicap/rating-corrected results or non-sailing league tables.

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

Security analysis

A100/100

Scanned December 6, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill regatta-series --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Regatta Series?

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

Security grade badge for Regatta Series
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-regatta-series-e6ca722b/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-regatta-series-e6ca722b)

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: regatta-series
description: "Use this skill when the user wants a club dinghy regatta or race series scored from race officer sheets (boats, finishers, DNF/OCS/DNS/DSQ/SCP codes): low-point race scores, a discard, tie-breaks, final standings as series.csv and per-race winners. Not for handicap/rating-corrected results or non-sailing league tables."
---

# Regatta series scoring (low point, one design)

Work by hand from the files; no code execution is needed. Be careful and re-check arithmetic.

## Inputs
`input.json` in the working folder:
- `boats`: `[{sail, name}]`, all boats entered. `N` = number of boats.
- `races`: `[{race, finishers, codes}]` in the order sailed. Use array order as race order (r1 = first element), not the `race` value.
- `finishers`: sail numbers in crossing order. `codes`: `[{sail, code}]`, code in DNF, OCS, DNS, DSQ, SCP.
If `input.json` is missing or unreadable, stop and tell the user. Ignore wind, course, times, handicaps. Ignore codes or finishers whose sail is not in `boats`, and repeat mentions of a sail within a race (keep the first).

## Step 1: per-race scores
For each race, with `R = N + 1`:
1. `starters = len(finishers) + count(codes DNF or OCS)` (DSQ and SCP boats are already in finishers; do not count them twice).
2. Build the finishing order with DSQ boats removed. `place` = 1-based position in that reduced list.
3. Score each boat:
   - Finisher with no code: `place`.
   - SCP: `min(place + 3, starters + 1)`. Other boats are not moved.
   - DSQ: `N + 1`. Mark this score as **DSQ** (not discardable).
   - DNF or OCS: `starters + 1`.
   - DNS, or sail in neither finishers nor codes: `N + 1`.
Scores are whole numbers. A boat gets exactly one score per race.

Write the score table (boat × race) down before continuing, and check each race: the non-DSQ finishers' places must be 1..k with no gaps.

## Step 2: discard
Let `n` = number of races.
- If `n < 4`: no discard; net = total; no brackets.
- If `n >= 4`: per boat, discard the single highest score among its non-DSQ scores. If that highest value occurs in several races, discard the **latest** race. If the boat has no non-DSQ score, discard nothing.
- `total` = sum of all race scores (including the discarded and DSQ ones). `net = total - discard` (discard = 0 when none).

## Step 3: ranking
Sort by, in order (lower/better first):
1. `net` ascending.
2. Tie on net: take each boat's race scores excluding the discarded race (if none discarded, all scores), sort each ascending (best to worst), compare element by element; the lower value at the first difference ranks ahead.
3. Still level: compare final-race score (the discarded score counts here), then the race before, back to race 1; lower ranks ahead at the first difference.
4. Still level: ascending sail number.
Ranks are 1..N with no sharing. Apply the tiebreak to every group of equal net, not only pairs.

## Step 4: write outputs (beside input.json)
**series.csv**: header `rank,sail,boat,r1,...,rn,total,net`; one row per boat in rank order, all N boats. Race cells are plain integers; the discarded cell is wrapped in brackets, e.g. `(8)`. Quote a boat name in double quotes if it contains a comma or a quote (double any inner quote). Use `\n` line endings and no extra blank lines.

**race-winners.json**: JSON array, one `{"race": <race value from input>, "sail": <sail number>}` per race in race order, naming the boat whose score is 1. If a race somehow has no 1-point boat (every finisher disqualified), use `"sail": null` for it and mention that to the user.

After writing, re-read both files and verify: N rows, n race columns, each row's total equals the sum of its cells, net equals total minus the bracketed value, ranks 1..N.

## Worked example
N = 8 (R = 9). Race: finishers `[A,B,C,D,E]`, codes: B DSQ, E SCP, F DNF; G, H absent.
- starters = 5 + 1 = 6. Reduced order A,C,D,E → places 1,2,3,4.
- A = 1, C = 2, D = 3, E = min(4+3, 7) = 7, F = 7, B = 9, G = 9, H = 9.

Discard example: scores 3, 9(DSQ), 5, 5 over four races → highest non-DSQ is 5, in races 3 and 4 → discard race 4: `3,9,5,(5)`, total 22, net 17.

## Ambiguity
Decide using the rules above and do not ask questions. If input deviates from the stated shape (e.g. a sail in both DNF and finishers), follow the rule for the code and mention the issue in the reply.

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

Comments

Loading comments…

Newsletter

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