star-history-chart
Fungsinya
Skill ini menyiapkan grafik riwayat bintang di README repositori Anda yang tidak bergantung pada layanan grafik pihak luar. Skill ini untuk pengelola open source yang ingin menunjukkan pertumbuhan proyek mereka.
Kapan dipakai
- βSaat Anda ingin grafik pemberi bintang dari waktu ke waktu ditampilkan di README GitHub Anda.
- βKetika gambar grafik bintang dari pihak ketiga sudah tidak bisa dimuat untuk repositori Anda.
- βSaat Anda ingin grafik disegarkan otomatis setiap minggu dengan GitHub Action.
Link skill
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/git/star-history-chart/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βTambahkan grafik riwayat bintang ke README proyek saya yang memperbarui dirinya sendiri setiap minggu.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent menyalin skrip dan alur kerja GitHub ke repositori Anda. Alur kerja memakai token milik repositori untuk mengambil bintang, menggambar SVG dengan tema terang dan gelap, lalu meng-commit-nya setiap minggu.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Star History Chart (self-hosted, never breaks)
Add a "Stargazers over time" chart that renders from a static SVG committed to the repo and refreshes itself weekly β no external chart service, no broken images.
Why this exists
GitHub now restricts the /stargazers endpoint to a repository's own admins and
collaborators. Unauthenticated requests return {"message":"Requires authentication"}, which breaks every third-party live-chart service
(star-history.com free tier, starchart.cc, etc.) for all repos. The only
reliable fix is to generate the chart yourself with an authenticated token and
commit a static image. Inside GitHub Actions, the repo's own GITHUB_TOKEN can
read its own stargazers, so the whole thing runs with zero secrets to configure.
What this skill sets up
scripts/generate_star_history.pyβ fetches stargazers (authenticated), renders a clean, light/dark-adaptive SVG..github/workflows/star-history.ymlβ weekly cron + manual trigger that regenerates and commitsdocs/star-history.svg.- A README section pointing at the local SVG.
Workflow
Step 1: Copy the script and workflow into the repo
mkdir -p scripts .github/workflows docs
cp skills/git/star-history-chart/scripts/generate_star_history.py scripts/generate_star_history.py
cp skills/git/star-history-chart/assets/star-history.yml .github/workflows/star-history.yml
The script needs the
requestspackage:pip install requests. It resolves the repo fromSTAR_HISTORY_REPO, thenGITHUB_REPOSITORY(set automatically in Actions), then theorigingit remote β so no edits are required for it to work in a different repo.
Step 2: Generate the SVG once, locally
Use a token that can read the repo's stargazers (as owner/collaborator). The GitHub CLI provides one:
GITHUB_TOKEN=$(gh auth token) python scripts/generate_star_history.py
This writes docs/star-history.svg. For a repo with many thousands of stars the
first run paginates the whole stargazer list and can take a couple of minutes.
Verify it rendered (optional, macOS): qlmanage -t -s 800 -o . docs/star-history.svg
Step 3: Add it to the README
Add or replace the star chart section. Point the image at the local SVG. Set the link target to wherever you want clicks to go (the repo, a docs page, or your own site):
## Stargazers over time
[](https://github.com/OWNER/REPO/stargazers)
If replacing a broken star-history.com / starchart.cc embed, swap only the
image URL to docs/star-history.svg and keep or update the link target.
Step 4: Commit
git add scripts/generate_star_history.py .github/workflows/star-history.yml docs/star-history.svg README.md
git commit -m "feat(readme): self-hosted stargazers chart with weekly auto-refresh"
git push
Step 5: (Optional) Trigger the auto-refresh now
The workflow runs every Monday at 04:00 UTC. To refresh immediately without waiting: GitHub β Actions β "Update Star History" β Run workflow.
Customization
- Output path β set
STAR_HISTORY_OUTPUT(defaultdocs/star-history.svg). - Different repo β set
STAR_HISTORY_REPO=owner/name. - Colors / size β edit the
.line,.area,.dotCSS andWIDTH/HEIGHTconstants near the top ofgenerate_star_history.py. The chart is theme-aware via aprefers-color-scheme: darkblock, so it looks right in both GitHub light and dark modes. - Refresh cadence β edit the
cronexpression in the workflow.
Notes
- No secrets to add: the workflow uses the automatic
GITHUB_TOKEN. - Private repos work too, as long as the token can read the repo.
- The script uses only
requestsplus the Python standard library.
Pertanyaan umum
Mengapa tidak memakai situs grafik langsung?
Skill ini menjelaskan bahwa GitHub kini membatasi data pemberi bintang hanya untuk admin repositori, sehingga banyak layanan grafik pihak luar gagal untuk semua orang.
Apakah saya perlu menambahkan kunci rahasia?
Skill ini menyatakan alur kerja berjalan dengan token milik repositori di dalam GitHub Actions, sehingga tidak perlu mengatur rahasia tambahan.
Apa yang ditambahkan ke proyek saya?
Sebuah skrip, berkas alur kerja mingguan, SVG yang dihasilkan di folder docs, dan bagian README yang mengarah ke grafik tersebut.
Detail
Deskripsi asli dari pembuat
Add a self-hosted "Stargazers over time" chart to any GitHub repo's README. GitHub now restricts the stargazers endpoint to a repo's own admins/collaborators, so third-party live services (star-history free tier, starchart.cc) return "Requires authentication" for everyone. This generates a static, theme-aware SVG in-repo and auto-refreshes it weekly with a GitHub Action using the repo's own GITHUB_TOKEN. Use when the star chart in a README is broken, shows "Requires authentication", or you want a star history that never breaks.
Popularitas
- Bintang GitHub
- 33k
- Peringkat
- #8855
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
owasp-security
33kMengajari agent Anda panduan keamanan OWASP untuk aplikasi web, API, mobile, kontainer, dan agent AI, sehingga bisa menemukan kelemahan umum dan menyarankan perbaikan.
agent-management
33kMembiarkan agent Anda membuat, mencantumkan, menidurkan, membangunkan, mengganti nama, dan menghapus agent AI menggunakan baris perintah AI Maestro, sambil mengelola siklus hidup setiap agent.
agent-messaging
33kMembiarkan agent Anda mengirim, menerima, dan membalas pesan bertanda tangan antaragent AI, menggunakan Agent Messaging Protocol, sebagian besar di mesin Anda sendiri.
docs-search
33kMembiarkan agent Anda mencari dokumentasi kode yang dibuat otomatis untuk tanda tangan fungsi, definisi kelas, dan komentar, sehingga agent memeriksa API yang sebenarnya sebelum mengubah kode.
Skill serupa
openclaw-update
394kMembantu agent Anda memperbarui OpenClaw Gateway yang sudah ada, dengan memilih metode pembaruan yang sesuai cara pemasangannya dan menjaga sesi Anda tetap berjalan.
diagnose-gateway
394kMembantu agent Anda mencari tahu mengapa OpenClaw Gateway gagal dengan memeriksa pengaturan, channel, dan port tanpa mengubah apa pun.
crabbox-apps
394kMembantu agent Anda membuka dan menjalankan aplikasi di mesin cloud sementara, lalu menampilkan tampilannya di panel samping chat Anda.