Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aktsmm avatar

Vscode Extension Guide

  • 170 installs
  • 23 repo stars
  • Updated August 4, 2026
  • aktsmm/agent-skills

Scaffold, structure, and implement VS Code extensions with manifests, commands, webviews, and packaging steps aligned to marketplace requirements.

About

vscode-extension-guide walks developers through creating VS Code extensions end to end: project layout, package.json contributions, command registration, webviews, testing, and publish workflow. It targets teams shipping editor-side tools, language helpers, or agent integrations as first-class marketplace extensions.

  • extension manifest setup
  • command and webview patterns
  • TypeScript extension host
  • marketplace packaging
  • activation and contribution points

Vscode Extension Guide by the numbers

  • 170 all-time installs (skills.sh)
  • Ranked #922 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aktsmm/agent-skills --skill vscode-extension-guide

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs170
repo stars23
Last updatedAugust 4, 2026
Repositoryaktsmm/agent-skills

What it does

Scaffold, structure, and implement VS Code extensions with manifests, commands, webviews, and packaging steps aligned to marketplace requirements.

Files

SKILL.mdMarkdownGitHub ↗

VS Code Extension Guide

Create, develop, and publish VS Code extensions.

When to Use

  • VS Code extension, extension development, vscode plugin
  • Creating a new VS Code extension from scratch
  • Adding commands, keybindings, or settings to an extension
  • Publishing to VS Code Marketplace

Quick Start

# Scaffold new extension (recommended)
npm install -g yo generator-code
yo code

# Or minimal manual setup
mkdir my-extension && cd my-extension
npm init -y && npm install -D typescript @types/vscode

Project Structure

my-extension/
├── package.json          # Extension manifest (CRITICAL)
├── src/extension.ts      # Entry point
├── out/                  # Compiled JS (gitignore)
├── artifacts/vsix/       # Keep local VSIX archives out of the repo root
├── images/icon.png       # 128x128 PNG for Marketplace
└── .vscodeignore         # Exclude files from VSIX

Building & Packaging

npm run compile      # Build once
npm run watch        # Watch mode (F5 to launch debug)
mkdir -p artifacts/vsix
npx @vscode/vsce package --out artifacts/vsix/my-extension-1.0.0.vsix

Keep local .vsix archives under artifacts/vsix/ instead of the repository root, and prune old local builds on a schedule so release artifacts do not pile up.

Done Criteria

  • [ ] Extension activates without errors
  • [ ] All commands registered and working
  • [ ] Package size < 5MB (use .vscodeignore)
  • [ ] README.md includes Marketplace/GitHub links
  • [ ] Local VSIX artifacts stored outside the repo root and pruned regularly

Quick Troubleshooting

SymptomFix
Extension not loadingAdd activationEvents to package.json
Command not foundMatch command ID in package.json/code
Shortcut not workingRemove when clause, check conflicts

Reference Map

TopicReference
AI Customizationreferences/ai-customization.md
Code Review Promptsreferences/code-review-prompts.md
Code Samplesreferences/ai-customization.md and references/webview.md
TreeViewreferences/treeview.md
Webviewreferences/webview.md
Testingreferences/testing.md
Publishingreferences/publishing.md
Troubleshootingreferences/troubleshooting.md

Best Practices

Extension Host 境界

  • Extension Host 上で動く scanner / provider / TreeView は、同じことができるなら Node 固有の path / Buffer / 生 fs より VS Code API を優先する。Problems と実ビルドの環境差を避けやすい。
  • 自分の拡張に同梱したリソースは、ユーザーのホーム配下や VS Code のインストール先を推測せず、context.extensionUrivscode.Uri.joinPath など extension context から解決する。
  • 他の installed extension に同梱されたリソースを読む必要がある場合も、resources/agents|skills|prompts|instructions|hooks|mcp の既知 root と、manifest の chatAgents / chatPromptFiles 宣言を優先して見る。built-in resource とは別の read-only resource として扱い、削除や再インストール導線を混ぜない。
  • Runtime の診断ログは console.log に散らさず、Output Channel ベースの logger に集約する。ユーザーがログを開ける導線も command / notification / README のどこかに用意する。

Manifest / Docs / Localization

  • package.json の commands、views、configuration、menus を変えたら、コード上の command ID / setting key と同時に確認する。
  • Marketplace 表示や設定説明をローカライズしている拡張では、package.nls.json と対象言語の package.nls.*.json を同じ変更で更新する。
  • 設定の並び順や説明を変えたら README の設定表、manifest consistency test、release notes の必要有無までまとめて見る。

Generated Sections

  • START / END marker で囲む generated section は単一の SSOT として扱う。
  • 重複した marker pair を見つけたら、両方を残して追記せず、内容を統合して marker pair を1つに戻す。

命名の一貫性

公開前にパッケージ名・設定キー・コマンド名を統一:

項目
パッケージ名copilot-scheduler
設定キーcopilotScheduler.enabled
コマンドIDcopilotScheduler.createTask
ビューIDcopilotSchedulerTasks

通知の一元管理

type NotificationMode = "sound" | "silentToast" | "silentStatus";

function normalizeNotificationMode(mode: unknown): NotificationMode {
  switch (mode) {
    case "sound":
    case "silentToast":
    case "silentStatus":
      return mode;
    default:
      return "sound";
  }
}

function getNotificationMode(): NotificationMode {
  const config = vscode.workspace.getConfiguration("myExtension");
  if (config.get<boolean>("showNotifications", true) === false) {
    return "silentStatus";
  }
  return normalizeNotificationMode(
    config.get<NotificationMode>("notificationMode", "sound"),
  );
}

function notifyInfo(message: string, timeoutMs = 4000): void {
  const mode = getNotificationMode();
  switch (mode) {
    case "silentStatus":
      vscode.window.setStatusBarMessage(message, timeoutMs);
      break;
    case "silentToast":
      void vscode.window.withProgress(
        { location: vscode.ProgressLocation.Notification, title: message },
        async () => {},
      );
      break;
    default:
      void vscode.window.showInformationMessage(message);
  }
}

function notifyError(message: string, timeoutMs = 6000): void {
  const mode = getNotificationMode();
  if (mode === "silentStatus") {
    vscode.window.setStatusBarMessage(`⚠ ${message}`, timeoutMs);
    console.error(message);
    return;
  }
  void vscode.window.showErrorMessage(message);
}

設定値は型注釈だけで信用せず、runtime で既知 enum へ正規化してください。設定ファイルの手編集や migration ずれで無効値が入っても通知経路を壊さないようにします。

Related skills

Frontend Developmentfrontendintegrationsdocs

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.