sharepoint
БесплатноБез исполняемых скриптовНе проверенBuild integrations with SharePoint Online for document management, site automation, and intranet development. Use when someone asks to "integrate with…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
SharePoint
Overview
This skill helps AI agents integrate with SharePoint Online for document management, list operations, site automation, and custom development. It covers Microsoft Graph API for sites/lists/files, SharePoint REST API for advanced operations, search, permissions management, and SharePoint Framework (SPFx) for custom web parts.
Not covered here: the SharePoint Azure ACS app-only model (client ID and secret registered through appregnew.aspx) is retired; app-only access to the SharePoint REST API now requires a Microsoft Entra app with a certificate, while Microsoft Graph accepts a client secret.
Instructions
Step 1: Authentication
import { ClientSecretCredential } from '@azure/identity';
import { Client } from '@microsoft/microsoft-graph-client';
import { TokenCredentialAuthenticationProvider } from '@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials';
// App-only permissions (admin consent): Sites.ReadWrite.All covers sites, lists and libraries.
// Prefer Sites.Selected plus a per-site grant (see Guidelines) so the app reaches only the sites it needs.
const credential = new ClientSecretCredential(
process.env.AZURE_TENANT_ID!, process.env.AZURE_CLIENT_ID!, process.env.AZURE_CLIENT_SECRET!
);
const authProvider = new TokenCredentialAuthenticationProvider(credential, {
scopes: ['https://graph.microsoft.com/.default'],
});
const graphClient = Client.initWithMiddleware({ authProvider });
Step 2: Sites & Document Libraries
// Get site by URL
const site = await graphClient.api('/sites/contoso.sharepoint.com:/sites/engineering').get();
// Get document libraries (drives)
const drives = await graphClient.api(`/sites/${site.id}/drives`).get();
const driveId = drives.value[0].id;
// List folder contents
const items = await graphClient.api(`/drives/${driveId}/root/children`)
.select('id,name,size,lastModifiedDateTime,webUrl').get();
// Create folder
await graphClient.api(`/drives/${driveId}/root/children`).post({
name: 'New Project', folder: {}, '@microsoft.graph.conflictBehavior': 'rename',
});
Step 3: File Operations
// Upload small file (simple PUT, up to 250 MB)
await graphClient.api(`/drives/${driveId}/root:/Reports/monthly-report.pdf:/content`).putStream(fileContent);
// Upload large file — resumable upload session (recommended above 10 MiB)
const session = await graphClient
.api(`/drives/${driveId}/root:/LargeFiles/dataset.csv:/createUploadSession`)
.post({ item: { '@microsoft.graph.conflictBehavior': 'replace', name: 'dataset.csv' } });
// PUT chunks to session.uploadUrl with Content-Range headers (no Authorization header on that URL).
// Each chunk must be a multiple of 320 KiB (327,680 bytes) and under 60 MiB; 5-10 MiB is recommended.
// Download, copy, move, delete
await graphClient.api(`/drives/${driveId}/items/${itemId}/content`).getStream();
await graphClient.api(`/drives/${driveId}/items/${itemId}/copy`).post({ parentReference: { driveId, id: archiveFolderId }, name: 'backup.pdf' }); // async: 202 Accepted
await graphClient.api(`/drives/${driveId}/items/${itemId}`).patch({ parentReference: { id: targetFolderId } });
await graphClient.api(`/drives/${driveId}/items/${itemId}`).delete();
// Create sharing link
await graphClient.api(`/drives/${driveId}/items/${itemId}/createLink`).post({
type: 'view', scope: 'organization',
});
Step 4: SharePoint Lists
// Create a list
await graphClient.api(`/sites/${siteId}/lists`).post({
displayName: 'Project Tracker',
columns: [
{ name: 'ProjectName', text: {} },
{ name: 'Status', choice: { choices: ['Not Started', 'In Progress', 'Complete'] } },
{ name: 'DueDate', dateTime: {} },
{ name: 'Budget', currency: {} },
],
list: { template: 'genericList' },
});
// Get items with filter
const items = await graphClient.api(`/sites/${siteId}/lists/${listId}/items`)
.expand('fields($select=ProjectName,Status,DueDate)')
.filter("fields/Status eq 'In Progress'")
.orderby('fields/DueDate').get();
// Create / Update / Delete items
await graphClient.api(`/sites/${siteId}/lists/${listId}/items`).post({
fields: { ProjectName: 'Website Redesign', Status: 'In Progress', DueDate: '2026-12-01', Budget: 25000 },
});
await graphClient.api(`/sites/${siteId}/lists/${listId}/items/${itemId}/fields`).patch({ Status: 'Complete' });
await graphClient.api(`/sites/${siteId}/lists/${listId}/items/${itemId}`).delete();
// Bulk create (batch request)
const batchBody = {
requests: items.map((item, i) => ({
id: `${i}`, method: 'POST', url: `/sites/${siteId}/lists/${listId}/items`,
body: { fields: item }, headers: { 'Content-Type': 'application/json' },
})),
};
await graphClient.api('/$batch').post(batchBody);
Step 5: Search
// Search across all SharePoint content
const results = await graphClient.api('/search/query').post({
requests: [{
entityTypes: ['driveItem', 'listIte
Установить sharepoint в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл sharepoint?
Build integrations with SharePoint Online for document management, site automation, and intranet development. Use when someone asks to "integrate with SharePoint", "upload files to SharePoint", "manage SharePoint lists", "create SharePoint site", "automate SharePoint", "search SharePoint documents", "SharePoint API", or "SharePoint permissions". Covers Graph API for sites, lists, document libraries, file operations, search, permissions, and SharePoint Framework (SPFx) development.
Как установить скилл sharepoint?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sharepoint запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic