# Contributor handoff — microsoft/vscode

> Canonical page: https://codevetter.com/unpack/vscode/agent-handoff

# Contributor handoff — microsoft/vscode

Scanned commit f6439326f6891a1eaf254a19fc1a78243cbb8f9d (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Before editing, read .github/copilot-instructions.md (the canonical conventions doc referenced by AGENTS.md): tabs not spaces, DI rules (services only via constructor params, never IInstantiationService lookups later), strict disposable discipline (DisposableStore/MutableDisposable), nls.localize for all user strings, no cross-component storage-key access, prefer IEditorService for opening editors, and events are for broadcasting not control flow. Respect the layering (base→platform→editor→workbench; sessions may import workbench, not vice versa) enforced by valid-layers-check. New shared services go through registerSingleton in the right workbench.*.main.ts barrel — never in Workbench.initServices. Test with scripts/test.sh --grep for unit tests; use npm run typecheck-client or the watch tasks for validation, and transpile-client when you only need fresh output.
- Read .github/copilot-instructions.md first — it is the canonical agent doc (AGENTS.md just points to it) covering layers, DI rules, coding style, disposable rules, and validation strategy. — [AGENTS.md](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/AGENTS.md) [.github/copilot-instructions.md](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/.github/copilot-instructions.md)
- Layer rule: vs/sessions may import vs/workbench but not vice versa; platform code must not import workbench; layering is machine-checked by npm run valid-layers-check (build/checker/layersChecker.ts) — run it when changing module dependencies. — [.github/copilot-instructions.md#L27-L34](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/.github/copilot-instructions.md#L27-L34) [package.json#L69](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/package.json#L69) [build/checker/layersChecker.ts](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/build/checker/layersChecker.ts)
- Service registration trap: Workbench.initServices has an explicit 'do NOT register services here' comment — use registerSingleton() in workbench.common.main.ts (or web/desktop main for platform-specific services) with InstantiationType.Delayed unless eager startup is required. — [src/vs/workbench/browser/workbench.ts#L177-L180](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/src/vs/workbench/browser/workbench.ts#L177-L180) [src/vs/workbench/workbench.web.main.ts#L111-L133](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/src/vs/workbench/workbench.web.main.ts#L111-L133)
- Common-import rule: the banner in workbench.web.main.ts says add common imports to workbench.common.main.ts; import order in these barrels controls module side effects, so keep the regioned structure intact. — [src/vs/workbench/workbench.web.main.ts#L7-L16](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/src/vs/workbench/workbench.web.main.ts#L7-L16)
- ESM import convention: all in-repo imports use explicit '.js' extensions on TypeScript sources (e.g., '../../base/common/uri.js'); the codebase is 'type: module' and bootstrapped via bootstrapESM. — [src/vs/code/electron-main/main.ts#L10-L30](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/src/vs/code/electron-main/main.ts#L10-L30) [package.json#L10](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/package.json#L10) [src/bootstrap-esm.ts](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/src/bootstrap-esm.ts)
- Disposable discipline is enforced in review: register disposables immediately (DisposableStore/DisposableMap/MutableDisposable); don't register method-created disposables on the containing class to avoid leaks — return IDisposable to the caller instead. — [.github/copilot-instructions.md#L147](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/.github/copilot-instructions.md#L147)
- Unit tests: put tests in the sibling test/ folder of the layer (e.g., src/vs/platform/x/test), use mocha tdd describe/test style, run via scripts/test.sh --grep on desktop or npm run test-node / test-browser for the relevant suite. — [scripts/test.sh](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/scripts/test.sh) [.github/copilot-instructions.md#L65](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/.github/copilot-instructions.md#L65) [test/unit/node/index.js](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/test/unit/node/index.js)
- Validation hierarchy: prefer existing watch-task diagnostics; use npm run transpile-client when tests just need fresh output; npm run typecheck-client for broad src changes; npm run gulp compile-extensions for built-in extensions; avoid redundant typecheck+compile runs. — [.github/copilot-instructions.md#L52-L65](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/.github/copilot-instructions.md#L52-L65) [package.json#L28-L44](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/package.json#L28-L44)
- User-facing strings must go through vs/nls (nls.localize/localize2) with placeholders, never concatenation; command/menu labels use title-case per the UI-label rules. — [.github/copilot-instructions.md#L91-L99](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/.github/copilot-instructions.md#L91-L99)
- Every file needs the Microsoft copyright header (MIT) — enforced by hygiene (build/hygiene.ts run as precommit). — [.github/copilot-instructions.md#L133](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/.github/copilot-instructions.md#L133) [package.json#L55](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/package.json#L55) [src/vs/code/electron-main/main.ts#L1-L4](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/src/vs/code/electron-main/main.ts#L1-L4)
- Do not read another component's storage keys to mutate its state — add a proper API instead; use IEditorService (not IEditorGroupsService.activeGroup.openEditor) to open editors so revealIfOpened/preserveFocus are honored. — [.github/copilot-instructions.md#L148-L149](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/.github/copilot-instructions.md#L148-L149)
- Perf convention: instrument startup paths with perf.mark('code/...') markers matching the existing naming scheme (code/willX/code/didX); thresholds like setGlobalLeakWarningThreshold(175) exist and tests will flag emitter leaks. — [src/main.ts#L23-L31](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/src/main.ts#L23-L31) [src/vs/workbench/browser/workbench.ts#L115](https://github.com/microsoft/vscode/blob/f6439326f6891a1eaf254a19fc1a78243cbb8f9d/src/vs/workbench/browser/workbench.ts#L115)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
