From bopen-tools
Adds live GitHub star counts and badges to websites using client-side or server-side fetching. Provides a React hook and display pattern with graceful fallback.
How this skill is triggered — by the user, by Claude, or both
Slash command
/bopen-tools:github-starsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Add live GitHub star counts to websites as social proof. Two patterns depending on traffic level — pick the right one and go.
Add live GitHub star counts to websites as social proof. Two patterns depending on traffic level — pick the right one and go.
Client-side hook (default) — fetch directly from GitHub API in the browser.
Server-side caching — proxy through your own API route with a GITHUB_TOKEN.
next: { revalidate: 300 } to cache for 5 minutesimport { useEffect, useState } from "react";
export function useGitHubStars(repo: string) {
const [stars, setStars] = useState<number | null>(null);
useEffect(() => {
fetch(`https://api.github.com/repos/${repo}`)
.then((res) => res.json())
.then((data) => {
if (data.stargazers_count !== undefined) {
setStars(data.stargazers_count);
}
})
.catch(() => {}); // Intentional: star count is non-critical social proof — icon renders without it
}, [repo]);
return stars;
}
import { Github } from "lucide-react";
const stars = useGitHubStars("owner/repo");
<a
href="https://github.com/owner/repo"
target="_blank"
rel="noopener noreferrer"
className="inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
>
<Github className="h-4 w-4" />
{stars !== null && <span className="text-xs tabular-nums">{stars}</span>}
</a>
Why tabular-nums: prevents layout shift as the digit count changes — all numerals occupy the same width.
Why stars !== null: the GitHub icon always renders; the count only appears after the fetch succeeds. If GitHub is down or rate-limited, the link still works as a plain GitHub link.
Read references/patterns.md for:
npx claudepluginhub itsbrex/b-open-prompts2plugins reuse this skill
First indexed Jun 23, 2026
Adds live GitHub star counts and badges to websites using client-side or server-side fetching. Provides a React hook and display pattern with graceful fallback.
Fetches GitHub star timestamps and renders ASCII charts of stars by day and hour in the terminal. Useful for tracking repo growth or launch spikes.
Manages GitHub Stars with auto-discovery from content, update tracking (releases/commits), and an HTML dashboard for visualizing starred projects.