Agent skill

Rename Files Date Prefix

by pnp in pnp/sharepoint-skills

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).

MITAuto-check passedDocuments & Office

Install Rename Files Date Prefix

skills CLI
$ npx skills add pnp/sharepoint-skills --skill rename-files-date-prefix -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pnp/sharepoint-skills rename-files-date-prefix --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pnp/sharepoint-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/Skills/rename-files-date-prefix/rename-files-date-prefix .claude/skills/rename-files-date-prefix && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
rename-files-date-prefix
GitHub stars
133
Token cost
~1.6k tokens
SKILL.md length
791 words
Files
1
Skills in repo
52
Repo updated
First seen
Licence
MIT

At a glance

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).

  • Works in 7 steps: Identify the Target Library → Get the Library Schema → Retrieve All Files (Including Subfolders) → …
  • The user asks to prefix filenames with dates
  • SKILL.md covers Steps, Date Formatting Rules, Edge Cases and Resuming after a mid-batch…, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Rename Files Date Prefix is an agent skill from pnp/sharepoint-skills. 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.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Documents & Office, covering File organization, Cloud office suites and PDF. It works with Microsoft SharePoint. The repository describes itself as: Skills for Copilot in SharePoint. The licence is MIT.

When your agent uses it

  • The user asks to prefix filenames with dates
  • Add date prefixes to files

Example prompts

  • “Use the rename-files-date-prefix skill to rename all files in a SharePoint document library (including subfolders) to prefix them with their created…”
  • “/rename-files-date-prefix”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Identify the Target Library
  2. Get the Library Schema
  3. Retrieve All Files (Including Subfolders)
  4. Build the Preview
  5. Show the Preview Table
  6. Rename on Confirmation
  7. Report Results

What it can do on your machine

Read from SKILL.md and the folder at commit 69712d2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Rename Files Date Prefix loads about 1.6k tokens when it runs. Until then it costs about 79 tokens; SKILL.md has 791 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~79
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from pnp/sharepoint-skills at commit 69712d2, republished under its MIT licence (© pnp). 791 words, ~1,556 tokens.

Download SKILL.mdSave it as .claude/skills/rename-files-date-prefix/SKILL.md (or your agent's skills folder).
name
rename-files-date-prefix
description
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 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.").
Show full SKILL.md (383 more words)Show less

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).

© pnp, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in Skills/rename-files-date-prefix/rename-files-date-prefix of pnp/sharepoint-skills.

Open the folder on GitHubat commit 69712d2

Compare with similar skills

Rename Files Date Prefix next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Rename Files Date Prefix compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rename Files Date Prefix this skillpnp/sharepoint-skills133—~1.6kAutomated safety check: PassMIT
Msgraphcodemie-ai/codemie-code294—~4.1kAutomated safety check: PassApache-2.0
aai-cli Microsoft 365aai-labs/agent-barn109—~1.2kAutomated safety check: PassApache-2.0
Colleague DistillationZhixiangLuo/10xProductivity479—~2.1kAutomated safety check: NotesMIT
Rename Pdfs Exerealspqrk/autorename-pdf122—~529Automated safety check: PassMIT
Workiqmicrosoft/work-iq1k—~15kAutomated safety check: PassCustom licence

Similar skills

  • Msgraph

    codemie-ai/codemie-code

    Work with Microsoft 365 services via the Graph API — emails, calendar events, SharePoint sites (read and write), Teams chats and channel messages, OneDrive files, OneNote notebooks, Planner task…

    294 GitHub stars~4.1k tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • aai-cli Microsoft 365

    aai-labs/agent-barn

    Guides work with Outlook, OneDrive, SharePoint, Teams, Excel, To Do and Planner through aai-cli's Microsoft Graph commands, starting from which service owns the data.

    109 GitHub stars~1.2k tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • Colleague Distillation

    ZhixiangLuo/10xProductivity

    Distill a colleague into a reusable AI skill (work + persona) using tool connections — Slack, Slack AI, Jira, GHE, Bitbucket, Confluence, SharePoint, Teams, Outlook, Notion, Linear, Google Docs, and…

    479 GitHub stars~2.1k tokensUpdated 3 mo ago
    Documents & OfficeAuto-check: notes
  • Rename Pdfs Exe

    realspqrk/autorename-pdf

    [Production] Rename PDF files using the compiled autorename-pdf-cli.exe.

    122 GitHub stars~529 tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • Workiq

    microsoft/work-iq

    Official

    WorkIQ tools for Microsoft 365 workplace data and actions. An agent skill from microsoft/work-iq.

    1k GitHub stars~15k tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • Workiq Preview

    microsoft/work-iq

    Official

    WorkIQ tools for Microsoft 365 workplace data and actions. An agent skill from microsoft/work-iq.

    1k GitHub stars~3.3k tokensUpdated yesterday
    Documents & OfficeAuto-check passed

More from pnp/sharepoint-skills

All 52 skills in this repo
  • Scorecard Matrix

    pnp/sharepoint-skills

    Generates a polished, self-contained HTML heatmap scorecard — a weighted comparison matrix where entities (rows) are scored across dimensions (columns), with computed totals, rank badges, and a…

    133 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Analyze Document Library

    pnp/sharepoint-skills

    Analyze the current SharePoint document library in read-only mode and produce a structured summary of files, folders, file types, recent activity, naming issues, and organization recommendations.

    133 GitHub stars~899 tokensUpdated yesterday
    Auto-check passed
  • Broken Link Auditor

    pnp/sharepoint-skills

    Audits SharePoint pages, news posts, and hyperlink fields for broken or risky links and saves a self-contained HTML link-health report to the site.

    133 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Custom Image Tagger

    pnp/sharepoint-skills

    Analyze selected construction images, create missing object metadata columns, and write concise visual metadata back to SharePoint columns using explicit image-analysis, list-schema, list-update…

    133 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Dossier

    pnp/sharepoint-skills

    Renders a polished, self-contained HTML briefing from any data source — SharePoint lists, uploaded documents, or a verbal description.

    133 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Exec Report

    pnp/sharepoint-skills

    Generates a polished, self-contained HTML executive report or dashboard from any data source — SharePoint lists, CSV exports, or a user description.

    133 GitHub stars~2k tokensUpdated yesterday
    Auto-check passed

Questions about Rename Files Date Prefix

What does Rename Files Date Prefix do?

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). Rename Files Date Prefix is an agent skill from pnp/sharepoint-skills.pdf).

When should I use Rename Files Date Prefix?

Rename Files Date Prefix fits situations like: the user asks to prefix filenames with dates; add date prefixes to files.

How do I install Rename Files Date Prefix in Claude Code?

Run `npx skills add pnp/sharepoint-skills --skill rename-files-date-prefix -a claude-code`. Or copy the skill folder (Skills/rename-files-date-prefix/rename-files-date-prefix in pnp/sharepoint-skills) into .claude/skills/rename-files-date-prefix in your project. Claude Code loads it when a task matches its description.

How do I install Rename Files Date Prefix in Codex?

Run `npx skills add pnp/sharepoint-skills --skill rename-files-date-prefix -a codex`. Or copy the skill folder (Skills/rename-files-date-prefix/rename-files-date-prefix in pnp/sharepoint-skills) into .agents/skills/rename-files-date-prefix in your project. Codex loads it when a task matches its description.

Can I use Rename Files Date Prefix in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pnp/sharepoint-skills --skill rename-files-date-prefix -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rename-files-date-prefix, .gemini/skills/rename-files-date-prefix, .github/skills/rename-files-date-prefix and .opencode/skills/rename-files-date-prefix in your project.

What does Rename Files Date Prefix need to run?

SKILL.md names no scripts, command-line tools or credentials: Rename Files Date Prefix is instructions for the agent only.

Does Rename Files Date Prefix access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Rename Files Date Prefix safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Rename Files Date Prefix use?

Rename Files Date Prefix is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Rename Files Date Prefix use?

About 1.6k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Rename Files Date Prefix?

Skills that share tags, products or a category with Rename Files Date Prefix: Msgraph (codemie-ai/codemie-code, 294 stars), aai-cli Microsoft 365 (aai-labs/agent-barn, 109 stars), Colleague Distillation (ZhixiangLuo/10xProductivity, 479 stars) and Rename Pdfs Exe (realspqrk/autorename-pdf, 122 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Rename Files Date Prefix?

pnp (a GitHub organization) maintains it in pnp/sharepoint-skills, which has 133 GitHub stars. The repository holds 52 skills in this directory. The repository was last updated on October 9, 2026.

Source: pnp/sharepoint-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.