{
  "schema": "https://ai-atoms.com/schemas/skill-v1.json",
  "type": "skill",
  "id": "skill/dump-collect",
  "version": "1.0.0",
  "name": "dump-collect",
  "description": "Configure and collect crash dumps for modern .NET applications. USE FOR: enabling automatic crash dumps for CoreCLR or NativeAOT, capturing dumps from running .NET processes, setting up dump collection in Docker or Kubernetes, using dotnet-dump collect or createdump. DO NOT USE FOR: analyzing or debugging dumps, post-mortem investigation with lldb/windbg/dotnet-dump analyze, profiling or tracing, or for .NET Framework processes.",
  "system_prompt_fragment": "# .NET Crash Dump Collection\n\nThis skill configures and collects crash dumps for modern .NET applications (CoreCLR and NativeAOT) on Linux, macOS, and Windows — including containers.\n\n## Stop Signals\n\n🚨 **Read before starting any workflow.**\n\n- **Stop after dumps are enabled or collected.** Do not open, analyze, or triage dump files.\n- **If the user already has a dump file**, this skill does not cover analysis. Let them know analysis is out of scope.\n- **Do not install analysis tools** (dotnet-dump analyze, windbg). Only install collection tools (dotnet-dump collect). Using `lldb` for on-demand dump capture on macOS is allowed — it ships with Xcode command-line tools and is not being used for analysis.\n- **Do not trace root cause** of crashes. Report the dump file location and move on.\n- **Do not modify application code.** Configuration is environment-only (env vars, OS settings, container specs).\n\n## Step 1 — Identify the Scenario\n\nAsk or determine:\n\n1. **Goal**: Enable automatic crash dumps, or capture a dump from a running process right now?\n2. **Platform**: Linux, macOS, or Windows? Running in a container (Docker/Kubernetes)?\n3. **Runtime**: CoreCLR or NativeAOT?\n\n### Detecting CoreCLR vs NativeAOT\n\n**From a binary file (Linux/macOS):**\n```bash\n# CoreCLR — has IL metadata / managed entry point\nstrings <binary> | grep -q \"CorExeMain\" && echo \"CoreCLR\"\n\n# NativeAOT — has Redhawk runtime symbols\nstrings <binary> | grep -q \"Rhp\" && echo \"NativeAOT\"\n\n# On macOS/Linux, also try:\nnm <binary> 2>/dev/null | grep -qi \"Rhp\" && echo \"NativeAOT\"\n```\n\n**From a binary file (Windows):**\n```powershell\n# CoreCLR — has a CLI header (IL entry point)\ndumpbin /clrheader <binary.exe> | Select-String \"CLI Header\" -Quiet\n\n# NativeAOT — no CLI header, has Redhawk symbols\ndumpbin /symbols <binary.exe> | Select-String \"Rhp\" -Quiet\n```\n\n**From a running process (Linux):**\n```bash\n# Resolve the binary, then use the same file checks\nBINARY=$(readlink /proc/<pid>/exe)\nstrings \"$BINARY\" | grep -q \"CorExeMain\" && echo \"CoreCLR\" || echo \"NativeAOT\"\n```\n\n**From a running process (macOS):**\n```bash\n# Resolve the binary path from the running process\nBINARY=$(ps -o comm= -p <pid>)\nstrings \"$BINARY\" | grep -q \"CorExeMain\" && echo \"CoreCLR\" || echo \"NativeAOT\"\n```\n\n**From a running process (Windows PowerShell):**\n```powershell\n# CoreCLR — loads coreclr.dll\n(Get-Process -Id <pid>).Modules.ModuleName -contains \"coreclr.dll\"\n\n# .NET Framework — loads clr.dll (this skill does not apply)\n(Get-Process -Id <pid>).Modules.ModuleName -contains \"clr.dll\"\n```\n\n> **If the app is .NET Framework (`clr.dll`), stop.** This skill covers modern .NET (CoreCLR and NativeAOT) only.\n>\n> **If neither CoreCLR nor NativeAOT is detected, stop.** This skill only applies to .NET applications — do not proceed.\n\n## Step 2 — Load the Appropriate Reference\n\nBased on the scenario identified in Step 1, read the relevant reference file:\n\n| Scenario | Reference |\n|----------|-----------|\n| CoreCLR app (any platform) | `references/coreclr-dumps.md` |\n| NativeAOT app (any platform) | `references/nativeaot-dumps.md` |\n| Any app in Docker or Kubernetes | `references/container-dumps.md` (then also load the runtime-specific reference) |\n\n## Step 3 — Execute\n\nFollow the instructions in the loaded reference to configure or collect dumps. Always:\n\n1. **Confirm the dump output directory exists** and has write permissions before enabling collection.\n2. **Report the dump file path** back to the user after collection succeeds.\n3. **Verify configuration took effect** — for env vars, echo them; for OS settings, read them back.\n4. **Remind the user to disable automatic dumps if they were enabled temporarily** — remove or unset `DOTNET_DbgEnableMiniDump` and related env vars to avoid accumulating dump files.",
  "applicable_domains": [
    "code",
    "dotnet",
    "engineering"
  ],
  "invocation": [
    "/dump-collect"
  ],
  "tags": [
    "dotnet-diag",
    "dotnet",
    "csharp",
    "microsoft"
  ],
  "authored_by": "anthropics",
  "source_url": "https://github.com/dotnet/skills/blob/main/plugins/dotnet-diag/skills/dump-collect/SKILL.md",
  "lifecycle": "stable",
  "category": "dotnet",
  "provenance": {
    "source": "dotnet/skills",
    "source_url": "https://github.com/dotnet/skills/blob/main/plugins/dotnet-diag/skills/dump-collect/SKILL.md",
    "author": "Microsoft / .NET Foundation",
    "license": "MIT",
    "notes": "Imported by scripts/import-anthropic-skills.py."
  }
}