Summarise a school class register from input.json (array of {pupil, marks} with P/L/A/E letters per day) into register-summary.csv and absence-alerts.json. Use whenever the user asks to summarise, tally, or flag absences from a class register or attendance marks, 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 Class Register?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/gabrielmoreira-class-register-48c80350)
---
name: class-register
description: Summarise a school class register from input.json (array of {pupil, marks} with P/L/A/E letters per day) into register-summary.csv and absence-alerts.json. Use whenever the user asks to summarise, tally, or flag absences from a class register or attendance marks, even if they don't name the files.
---
# Class register summary
Read `input.json` in the working folder. Shape: `{"register": [{"pupil": "Maya", "marks": "AAAPPP"}, ...]}`. Each character of `marks` is one school day, in order. Write both outputs in the same folder as `input.json`. You cannot run code, so compute by hand, carefully, one pupil at a time.
## Rules (derived from the worked examples)
Per pupil, go through `marks` left to right:
- **present** = number of `P` plus number of `L` (late still counts as attending).
- **absent** = number of `A` only. `E` (authorised) is not counted as absent and not counted as present.
- **longest_absence** = the longest run of `A`s, where `E` is *transparent*: it neither adds to a run nor breaks it. Only `P` or `L` ends a run. So skip every `E`, then find the longest block of consecutive `A`s in what remains.
- `AEAAP` → A A A then P → 3 (absent 3, present 1)
- `AEAPAA` → AAA? No: after dropping E it is `AAPAA` → longest 2 (absent 4)
- `EALAAP` → `ALAAP` → longest 2 (absent 3, present 2)
- `PELEP` → `PLP` → absent 0, longest 0
Check: present + absent + (number of E) should equal the length of `marks`. Recount if not.
## register-summary.csv
Header line exactly `pupil,present,absent,longest_absence`, then one row per pupil in **input order**, comma separated, no spaces, no quotes (unless a name contains a comma, then quote it), newline after each line.
```
pupil,present,absent,longest_absence
Maya,3,3,3
```
## absence-alerts.json
A JSON array of pupil names (strings) whose `longest_absence` is **3 or more**.
Order: highest `longest_absence` first; ties broken alphabetically by name (A→Z). Note this is NOT input order. Example: Tom and Nell both have 3, so `["Nell", "Tom"]`; Zara (4) and Ivan (3) give `["Zara", "Ivan"]`.
Format with 2-space indentation, one name per line:
```json
[
"Nell",
"Tom"
]
```
If nobody qualifies, write `[]`.
## Procedure
1. Read input.json.
2. For each pupil, write out the marks with E removed, then count P+L, count A, and find the longest A run.
3. Write the CSV, then select and sort the alerts, then write the JSON.
4. Re-verify each number once against the marks before finishing.