From 6e8300785799e29f50e2ab2ba1f84c45397bf546 Mon Sep 17 00:00:00 2001 From: Quanlai Li Date: Thu, 16 Jul 2026 09:56:23 -0700 Subject: [PATCH] tools: add update-star-chart.sh to regenerate the README star chart Co-Authored-By: Claude Fable 5 --- tools/update-star-chart.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 tools/update-star-chart.sh diff --git a/tools/update-star-chart.sh b/tools/update-star-chart.sh new file mode 100755 index 0000000..9d9294b --- /dev/null +++ b/tools/update-star-chart.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# Regenerate assets/star-history.png from the repo's own star data. +# Needs a gh login with admin/collab access to the repo (GitHub restricted +# the stargazers API to admins/collaborators in June 2026), plus matplotlib. +set -e +cd "$(dirname "$0")/.." + +gh api -H "Accept: application/vnd.github.star+json" --paginate \ + "repos/OpenClaudia/openclaudia-skills/stargazers?per_page=100" \ + --jq '.[].starred_at' > /tmp/openclaudia-stars.txt + +python3 - <<'EOF' +import matplotlib +matplotlib.use('Agg') +import matplotlib.pyplot as plt +from datetime import datetime + +dates = sorted(datetime.strptime(l.strip(), '%Y-%m-%dT%H:%M:%SZ') + for l in open('/tmp/openclaudia-stars.txt')) +fig, ax = plt.subplots(figsize=(8, 4.5), dpi=150) +ax.plot(dates, range(1, len(dates) + 1), color='#2f81f7', linewidth=2) +ax.fill_between(dates, range(1, len(dates) + 1), alpha=0.1, color='#2f81f7') +ax.set_title('OpenClaudia/openclaudia-skills — Star History', fontsize=12) +ax.set_ylabel('GitHub Stars') +ax.grid(alpha=0.3) +fig.autofmt_xdate() +fig.tight_layout() +fig.savefig('assets/star-history.png') +print(f'{len(dates)} stars') +EOF + +sed -i '' -E "s/Updated [0-9]{4}-[0-9]{2}-[0-9]{2}\./Updated $(date +%F)./" README.md +rm -f /tmp/openclaudia-stars.txt