重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
vscode-extension-guide by aktsmm/agent-skills
npx skills add https://github.com/aktsmm/agent-skills --skill vscode-extension-guide创建、开发和发布 VS Code 扩展。
# 脚手架新建扩展(推荐)
npm install -g yo generator-code
yo code
# 或最小化手动设置
mkdir my-extension && cd my-extension
npm init -y && npm install -D typescript @types/vscode
my-extension/
├── package.json # 扩展清单(关键)
├── src/extension.ts # 入口点
├── out/ # 编译后的 JS(gitignore)
├── images/icon.png # 用于市场的 128x128 PNG 图标
└── .vscodeignore # 从 VSIX 中排除的文件
npm run compile # 构建一次
npm run watch # 监视模式(按 F5 启动调试)
npx @vscode/vsce package # 创建 .vsix 文件
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
.vscodeignore)| 症状 | 修复方法 |
|---|---|
| 扩展未加载 | 在 package.json 中添加 activationEvents |
| 命令未找到 | 确保 package.json 和代码中的命令 ID 匹配 |
| 快捷键不工作 | 移除 when 子句,检查冲突 |
| 主题 | 参考 |
| --- | --- |
| AI 定制 | references/ai-customization.md |
| 代码审查提示 | references/code-review-prompts.md |
| 代码示例 | references/code-samples.md |
| 树视图 | references/treeview.md |
| Webview | references/webview.md |
| 测试 | references/testing.md |
| 发布 | references/publishing.md |
| 故障排除 | references/troubleshooting.md |
发布前统一包名、设置键、命令名:
| 项目 | 示例 |
|---|---|
| 包名 | copilot-scheduler |
| 设置键 | copilotScheduler.enabled |
| 命令 ID | copilotScheduler.createTask |
| 视图 ID | copilotSchedulerTasks |
type NotificationMode = "sound" | "silentToast" | "silentStatus";
function getNotificationMode(): NotificationMode {
const config = vscode.workspace.getConfiguration("myExtension");
return 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);
}
通过配置 notificationMode,让用户可以控制通知音效。
每周安装量
42
代码仓库
GitHub 星标数
9
首次出现
2026年2月2日
安全审计
安装于
gemini-cli39
codex39
cursor39
opencode38
amp38
github-copilot38
Create, develop, and publish VS Code extensions.
# 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
my-extension/
├── package.json # Extension manifest (CRITICAL)
├── src/extension.ts # Entry point
├── out/ # Compiled JS (gitignore)
├── images/icon.png # 128x128 PNG for Marketplace
└── .vscodeignore # Exclude files from VSIX
npm run compile # Build once
npm run watch # Watch mode (F5 to launch debug)
npx @vscode/vsce package # Creates .vsix
.vscodeignore)| Symptom | Fix |
|---|---|
| Extension not loading | Add activationEvents to package.json |
| Command not found | Match command ID in package.json/code |
| Shortcut not working | Remove when clause, check conflicts |
| Topic | Reference |
| --- | --- |
| AI Customization | references/ai-customization.md |
| Code Review Prompts | references/code-review-prompts.md |
| Code Samples | references/code-samples.md |
公開前にパッケージ名・設定キー・コマンド名を統一:
| 項目 | 例 |
|---|---|
| パッケージ名 | copilot-scheduler |
| 設定キー | copilotScheduler.enabled |
| コマンドID | copilotScheduler.createTask |
| ビューID | copilotSchedulerTasks |
type NotificationMode = "sound" | "silentToast" | "silentStatus";
function getNotificationMode(): NotificationMode {
const config = vscode.workspace.getConfiguration("myExtension");
return 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);
}
設定で notificationMode を選べるようにすることで、ユーザーが通知音を制御可能。
Weekly Installs
42
Repository
GitHub Stars
9
First Seen
Feb 2, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli39
codex39
cursor39
opencode38
amp38
github-copilot38
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
125,600 周安装
| TreeView | references/treeview.md |
| Webview | references/webview.md |
| Testing | references/testing.md |
| Publishing | references/publishing.md |
| Troubleshooting | references/troubleshooting.md |