microsoft/vscode-cmake-tools/add-command
Claude Code and agent skill by microsoft/vscode-cmake-tools
- vendor
Checking that the SKILL.md file is still in the repository.
Use when adding a new cmake.* command to CMake Tools. Touches package.json (contributes.commands), package.nls.json, src/extension.ts (funs array), and CHANGELOG.md. Triggers: "add command", "register command", "new command palette entry".
Install
npx vskill@latest install microsoft/vscode-cmake-tools/add-commandSKILL.md
The same SKILL.md was published earlier as microsoft/vscode-cmake-tools/add-command.
Adding a New Command
Recipe for adding a new cmake.* command to CMake Tools.
Files you must touch
| 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 |
Step 1 — Declare the command in package.json
1a — contributes.commands
Rules
- Command ID format:
cmake.<commandName>(camelCase). - Title: NLS key in the format
%cmake-tools.command.cmake.<commandName>.title%. - Category:
"CMake"— this prefixes the title in the Command Palette asCMake: <title>. - `when` (optional): controls when the command appears in the Command Palette.
- `icon` (optional): Codicon reference like
"$(settings-gear)"for tree-view inline buttons.
1b — contributes.menus (if needed)
Add visibility rules for where the command appears.
Command Palette visibility:
Sidebar tree-view inline button:
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 |
Step 2 — Add the English string to package.nls.json
For titles containing the product name, use the object form with a translator comment:
Do not modify any file underi18n/.
Step 3 — Register the command in src/extension.ts
Add 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.
That's it — no manual registerCommand call needed. The loop that follows handles registration automatically:
Only use manualvscode.commands.registerCommand()for commands that needcustom argument handling (e.g., tree-view context-menu commands that receivea node argument). Most commands go through thefunsarray.
Step 4 — Implement the handler on ExtensionManager
Add a method to the ExtensionManager class in src/extension.ts. The method name must match the string added to the funs array.
Pattern A — Delegate to CMakeProject (most common)
Then implement the actual logic on CMakeProject in src/cmakeProject.ts.
Pattern B — Run for all projects
Pattern C — Direct implementation (no CMakeProject delegation)
Key helpers
| 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 |
Step 5 — Add a CHANGELOG entry
Add an entry under the current version in CHANGELOG.md, in the Features: section.
Verification checklist
- [ ]
package.json— command declared with NLS title and"CMake"category - [ ]
package.json— menu entries added (if applicable) with correctwhenclauses - [ ]
package.nls.json— English title string added - [ ]
src/extension.ts— method name added tofunsarray - [ ]
src/extension.ts— handler method implemented onExtensionManager - [ ] Handler uses
telemetry.logEvent()for telemetry - [ ] Handler delegates to
CMakeProjectviarunCMakeCommand(if project-scoped) - [ ]
CHANGELOG.md— entry added - [ ]
yarn compilesucceeds - [ ] No files under
i18n/were modified
See also: [`.github/copilot-instructions.md`](../copilot-instructions.md) for project-wide conventions.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 8 Jun 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/add-command/SKILL.md
Popularity
- Repository stars
- 1,677
- Repository forks
- 527
- 7-day trend score
- 37
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/vscode-cmake-tools/add-command)