From sharepoint-client-file-inventory
SharePoint File Inventory Report — Take inventory of files across your SharePoint vault and generate an organized report
How this skill is triggered — by the user, by Claude, or both
Slash command
/sharepoint-client-file-inventory:sharepoint-file-inventoryThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are running the SharePoint File Inventory skill — it scans a SharePoint document library, catalogs every file per household folder with document category tagging, and generates an HTML report.
You are running the SharePoint File Inventory skill — it scans a SharePoint document library, catalogs every file per household folder with document category tagging, and generates an HTML report.
CRITICAL: Never use cd in bash commands. All CLI commands use the absolute path prefix shown below.
CLI tool: node ${CLAUDE_SKILL_DIR}/../../scripts/cli.js <command> — all commands output JSON to stdout
${CLAUDE_SKILL_DIR} is automatically set to this skill's directory. The plugin root is two levels up.
Run these commands silently (do not display output to user). Ignore any errors — these are best-effort and must never block the flow.
git -C ${CLAUDE_SKILL_DIR}/../.. pull --ff-only 2>/dev/null || true
npm install --prefix ${CLAUDE_SKILL_DIR}/../../scripts 2>/dev/null || true
Then check setup status:
node ${CLAUDE_SKILL_DIR}/../../scripts/cli.js check-setup 2>/dev/null
Parse the JSON. Store registered, email, sharepoint_connected for routing.
registered AND sharepoint_connected → skip to Step 3registered but NOT sharepoint_connected → skip to Step 2registered → proceed to Step 1Display:
██╗ ███████╗ █████╗
██║ ██╔════╝██╔══██╗
██║ █████╗ ███████║
██║ ██╔══╝ ██╔══██║
███████╗███████╗██║ ██║
╚══════╝╚══════╝╚═╝ ╚═╝
SharePoint File Inventory Report — A LEA Skill
What does it do? Takes inventory of your SharePoint vault — every file across all client and household folders, organized by document type (agreements, tax docs, statements, and more). Generates an HTML report you can open in your browser with one click.
Who is this for? Wealth management firms that store client documents in SharePoint and want a clear picture of what's in their vault — file counts, document categories, and which households have gaps.
How it works:
| Step | What happens |
|---|---|
| Connect | Securely link your Microsoft 365 account via OAuth |
| Pick location | Choose which SharePoint site, library, and folder contains your client folders |
| Inventory | Catalog every file and tag it by document type |
| Report | Generate an HTML report with stats, categories, and CSV export |
Credentials stored encrypted on LEA servers. All scanning runs locally — your files flow directly between your machine and SharePoint, never through LEA.
Use AskUserQuestion: "Ready to get started?"
If "Not now", stop.
IMPORTANT: Do NOT use AskUserQuestion for email or firm name. Just output the question as text and wait for the user to reply in the chat.
Output: "What's your work email?" — then STOP and wait for the user to type their email in the chat.
After they reply with their email, output: "And your firm name? (or just hit enter to skip)" — then STOP and wait again.
Run registration with whatever they provided:
node ${CLAUDE_SKILL_DIR}/../../scripts/cli.js register "USER_EMAIL" "FIRM_NAME" 2>/dev/null
If the response includes "returning": true, the user was already registered — display: "Welcome back! Token refreshed."
Otherwise display: "Registered! Now let's connect your SharePoint account."
This skill requires Microsoft 365 permissions (Files.ReadWrite.All, Sites.Read.All) that need an admin to approve the LEA app for your organization. This is a one-time step — once approved, everyone at the firm can connect.
Use AskUserQuestion: "Are you a Microsoft 365 admin at your firm? (Global Admin, Application Admin, or Cloud Application Admin)"
Display exactly this:
Great — when you sign in next, Microsoft will ask you to consent on behalf of your organization.
On the Microsoft sign-in page, look for a checkbox that says "Consent on behalf of your organization" — check it and click Accept. This grants the LEA app access to SharePoint files for everyone at your firm.
The app only gets access to files each person can already see — it can't see anything beyond their existing SharePoint permissions. Write access is included for the Agreement Organizer skill (which copies files), but this skill only reads.
Then proceed to Step 2b.
Display exactly this:
A Microsoft 365 admin at your firm needs to approve the LEA app first. This is a one-time step.
Send this to your admin:
Please approve the LEA Skills app for SharePoint access:
- Open this link:
https://login.microsoftonline.com/common/adminconsent?client_id=YOUR_MS_CLIENT_ID- Sign in with your admin account
- Review the permissions (SharePoint file access) and click Accept
This grants LEA access to SharePoint files. Each user can only access files they already have permissions for — nothing extra is exposed.
Use AskUserQuestion: "Let me know when your admin has approved the app."
If "Not yet", display exactly this:
No problem — run this skill again once the app is approved.
Then stop.
Get the OAuth URL:
node ${CLAUDE_SKILL_DIR}/../../scripts/cli.js auth-sharepoint 2>/dev/null
Parse the JSON. Extract auth_url and session_id.
Display exactly this:
Now let's connect your Microsoft 365 account.
I'll open a Microsoft sign-in page. Sign in with your work account and approve access.
Open the auth URL in the browser automatically:
open "AUTH_URL"
Display exactly this:
Sign in and approve access in the browser tab that just opened, then come back here.
Wait for OAuth completion (polls automatically for up to 2 minutes):
node ${CLAUDE_SKILL_DIR}/../../scripts/cli.js poll-sharepoint-wait SESSION_ID 2>/dev/null
status is "connected" → proceed to Step 3status is "failed", "expired", or "timeout" → show the error and ask to retry. If the error mentions "admin approval required" or "AADSTS65001", explain that an admin needs to approve the app first (see Step 2a).Display: "SharePoint connected!"
node ${CLAUDE_SKILL_DIR}/../../scripts/cli.js verify-sharepoint 2>/dev/null
Parse JSON. Show:
SharePoint Connected Logged in as: DISPLAY_NAME (MAIL)
node ${CLAUDE_SKILL_DIR}/../../scripts/cli.js load-config sharepoint-file-inventory 2>/dev/null
If config exists and has site_id, drive_id, folder_id, and site_name, library_name, folder_name:
Display:
Previously used location: Site: SITE_NAME → Library: LIBRARY_NAME → Folder: FOLDER_NAME
Use AskUserQuestion: "Use this location again?"
If "Yes", skip to Step 5 using the saved drive_id and folder_id.
Display: "Loading your SharePoint sites..."
node ${CLAUDE_SKILL_DIR}/../../scripts/cli.js list-sites 2>/dev/null
Display sites as a numbered list (show site names only, never show IDs to the user):
Your SharePoint sites:
- Site Name A
- Site Name B
- ...
Use AskUserQuestion: "Which site has your client documents?"
Important: Internally map the user's selection back to the site ID from the JSON response. Never display IDs.
node ${CLAUDE_SKILL_DIR}/../../scripts/cli.js list-libraries SELECTED_SITE_ID 2>/dev/null
Display libraries as a numbered list:
Document libraries in "SITE_NAME":
- Documents
- Client Files
- ...
If there is only one library, auto-select it and display: "Using library: LIBRARY_NAME"
Otherwise use AskUserQuestion: "Which library?"
node ${CLAUDE_SKILL_DIR}/../../scripts/cli.js list-folders SELECTED_DRIVE_ID 2>/dev/null
Display folders as a numbered list (folder names only):
Folders in "LIBRARY_NAME":
- Folder Name A
- Folder Name B
- ...
Use AskUserQuestion: "Which folder contains your client/household folders?"
Confirm by listing subfolders:
node ${CLAUDE_SKILL_DIR}/../../scripts/cli.js list-folders SELECTED_DRIVE_ID SELECTED_ITEM_ID 2>/dev/null
Show the subfolders:
Folders inside "SELECTED_FOLDER_NAME":
(list first ~10 subfolder names)
These look like your client/household folders.
Use AskUserQuestion: "Ready to take inventory of this folder?"
If "Go back" → repeat folder selection. If "Go deeper" → ask which subfolder, list it, repeat.
After confirming the folder, save the location for next time:
node ${CLAUDE_SKILL_DIR}/../../scripts/cli.js save-config sharepoint-file-inventory '{"site_id": "SITE_ID", "site_name": "SITE_NAME", "drive_id": "DRIVE_ID", "library_name": "LIBRARY_NAME", "folder_id": "FOLDER_ID", "folder_name": "FOLDER_NAME"}' 2>/dev/null
Display exactly this:
Taking inventory of all files in "FOLDER_NAME"... This takes around 30 seconds, depending on how many files you have.
Run a single command that inventories and generates the HTML report:
node ${CLAUDE_SKILL_DIR}/../../scripts/cli.js scan-inventory DRIVE_ID FOLDER_ID --report ${CLAUDE_SKILL_DIR}/../../scripts/inventory-report.html 2>/dev/null
Do NOT show a summary table. Do NOT show stats, metrics, or file counts. The report has all of this. Just open the report immediately.
Open the HTML report in the browser:
open "${CLAUDE_SKILL_DIR}/../../scripts/inventory-report.html"
Display exactly this:
Your File Inventory Report is open in your browser.
It includes a per-household document coverage breakdown, a client coverage summary, and a CSV export.
Log usage (silently, do not display output):
node ${CLAUDE_SKILL_DIR}/../../scripts/cli.js log-usage sharepoint-file-inventory 2>/dev/null
Display exactly this:
Done! Got questions? Want more? [email protected]
Use AskUserQuestion: "What next?"
success: false in any CLI response, show the error message and ask to retry or exit2>/dev/null)| Step | Command | When |
|---|---|---|
| 0 | git pull | Always (silent) |
| 0 | npm install | Always (silent) |
| 0 | check-setup | Always |
| 1 | register | First run only |
| 2a | (no CLI) | Admin consent — instructions only |
| 2b | auth-sharepoint | First run only |
| 2b | open | First run only (OAuth URL) |
| 2b | poll-sharepoint-wait | First run only |
| 3 | verify-sharepoint | Always |
| 4 | load-config | Check saved location |
| 4 | list-sites | Site selection |
| 4 | list-libraries | Library selection |
| 4 | list-folders | Folder selection (1-3 calls) |
| 4 | save-config | Save chosen location |
| 5 | scan-inventory | Main inventory |
| 5 | open | Open report |
| 7 | log-usage | Usage tracking |
Total: 8-14 bash calls for full flow
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Applies a firm's KYC/AML rules grid to parsed onboarding records: assigns risk rating, checks required documents, outputs rule outcomes with citations, and routes for escalation.
Generates daily or weekly digests of activity from connected sources (chat, email, docs, tasks, CRM), highlighting action items, decisions, mentions, and project updates.
npx claudepluginhub lea-product-and-engineering/lea-wealth-plugins --plugin sharepoint-client-file-inventory