Skip to content
Back to skills

Class Register

ASecurity

Use this skill when the user wants to summarise a class register or attendance sheet: count each pupil's present and absent days, find their longest run of absence, and flag pupils with long absence streaks. Handles input.json with per-pupil P/L/A/E day marks and produces register-summary.csv and absence-alerts.json. Not for timetables, grades or other spreadsheets.

  • 24 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 6, 2026
data

Security analysis

A100/100

Scanned December 6, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill class-register --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Class Register?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Class Register
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-class-register-0944827a/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-class-register-0944827a)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: class-register
description: "Use this skill when the user wants to summarise a class register or attendance sheet: count each pupil's present and absent days, find their longest run of absence, and flag pupils with long absence streaks. Handles input.json with per-pupil P/L/A/E day marks and produces register-summary.csv and absence-alerts.json. Not for timetables, grades or other spreadsheets."
---

# Class register summary

## Input
Read `input.json` in the working folder: `{"register": [{"pupil": "Maya", "marks": "AAAPPP"}, ...]}`.
`marks` has one letter per school day, in day order: `P` present, `L` late, `A` absent, `E` authorised absence. Pupil names are unique.

## Rules (per pupil, scanning `marks` left to right)
- `present` = number of `P` plus number of `L` (late counts as present).
- `absent` = number of `A` only. `E` is NOT counted as absent and NOT as present.
- `longest_absence` = longest run of `A` marks, where:
  - `A` adds 1 to the current run;
  - `E` is neutral: it neither adds nor breaks the run (skip it as if it were not there);
  - `P` or `L` ends the run (current run = 0);
  - `longest_absence` is the maximum run reached; 0 if there is no `A`.
  - Example: `AEAPAA` -> run 2 (A,E,A), reset, run 2 -> longest 2.
- Empty `marks` gives 0,0,0. Treat lowercase letters as uppercase. If another character appears, ignore it and mention it in your reply.

## Alerts
A pupil is alerted when `longest_absence >= 3`.
Order the alerts by `longest_absence` descending; ties by pupil name ascending (plain alphabetical, case-sensitive character order).

## Steps
1. Read `input.json`.
2. For each pupil compute present, absent, longest_absence by hand, carefully, character by character. Re-check each pupil's counts: present + absent + (number of E) must equal the length of `marks`.
3. Write `register-summary.csv` beside `input.json`.
4. Compute the alert list and write `absence-alerts.json` beside it.

## Output formats
`register-summary.csv`: header `pupil,present,absent,longest_absence`, then one row per pupil in the SAME order as the input, comma-separated, no spaces, no quotes (unless a name contains a comma; then quote it), newline after each line.

`absence-alerts.json`: a JSON array of pupil-name strings, 2-space indent. If nobody is alerted write `[]`.

## Missing or odd input
- If `input.json` is missing or has no `register` array, tell the user and write nothing.
- An empty register gives a CSV with only the header and `[]`.

## Worked example
Input marks: Ivan `AEAAP`, Beth `PELEP`, Zara `AAAAP`.

```csv
pupil,present,absent,longest_absence
Ivan,1,3,3
Beth,3,0,0
Zara,1,4,4
```
```json
[
  "Zara",
  "Ivan"
]
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.