شعار Rename Files Date Prefix

Rename Files Date Prefix

مؤسسة
pnp
rename-files-date-prefix

Renames all files in a SharePoint document library (including subfolders) to prefix them with their created date in yyMMdd format (e.g., 251203-Status Report.pdf). Offers a preview before committing changes. Use when the user asks to prefix filenames with dates or add date prefixes to files.

نظرة عامة

الناشرpnp
المستودعsharepoint-skills
اسم المهارةrename-files-date-prefix
النجوم
141
التفريعات
60
الملفات المرفقة
تعليمات فقط
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • مكتفية بذاتها

    كل ما يحتاجه النموذج موجود في التعليمات — لا ملفات إضافية لمزامنتها.

  • مفتوحة المصدر

    نشرها pnp على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Rename Files Date Prefix في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/pnp/sharepoint-skills/tree/main/Skills/rename-files-date-prefix/rename-files-date-prefix
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/pnp/sharepoint-skills.git /tmp/sharepoint-skills
mkdir -p .claude/skills
cp -r /tmp/sharepoint-skills/Skills/rename-files-date-prefix/rename-files-date-prefix .claude/skills/rename-files-date-prefix
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Rename Files Date Prefix في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Rename Files Date Prefix تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Rename Files Date Prefix بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Rename Files with Date Prefix

Rename all files in a SharePoint document library to prefix them with their created date in yyMMdd format (e.g., 251203-Status Report.pdf).

Steps

1. Identify the Target Library

  • Use the current document library if the user doesn't specify one.
  • Call get_current_list_or_library to get the library ID.

2. Get the Library Schema

  • Call get_list_schema to confirm the library has Created and FileLeafRef fields and to understand the structure.

3. Retrieve All Files (Including Subfolders)

  • Call get_list_item_metadata with fetchAll: true to retrieve all items.
  • Use a CAML query that filters to files only (FSObjType = 0):
    <Query><Where><Eq><FieldRef Name='FSObjType'/><Value Type='Integer'>0</Value></Eq></Where><OrderBy><FieldRef Name='FileLeafRef' Ascending='TRUE'/></OrderBy></Query>

4. Build the Preview

For each file returned:

  1. Extract the Created date and format it as yyMMdd (2-digit year, 2-digit month, 2-digit day).
  2. Get the current filename from FileLeafRef.
  3. Determine the folder path from FileRef (strip the filename to get the folder).
  4. Skip check: If the filename already matches the pattern ^\d{6}- (six digits followed by a hyphen), mark it as skipped with reason "Already has date prefix".
  5. Build the new filename: yyMMdd-OriginalFilename.

5. Show the Preview Table

Always show the preview before making any changes. Present a markdown table:

#Current NameNew NameFolderStatus
1Status Report.pdf251203-Status Report.pdf/sites/Team/DocsWill rename
2251203-Budget.xlsx251203-Budget.xlsx/sites/Team/Docs/FinanceSkipped (already prefixed)

Include a summary:

  • Total files found: X
  • To be renamed: Y
  • Skipped: Z

Then ask: "Ready to rename Y files? Confirm to proceed."

6. Rename on Confirmation

Once the user confirms:

  • For each file to be renamed, call update_list_items with:
    • itemId: the file's list item ID
    • fieldInternalNames: ["FileLeafRef"]
    • newValues: ["yyMMdd-OriginalFilename"]
  • Process files one at a time to handle errors gracefully.
  • If a rename fails, log the error and continue with the remaining files.

7. Report Results

After processing, show a summary:

  • Successfully renamed: X files
  • Skipped (already prefixed): Y files
  • Errors: Z files (list the filenames and error details)

Date Formatting Rules

  • Use the file's Created date (not Modified).
  • Format: yyMMdd — 2-digit year, 2-digit month (zero-padded), 2-digit day (zero-padded).
  • Example: December 3, 2025 → 251203
  • Example: January 15, 2024 → 240115
  • Time zone: SharePoint returns Created in UTC. Format the prefix from the site's regional time zone, not raw UTC, so a file uploaded at 23:30 local time keeps its local-day date. If the site time zone cannot be determined, fall back to UTC and tell the user once in the preview header ("Dates are formatted in UTC — set the site regional settings to use local time.").

Edge Cases

  • Already prefixed files: Skip any file whose name starts with 6 digits followed by a hyphen (^\d{6}-).
  • Folders: Never rename folders — only process items where FSObjType = 0.
  • Subfolders: Process files in all subfolders recursively (use fetchAll: true).
  • Duplicate names after prefixing: If the proposed yyMMdd-Name already exists in the same folder, do not rename and do not overwrite. Mark the file as Skipped (name collision) in the preview / results with the conflicting target name shown. Never append numeric suffixes (-1, -2) to disambiguate — the user must resolve the conflict manually. The other files in the batch still rename.
  • Special characters: Preserve the original filename exactly as-is after the prefix.
  • Empty libraries: If no files match the CAML query, tell the user the library has no files to rename and stop — do not show an empty preview table.

Resuming after a mid-batch failure

Long runs can be interrupted — throttling, network drop, the user closing the chat. The skill must be safe to re-run from scratch without any extra bookkeeping:

  • The ^\d{6}- skip check automatically excludes every file that was successfully renamed in the previous run. Re-running picks up exactly where the failure stopped.
  • If a file failed mid-rename (rare — SharePoint renames are atomic), it will still match the original name and be processed again in the next run.
  • Do not keep an external "already processed" list, lock file, or marker column. The filename itself is the source of truth.
  • After a partial run, the Step 7 results report must clearly distinguish Renamed, Skipped (already prefixed), Skipped (name collision), and Errors so the user can decide whether to re-run.

Example

User: "Prefix all files in this library with their created date"

Agent response (preview):

#Current NameNew NameFolderStatus
1Quarterly Review.docx250915-Quarterly Review.docx/sites/Team/ReportsWill rename
2241101-Notes.pdf241101-Notes.pdf/sites/Team/ReportsSkipped (already prefixed)
3Budget.xlsx250301-Budget.xlsx/sites/Team/FinanceWill rename

Total files: 3 | To rename: 2 | Skipped: 1

Ready to rename 2 files? Confirm to proceed.

Constraints

  • Never rename without showing the preview first.
  • Never rename folders.
  • Never double-prefix files.
  • Never append numeric suffixes to resolve name collisions — mark as Skipped (name collision) instead.
  • Always process errors gracefully — one failure should not stop the entire batch. Safe to re-run; the ^\d{6}- skip check protects already-renamed files (see Resuming after a mid-batch failure).

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

ماذا تفعل مهارة الذكاء الاصطناعي Rename Files Date Prefix؟

Renames all files in a SharePoint document library (including subfolders) to prefix them with their created date in yyMMdd format (e.g., 251203-Status Report.pdf). Offers a preview before committing changes. Use when the user asks to prefix filenames with dates or add date prefixes to files.

لماذا تستخدم Rename Files Date Prefix على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Rename Files Date Prefix عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Rename Files Date Prefix في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/pnp/sharepoint-skills/tree/main/Skills/rename-files-date-prefix/rename-files-date-prefix. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Rename Files Date Prefix؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Rename Files Date Prefix؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Rename Files Date Prefix معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Rename Files Date Prefix مجانية؟

نعم. نشرها pnp على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇