Summarise a class attendance register from input.json (pupils with day-by-day marks P/L/A/E) 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 file, even if they don't name the output 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-agent-skills-mirror)
---
name: class-register
description: Summarise a class attendance register from input.json (pupils with day-by-day marks P/L/A/E) 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 file, even if they don't name the output files.
---
# Class register summary
You cannot run code, so work through each pupil by hand, carefully, one character at a time.
## Input
`input.json` in the working folder: `{"register": [{"pupil": "Name", "marks": "PPALE..."}, ...]}`.
`marks` has one letter per school day, in order: P present, L late, A absent, E authorised absence.
## Per-pupil rules (derived from the worked examples)
- **present** = number of `P` plus number of `L`. Late still counts as attending.
- **absent** = number of `A` only. `E` is not counted as absent.
- **longest_absence** = the longest run of `A` marks, where:
- `E` is transparent: it neither adds to a run nor breaks it. Skip over it. (`AEAAP` → run of 3.)
- `P` and `L` break a run. (`AALAA` → longest 2.)
- A pupil with no `A` has longest_absence 0 (e.g. `PELEP` → 0).
Method: write the marks out, walk left to right keeping `current` (reset to 0 on P or L; +1 on A; unchanged on E) and `best` (max of current). Then count P+L and A separately and check present + absent + (number of E) equals the string length.
## Outputs (write beside input.json)
### register-summary.csv
Header `pupil,present,absent,longest_absence`, then one row per pupil in the **same order as the input**. No spaces, no quotes, a trailing newline.
```
pupil,present,absent,longest_absence
Maya,3,3,3
```
### absence-alerts.json
A JSON array of pupil names (strings), 2-space indent, trailing newline.
- Include a pupil only if **longest_absence >= 3**. (Total absent count alone doesn't qualify: AP AP AP with 3 absences but runs of 1 is not alerted.)
- Order: longest_absence descending; ties broken by name ascending (A–Z).
- If nobody qualifies, write `[]`.
```json
[
"Zara",
"Ivan"
]
```
## Checks before finishing
1. Row count equals the number of pupils; names copied exactly.
2. Recount any pupil whose numbers look odd.
3. Alerts list matches the rule and ordering above.
4. Both files are in the same folder as input.json.