add-command
Create new VS Code commands with all required boilerplate
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Create new VS Code commands with all required boilerplate
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Use for one-off / single-question inspection of the running GitLens extension — examining UI state, reading logs, checking feature flags, dispatching a command, or asking "what does the live DOM look like right now". Reference for `vscode-inspector` MCP primitives. For iterative debug-and-fix loops on UI bugs (sweep → fix → re-verify), use `/live-exercise` instead.
Use whenever any UI-bearing work touches a running instance — building or fixing a feature, ship-gating, auditing, OR debugging visible bugs (flaky behavior, intermittent rendering, "sometimes does X" reports, hover/focus/animation glitches, layout overflow). Adaptive depth from tactical fix-loop to ship-gate audit. Not for pure-logic diff review.
Use to audit a component, file, or directory for WCAG 2.1 AA accessibility compliance. Detects ARIA anti-patterns, missing semantics, keyboard gaps, and color-only information. Safety-first — refuses to emit fixes that would create a new accessibility bug. Scope is always explicit; do not use for page-level flow or cross-program planning.
Use to audit a page, view, or composed flow for WCAG 2.1 AA compliance at the composition level - landmarks, heading hierarchy, tab order across components, focus handoff on modal open/close, live-region conflicts. Scope is page/view, NOT component internals. Safety-first - refuses to emit fixes that would create a new a11y bug. For single-component audits use /a11y-audit; for cross-program planning use /a11y-remediate.
Use to produce a leader-facing remediation proposal from one or more /a11y-audit outputs plus team and product context. Translates audit findings into sprint plans, staffing asks, customer-facing language, compliance rollups, and critical-path analysis. Refuses to fabricate numbers, owners, or commitments beyond the inputs it has.
Add new icons to the GitLens GL Icons font
| name | add-command |
| description | Create new VS Code commands with all required boilerplate |
Scaffold a new VS Code command with all required boilerplate.
/add-command [name]
myNewFeature (becomes gitlens.myNewFeature)GlCommandBase — No editor required (opening panels, showing pickers)ActiveEditorCommand — Requires active editorActiveEditorCachedCommand — Like ActiveEditorCommand with "repeat last command" support:views, :graph, :scm suffixes for context menussrc/commands/{commandName}.tsimport type { TextEditor, Uri } from 'vscode';
import type { Container } from '../container.js';
import { command } from '../system/-webview/command.js';
import { {BaseClass} } from './commandBase.js';
export interface {CommandName}CommandArgs {
// Define args if needed
}
@command()
export class {CommandName}Command extends {BaseClass} {
constructor(private readonly container: Container) {
super([
'gitlens.{commandId}',
// Add variants here
]);
}
async execute(editor?: TextEditor, uri?: Uri, args?: {CommandName}CommandArgs): Promise<void> {
// TODO: Implement
}
}
src/commands.tsimport './commands/{commandName}.js';
contributions.jsonUnder "commands" key:
"gitlens.{commandId}": {
"label": "{Label}",
"category": "GitLens",
"commandPalette": "gitlens:enabled"
}
For :views variant:
"gitlens.{commandId}:views": {
"label": "{Label}",
"icon": "$(icon-name)",
"menus": {
"view/item/context": [{
"when": "viewItem =~ /gitlens:/ && gitlens:enabled",
"group": "1_gitlens"
}]
}
}
pnpm run generate:contributions && pnpm run generate:commandTypes
when Clausesgitlens:enabled — Extension is enabled!gitlens:readonly — Not in readonly mode!gitlens:untrusted — Workspace is trustedgitlens:plus — Pro features availableviewItem =~ /gitlens:commit/ — On a commit nodeviewItem =~ /gitlens:branch/ — On a branch node