New to Claude Skills? Learn how to install them →

davila7 on GitHub

Star History Chart

Free

Self-hosted stargazer charts for GitHub repos.

Get this skill

Free · Opens the source repo

What Star History Chart does

The Star History Chart skill allows developers to add a self-hosted "Stargazers over time" chart to their GitHub repository's README file. This skill addresses the recent changes in GitHub's API, which restrict access to the stargazers endpoint, making it impossible for unauthenticated users to retrieve this data. With this skill, users can generate a static SVG chart that is committed to the repository, ensuring that it remains accessible and up-to-date without relying on third-party services that may return authentication errors.

The skill consists of a Python script and a GitHub Actions workflow. The script, generate_star_history.py, fetches the stargazer data using the repository's own GITHUB_TOKEN, rendering a clean SVG that adapts to both light and dark themes. The accompanying GitHub Actions workflow, defined in star-history.yml, automates the process of refreshing the chart weekly, ensuring that the data remains current without manual intervention. This setup eliminates the risk of broken images commonly associated with external chart services.

To implement this skill, users need to copy the provided script and workflow files into their repository, generate the SVG locally using an authenticated token, and update their README to link to the newly created chart. The skill is designed to be straightforward, requiring minimal configuration and no additional secrets, making it accessible for both private and public repositories.

Overall, the Star History Chart skill is an essential tool for developers who want to maintain an accurate representation of their repository's popularity over time, free from the limitations imposed by GitHub's API changes.

When to use it

Use this skill when you want to display an up-to-date stargazer chart in your README without relying on third-party services.

When not to use it

This skill may not be suitable if you do not have access to the repository's `GITHUB_TOKEN` or if you prefer using external services for chart generation.

What you can build with it

Updating a Broken Chart

If your existing stargazer chart is broken due to GitHub's API restrictions, this skill provides a reliable alternative.

Automating Stargazer Updates

Set up the skill to automatically refresh the stargazer chart weekly, ensuring your README always displays accurate data.

Customizing Chart Appearance

Modify the chart's colors and size to match your repository's branding or personal preferences.

How to install Star History Chart

View source

1. Install with the skills CLI

npx skills add davila7/claude-code-templates/star-history-chart --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by davila7

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.

Frequently asked questions about Star History Chart

Similar skills