add-command

Generates TypeScript boilerplate and configuration for new VS Code commands.

9.9k|1.8k|Updated Aug 8, 2016
One-click install
npx skills add https://github.com/gitkraken/vscode-gitlens --skill add-command-gitkraken
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-command
Source: https://github.com/gitkraken/vscode-gitlens/tree/main/.claude/skills/add-command
Command: npx skills add https://github.com/gitkraken/vscode-gitlens --skill add-command-gitkraken

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the creation of new VS Code commands, generating all necessary boilerplate code and configuration files to ensure consistency and reduce manual setup time.

Core Features & Use Cases

  • Boilerplate Generation: Creates command files (.ts), updates import statements, and modifies contributions.json.
  • Customizable Commands: Supports different base classes (GlCommandBase, ActiveEditorCommand, ActiveEditorCachedCommand) and command variants (e.g., :views, :graph).
  • Use Case: When developing a new feature in VS Code that requires a new command, use this Skill to quickly set up the command's structure, including its ID, label, and integration into the command palette and context menus.

Quick Start

Use the add-command skill to create a new VS Code command with the ID 'myNewFeature', label 'My New Feature', and base class 'GlCommandBase'.

Frequently Asked Questions about add-command

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a new VS Code command in a TypeScript project?

To scaffold a new VS Code command in a TypeScript project, you can automatically generate the required boilerplate code and configuration files by specifying the command ID, label, and base class. This updates imports and contribution manifests.

What boilerplate is needed to add a command to the VS Code command palette?

Adding a command to the VS Code command palette requires a TypeScript command file, updated import statements, and modifications to contributions.json for manifest generation, ensuring the command ID and label are registered correctly.

Can I use different base classes when generating VS Code commands?

Yes, you can use different base classes when generating VS Code commands, including GlCommandBase, ActiveEditorCommand, and ActiveEditorCachedCommand. This allows you to customize the command structure for specific editor interactions.

How do I add context menu variants for VS Code extension commands?

You can add context menu variants for VS Code extension commands by defining specific variants like :views or :graph during the scaffolding process. This integrates the command variations directly into the contribution manifest.

Does this command scaffolding integrate with the build process for contribution manifests?

Yes, the command scaffolding integrates with the build process for contribution manifest generation. It automatically updates contributions.json and import statements to ensure the new command configuration is consistent.