
Fix Errors
Turn VS Code telemetry crashes into durable fixes by tracing bad data to its producer instead of patching the crash line.
Overview
fix-errors is an agent skill most often used in Operate (also Ship) that walks telemetry stack traces upstream to fix invalid data producers—not the crash site.
Install
npx skills add https://github.com/microsoft/vscode --skill fix-errorsWhat is this skill?
- Explicit rule: do not fix only at the crash site—guards and swallowed errors mask upstream bad data
- Walks the stack bottom-up to find producers of invalid IPC, API, storage, or user input
- Separates consumers that crash from sources that emit malformed payloads
- Covers enriching error messages for telemetry diagnosis without silent failure anti-patterns
- Maps dashboard fields (message, stack, hits, users) to a repeatable investigation ritual
Adoption & trust: 1.4k installs on skills.sh; 186k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your telemetry dashboard shows a hot stack trace, but patching the crashing line hides the real source of bad data flowing through IPC, APIs, and storage.
Who is it for?
Maintainers of VS Code extensions or core-adjacent code who get recurring unhandled errors with hit and user counts in the telemetry dashboard.
Skip if: Greenfield features with no production signal, or teams who only want a one-line guard at the exception without tracing data origins.
When should I use this skill?
Investigating error-telemetry issues with stack traces, error messages, and hit/user counts from the VS Code error telemetry dashboard.
What do I get? / Deliverables
You document the producer fix, improve diagnosable error surfaces, and stop the same malformed payload from failing other code paths after deploy.
- Root-cause fix at data producer
- Improved error messaging for telemetry
- Notes on data contract violations
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Unhandled errors surfaced in production telemetry are an operate-phase reliability problem; the skill is shelved under errors because that is where dashboards and hit counts drive remediation. The workflow starts from error message, stack trace, hit count, and affected users—classic production error triage, not greenfield feature work.
Where it fits
Prioritize a telemetry spike by tracing IPC payloads before patching revive() at the throw site.
Pre-release review of error paths to ensure messages enrich telemetry instead of masking upstream bugs.
Harden an extension API surface after learning malformed calls originate from a specific message handler.
How it compares
Use instead of crash-site try/catch or silent fallbacks when telemetry proves the bug is data-shape corruption upstream.
Common Questions / FAQ
Who is fix-errors for?
Solo and indie builders shipping VS Code extensions or editor-integrated software who investigate production errors from the telemetry dashboard with stack traces and user impact metrics.
When should I use fix-errors?
In Operate when triaging telemetry hits; in Ship when hardening paths before release; whenever you have message, stack, hit count, and affected users and suspect bad data—not a bad guard at the crash line.
Is fix-errors safe to install?
It is procedural guidance for investigation and code changes in your repo—review the Security Audits panel on this skill’s detail page before installing any package from the catalog.
SKILL.md
READMESKILL.md - Fix Errors
When fixing an unhandled error from the telemetry dashboard, the issue typically contains an error message, a stack trace, hit count, and affected user count. ## Approach ### 1. Do NOT fix at the crash site The error manifests at a specific line in the stack trace, but **the fix almost never belongs there**. Fixing at the crash site (e.g., adding a `typeof` guard in a `revive()` function, swallowing the error with a try/catch, or returning a fallback value) only masks the real problem. The invalid data still flows through the system and will cause failures elsewhere. ### 2. Trace the data flow upward through the call stack Read each frame in the stack trace from bottom to top. For each frame, understand: - What data is being passed and what is expected - Where that data originated (IPC message, extension API call, storage, user input, etc.) - Whether the data could have been corrupted or malformed at that point The goal is to find the **producer of invalid data**, not the consumer that crashes on it. ### 3. When the producer cannot be identified from the stack alone Sometimes the stack trace only shows the receiving/consuming side (e.g., an IPC server handler). The sending side is in a different process and not in the stack. In this case: - **Enrich the error message** at the consuming site with diagnostic context: the type of the invalid data, a truncated representation of its value, and which operation/command received it. This information flows into the error telemetry dashboard automatically via the unhandled error pipeline. - **Do NOT silently swallow the error** — let it still throw so it remains visible in telemetry, but with enough context to identify the sender in the next telemetry cycle. - Consider adding the same enrichment to the low-level validation function that throws (e.g., include the invalid value in the error message) so the telemetry captures it regardless of call site. ### 4. When the producer IS identifiable Fix the producer directly: - Validate or sanitize data before sending it over IPC / storing it / passing it to APIs - Ensure serialization/deserialization preserves types correctly (e.g., URI objects should serialize as `UriComponents` objects, not as strings) ## Example Given a stack trace like: ``` at _validateUri (uri.ts) ← validation throws at new Uri (uri.ts) ← constructor at URI.revive (uri.ts) ← revive assumes valid UriComponents at SomeChannel.call (ipc.ts) ← IPC handler receives arg from another process ``` **Wrong fix**: Add a `typeof` guard in `URI.revive` to return `undefined` for non-object input. This silences the error but the caller still expects a valid URI and will fail later. **Right fix (when producer is unknown)**: Enrich the error at the IPC handler level and in `_validateUri` itself to include the actual invalid value, so telemetry reveals what data is being sent and from where. Example: ```typescript // In the IPC handler — validate before revive function reviveUri(data: UriComponents | URI | undefined | null, context: string): URI { if (data && typeof data !== 'object') { throw new Error(`[Channel] Invalid URI data for '${context}': type=${typeof data}, value=${String(data).substring(0, 100)}`); } // ... } // In _validateUri — include the scheme value throw new Error(`[UriError]: Scheme contains illegal characters. scheme:"${ret.scheme.substring(0, 50)}" (len:${ret.scheme.length})`); ``` **Right fix (when producer is known)**: Fix the code that sends malformed data. For