Use this skill when the user wants to review a TLS/SSL certificate inventory and find which certificates are expired or need renewing soon (within 30 days), skipping ones the platform auto-renews and ignoring superseded duplicates, and produce a renewals list (renewals.csv) with counts (renewal-counts.json). Not for issuing certificates or checking live servers.
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 Cert Renewals?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/gabrielmoreira-cert-renewals-2bfa5364)
---
name: cert-renewals
description: "Use this skill when the user wants to review a TLS/SSL certificate inventory and find which certificates are expired or need renewing soon (within 30 days), skipping ones the platform auto-renews and ignoring superseded duplicates, and produce a renewals list (renewals.csv) with counts (renewal-counts.json). Not for issuing certificates or checking live servers."
---
# Certificate renewals review
## When to use
Use for an `input.json` holding `today` (whole day number) and `certificates` (array of `{domain, expiresDay, autoRenew}`). Do not use for live certificate checks, issuing certs, or other date formats.
## Inputs
- `input.json` in the working folder. If missing or malformed, stop and report; do not invent data.
- Empty `certificates` is valid: output header only and zero counts.
## Steps
1. Read `today` and `certificates`.
2. Deduplicate: for each domain, keep only the certificate with the largest `expiresDay`. Drop all others, wherever they appear in the list (a newer one may come before or after). Domains are lower case; compare exactly.
3. For each kept certificate compute `days_left = expiresDay - today` (integer; may be negative).
4. Classify:
- `days_left <= 0` -> status `expired`, listed regardless of `autoRenew`.
- `1 <= days_left <= 30` -> status `renew`, listed only if `autoRenew` is not true; if `autoRenew` is true, omit.
- `days_left > 30` -> omit.
5. Sort the listed rows by `days_left` ascending numerically (most negative first; compare as numbers, not text, so -10 comes before -9 and 5 before 12). Ties: ascending ASCII order of `domain` (plain byte order; `-` < `.` < digits < letters).
6. Write `renewals.csv` beside `input.json`:
- First line exactly `domain,days_left,status`
- One line per row: `domain,days_left,status`, e.g. `shop.example.net,0,expired`. Plain integers, no quotes, no spaces, no `+` sign, `-` for negatives. Newline after each line.
7. Write `renewal-counts.json` beside `input.json`: `{"expired": N, "renew": M}`, exactly those two keys, counts of rows by status (0 if none).
8. Re-read both files and check: row count equals expired+renew, ordering holds, no domain appears twice, no superseded certificate was used.
## Edge cases
- A superseded certificate is never listed, even if it is expired and the newest is fine.
- Dedupe by largest `expiresDay` happens before the autoRenew check; autoRenew of an older certificate is irrelevant.
- Expires today (`days_left` 0) is expired. 30 days left is renew; 31 is not listed.
- `autoRenew` missing: treat as false.
## Example
today = 400:
- shop.example.net exp 400, autoRenew false -> 0, expired
- api.example.net exp 430, false -> 30, renew (if true: omitted)
- mail.example.net exp 405 and 520 -> only 520 counts, 120 days, omitted
- old.example.net exp 390, autoRenew true -> -10, expired
renewals.csv:
```
domain,days_left,status
old.example.net,-10,expired
shop.example.net,0,expired
api.example.net,30,renew
```
renewal-counts.json: `{"expired": 2, "renew": 1}`