star-history-chart
ما الذي تفعله
تُعد هذه المهارة مخطط تاريخ النجوم في ملف README لمستودعك، دون الاعتماد على خدمات رسوم خارجية. وهي مناسبة لمشرفي المشاريع مفتوحة المصدر الذين يريدون إظهار نمو مشروعهم.
متى تستخدمها
- ✓عندما تريد مخطط عدد النجوم عبر الزمن في ملف README على GitHub.
- ✓عندما توقفت صورة مخطط نجوم من طرف ثالث عن الظهور لمستودعك.
- ✓عندما تريد تحديث المخطط تلقائيا كل أسبوع عبر GitHub Action.
رابط المهارة
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/git/star-history-chart/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“أضف مخطط تاريخ النجوم إلى ملف README لمشروعي، ويتحدث نفسه كل أسبوع.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
ينسخ وكيلك سكربتا وملف سير عمل GitHub إلى المستودع. يستخدم سير العمل رمز المستودع نفسه لجلب النجوم، ويرسم SVG بسمة فاتحة وأخرى داكنة، ويلتزم به أسبوعيا.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من 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
scripts/generate_star_history.py— fetches stargazers (authenticated), renders a clean, light/dark-adaptive SVG..github/workflows/star-history.yml— weekly cron + manual trigger that regenerates and commitsdocs/star-history.svg.- 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
requestspackage:pip install requests. It resolves the repo fromSTAR_HISTORY_REPO, thenGITHUB_REPOSITORY(set automatically in Actions), then theorigingit 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
[](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(defaultdocs/star-history.svg). - Different repo — set
STAR_HISTORY_REPO=owner/name. - Colors / size — edit the
.line,.area,.dotCSS andWIDTH/HEIGHTconstants near the top ofgenerate_star_history.py. The chart is theme-aware via aprefers-color-scheme: darkblock, so it looks right in both GitHub light and dark modes. - Refresh cadence — edit the
cronexpression 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
requestsplus the Python standard library.
الأسئلة الشائعة
لماذا لا نستخدم موقع مخططات مباشرا؟
تشرح المهارة أن GitHub بات يحصر بيانات المعجبين بالنجوم على مديري المستودع، لذا تفشل كثير من الخدمات الخارجية للجميع.
هل أحتاج إلى إضافة مفاتيح سرية؟
تقول المهارة إن سير العمل يعمل بالرمز الخاص بالمستودع داخل GitHub Actions، فلا حاجة لإعداد أسرار إضافية.
ماذا يُضاف إلى مشروعي؟
سكربت، وملف سير عمل أسبوعي، وملف SVG مولَّد في مجلد docs، وقسم في README يشير إلى المخطط.
التفاصيل
الوصف الأصلي من المؤلف
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.
الشعبية
- نجوم GitHub
- 33k
- الترتيب
- #8855
- الترخيص
- MIT
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
owasp-security
33kتعلّم وكيلك إرشادات OWASP الأمنية لتطبيقات الويب وواجهات API والموبايل والحاويات ووكلاء الذكاء الاصطناعي، ليكشف نقاط الضعف الشائعة ويقترح الإصلاحات.
agent-management
33kتتيح لوكيلك إنشاء وكلاء ذكاء اصطناعي وسردهم وإسباتهم وإيقاظهم وإعادة تسميتهم وحذفهم عبر أداة سطر الأوامر AI Maestro، مع إدارة دورة حياة كل وكيل.
agent-messaging
33kتتيح لوكيلك إرسال الرسائل الموقعة بين وكلاء الذكاء الاصطناعي واستقبالها والرد عليها، باستخدام بروتوكول المراسلة بين الوكلاء، في الغالب على جهازك.
docs-search
33kتتيح لوكيلك البحث في توثيق الشيفرة المُنشأ تلقائياً عن توقيعات الدوال وتعريفات الكلاسات والتعليقات، فيتحقق من الواجهة البرمجية الفعلية قبل تعديل الشيفرة.
مهارات مشابهة
openclaw-update
394kيساعد وكيلك على تحديث بوابة OpenClaw Gateway الموجودة، مع اختيار طريقة التحديث المناسبة لطريقة تثبيتها والحفاظ على جلستك.
diagnose-gateway
394kيساعد وكيلك على معرفة سبب فشل بوابة OpenClaw Gateway عبر فحص الإعدادات والقنوات والمنافذ دون تغيير أي شيء.
crabbox-apps
394kيساعد وكيلك على فتح تطبيق وتشغيله على جهاز سحابي مؤقت، ثم عرض واجهته في الشريط الجانبي للدردشة.