

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
123456# Best Practices78## Buttons & Actions910- Don't create a new class or custom CSS to render a button or action. Reuse the existing `Button` class (`vs/base/browser/ui/button/button.ts`) and the existing `Action` types (`vs/base/common/actions.ts`). This keeps theming, accessibility, and behavior consistent.11- Render actions inside a toolbar rather than by hand. Prefer `MenuWorkbenchToolBar` (`vs/platform/actions/browser/toolbar.ts`): give it a `MenuId` so actions can be contributed from anywhere (contributions, other components) without coupling.12- Use `WorkbenchToolBar` when you need explicit control over which actions render and where separators go.13- Never add a separator while rendering an action. Add separators with the existing `Separator` class (`vs/base/common/actions.ts`).14- If a `MenuWorkbenchToolBar` lives in a widget/view that can be rendered multiple times at once, give the toolbar a scoped `IContextKeyService` which is scoped to the dom element of that widget/view and set the context keys per individual widget/view instance.1516## Editor/Session Actions1718- Don't assume the action runs on the active editor/session. An action (e.g. one contributed to some editor or session related toolbar) can be triggered for an editor/session that isn't active. The `run` method receives arguments describing the invocation context (such as the originating editor group or the originating session).19- Resolve editor action arguments with `resolveCommandsContext` (`vs/workbench/browser/parts/editor/editorCommandsContext.ts`) to get the correct editor(s) instead of reading `editorService.activeEditor`.20- Support multi-selection. The resolved editor actions context can contain several editors (e.g. multi-selected tabs).2122## Context Keys2324- Don't use context keys as a source of truth for application logic (for example, by reading `IContextKeyService.getContextKeyValue()` and branching on the result). Read the state from its owning service or model instead. Context keys are intended for declarative enablement and visibility, such as when clauses, command preconditions, and menu contributions.2526## URI2728- Don't hardcode URI scheme strings like `'file'`, `'untitled'`, or `'vscode-remote'`. Use the `Schemas` constants from `vs/base/common/network.ts` (e.g. `Schemas.file`, `Schemas.untitled`, `Schemas.vscodeRemote`).29- Don't compare URIs with `===` or `uri.toString()`. Use the comparison utilities from `vs/base/common/resources.ts`: `isEqual` for equality, `isEqualOrParent` for containment, and `getComparisonKey` when a URI is used as a map/set key. These handle path-case sensitivity and fragment/authority correctly. When you need explicit control over case sensitivity, use an `ExtUri` instance (`extUri`, `extUriIgnorePathCase`, or `extUriBiasedIgnorePathCase`) instead of the bound helpers.3031## Resource Labels3233- Don't set `{ supportIcons: true }` when creating a `ResourceLabel` (`vs/workbench/browser/labels.ts`). This option makes the label parse `$(codicon)` syntax in the name/description and is only needed when you want to render a codicon inline with the resource text. By default (without it), the label computes the proper file-icon CSS classes for the resource, which is what we almost always want. Note that those classes only render as icons when an ancestor DOM element enables file icons (see below); otherwise the label shows text only.34- To actually display file icons for resource labels in a tree/list, an ancestor container must have the `show-file-icons` class and be wired to the active file icon theme. Don't add the class by hand — call `createFileIconThemableTreeContainerScope` (`vs/workbench/contrib/files/browser/views/explorerView.ts`) on the container. It adds the required `show-file-icons` / `file-icon-themable-tree` classes and keeps `align-icons-and-twisties` / `hide-arrows` in sync with the file icon theme. Register the returned `IDisposable`. A common bug is placing a resource-label list/tree outside such a scoped container, which makes file icons silently disappear.3536## Styling3738- Avoid `getComputedStyle`. If a style value is needed in both CSS and TypeScript, prefer hardcoding the value in TypeScript and setting it directly on the DOM element (e.g. `element.style.width = '100px'`), or set a CSS custom property via `element.style.setProperty('--my-var', value)` when the value is needed across multiple CSS rules.3940## Editor Decorations4142- For editor highlights, use a regular editor decoration with an `inlineClassName` or `className` plus a CSS rule.43- `ICodeEditorService.registerDecorationType` / `setDecorationsByType` is reserved for the extension host API and should be avoided at all cost.44
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| microsoft/vscodeextensions/copilot/src/platform/authentication/common/AGENTS.md · 189k | AGENTS.md | archsecurityagent-behaviour | 58/100 | 14 days ago | |
| microsoft/vscode.github/instructions/oss.instructions.md · 189k | Copilot instructions | git | 44/100 | 14 days ago | |
| microsoft/vscode.github/copilot-instructions.md · 189k | Copilot instructions | stylearchtypesui+2 | 74/100 | 13 days ago | |
| microsoft/vscode.github/instructions/accessibility.instructions.md · 189k | Copilot instructions | styledo-not | 61/100 | 14 days ago | |
| microsoft/vscode.github/instructions/agentHostTesting.instructions.md · 189k | Copilot instructions | teststyletesting-strategyagent-behaviour | 55/100 | 7 days ago | |
| microsoft/vscode.github/instructions/chat.instructions.md · 189k | Copilot instructions | agent-behaviour | 39/100 | today | |
| microsoft/vscode.github/instructions/coding-guidelines.instructions.md · 189k | Copilot instructions | styletypesuidocs | 60/100 | 14 days ago | |
| microsoft/vscode.github/instructions/committing.instructions.md · 189k | Copilot instructions | do-not | 23/100 | 14 days ago | |
| microsoft/vscode.github/instructions/css-best-practices.instructions.md · 189k | Copilot instructions | styleui | 29/100 | 14 days ago | |
| microsoft/vscode.github/instructions/design-philosophy.instructions.md · 189k | Copilot instructions | style | 34/100 | 14 days ago | |
| microsoft/vscode.github/instructions/design-tokens.instructions.md · 189k | Copilot instructions | styledo-not | 65/100 | 14 days ago | |
| microsoft/vscode.github/instructions/interactive.instructions.md · 189k | Copilot instructions | ui | 43/100 | 14 days ago | |
| microsoft/vscode.github/instructions/notebook.instructions.md · 189k | Copilot instructions | no sections | 48/100 | 14 days ago | |
| microsoft/vscode.github/instructions/observables.instructions.md · 189k | Copilot instructions | no sections | 40/100 | 14 days ago | |
| microsoft/vscode.github/instructions/oss-third-party-notices.instructions.md · 189k | Copilot instructions | buildgitdependenciesdeployment+1 | 65/100 | 14 days ago | |
| microsoft/vscode.github/instructions/sessions.instructions.md · 189k | Copilot instructions | no sections | 24/100 | today | |
| microsoft/vscode.github/instructions/source-code-organization.instructions.md · 189k | Copilot instructions | do-not | 73/100 | 14 days ago | |
| microsoft/vscode.github/instructions/telemetry.instructions.md · 189k | Copilot instructions | styletypesdo-not | 65/100 | 14 days ago | |
| microsoft/vscode.github/instructions/tree-widgets.instructions.md · 189k | Copilot instructions | stylearchperformance | 62/100 | 14 days ago | |
| microsoft/vscode.github/instructions/writing-tests.instructions.md · 189k | Copilot instructions | teststyletypes | 58/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 65 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 14 days ago | |
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 100/100 | 14 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 32k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 7 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 14 days ago | |
| darkmatter/nixmac.github/copilot-instructions.md · 25 | Copilot instructions | setupbuildtestlint-format+8 | 96/100 | 14 days ago | |
| nerolis-lab/nerolis-lab.github/copilot-instructions.md · 32 | Copilot instructions | setupbuildtestlint-format+11 | 96/100 | 14 days ago | |
| thangaram611/second-brain.github/copilot-instructions.md · 0 | Copilot instructions | setupteststylearch+4 | 96/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/microsoft-vscode-github-instructions-best-practices-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.