Skip to content
Skillpedia
Deploy & cloud (DevOps)33k Β· #8855

star-history-chart

What it does

This skill sets up a star history chart in your repository's README that does not depend on outside chart services. It is for open source maintainers who want to show their project's growth.

When to use it

  • βœ“When you want a stargazers-over-time chart shown in your GitHub README.
  • βœ“When a third-party star chart image has stopped loading for your repository.
  • βœ“When you want the chart refreshed automatically each week with a GitHub Action.

Skill link

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/git/star-history-chart/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/git/star-history-chart/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œAdd a star history chart to my project's README that updates itself each week.”

5 new skills a week. 1 minute to read.

How it works

The agent copies a script and a GitHub workflow into your repo. The workflow uses the repo's own token to fetch stars, draws a light and dark theme SVG, and commits it weekly.

Technical content (original SKILL.md)

Original text by the author, straight from 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

  1. scripts/generate_star_history.py β€” fetches stargazers (authenticated), renders a clean, light/dark-adaptive SVG.
  2. .github/workflows/star-history.yml β€” weekly cron + manual trigger that regenerates and commits docs/star-history.svg.
  3. 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 requests package: pip install requests. It resolves the repo from STAR_HISTORY_REPO, then GITHUB_REPOSITORY (set automatically in Actions), then the origin git 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
[![Stargazers over time](docs/star-history.svg)](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 (default docs/star-history.svg).
  • Different repo β€” set STAR_HISTORY_REPO=owner/name.
  • Colors / size β€” edit the .line, .area, .dot CSS and WIDTH/HEIGHT constants near the top of generate_star_history.py. The chart is theme-aware via a prefers-color-scheme: dark block, so it looks right in both GitHub light and dark modes.
  • Refresh cadence β€” edit the cron expression 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 requests plus the Python standard library.
FAQ

Why not use a live chart website?

The skill explains that GitHub now limits stargazer data to repo admins, so many outside chart services fail for everyone.

Do I need to add secret keys?

The skill says the workflow runs with the repository's own token inside GitHub Actions, so no extra secrets need configuring.

What gets added to my project?

A script, a weekly workflow file, a generated SVG in a docs folder, and a README section that points to the chart.

Details

Original description by the author

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.

repo: davila7/claude-code-templates

Popularity

GitHub stars
33k
Ranking position
#8855
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills