powerplatform-vscode
AGENTS.md278 starsChanged 11 months agoMITView on GitHub
This is the Power Platform VS Code extension that provides tooling for creating, building, and deploying Power Platform solutions, packages, and portals. It integrates the Power Platform CLI (pac) directly into VS Code. - src/client/extension.ts: Main extension entry point - package.json: Extension manifest with commands and contributions - src/client/lib/PacActivityBarUI.ts: Activity bar panels and UI registration - src/client/PortalWebView.ts: Power Pages portal webview management - src/client/pac/PacWrapper.ts: Wrapper for Power Platform CLI commands - src/client/power-pages/actions-hub/ActionsHubTreeDataProvider.ts: Power Pages Actions Hub tree data provider -
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repository4 other files it gives its agents.
- src/client/Agents.mdAGENTS.md
- src/web/Agents.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- fix-dependabot-alertsSkill
The file
We split this Agents.md into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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
- Distinctive: line 53
Use 4 spaces for indentation (no tabs)
- Very specific: line 56
No whitespace in parenthesized constructs: for (let i = 0.
- Distinctive: line 63
Use whole words when possible
- Very specific: line 69
All user-visible strings MUST be externalized using vscode-nls
- Distinctive: line 73
Use JSDoc style comments for functions, interfaces, enums, and classes
- Distinctive: line 78
Use async/await for asynchronous code
- Very specific: line 79
When modifying any localization strings, run npm run translations-export to ensure updates are captured.
- Very specific: line 85
Mocha: test framework with describe and it blocks
- Very specific: line 120
Use oneDSLoggerWrapper for all telemetry events
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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
Agents Instructions
Architecture Overview
This is the Power Platform VS Code extension that provides tooling for creating, building, and deploying Power Platform solutions, packages, and portals. It integrates the Power Platform CLI (pac) directly into VS Code.
Key Components
- Client (
src/client/): Main VS Code extension logic, UI components, and Power Pages tooling - Server (
src/server/): Language servers for HTML/Liquid and YAML files - Debugger (
src/debugger/): PCF debugging capabilities for Power Platform components - Web (
src/web/): VS Code for Web support - Common (
src/common/): Shared utilities, telemetry, and services
Critical Architecture Patterns
- PAC CLI Integration: The extension automatically downloads and manages the Power Platform CLI (
src/client/lib/CliAcquisition.ts,src/client/pac/PacWrapper.ts) - Multi-Target Build: Uses webpack to build for desktop VS Code, web, and language servers (
webpack.config.js) - Telemetry-First: Comprehensive telemetry using OneDSLogger for both desktop and web (
src/common/OneDSLoggerTelemetry/) - Service Architecture: Core services in
src/common/services/(ArtemisService, BAPService, PPAPIService)
Development Workflows
Build Commands
npm run buildorgulp: Full build (uses gulpfile.mjs)npm run compile-web: Build web version onlynpm run test-desktop-int: Run desktop integration testsnpm run test-web-integration: Run web integration tests
Key Files for Extension Development
src/client/extension.ts: Main extension entry pointpackage.json: Extension manifest with commands and contributionssrc/client/lib/PacActivityBarUI.ts: Activity bar panels and UI registrationsrc/client/PortalWebView.ts: Power Pages portal webview managementsrc/client/pac/PacWrapper.ts: Wrapper for Power Platform CLI commandssrc/client/power-pages/actions-hub/ActionsHubTreeDataProvider.ts: Power Pages Actions Hub tree data provider
PAC CLI Integration Patterns
// Always use PacWrapper for CLI operations
const pacWrapper = new PacWrapper(context);
await pacWrapper.executeCommand(['solution', 'list']);Coding Guidelines
Indentation & Style
- Use 4 spaces for indentation (no tabs)
- Arrow functions
=>over anonymous functions - Curly braces on same line, always use braces for loops/conditionals
- No whitespace in parenthesized constructs:
for (let i = 0; i < 10; i++)
Naming Conventions
- PascalCase:
typenames,enumvalues - camelCase:
function/methodnames,propertynames,local variables - UPPER_CASE: constants
- Use whole words when possible
Strings & Localization
- "double quotes" for user-facing strings that need localization
- 'single quotes' for internal strings
- All user-visible strings MUST be externalized using
vscode-nls
Comments
- Use JSDoc style comments for functions, interfaces, enums, and classes
- Include parameter descriptions and return types
Workflow
- Use async/await for asynchronous code
- When modifying any localization strings, run
npm run translations-exportto ensure updates are captured.
Testing Patterns
Framework Usage
- Mocha test framework with
describeanditblocks - Chai
expectassertions (not assert) - Sinon for stubs and spies
- Mock dependencies extensively for unit tests
Test Organization
- Unit tests:
src/*/test/unit/ - Integration tests:
src/*/test/integration/ - No
//Arrange,//Act,//Assertcomments
Running Tests
npm run test # Unit tests
npm run test-desktop-int # Desktop integration tests
npm run test-web-integration # Web integration testsPower Platform Specific Patterns
Power Pages Development
- Portal files use specific extensions:
.copy.html,.custom_javascript.js(seesrc/common/constants.ts) - File system callbacks in
src/client/power-pages/fileSystemCallbacks.ts - Bootstrap diff functionality for portal template updates
CLI Version Management
- CLI versions managed in
src/client/lib/CliAcquisition.ts - Global storage for CLI binaries in VS Code's global storage path
- Cross-platform support (Windows
.exe, Unix executables)
Telemetry Implementation
- Use
oneDSLoggerWrapperfor all telemetry events - Events defined in
src/common/OneDSLoggerTelemetry/telemetryConstants.ts - Separate telemetry for desktop vs web experiences
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.

