Skip to content
Development
Skill

/files

OneDrive personal storage and SharePoint document libraries, both reached through the shared Microsoft Graph `/drives` endpoint: drive and item addressing, sharing permissions, storage quotas, file search, and the offboarding file-transfer workflow.

From plugin
msp-claude-plugins
46200 skills146 agents200 commands4 MCP
Install
$ npx -y skills add wyre-technology/msp-claude-plugins --skill files --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/files

Context preview

The summary Claude sees to decide when to auto-load this skill.

OneDrive personal storage and SharePoint document libraries, both reached through the shared Microsoft Graph `/drives` endpoint: drive and item addressing, sharing permissions, storage quotas, file search, and the offboarding file-transfer workflow.

SKILL.md

files.SKILL.md
name: "Microsoft 365 Files"
description: >
  OneDrive personal storage and SharePoint document libraries, both reached through
  the shared Microsoft Graph `/drives` endpoint: drive and item addressing, sharing
  permissions, storage quotas, file search, and the offboarding file-transfer
  workflow.
when_to_use: >-
  When investigating M365 file access, sharing, storage-quota, or file-search issues across
  OneDrive and SharePoint. Use
  when: onedrive, m365 files, sharepoint files, onedrive quota, file sharing m365, onedrive
  permissions, m365 storage, find file m365, onedrive access, or sharepoint document library.

Microsoft 365 Files (OneDrive & SharePoint)

Overview

Microsoft 365 provides two file storage surfaces: OneDrive (personal, per-user) and SharePoint (team/department libraries). Both are accessible through the same Microsoft Graph `/drives` endpoint. MSP support tasks include investigating access issues, checking storage quotas, managing sharing permissions, and transferring file access during offboarding.

Anti-triggers

  • **Files on the machine this session is running on** — "read the

file", "find the config", "list the directory" almost always mean the local filesystem, which Claude Code's own file tools handle. This skill only reaches a customer's cloud storage through Graph, and loading it for local work wastes the call.

  • **Restoring a deleted or ransomware-encrypted file** — past the

recycle bin and retention window, Graph has nothing to return; use the `backup-pack` or `kaseya/datto-saas-protection`.

  • **MSP documentation, runbooks, and stored credentials** — those live

in the documentation platform, not the customer's OneDrive; use `kaseya/it-glue` or `hudu`.

  • **A tenant-wide external-sharing posture review** — this skill

inspects one item's permissions; the policy question across the tenant or the fleet is `m365-security` or `cipp`.

Core Concepts

| Surface | Use | Graph Resource | |---------|-----|---------------| | **OneDrive Personal** | Individual user's documents | `/users/{id}/drive` | | **SharePoint Site Drive** | Team/department files | `/sites/{id}/drives` | | **SharePoint Library** | Document library within a site | `/drives/{driveId}` |

Graph API Patterns

Get a User's OneDrive Info (Quota)

GET /v1.0/users/{userId}/drive?$select=id,name,quota

**Response:**

{
  "id": "drive-guid",
  "name": "OneDrive",
  "quota": {
    "used": 5368709120,
    "remaining": 1127428915200,
    "total": 1132797624320,
    "state": "normal"
  }
}

`state` values: `normal`, `nearing`, `critical`, `exceeded`

List Files in Root

GET /v1.0/users/{userId}/drive/root/children?$select=id,name,size,lastModifiedDateTime,webUrl,folder,file

List Files in a Specific Folder

GET /v1.0/users/{userId}/drive/items/{folderId}/children?$select=id,name,size,lastModifiedDateTime,webUrl

Search for Files Across OneDrive

GET /v1.0/users/{userId}/drive/root/search(q='budget 2024')?$select=id,name,parentReference,lastModifiedDateTime,webUrl

Get File Sharing Permissions

GET /v1.0/drives/{driveId}/items/{itemId}/permissions

**Response includes:**

{
  "value": [
    {
      "id": "perm-id",
      "roles": ["write"],
      "grantedToV2": {
        "user": { "displayName": "Bob Manager", "email": "bmanager@contoso.com" }
      },
      "link": null
    },
    {
      "id": "link-id",
      "roles": ["read"],
      "link": {
        "type": "view",
        "scope": "anonymous",
        "webUrl": "https://contoso-my.sharepoint.com/..."
      }
    }
  ]
}

Share a File (Create Sharing Link)

POST /v1.0/drives/{driveId}/items/{itemId}/createLink
Content-Type: application/json

{
  "type": "view",
  "scope": "organization"
}

`type`: `view`, `edit`, `embed` `scope`: `anonymous`, `organization`, `users`

Grant Direct Access to a File/Folder

POST /v1.0/drives/{driveId}/items/{itemId}/invite
Content-Type: application/json

{
  "requireSignIn": true,
  "sendInvitation": false,
  "roles": ["read"],
  "recipients": [
    { "email": "manager@contoso.com" }
  ],
  "message": "Shared as part of employee transition"
}

Remove a Permission

DELETE /v1.0/drives/{driveId}/items/{itemId}/permissions/{permissionId}

Transfer OneDrive Access (Offboarding)

Grant another user access to the departing employee's entire OneDrive:

POST /v1.0/users/{departingUserId}/drive/root/invite
Content-Type: application/json

{
  "requireSignIn": true,
  "sendInvitation": false,
  "roles": ["write"],
  "recipients": [{ "email": "manager@contoso.com" }]
}

> Full ownership transfer (changing site admin) requires SharePoint admin PowerShell: > `Set-SPOSite -Identity <url> -Owner <email>`

SharePoint Document Libraries

List SharePoint Sites

GET /v1.0/sites?search=*&$select=id,displayName,webUrl,createdDateTime

List Drives (Document Libraries) in a Site

GET /v1.0/sites/{siteId}/drives?$select=id,name,driveType,quota

Get Files from a SharePoint Library

GET /v1.0/drives/{driveId}/root/children?$select=id,name,size,lastModifiedDateTime,webUrl

Common MSP Workflows

User Can't Access a File

1. Get the file's current permissions: `GET /items/{id}/permissions` 2. Check if user has direct access or if it's link-based 3. Check if user is in a group that has access: `GET /users/{id}/memberOf` 4. If sharing link expired: create new sharing link 5. If direct access missing: add via `/invite`

Pre-Offboarding Data Review

Before offboarding, identify files the user owns that are widely shared:

GET /v1.0/users/{userId}/drive/root/search(q='*')?$select=id,name,permissions,parentReference

Look for items with `scope: anonymous` sharing links — these should be cleaned up or ownership transferred.

OneDrive Quota Alert

Check users approaching quota limits

Read more
Ships withmsp-claude-plugins

One command to supercharge Claude Code for MSP workflows. Then restart Claude Code. That's it. Documentation: mcp.wyre.ai

Get the whole plugin

Other skills on msp-claude-plugins.