Community程式設計與開發github.com

microsoft/memory-leak-audit

審查程式碼中的記憶體洩漏與可釋放資源問題。適用於檢閱事件監聽器、DOM 處理器、生命週期回呼或修復洩漏報告。涵蓋 addDisposableListener、Event.once、MutableDisposable、DisposableStore 及 onWillDispose 等模式。

memory-leak-audit 是什麼?

這個 AI 技能專門用於審查程式碼中的記憶體洩漏 (memory leaks) 以及可釋放資源 (disposables) 的相關問題。它特別適用於檢查事件監聽器 (event listeners)、DOM 處理器 (DOM handlers)、生命週期回呼 (lifecycle callbacks),或是當開發者需要根據洩漏報告 (leak reports) 進行修復時。此技能主要支援 VS Code 等採用類似可釋放資源模式的開發平台。其運作方式是透過分析程式碼中常見的記憶體管理模式,例如 `addDisposableListener`、`Event.once`、`MutableDisposable`、`DisposableStore` 以及 `onWillDispose` 等 API 的使用情況,來偵測潛在的資源未正確釋放問題。使用這個技能能幫助開發者在程式碼審查 (code review) 階段就提前發現並修正記憶體管理錯誤,從而提升應用程式的穩定性和效能。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/microsoft/vscode/tree/main/skills/memory-leak-audit

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

memory-leak-audit 是做什麼的?

審查程式碼中的記憶體洩漏與可釋放資源問題。適用於檢閱事件監聽器、DOM 處理器、生命週期回呼或修復洩漏報告。涵蓋 addDisposableListener、Event.once、MutableDisposable、DisposableStore 及 onWillDispose 等模式。

Individual skills in this repo

This repo contains 10 individual skills — each has its own dedicated page.

microsoft/accessibility

Primary accessibility skill for VS Code. REQUIRED for new feature and contribution work, and also applies to updates of existing UI. Covers accessibility help dialogs, accessible views, verbosity settings, signals, ARIA announcements, keyboard navigation, and ARIA labels/roles.

microsoft/agent-sessions-layout

Agents workbench layout — covers the fixed layout structure, grid configuration, part visibility, editor modal, titlebar, sidebar footer, and implementation requirements. Use when implementing features or fixing issues in the Agents workbench layout.

microsoft/author-contributions

Identify all files a specific author contributed to on a branch vs its upstream, tracing code through renames. Use when asked who edited what, what code an author contributed, or to audit authorship before a merge. This skill should be run as a subagent — it performs many git operations and returns a concise table.

microsoft/azure-pipelines

Use when validating Azure DevOps pipeline changes for the VS Code build. Covers queueing builds, checking build status, viewing logs, and iterating on pipeline YAML changes without waiting for full CI runs.

microsoft/fix-errors

Guidelines for fixing unhandled errors from the VS Code error telemetry dashboard. Use when investigating error-telemetry issues with stack traces, error messages, and hit/user counts. Covers tracing data flow through call stacks, identifying producers of invalid data vs. consumers that crash, enriching error messages for telemetry diagnosis, and avoiding common anti-patterns like silently swallowing errors.

microsoft/hygiene

Use when making code changes to ensure they pass VS Code's hygiene checks. Covers the pre-commit hook, unicode restrictions, string quoting rules, copyright headers, indentation, formatting, ESLint, and stylelint. Run the hygiene check before declaring work complete.

microsoft/sessions

Agents window architecture — covers the agents-first app, layering, folder structure, chat widget, menus, contributions, entry points, and development guidelines. Use when implementing features or fixing issues in the Agents window.

microsoft/tool-rename-deprecation

Ensure renamed built-in tool references preserve backward compatibility. Use when renaming a toolReferenceName, tool set referenceName, or any tool identifier. Run on ANY change to tool registration code. Covers legacyToolReferenceFullNames for tools and legacyFullNames for tool sets.

microsoft/update-screenshots

Download screenshot baselines from the latest CI run and commit them. Use when asked to update, accept, or refresh component screenshot baselines from CI, or after the screenshot-test GitHub Action reports differences. This skill should be run as a subagent.

microsoft/validate-ui-scenario

Use when reproducing a UI bug or verifying a fix by driving a real VS Code window end to end and capturing evidence. Writes a scenario file, runs it against a dev build or installed Insiders, and produces a captioned video, per-step screenshots, a Playwright trace, and an HTML report to attach to an issue or pull request.

相關技能