vscode-extension-guide-en – skill Lập trình cho agent AI
Hướng dẫn phát triển extension VS Code từ khởi tạo scaffolding đến xuất bản lên Marketplace
Cài skill vscode-extension-guide-en bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/vscode-extension-guide-en-d349c.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /vscode-extension-guide-en – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/vscode-extension-guide-en-d349c.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $vscode-extension-guide-en – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/vscode-extension-guide-en-d349c.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /vscode-extension-guide-en – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/vscode-extension-guide-en-d349c.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /vscode-extension-guide-en – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
VS Code Extension Guide (English)
Overview
An English guide for building VS Code extensions, covering the full lifecycle from scaffolding to Marketplace publication. Includes reference material on webview patterns, CSP security, TreeView, testing, packaging and troubleshooting. Updated for VS Code 1.74+ APIs.
Adapted from aktsmm/agent-skills (CC BY-NC-SA 4.0), translated to English with corrections for current VS Code APIs.
When to Use This Skill
- Use when creating a new VS Code extension from scratch
- Use when adding commands, keybindings or settings to an extension
- Use when building TreeView or Webview UI in an extension
- Use when publishing an extension to the VS Code Marketplace
- Use when troubleshooting extension activation or packaging issues
How It Works
Quick Start
npm install -g yo generator-code
yo codeProject Structure
my-extension/
├── package.json # Extension manifest
├── src/extension.ts # Entry point
├── out/ # Compiled JS
├── images/icon.png # 128x128 PNG for Marketplace
└── .vscodeignore # Exclude files from VSIXBuilding and Packaging
npm run compile # Build once
npm run watch # Watch mode (F5 to launch debug)
npx @vscode/vsce package # Creates .vsixReference Topics
The upstream full skill advertises reference documents on the following topics; this AAS entry contains only this overview, not those files:
- Webview patterns with CSP security and message passing
- TreeView data providers and drag-and-drop
- Testing setup with @vscode/test-electron
- Publishing to the VS Code Marketplace
- AI customization for extension projects
- Code review prompts for extension code
- Troubleshooting common extension issues
Install the Full Skill
For the complete guide with all reference documents:
npx skills add lewiswigmore/agent-skills --skill vscode-extension-guide-enBest Practices
- Unify package name, setting keys, command IDs and view IDs before publishing
- Inspect the VSIX file list with
npx @vscode/vsce ls; exclude credentials, local data and unnecessary dependencies using the packaging configuration. A small package is a goal, not a universal 5MB Marketplace limit. - For webviews, start with scripts disabled unless needed; use a restrictive CSP, webview resource URIs and narrow local resource roots. Validate message shapes and allowed actions in the extension host; never pass arbitrary received strings to a shell or command dispatcher.
- Since VS Code 1.74,
activationEventsare auto-detected for contributed commands and views - Always test with the Extension Development Host (F5) before packaging
Common Pitfalls
- Problem: Extension not loading
Solution: Check activationEvents. Since VS Code 1.74, these are auto-detected for contributed commands/views.
- Problem: Command not found
Solution: Match the command ID exactly between package.json and your code.
- Problem: Webview content not displaying
Solution: Check your Content Security Policy. Use the webview's cspSource property.
Related Skills
@test-driven-development- Write tests before implementing extension features@debugging-strategies- Systematic troubleshooting for extension issues
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Skill liên quan
- warp-delegate – Chỉ giao các tác vụ lập trình cho Warp Agent CLI (`oz`) khi người dùng yêu cầu rõ ràng…
- web-review – Rà soát website hoặc trang đích và liệt kê những gì cần sửa, quan trọng nhất trước…
- web3-testing – Nắm vững các chiến lược kiểm thử toàn diện cho smart contract với Hardhat, Foundry và…
- web3-transaction-relayer-pool – Sổ đăng ký pool node relayer giao dịch không phí gas: giới hạn tài trợ phí, đồng bộ…
- webapp-testing – Để kiểm thử ứng dụng web cục bộ, viết script Playwright Python gốc.
- webdriverio-skill – Tạo test tự động hóa WebdriverIO (WDIO) bằng JavaScript hoặc TypeScript. Hỗ trợ chạy cục…
- what-could-break – Tìm những gì một thay đổi có thể làm hỏng ngoài phạm vi diff của nó, rồi chứng minh một…
- whatsapp-cloud-api – Tích hợp WhatsApp Business Cloud API (Meta). Tin nhắn, template, webhook HMAC-SHA256, tự…