Skillpedia
برمجة عامة144k · #674

commit-archaeologist

ما الذي تفعله

تنظر هذه المهارة في سجل git المحلي للمشروع لتفسير سبب وجود جزء من الشيفرة. وهي لمن يحتاج إلى سياق قبل تغيير شيفرة لم يكتبها.

متى تستخدمها

  • ✓عندما تسأل لماذا توجد دالة أو جزء من الشيفرة.
  • ✓عندما تريد معرفة من كتب جزءًا من الشيفرة وما الذي تغير بعده.
  • ✓عندما تخطط لإعادة كتابة وتحتاج إلى تاريخ الشيفرة أولًا.

رابط المهارة

https://github.com/Shubhamsaboo/awesome-llm-apps/blob/main/agent_skills/commit-archaeologist/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/Shubhamsaboo/awesome-llm-apps/blob/main/agent_skills/commit-archaeologist/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“لماذا توجد هذه الدالة؟ ابحث في سجل git واشرحها لي قبل أن أغيّرها.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

commit-archaeologist: دليل كامل

تفتح ملفًا فتجد كتلة شيفرة غريبة. فيها شروط غير مألوفة، أو علامة متروكة، أو قاعدة تبدو بلا فائدة. يخبرك أمر git blame بمن لمس السطر آخر مرة، لكن هذا الشخص نادرًا ما يكون من يعرف سبب كتابته. حذفها محفوف بالمخاطر، وتركها مزعج.

تقرأ هذه المهارة سجل git المحلي لديك وتعيد بناء القصة وراء الشيفرة. تجد الcommit الذي أدخلها، والتعديلات التي تلته، والملفات التي كثيرًا ما تغيرت معها. كما تقرأ رسائل الcommit بحثًا عن أدلة مثل أرقام المشكلات، أو التراجعات، أو كلمة "workaround". وهي مفيدة للمطورين ولغير المبرمجين الذين يرثون مشروعًا ويحتاجون إلى تقرير ما إذا كان تغيير شيء ما آمنًا. تعمل على جهازك ولا تكتب في المستودع.

حالات الاستخدام

قبل إزالة حل مؤقت

تقوم دالة في src/cache.py بمسح الذاكرة المؤقتة مرتين، وهذا يبدو كخطأ. تطلب سجلها التاريخي. يُظهر التقرير رسالة commit تذكر حلًا مؤقتًا ورقم مشكلة، فتعرف أن عليك مراجعة تلك المشكلة قبل حذف أي شيء.

التخطيط لإعادة الهيكلة

تريد تقسيم وحدة فوترة كبيرة. قبل البدء، تسأل عن الملفات التي تتغير عادةً معها. تسرد المهارة الملفات المرافقة التي ظهرت في عدة commits، فتعرف أي أجزاء تحتاج إلى اختبار وأيها يجب التعامل معه بحذر.

تسلم مشروع قديم

غادر زميل، وأصبحت الآن مسؤولًا عن سكربت لا يشرحه أحد. توجه المهارة إلى ملف واحد. تحصل على الcommit الذي أدخله، والجدول الزمني لإصلاحات لاحقة وتراجعات، ومؤشر ثقة يبين مقدار ما يثبته السجل فعلًا.

خطوة بخطوة

  1. 1ثبّت المهارة بوضع مجلدها في ~/.claude/skills/commit-archaeologist/ (أو في .claude/skills/ الخاص بمشروعك). تأكد من توفر Python 3 وgit على جهازك.
  2. 2انسخ المستودع محليًا إن لم تكن قد فعلت ذلك. لا تستطيع المهارة قراءة مستودع بعيد غير موجود على جهازك.
  3. 3أخبر الوكيل بمسار المستودع ومسار الملف. أضف نطاق أسطر مثل 40-72 إذا كنت تهتم بدالة واحدة.
  4. 4دع الوكيل يشغّل سكربت السجل. وهو للقراءة فقط، ويعيد بيانات منظمة عن المنشأ والجدول الزمني والملفات المرافقة والمؤلفين وأدلة النية.
  5. 5اقرأ التقرير: الخلاصة مع مؤشر الثقة، والمنشأ، والجدول الزمني، والملفات المرافقة، والأدلة، ومخاطر التغيير. ثم قرر هل تعدّل، أم تسأل المؤلف، أم تراجع مشكلة مرتبطة.

مثال

ماذا تطلب

“لماذا توجد حلقة إعادة المحاولة في src/payments/client.py في السطور 85-120؟ تحقق من السجل في /home/me/shop قبل أن أبسطها.”

ما الذي ستحصل عليه

الخلاصة: أُضيفت على الأرجح للتعامل مع مهلات انتظار من مزود الدفع، بثقة متوسطة. المنشأ: commit بعنوان "add retry for gateway timeout" مع رقم مشكلة مرتبط. لاحقًا، رفع أحد الإصلاحات عدد المحاولات، وأُلغي تراجع واحد. تغيرت الحلقة كثيرًا مع config/settings.py، فتحقق من هذا الملف قبل التبسيط.

نصائح

  • ✓أعطِ نطاق أسطر كلما أمكن. يتتبع النطاق ذلك الجزء فقط، بينما سجل الملف كاملًا يخلط تغييرات كثيرة غير مرتبطة ويصعب قراءته.
  • ✓لا تعتبر آخر مؤلف في blame هو من كتب الشيفرة. لهذا السبب تفصل المهارة بين blame الحالي وعدد الcommits التاريخية.
  • ✓رسائل الcommit الغامضة تحد من الإجابة. إذا قال التقرير إن الرسائل لا توضح السبب، فاعتبر الاستنتاج تخمينًا، واسأل زميلًا أو اقرأ النقاش المرتبط.

بدائل

  • diffs

    اختره عندما تريد عرض ما تغيّر في تعديلاتك كـ diff ومشاركته، بدلًا من البحث عن سبب وجود شيفرة قديمة.

  • code-review

    اختره عندما تكون مستعدًا للدمج وتريد مراجعة تغييراتك وفق معايير البرمجة والمواصفات، لا استكشافها تاريخيًا.

  • graphify

    اختره عندما يكون سؤالك عن عدد الملفات والمستندات المترابطة في المشروع، لا عن سبب وجود منطقة معينة من الشيفرة.

أسئلة وأجوبة

هل تعمل إذا أُعيدت تسمية الملف أو نُقل؟

نعم في حالة السجل الكامل للملف. من دون نطاق أسطر، تتتبع المهارة إعادات التسمية، ويسرد الجدول الزمني ما رصدته منها. كما تتضمن بيانات المنطقة المسارات التاريخية، فيصبح الاسم القديم جزءًا من القصة.

ما مدى ثقتي في الإجابة التي تقدمها؟

تعطي مؤشر ثقة: عالٍ أو متوسط أو منخفض. رسائل الcommit أدلة لا براهين. إذا كان السجل محدودًا، ينبغي أن يقول التقرير إن السجل يُظهر أو يرجّح، بدلًا من ادعاء سبب قاطع.

ماذا لو قالت رسالة commit إنه مؤقت أو حل مؤقت؟

تعامل المهارة هذه الكلمات كأدلة قوية على النية. لكنها لا تستطيع معرفة هل القيد ما زال ساريًا اليوم. لا يؤكد ذلك إلا المؤلف الأصلي أو نقاش مرتبط، لذا تحقق قبل إزالة الشيفرة.

كيف تعمل

تتتبع المهارة الملف أو الأسطر عبر التزامات git المحلية، وتجد الالتزام الذي أدخلها والتعديلات اللاحقة، وتقرأ رسائل الالتزامات بحثًا عن دلائل على النية. وكل شيء يعمل على حاسوبك.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Commit Archaeologist

git blame names the last person to touch a line. This skill reconstructs the reason the line exists. It traces a file or current line range through local git history, identifies its origin and later edits, finds files that repeatedly changed beside it, and extracts intent clues from commit messages.

Everything runs locally. No network calls, API keys, or repository writes.

When to use

  • The user asks why a block, function, or file exists
  • The user wants to know who introduced code and what changed afterward
  • A rewrite or refactor needs historical constraints and change risks
  • A workaround, temporary branch, or surprising design choice needs context

When not to use

  • The user only wants raw blame output or a commit list
  • The task is to squash, delete, or rewrite git history
  • The repository is remote and has not been cloned locally
  • The question is about project-wide architecture rather than one file or region

Gather the target

Get the repository path and tracked file path. Use a line range when the user names a current block or function. If either path is missing, ask only for the missing value. Do not scan sibling repositories.

Paths should be relative to the repository and use forward slashes. Line ranges use inclusive current line numbers such as 40-72.

Run the dig

From this skill directory:

python3 scripts/archaeologist.py /path/to/repo src/cache.py --lines 40-72 --json

For the complete history of a file, omit --lines:

python3 scripts/archaeologist.py /path/to/repo src/cache.py --json

The script is read-only. With a range it uses git line-log; without one it uses file history with rename following. It also reads current authorship with blame. If it rejects a path or range, report that error and ask for a corrected target.

Before interpreting the JSON, read references/reading-git-history.md. Its confidence rules prevent blame ownership, correlation, and commit-message hints from becoming false certainty.

Read the JSON

  • region: normalized repository, current and historical paths, mode, range, and co-change threshold
  • introduced_by: oldest commit in the selected history
  • timeline: commits ordered oldest to newest, with category, changed files, and detected renames
  • co_changed: files present beside the target in enough selected commits
  • authors: current blamed lines and historical commit counts, kept separate
  • intent_signals: issue references, reverts, workarounds, temporary markers, and unfinished-work markers found in commit messages

An empty signal list means the messages do not say why. It does not mean the change had no reason.

Write the report

Turn the JSON into a short "why this code exists" report:

  1. Bottom line. One or two sentences with the most likely explanation and a confidence label: high, medium, or low.
  2. Origin. Introducing hash, date, author, subject, and the neighboring files that make the initial purpose clearer.
  3. Timeline. Oldest to newest. Group mechanical edits when they do not change the story, but preserve reverts, fixes, and workarounds.
  4. Companion files. Explain repeated co-changes as a coupling clue. Do not treat a one-off file in changed_files as a dependency.
  5. Intent evidence. Quote short commit subjects or signal words. Label any conclusion beyond those facts as an inference.
  6. Change risk. Name the constraints, companion files, and unresolved temporary choices worth checking before an edit.

Keep hashes short in prose, but preserve enough characters to identify them. Do not dump the full JSON unless the user asks.

Evidence rules

  • Current blame ownership is not proof of original authorship.
  • The oldest selected commit is the region's introduction, not always the file's first commit.
  • Repeated co-change suggests coupling; it does not prove a dependency.
  • Commit categories are message heuristics, not verified issue types.
  • "Temporary" and "workaround" are strong intent clues, but only the message author or linked discussion can confirm whether the constraint still applies.
  • If the history is thin or messages are vague, say "the history shows" and "likely" instead of inventing a design rationale.

Follow-ups

End by offering one relevant follow-up, such as:

  • "Want me to assess whether this looks deliberate or accidental?"
  • "Want me to map what could break if this region changes?"

For a delibe

الأسئلة الشائعة

هل ترسل شيفرتي إلى مكان آخر؟

لا. تعمل المهارة محليًا بالكامل دون أي اتصال بالشبكة، ولا تكتب في المستودع.

ماذا تحتاج مني؟

مكان المستودع ومسار الملف، واختياريًا نطاق الأسطر للشيفرة المعنية.

هل تستطيع إعادة كتابة السجل أو حذفه؟

لا. إعادة كتابة السجل أو حذفه خارج ما تفعله هذه المهارة.

التفاصيل

الوصف الأصلي من المؤلف

Reconstructs why code exists from local git history, including the introducing commit, later changes, current authors, repeated companion files, and likely intent. Use when the user asks "why does this code exist", "who wrote this function and why", or to "explain the history of this function" before a rewrite, refactor, or risky edit. Runs entirely locally.

repo: Shubhamsaboo/awesome-llm-apps

الشعبية

نجوم GitHub
144k
الترتيب
#674
الترخيص
Apache-2.0
آخر تحديث
22‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة