sharepoint/spfx-dev-skills

spfx

SharePoint Framework (SPFx) development.

查看源码

使用方法

  1. 复制安装命令,在自己的智能体环境安装前先检查源码包。
  2. 从原始文档核对所需工具、凭据和支持的宿主。
  3. 说明输入材料与期望交付物,并对照来源检查输出。
npx skills add https://github.com/sharepoint/spfx-dev-skills --skill spfx

开始前需了解

  • 安装不包含模型订阅、API 额度或访问文件的权限。
  • 仓库星数和安装量反映活跃情况,不等于独立质量或安全测试。
仓库原始内容

按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。

SPFx Development

Pick the reference(s) that match the user's intent. Load only what is needed and execute the steps exactly:

  • Create a project → create.md
  • Upgrade a project → upgrade.md
  • Working on UI in a React SPFx project (components, styling, layout, accessibility) → react-design.md
  • Reading or writing SharePoint / Microsoft Graph data → pnpjs.md

Global rules (apply to every SPFx task)

  • Use PnPjs by default for all SharePoint and Microsoft Graph data operations. See pnpjs.md. Only fall back to raw SPHttpClient/MSGraphClientV3 when the user explicitly requires it or a dependency cannot be added.
  • When running `npm install`, always run it synchronously with a timeout of at least 3 minutes. SPFx projects have heavy dependency trees.

Toolchain decision rule

SPFx switched build systems at v1.22.0. Determine the version from .yo-rc.json (@microsoft/generator-sharepoint.version) or package.json, then:

Installed SPFx versionToolchain
v1.22.0 and newerHeft
v1.0 – v1.21.1gulp (legacy)