> Use when adding a new cmake.* command to CMake Tools. Touches package.json (contributes.commands), package.nls.json, src/extension.ts (funs array), and
npx skills add https://github.com/microsoft/vscode-cmake-tools --skill add-command
Recipe for adding a new cmake.* command to CMake Tools.
| File | What to add |
|------|-------------|
| package.json | Command declaration in contributes.commands + optional menu entries |
| package.nls.json | English title string |
| src/extension.ts | Method name in funs array + handler method on ExtensionManager |
| CHANGELOG.md | Entry under the current version |
package.jsoncontributes.commands// package.json → contributes.commands
{
"command": "cmake.myCommand",
"title": "%cmake-tools.command.cmake.myCommand.title%",
"category": "CMake"
}
cmake.<commandName> (camelCase).%cmake-tools.command.cmake.<commandName>.title%."CMake" — this prefixes the title in the Command Palette as CMake: <title>.when (optional): controls when the command appears in the Command Palette.icon (optional): Codicon reference like "$(settings-gear)" for tree-view inline buttons.contributes.menus (if needed)Add visibility rules for where the command appears.
Command Palette visibility:
// package.json → contributes.menus.commandPalette
{
"command": "cmake.myCommand",
"when": "cmake:enableFullFeatureSet"
}
Sidebar tree-view inline button:
// package.json → contributes.menus["view/item/context"]
{
"command": "cmake.projectStatus.myCommand",
"when": "view == cmake.projectStatus && cmake:enableFullFeatureSet && viewItem == 'myItem'",
"group": "inline"
}
Common when clause patterns:
| Pattern | Meaning |
|---------|---------|
| cmake:enableFullFeatureSet | Extension is fully activated |
| useCMakePresets | Presets mode is active |
| !useCMakePresets | Kits/variants mode is active |
| view == cmake.projectStatus && viewItem == 'kit' | Specific tree-view item |
| viewItem =~ /configPreset/ | Regex match on tree-view item |
package.nls.json"cmake-tools.command.cmake.myCommand.title": "My Command Title"
For titles containing the product name, use the object form with a translator comment:
"cmake-tools.command.cmake.myCommand.title": {
"message": "Do Something with CMake Tools",
"comment": ["The text 'CMake Tools' should not be localized."]
}
> Do not modify any file under i18n/.
src/extension.tsAdd the method name to the funs array (search for const funs: near the end of the file). The register() helper
auto-generates the command ID cmake.<name>, wraps it with debug logging, and hands
the promise to rollbar.takePromise() for error tracking.
// src/extension.ts
const funs: (keyof ExtensionManager)[] = [
// ... existing entries ...
'myCommand', // ← add here
];
That's it — no manual registerCommand call needed. The loop that follows handles registration automatically:
for (const key of funs) {
context.subscriptions.push(register(key));
}
> Only use manual vscode.commands.registerCommand() for commands that need
> custom argument handling (e.g., tree-view context-menu commands that receive
> a node argument). Most commands go through the funs array.
ExtensionManagerAdd a method to the ExtensionManager class in src/extension.ts. The method
name must match the string added to the funs array.
myCommand(folder?: vscode.WorkspaceFolder) {
telemetry.logEvent('myCommand');
return this.runCMakeCommand(
cmakeProject => cmakeProject.myCommand(),
folder,
undefined, // precheck (optional)
true // cleanOutputChannel
);
}
Then implement the actual logic on CMakeProject in src/cmakeProject.ts.
myCommandAll() {
telemetry.logEvent('myCommand', { all: 'true' });
return this.runCMakeCommandForAll(
cmakeProject => cmakeProject.myCommand()
);
}
async myCommand() {
telemetry.logEvent('myCommand');
const result = await vscode.window.showQuickPick(items);
if (!result) {
return;
}
// ... handle result ...
}
| Helper | Use when |
|--------|----------|
| this.runCMakeCommand(cmd, folder) | Single-project command |
| this.runCMakeCommandForAll(cmd) | Runs on every open CMake project |
| this.runCMakeCommandForProject(cmd, project) | Specific project instance |
Add an entry under the current version in CHANGELOG.md, in the Features: section.
package.json — command declared with NLS title and "CMake" categorypackage.json — menu entries added (if applicable) with correct when clausespackage.nls.json — English title string addedsrc/extension.ts — method name added to funs arraysrc/extension.ts — handler method implemented on ExtensionManagertelemetry.logEvent() for telemetryCMakeProject via runCMakeCommand (if project-scoped)CHANGELOG.md — entry addedyarn compile succeedsi18n/ were modified*See also: .github/copilot-instructions.md for project-wide conventions.*
Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.
Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances
Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.
Build and distribute Expo development clients locally or via TestFlight
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.
Take microsoft/add-command from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.