Work out weekly stationery handouts from a supply cupboard. Use whenever a task gives input.json with a "stock" array of {item, quantity} and a "requests" array of {person, item, quantity} and asks for stationery-issued.csv showing how much each person asked for and how much they get. Works by hand, no code execution needed.
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 Stationery Issue?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/gabrielmoreira-stationery-issue-c60f8ce8)
---
name: stationery-issue
description: Work out weekly stationery handouts from a supply cupboard. Use whenever a task gives input.json with a "stock" array of {item, quantity} and a "requests" array of {person, item, quantity} and asks for stationery-issued.csv showing how much each person asked for and how much they get. Works by hand, no code execution needed.
---
# Stationery issue
Read `input.json` in the working folder and write `stationery-issued.csv` in the same folder. You cannot run code, so do the arithmetic carefully by hand, following the steps below.
## Rules (derived from the worked examples)
1. **Combine requests per person per item.** If one person requests the same item several times, add the quantities into one `asked` figure. They get one row for that item.
2. **Serve people in order of their first request for that item.** Order people by the position of their earliest request for that item. Later top-up requests do not move them back in the queue. This is why, with 10 pens, amy (4 then 3 more) gets her full 7 and liv (5) gets the remaining 3. Do not process request by request.
3. **Allocate.** Start with `remaining` = the item's stock. For each person in that order: `issued = min(asked, remaining)`, then `remaining = remaining - issued`. A person who arrives when nothing remains still gets a row with `issued` 0.
4. **Row order.** Group rows by item, with items in the order they appear in `stock` (not the order of requests). Within an item, list people in the queue order from rule 2.
5. **Omit items nobody requested.** No rows for them (e.g. scissors in Example 3).
## Steps
1. Read `input.json`. Note the stock order and the quantity of each item.
2. For each stock item in order, go through `requests` top to bottom and pick out those for that item. Build the list of distinct people in order of first appearance, with the sum of their quantities.
3. Allocate with rule 3. Check that the sum of issued for the item never exceeds its stock.
4. Write the file.
## Output format
- First line exactly: `item,person,asked,issued`
- One line per row, no spaces after commas, plain integers, a newline after each line.
- Write item and person names exactly as in the input (keep case, e.g. `A4 pads`). Only add double quotes around a field if it contains a comma or a quote.
- If there are no requests at all, write only the header line.
## Worked check
Stock glue sticks 3; requests tom 2, dan 2, bea 1. Tom gets 2 (1 left), dan asks 2 gets 1 (0 left), bea asks 1 gets 0. Rows: `glue sticks,tom,2,2` / `glue sticks,dan,2,1` / `glue sticks,bea,1,0`.
Finish by re-reading the CSV and confirming every requested person/item pair appears once and issued totals do not exceed stock.