Chuyển đến nội dung
Skillpedia
Viết lách48k · #6136

vscode-extension-guide-en

Skill này làm gì

Hướng dẫn này dạy bạn cách xây dựng tiện ích mở rộng cho trình soạn thảo mã VS Code, từ đầu đến khi xuất bản. Nội dung bao gồm bảo mật, giao diện người dùng và cách khắc phục các lỗi thường gặp.

Khi nào nên dùng

  • ✓Khi bạn tạo một tiện ích mở rộng VS Code mới.
  • ✓Khi thêm các tính năng mới như lệnh hoặc menu.
  • ✓Khi bạn xuất bản tiện ích để người khác dùng.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/vscode-extension-guide-en/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/vscode-extension-guide-en/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm sao để tạo một tiện ích mở rộng VS Code đơn giản?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ cung cấp các lệnh để khởi tạo dự án và hiển thị cấu trúc tệp cơ bản. Bạn có thể biên dịch và kiểm thử mã bằng các lệnh đơn giản.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết 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 code

Project 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 VSIX

Building and Packaging

npm run compile           # Build once
npm run watch             # Watch mode (F5 to launch debug)
npx @vscode/vsce package  # Creates .vsix

Reference Topics

The full skill includes detailed reference documents on:

  • 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-en

Best Practices

  • Unify package name, setting keys, command IDs and view IDs before publishing
  • Keep package size under 5MB using .vscodeignore
  • Since VS Code 1.74, activationEvents are 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.
Câu hỏi thường gặp

‘Scaffolding’ là gì?

Đó là quá trình tạo cấu trúc ban đầu của một dự án, như một thư mục với các tệp cơ bản đã được thiết lập sẵn.

VS Code Marketplace là gì?

Đó là cửa hàng trực tuyến nơi các lập trình viên chia sẻ tiện ích mở rộng VS Code của họ với mọi người.

Vì sao kích thước tiện ích quan trọng?

Tiện ích nhỏ hơn tải nhanh hơn và dùng ít tài nguyên hơn, giúp cải thiện trải nghiệm người dùng.

Chi tiết

Mô tả gốc của tác giả

Guide for VS Code extension development from scaffolding to Marketplace publication

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#6136
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự