SharePoint-Embedded-VS-Code-Extension
Copilot instructions20 starsChanged 10 days agoMITView on GitHub
This repository is a VS Code extension for managing SharePoint Embedded resources from a dedicated activity bar container and tree views. The core flows are signing into an admin Microsoft 365 tenant, creating a trial container type, registering it on the local tenant, managing owning and guest apps, exporting Postman configuration, and operating on containers from the Development tree. Paid/Standard and direct-to-customer (D2C) container type support — including the Azure billing setup — is in active development (branch aljordac/paid-container-type-support).
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,336 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
We split this copilot-instructions.md into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Use src/commands/ContainerTypes/CreateTrialContainerType.ts and src/commands/ContainerType/RegisterOnLocalTenant.ts as the clearest …
- Very specific: line 30
Every command is a static class extending src/commands/Command.ts.
- Very specific: line 31
Keep tree item contextValue strings and package.json menu when clauses aligned.
- Very specific: line 33
After create/update/delete operations, refresh the Development tree through DevelopmentTreeViewProvider.getInstance().refresh() or a …
- Very specific: line 36
Every catch block in src/services/ARM/* and the paid-CT commands that call ARM should route the error through diagnoseArmError(error) …
≈ “Common” is an estimate: at least 1 in 5 of the 3,779 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot instructions
This repository is a VS Code extension for managing SharePoint Embedded resources from a dedicated activity bar container and tree views. The core flows are signing into an admin Microsoft 365 tenant, creating a trial container type, registering it on the local tenant, managing owning and guest apps, exporting Postman configuration, and operating on containers from the Development tree. Paid/Standard and direct-to-customer (D2C) container type support — including the Azure billing setup — is in active development (branch aljordac/paid-container-type-support).
Build, lint, and test
npm run compilecompiles TypeScript fromsrc/intoout/. Use this for normal local builds.npx tsc -p ./ --noEmitis the fastest way to check for TypeScript compile issues without overwritingout/. Prefer this when you only need a type-check.npm run watchis the default VS Code build task from.vscode/tasks.json;F5/ Run Extension depends on this watch build and opens an Extension Development Host.npm run lintruns ESLint oversrc/**/*.ts.npm testrunspretestfirst (npm run compile && npm run lint) and then launches the VS Code extension-host test harness vianode ./out/test/runTest.js.npm run test-compilecompiles test output intoout/testwithout launching the test harness.- There is no maintained single-test npm script, and there are currently no checked-in
*.test.tsfiles undersrc/test. If you need to debug one test while adding coverage, use the Extension Tests launch configuration and temporarily narrow the Mocha run withsuite.only/test.only;src/test/suite/index.tsglob-loads compiled**/**.test.jsfiles fromout/test. npm run esbuild,npm run esbuild-watch, andnpm run vscode:prepublishare the packaging path for the extension bundle; they are not the normal F5/debug loop.
High-level architecture
package.jsoncontributes thesharepoint-embeddedactivity bar container plus thespe-welcome,spe-accounts, andspe-developmentviews. Menu visibility is driven bywhenclauses against tree itemcontextValuevalues and context keys such asspe:isLoggedIn,spe:isLoggingIn,spe:showGettingStartedView, andspe:showFailedView.src/extension.tsis the orchestration point. It creates theSharePoint Embeddedoutput channel, initializesStorageProviderand telemetry, registers the account and development tree views, attaches the URI handler, and registers all commands fromsrc/commands/index.tsbefore auth initialization so the extension still responds if session restore hangs.- Authentication is centralized in
src/services/AuthenticationState.tsandsrc/services/Auth/. Use the singleton auth providers instead of creating ad hoc clients.GraphAuthProvider.resetInstance()also resetsGraphProvider, so tenant/account switches and deep-link tenant targeting need to flow through the auth state helpers. - The current refactor direction is commands -> services -> Zod schemas. New work should prefer
src/services/Graph/*plussrc/models/schemas/*rather than the older class-based models undersrc/models/*.ts. src/services/Graph/GraphProvider.tsis the singleton service hub around the Microsoft Graph SDK client. It exposesapplications,containerTypes,registrations,appPermissionGrants,containers, andusers. Graph services use thev1.0endpoint exclusively.src/services/ARM/ARMProvider.tsis the singleton hub for Azure Resource Manager operations (mirrorsGraphProvider), exposingsubscriptions,syntexProviders, andsyntexAccounts. ARM is used only by the paid/D2C billing setup: registering theMicrosoft.Syntexresource provider on a subscription and creating aMicrosoft.Syntex/accountsbilling account. Each ARM service is a stateless wrapper oversrc/services/ARM/armFetch.ts(armRequest), which acquires a token viaARMAuthProviderand throwsArmErroron non-2xx.src/services/ARM/diagnoseArmError.tsis the single ARM error classifier — route ARM failures through it before surfacing a toast rather than adding a new classifier.src/views/treeview/development/DevelopmentTreeViewProvider.tsowns the Development tree. It fetches root container types throughgraphProvider.containerTypes.list(), deduplicates concurrent root fetches for stable object identity, and is the source of truth for refresh/reveal behavior after mutations.src/services/UriHandler.tshandles deep links of the formvscode://sharepointembedded.ms-sharepoint-embedded-vscode-extension/{tenantId}/{containerTypeId}?action=openand uses auth state plus tree reveal logic to switch tenants and focus the correct container type.- Use
src/commands/ContainerTypes/CreateTrialContainerType.tsandsrc/commands/ContainerType/RegisterOnLocalTenant.tsas the clearest examples of the current command/service flow. The paid/D2C flow runs throughsrc/commands/ContainerTypes/CreateContainerType.ts→runStandardFlow.ts/runDirectToCustomerFlow.ts→attachBillingToContainerType.ts;CreateStandardContainerType.tsis a registered stub that no-ops.
Key conventions
- Every command is a static class extending
src/commands/Command.ts. To fully wire a new command, keep four places in sync: the command file,src/commands/index.ts,src/extension.ts, and the command/menu contribution inpackage.json. - Keep tree item
contextValuestrings andpackage.jsonmenuwhenclauses aligned.ContainerTypeTreeItemcomposes suffixes for trial vs. paid, discoverability state, registration state, billing validity, and extension-permission state, and those suffixes control which menu actions appear. - Authentication UI state depends on ordering:
onBeforeSignIn()empties the development tree beforespe:isLoggingInis set, and sign-out resets auth/provider singletons before clearing the logged-in context. New auth-related code should reuseAuthenticationStateinstead of toggling context keys ad hoc. - After create/update/delete operations, refresh the Development tree through
DevelopmentTreeViewProvider.getInstance().refresh()or a targeted subtree refresh so VS Code sees fresh tree item instances. - User-facing strings should use
vscode.l10n.t(...); this extension is localized throughl10n/andpackage.nls.json. - Service-layer code follows a consistent pattern: validate request/response shapes with Zod schemas (
src/models/schemas/*), log with[ClassName.methodName]prefixes viaLogger/console, and throw explicit errors rather than returning loosely shaped data or silently swallowing failures. Put.default(...)on create schemas, not on response schemas (a default on a response can silently misclassify data). Never log access tokens. - Every catch block in
src/services/ARM/*and the paid-CT commands that call ARM should route the error throughdiagnoseArmError(error)before surfacing a toast; extend that classifier rather than adding a new one when a new ARM error shape appears. - For day-to-day debugging, prefer the TypeScript compile/watch flow (
npm run watch,F5) rather than the esbuild packaging scripts. The workspace intentionally keepsout/visible for compiled extension and test output, and the checked-in launch configurations point atout/**/*.js. docs/ONBOARDING.mdis a deep architecture/onboarding reference (auth, ARM billing, sequence diagrams, file map); consult it for cross-cutting context beyond this summary. Related references indocs/:SEQUENCE_DIAGRAMS.md(end-to-end flow diagrams),API_ENDPOINTS.md(Graph/ARM endpoints used), andCODE_AUDIT.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

