azure-dev / vscode
AGENTS.md573 starsChanged 8 months agoMITView on GitHub
A file for guiding coding agents. IMPORTANT: Always run these checks before committing to avoid pipeline failures: Testing Requirements: - If you modify existing code, ensure related tests still pass - If you add new functionality, add corresponding unit tests - Add new words to .vscode/cspell-dictionary.txt if cspell flags valid technical terms
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 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 repository25 other files it gives its agents.
- cli/azd/AGENTS.mdAGENTS.md
- cli/azd/extensions/azure.ai.agents/AGENTS.mdAGENTS.md
- cli/azd/extensions/azure.ai.connections/AGENTS.mdAGENTS.md
- cli/azd/extensions/azure.ai.inspector/AGENTS.mdAGENTS.md
- cli/azd/extensions/azure.ai.projects/AGENTS.mdAGENTS.md
- cli/azd/extensions/azure.ai.routines/AGENTS.mdAGENTS.md
- cli/azd/extensions/azure.ai.skills/AGENTS.mdAGENTS.md
- cli/azd/extensions/azure.ai.toolboxes/AGENTS.mdAGENTS.md
- .github/skills/extension-user-contract-review/evals/fixtures/cli/azd/AGENTS.mdAGENTS.md
- ext/vscode/.github/copilot-instructions.mdCopilot instructions
- .github/copilot-instructions.mdCopilot instructions
- azdSkill
- agentic-workflowsSkill
- azd-code-reviewerSkill
- azd-grpc-contractsSkill
- azd-preflightSkill
- changelog-generationSkill
- extension-user-contract-reviewSkill
- foundry-extension-scenario-authoringSkill
- foundry-extension-scenario-pr-regressionSkill
- foundry-extension-scenario-suite-runSkill
- senseiSkill
- tool-version-upgradeSkill
- weekly-demo-videoSkill
- weekly-reportSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
18 rules. About 0 are common, 9 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
IMPORTANT: Always run these checks before committing to avoid pipeline failures:
- Very specific: line 30
Run npm run lint and fix all issues
- Very specific: line 31
Run npx cspell "src//*.ts" --config .vscode/cspell.yaml and fix spelling errors
- Very specific: line 32
Run npm run unit-test and ensure all tests pass
- Distinctive: line 33
Update README.md if functionality changed
- Distinctive: line 34
Verify no merge conflict markers in code
- Distinctive: line 37
If you modify existing code, ensure related tests still pass
- Distinctive: line 38
If you add new functionality, add corresponding unit tests
- Very specific: line 39
Add new words to .vscode/cspell-dictionary.txt if cspell flags valid technical terms
- Distinctive: line 44
All TypeScript source files MUST include the Microsoft copyright header:
- Very specific: line 51
All user-facing strings shown in the UI, error messages, etc.
- Very specific: line 52
All user-facing strings in package.json must be extracted into package.nls.json
- Very specific: line 55
Instead of vscode.window.showQuickPick, use IActionContext.ui.showQuickPick
- Very specific: line 62
Use ExtensionContext.subscriptions for cleanup
- Distinctive: line 65
Use Mocha for test framework
- Distinctive: line 66
Use Chai for assertions
- Distinctive: line 68
Keep tests focused and isolated
- Very specific: line 69
Use UserCancelledError from @microsoft/vscode-azext-utils for testing user cancellation scenarios
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
Agent Development Guide
A file for guiding coding agents.
Commands
- Install dependencies:
npm install - Build:
npm run build - Lint:
npm run lint - Spell Check:
npx cspell "src/**/*.ts" --config .vscode/cspell.yaml - Unit Tests:
npm run unit-test - Watch mode:
npm run watch - Package extension:
npm run package
Directory Structure
- Extension entry point:
src/extension.ts - Commands:
src/commands/ - Language features:
src/language/(IntelliSense, diagnostics, etc.) - Views & tree providers:
src/views/ - Utilities:
src/utils/ - Tests:
src/test/ - Constants:
src/constants/ - Services:
src/services/
Pre-Commit Checklist
IMPORTANT: Always run these checks before committing to avoid pipeline failures:
- Run
npm run lintand fix all issues - Run
npx cspell "src/**/*.ts" --config .vscode/cspell.yamland fix spelling errors - Run
npm run unit-testand ensure all tests pass - Update README.md if functionality changed
- Verify no merge conflict markers in code
Testing Requirements:
- If you modify existing code, ensure related tests still pass
- If you add new functionality, add corresponding unit tests
- Add new words to
.vscode/cspell-dictionary.txtif cspell flags valid technical terms
Code Conventions
Copyright Headers
All TypeScript source files MUST include the Microsoft copyright header:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.Localization
- All user-facing strings shown in the UI, error messages, etc. must use
vscode.l10n.t() - All user-facing strings in package.json must be extracted into package.nls.json
UI Best Practices
- Instead of
vscode.window.showQuickPick, useIActionContext.ui.showQuickPick - Instead of
vscode.window.showInputBox, useIActionContext.ui.showInputBox - Same for
showWarningMessage,showOpenDialog, andshowWorkspaceFolderPick
Resource Management
- FileSystemWatchers are a scarce resource on some systems - use the shared
FileSystemWatcherService - Dispose resources properly using
vscode.Disposablepattern - Use
ExtensionContext.subscriptionsfor cleanup
Testing
- Use Mocha for test framework
- Use Chai for assertions
- Mock VS Code APIs using Sinon
- Keep tests focused and isolated
- Use
UserCancelledErrorfrom@microsoft/vscode-azext-utilsfor testing user cancellation scenarios
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.

