Plan a rotating weekly bin-duty rota (who wheels the wheelie bins out) from an input.json containing households, startWith and weeks with double/away flags. Writes bin-rota.csv and bin-turns.json beside input.json. Use whenever the user asks for a bin rota, bin turns, or a rotating duty roster with skipped-away households and double weeks, even if they don't name the files.
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 Bin Rota Plan?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/gabrielmoreira-bin-rota-plan-cd247278)
---
name: bin-rota-plan
description: Plan a rotating weekly bin-duty rota (who wheels the wheelie bins out) from an input.json containing households, startWith and weeks with double/away flags. Writes bin-rota.csv and bin-turns.json beside input.json. Use whenever the user asks for a bin rota, bin turns, or a rotating duty roster with skipped-away households and double weeks, even if they don't name the files.
---
# Bin rota plan
You cannot run code, so do this by hand, carefully. Work in a written trace so nothing is guessed.
## Input (input.json, in the working folder)
- `households`: names in rota order (index 0 .. n-1), unique.
- `startWith`: the household whose turn is up in the first week.
- `weeks`: list of `{week, double, away}` in plan order. `away` is a list of names (ignore any name not in households).
## Algorithm
Keep one **pointer** = the index of the household whose turn is up next. Initially it is the index of `startWith`.
For each week, in the order given:
1. Need `k` = 2 if `double` is true, else 1.
2. Starting at the pointer, walk down the households list, wrapping from the last back to index 0. For each household: if it is in this week's `away`, skip it (passed over, no make-up turn later); otherwise it takes a turn. Stop when `k` households have been chosen. Never choose the same household twice in a week (guaranteed to be enough at home).
3. Record the chosen households in the order the walk reached them (not alphabetical, not list order: after a wrap the end-of-list household comes first).
4. Set the pointer to the index just after the **last** household chosen (wrapping n-1 to 0). Households skipped over are not revisited; the next week starts after the last taker, regardless of who was skipped.
5. Add 1 to each chosen household's tally.
`startWith` gets no special treatment: if it is away in week 1 it is skipped like anyone else.
Worked example: households [Okafor, Brennan, Szabo, Liu], start Brennan. Wk10: Brennan, pointer to Szabo. Wk11 Szabo away: skip, Liu takes, pointer to Okafor. Wk12 double: Okafor+Brennan, pointer to Szabo. Wk13: Szabo.
## Method on the page
Write the households with their indices first. Then for each week write one line: pointer name, away list, skipped, chosen, new pointer. Doing this per week prevents drift over long plans. Re-check wrap-arounds and double weeks at the end.
## Outputs (beside input.json)
**bin-rota.csv**: header line `week,households`, then one row per week in the same order as `weeks`, e.g. `12,Okafor+Brennan`. Copy the week value as given. Double weeks join the two names with `+`, no spaces. Use plain newlines, no blank lines or extra columns. If a name contains a comma or quote, wrap that field in double quotes.
**bin-turns.json**: one JSON object with a key for every household, in `households` order, value = integer number of turns across the plan (0 if none). Example: `{"Okafor": 2, "Brennan": 2, "Szabo": 1, "Liu": 1}`. The counts must sum to 1 per normal week plus 2 per double week; verify this before writing.
Write both files, then reply with a brief confirmation. Do not alter input.json.