Skip to content

Commit a176ad5

Browse files
committed
feat(crg): add crg-grade and crg-badge justfile recipes
1 parent 29e7a75 commit a176ad5

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Justfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,3 +321,21 @@ help-me:
321321
echo " 2. just heal (auto-install what's missing)"
322322
echo " 3. cargo clean && just build (fresh build)"
323323
echo " 4. Read .claude/CLAUDE.md for full context"
324+
325+
326+
# Print the current CRG grade (reads from READINESS.md '**Current Grade:** X' line)
327+
crg-grade:
328+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
329+
[ -z "$$grade" ] && grade="X"; \
330+
echo "$$grade"
331+
332+
# Generate a shields.io badge markdown for the current CRG grade
333+
# Looks for '**Current Grade:** X' in READINESS.md; falls back to X
334+
crg-badge:
335+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
336+
[ -z "$$grade" ] && grade="X"; \
337+
case "$$grade" in \
338+
A) color="brightgreen" ;; B) color="green" ;; C) color="yellow" ;; \
339+
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
340+
*) color="lightgrey" ;; esac; \
341+
echo "[![CRG $$grade](https://img.shields.io/badge/CRG-$$grade-$$color?style=flat-square)](https://github.com/hyperpolymath/standards/tree/main/component-readiness-grades)"

0 commit comments

Comments
 (0)