Globales Ranking · von 601 Skills
github-stars AI Agent Skill
Quellcode ansehen: b-open-io/prompts
SafeInstallation
npx skills add b-open-io/prompts --skill github-stars 10
Installationen
GitHub Star Count Integration
Add live GitHub star counts to websites as social proof. Two patterns depending on traffic level — pick the right one and go.
Decision: Client-Side vs Server-Side
Client-side hook (default) — fetch directly from GitHub API in the browser.
- No API key needed for public repos
- GitHub allows 60 requests/hour per IP (unauthenticated)
- Fine for most sites — each visitor makes their own request
- Star count simply doesn't render if the fetch fails
Server-side caching — proxy through your own API route with a GITHUB_TOKEN.
- Raises the limit to 5,000 requests/hour
- Add
next: { revalidate: 300 }to cache for 5 minutes - Use this for high-traffic pages or when you need the count at build time
Client-Side Hook
import { 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;
}Display Pattern
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.
For More
Read references/patterns.md for:
- Server-side caching API route (Next.js)
- Mobile-responsive display (collapsed on small screens, badge on large)
- Rate limit details and when to add a token
- Animated star count (number counting up on mount)
- Reference implementation from our theme-token project
Installationen
Sicherheitsprüfung
Quellcode ansehen
b-open-io/prompts
Mehr aus dieser Quelle
Power your AI Agents with
the best open-source models.
Drop-in OpenAI-compatible API. No data leaves Europe.
Explore Inference APIGLM
GLM 5
$1.00 / $3.20
per M tokens
Kimi
Kimi K2.5
$0.60 / $2.80
per M tokens
MiniMax
MiniMax M2.5
$0.30 / $1.20
per M tokens
Qwen
Qwen3.5 122B
$0.40 / $3.00
per M tokens
So verwenden Sie diesen Skill
Install github-stars by running npx skills add b-open-io/prompts --skill github-stars in your project directory. Führen Sie den obigen Installationsbefehl in Ihrem Projektverzeichnis aus. Die Skill-Datei wird von GitHub heruntergeladen und in Ihrem Projekt platziert.
Keine Konfiguration erforderlich. Ihr KI-Agent (Claude Code, Cursor, Windsurf usw.) erkennt installierte Skills automatisch und nutzt sie als Kontext bei der Code-Generierung.
Der Skill verbessert das Verständnis Ihres Agenten für github-stars, und hilft ihm, etablierte Muster zu befolgen, häufige Fehler zu vermeiden und produktionsreifen Code zu erzeugen.
Was Sie erhalten
Skills sind Klartext-Anweisungsdateien — kein ausführbarer Code. Sie kodieren Expertenwissen über Frameworks, Sprachen oder Tools, das Ihr KI-Agent liest, um seine Ausgabe zu verbessern. Das bedeutet null Laufzeit-Overhead, keine Abhängigkeitskonflikte und volle Transparenz: Sie können jede Anweisung vor der Installation lesen und prüfen.
Kompatibilität
Dieser Skill funktioniert mit jedem KI-Coding-Agenten, der das skills.sh-Format unterstützt, einschließlich Claude Code (Anthropic), Cursor, Windsurf, Cline, Aider und anderen Tools, die projektbezogene Kontextdateien lesen. Skills sind auf Transportebene framework-agnostisch — der Inhalt bestimmt, für welche Sprache oder welches Framework er gilt.
Chat with 100+ AI Models in one App.
Use Claude, ChatGPT, Gemini alongside with EU-Hosted Models like Deepseek, GLM-5, Kimi K2.5 and many more.