Score a one-design dinghy regatta series (low-point system with DNF/OCS/DNS/DSQ/SCP codes, one discard, tie-breaks) from input.json, writing series.csv and race-winners.json. Use whenever the user asks to score, rank or tabulate a sailing series, regatta results, race officer sheets, or mentions finishers/codes/discards in input.json, even if they don't say "skill".
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Regatta Series?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/gabrielmoreira-regatta-series-ca198c19)
---
name: regatta-series
description: Score a one-design dinghy regatta series (low-point system with DNF/OCS/DNS/DSQ/SCP codes, one discard, tie-breaks) from input.json, writing series.csv and race-winners.json. Use whenever the user asks to score, rank or tabulate a sailing series, regatta results, race officer sheets, or mentions finishers/codes/discards in input.json, even if they don't say "skill".
---
# Regatta series scoring (by hand, no code execution)
You cannot run programs, so work carefully on paper: read input.json, build the tables below in your reasoning, double-check arithmetic, then write the two files. Errors usually come from (a) forgetting DSQ boats still count as starters, (b) wrong place after removing DSQ boats, (c) discard and tie-break details. Follow the steps in order.
## Step 0: constants
- `N` = number of entries in `boats` (all boats count, even ones that never raced).
- `K` = number of races in `races` (use array order; column r1..rK = array position, not the `race` value).
## Step 1: score each race (repeat for every race)
1. `S` (starters) = (number of sail numbers in `finishers`, DSQ and SCP boats included) + (number of codes DNF or OCS). DNS and absent boats are NOT starters.
2. Compute each finisher's **place**: walk `finishers` in order, skipping any boat coded DSQ; the non-DSQ boats get places 1, 2, 3, ... (this is the "move up one" rule).
3. Score every boat in `boats`:
- Finisher with no code: its place.
- SCP: `min(place + 3, S + 1)`, where place is computed in step 2. No other boat moves.
- DSQ: `N + 1`.
- DNF or OCS: `S + 1`.
- DNS: `N + 1`.
- Not in finishers and not in codes: `N + 1`.
Note DNF/OCS use S+1 but DNS/absent/DSQ use N+1; these differ whenever some boats stayed ashore.
4. Sanity check: the place-1 boat exists (if the first finisher is DSQ, the next one is place 1).
Worked example (N=8, finishers a,b,c,d,e; b is DSQ, e is SCP, f is DNF): S=6. a=1, b=9, c=2, d=3, e=(4th place)+3=7 (cap 7), f=7.
## Step 2: race winners
For each race the winner is the boat that scored 1 point: the first non-DSQ finisher, provided it is not SCP. (An SCP first-place boat scores at least 4, so then nobody scores 1; in that rare case name the boat with the lowest score in that race, and if tied the one that crossed the line earlier. Mention this in your final reply.) Output `{"race": <the race value from input>, "sail": <number>}`.
## Step 3: discards
- If K < 4: no discard; net = total.
- If K >= 4: each boat discards exactly one score: its highest score among races where it was NOT coded DSQ. If that highest value occurs in several races, discard the **latest** of them. DSQ scores are never discarded, even if highest. (If a boat is DSQ in every race, there is nothing to discard.)
- total = sum of all K scores (discarded one included). net = total − discarded score.
## Step 4: rank
Sort by:
1. net ascending.
2. Tie on net: take each boat's scores with the discarded race removed (when there is a discard), sorted best to worst (ascending). Compare element by element; the lower value at the first difference ranks ahead.
3. Still tied: compare using ALL race scores including the discarded one, in race order from the last race backward (rK, rK-1, ... r1); the lower score at the first difference ranks ahead.
4. Still tied: lower sail number first.
Ranks are 1..N with no sharing. Do the sort by explicitly grouping boats with equal net and resolving each group; re-check the final order by scanning adjacent pairs.
## Step 5: write files (beside input.json)
**series.csv**: header `rank,sail,boat,r1,...,rK,total,net`. One row per boat in rank order. Race cells are plain integers; the discarded score is wrapped in brackets, e.g. `(8)`. Only one bracketed cell per boat, none if K<4. If a boat name contains a comma or quote, wrap it in double quotes (double any inner quotes). No spaces after commas. Include every boat in `boats`.
**race-winners.json**: JSON array, one object per race in race order, e.g. `[{"race":1,"sail":123},{"race":2,"sail":45}]`. Use the `race` value from input.json and the sail as a number.
## Final check before finishing
- Row count = N; each row has K+5 fields.
- For each row: sum of the K scores = total; total − bracketed = net.
- In each race, the scores of finishers form a consistent sequence (places 1..n without gaps, plus SCP/DSQ adjustments).