From a3fa95f443a634eb80f04c5a31938bc8481572ae Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Sat, 4 Apr 2026 20:37:23 +0100 Subject: [PATCH] feat(crg): add crg-grade and crg-badge justfile recipes --- Justfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Justfile b/Justfile index 6257e3f..29780a1 100644 --- a/Justfile +++ b/Justfile @@ -990,3 +990,21 @@ help-me: @echo " https://github.com/hyperpolymath/vql-ut/issues/new" @echo "" @echo "Include the output of 'just doctor' in your report." + + +# Print the current CRG grade (reads from READINESS.md '**Current Grade:** X' line) +crg-grade: + @grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \ + [ -z "$$grade" ] && grade="X"; \ + echo "$$grade" + +# Generate a shields.io badge markdown for the current CRG grade +# Looks for '**Current Grade:** X' in READINESS.md; falls back to X +crg-badge: + @grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \ + [ -z "$$grade" ] && grade="X"; \ + case "$$grade" in \ + A) color="brightgreen" ;; B) color="green" ;; C) color="yellow" ;; \ + D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \ + *) color="lightgrey" ;; esac; \ + echo "[![CRG $$grade](https://img.shields.io/badge/CRG-$$grade-$$color?style=flat-square)](https://github.com/hyperpolymath/standards/tree/main/component-readiness-grades)"