Use this skill for reviewing a company's TLS/SSL certificate inventory to find which certificates are expired or need renewing soon, e.g. 'which certs expire within 30 days', 'list expired certificates', 'build a renewal report from the certificate inventory'. Handles superseded duplicate certificates per domain and auto-renew exceptions, and produces a renewals CSV plus status counts JSON. Not for issuing or installing certificates.
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-8dbb8d9c)
---
name: cert-renewals
description: "Use this skill for reviewing a company's TLS/SSL certificate inventory to find which certificates are expired or need renewing soon, e.g. 'which certs expire within 30 days', 'list expired certificates', 'build a renewal report from the certificate inventory'. Handles superseded duplicate certificates per domain and auto-renew exceptions, and produces a renewals CSV plus status counts JSON. Not for issuing or installing certificates."
---
# Certificate renewals review
## When to use
Use when given an inventory (normally `input.json` in the working folder) with `today` (whole day number) and `certificates` (array of `{domain, expiresDay, autoRenew}`) and asked to find certificates needing action. Do not use for issuing, installing or validating certificates.
## Inputs
- `input.json` beside where outputs go. If missing or lacking `today`/`certificates`, stop and report what is missing; do not guess values.
- An empty `certificates` array is valid: output header only and zero counts.
## Steps
1. Read `input.json`. You cannot run code: work by hand, carefully.
2. Group certificates by `domain` (already lower case; compare exactly). Within each group keep only the one with the largest `expiresDay`. Drop all others, wherever they appear in the list (even if later in the list, or if the dropped one is expired or not auto-renewing). Two certs for one domain never share an `expiresDay`.
3. For each kept certificate compute `days_left = expiresDay - today` (integer; may be negative or zero).
4. Classify:
- `days_left <= 0` → status `expired`, listed regardless of `autoRenew`.
- `1 <= days_left <= 30` and `autoRenew` is false → status `renew`, listed.
- `1 <= days_left <= 30` and `autoRenew` is true → not listed.
- `days_left > 30` → not listed.
5. Sort listed rows by `days_left` ascending numerically (most negative first, so -10 before -2 before 0 before 5; never compare as text). Ties: ascending ASCII order of `domain` (compare character by character by code: `-`(45) < `.`(46) < digits < lower-case letters; a shorter prefix sorts first).
6. Write `renewals.csv` beside `input.json`:
- First line exactly `domain,days_left,status`.
- One row per listed certificate: `domain,days_left,status`, no spaces, no quotes, `days_left` as plain integer with a leading `-` when negative.
- Newline after each line; no blank lines.
7. Write `renewal-counts.json` beside `input.json`: an object with exactly the keys `expired` and `renew`, integers equal to the number of CSV rows with each status (0 if none). Example: `{"expired": 1, "renew": 2}`.
8. Re-check: every domain appears at most once; row count equals `expired + renew`; order is correct; each superseded certificate was excluded before classification (a domain whose newest cert is fine must not appear because of an older expired one).
## Worked example
`today` = 400:
- shop.example.net, expires 400, autoRenew false → 0 days, `expired`
- api.example.net, expires 430, autoRenew false → 30 days, `renew`
- web.example.net, expires 430, autoRenew true → not listed
- mail.example.net twice, 405 and 520 → only 520 counts, 120 days → not listed
- old.example.net, expires 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}`
## Ambiguity
- Missing `autoRenew` on a certificate: treat as false and note it in your reply.
- Do not alter `input.json`. Overwrite existing outputs.