star-history-chart

Generates a self-hosted stargazers-over-time SVG chart with weekly GitHub Actions refresh.

30.5k|3.5k|Updated Jul 4, 2025
One-click install
npx skills add https://github.com/davila7/claude-code-templates --skill star-history-chart
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: star-history-chart
Source: https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/git/star-history-chart
Command: npx skills add https://github.com/davila7/claude-code-templates --skill star-history-chart

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, and includes scripts (resource) and assets (resource) components.

What problem does it solve?

GitHub now restricts the stargazers API endpoint to a repository's own admins and collaborators, so third-party live chart services like star-history.com and starchart.cc return "Requires authentication" errors for every repo. This Skill replaces those broken embeds with a static SVG generated in-repo using an authenticated token, so the chart never breaks.

Core Features & Use Cases

  • Authenticated data fetching: A Python script paginates the GitHub stargazers API with a token and builds a cumulative star-count time series.
  • Theme-aware SVG rendering: Produces a light/dark adaptive chart via a prefers-color-scheme media query, with configurable colors and dimensions.
  • Automated weekly refresh: A GitHub Actions workflow regenerates and commits docs/star-history.svg every Monday using the repo's own GITHUB_TOKEN, with no secrets to configure.
  • Use Case: Your README's star-history.com badge shows "Requires authentication". Use this Skill to replace it with a locally committed SVG that auto-updates weekly.

Quick Start

Set up a self-hosted stargazers chart for my repository by copying the generator script and workflow, generating the initial SVG with my GitHub token, and updating the README to point at the local image.

Frequently Asked Questions about star-history-chart

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a broken star history chart in my GitHub README?

Third-party services like star-history.com fail because GitHub restricts the stargazers endpoint to repo admins and collaborators. Generate a static SVG in-repo with an authenticated token and commit it, then point your README image at the local file.

How do I generate a stargazers over time chart with Python?

Run the generate_star_history.py script with a GITHUB_TOKEN that can read the repo's stargazers. It paginates the GitHub API, builds a cumulative time series, and renders a theme-aware SVG to docs/star-history.svg.

Does the star history workflow require configuring secrets?

No secrets are needed. The GitHub Actions workflow uses the automatic GITHUB_TOKEN, which can read the repository's own stargazers, and GITHUB_REPOSITORY is set automatically by Actions.

Why does star-history.com show Requires authentication?

GitHub now restricts unauthenticated access to the stargazers endpoint, returning a "Requires authentication" error for all repos. This breaks every third-party live-chart service, so the only fix is generating the chart yourself with an authenticated token.

Can I use this star chart for a private repository?

Yes, private repos work as long as the token can read the repository. The workflow's GITHUB_TOKEN already has the required access, and locally you can use a token from the GitHub CLI.

What are the limitations of the GitHub stargazers API pagination?

GitHub caps stargazers pagination at 400 pages of 100 results, covering up to 40,000 stars. For repos with many stars, the first run paginates the full list and can take a couple of minutes.